text
stringlengths
2
1.04M
meta
dict
SYNONYM #### According to Integrated Taxonomic Information System #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f0fcda79616b55651864633bc8cdb82f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.7218045112781954, "repo_name": "mdoering/backbone", "id": "e3dfb6070cd9b919a41c140e9231ff2c6c513f75", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Marchantiophyta/Jungermanniopsida/Porellales/Lejeuneaceae/Cololejeunea/Cololejeunea cardiocarpa/ Syn. Leptocolea cardiocarpa/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!-- @license Apache-2.0 Copyright (c) 2018 The Stdlib Authors. 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. --> # array2iterator > Create an iterator from an array-like object. <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> <section class="intro"> </section> <!-- /.intro --> <!-- Package usage documentation. --> <section class="usage"> ## Usage ```javascript var array2iterator = require( '@stdlib/array/to-iterator' ); ``` #### array2iterator( src\[, mapFcn\[, thisArg]] ) Returns an iterator which iterates over each element in an array-like `object`. ```javascript var it = array2iterator( [ 1, 2, 3, 4 ] ); // returns <Object> var v = it.next().value; // returns 1 v = it.next().value; // returns 2 v = it.next().value; // returns 3 // ... ``` The returned iterator protocol-compliant object has the following properties: - **next**: function which returns an iterator protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the iterator is finished. - **return**: function which closes an iterator and returns a single (optional) argument in an iterator protocol-compliant object. To invoke a function for each `src` value, provide a callback function. ```javascript function fcn( v ) { return v * 10.0; } var it = array2iterator( [ 1, 2, 3, 4 ], fcn ); // returns <Object> var v = it.next().value; // returns 10.0 v = it.next().value; // returns 20.0 v = it.next().value; // returns 30.0 // ... ``` The invoked function is provided three arguments: - **value**: iterated value. - **index**: iterated value index. - **src**: source array-like object. ```javascript function fcn( v, i ) { return v * (i+1); } var it = array2iterator( [ 1, 2, 3, 4 ], fcn ); // returns <Object> var v = it.next().value; // returns 1 v = it.next().value; // returns 4 v = it.next().value; // returns 9 // ... ``` To set the callback function execution context, provide a `thisArg`. ```javascript function fcn( v ) { this.count += 1; return v * 10.0; } var ctx = { 'count': 0 }; var it = array2iterator( [ 1, 2, 3, 4 ], fcn, ctx ); // returns <Object> var v = it.next().value; // returns 10.0 v = it.next().value; // returns 20.0 v = it.next().value; // returns 30.0 var count = ctx.count; // returns 3 ``` </section> <!-- /.usage --> <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> <section class="notes"> ## Notes - If an environment supports `Symbol.iterator`, the returned iterator is iterable. - If provided a generic `array`, the returned iterator does **not** ignore holes. To achieve greater performance for sparse arrays, use [`@stdlib/array/to-sparse-iterator`][@stdlib/array/to-sparse-iterator]. - A returned iterator does **not** copy a provided array-like `object`. To ensure iterable reproducibility, copy a provided array-like `object` **before** creating an iterator. Otherwise, any changes to the contents of an array-like `object` will be reflected in the returned iterator. - In environments supporting `Symbol.iterator`, the function **explicitly** does **not** invoke an array's `@@iterator` method, regardless of whether this method is defined. To convert an array to an implementation defined iterator, invoke this method directly. - The returned iterator supports array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/complex64`][@stdlib/array/complex64]). </section> <!-- /.notes --> <!-- Package usage examples. --> <section class="examples"> ## Examples <!-- eslint no-undef: "error" --> ```javascript var Float64Array = require( '@stdlib/array/float64' ); var inmap = require( '@stdlib/utils/inmap' ); var randu = require( '@stdlib/random/base/randu' ); var array2iterator = require( '@stdlib/array/to-iterator' ); function scale( v, i ) { return v * (i+1); } // Create an array filled with random numbers: var arr = inmap( new Float64Array( 100 ), randu ); // Create an iterator from the array which scales iterated values: var it = array2iterator( arr, scale ); // Perform manual iteration... var v; while ( true ) { v = it.next(); if ( v.done ) { break; } console.log( v.value ); } ``` </section> <!-- /.examples --> <!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> <section class="references"> </section> <!-- /.references --> <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> <section class="related"> * * * ## See Also - <span class="package-name">[`@stdlib/array/from-iterator`][@stdlib/array/from-iterator]</span><span class="delimiter">: </span><span class="description">create (or fill) an array from an iterator.</span> - <span class="package-name">[`@stdlib/array/to-circular-iterator`][@stdlib/array/to-circular-iterator]</span><span class="delimiter">: </span><span class="description">create an iterator which repeatedly iterates over the elements of an array-like object.</span> - <span class="package-name">[`@stdlib/array/to-iterator-right`][@stdlib/array/to-iterator-right]</span><span class="delimiter">: </span><span class="description">create an iterator from an array-like object, iterating from right to left.</span> - <span class="package-name">[`@stdlib/array/to-strided-iterator`][@stdlib/array/to-strided-iterator]</span><span class="delimiter">: </span><span class="description">create an iterator from a strided array-like object.</span> </section> <!-- /.related --> <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> <section class="links"> [@stdlib/array/to-sparse-iterator]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/to-sparse-iterator [@stdlib/array/complex64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64 <!-- <related-links> --> [@stdlib/array/from-iterator]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/from-iterator [@stdlib/array/to-circular-iterator]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/to-circular-iterator [@stdlib/array/to-iterator-right]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/to-iterator-right [@stdlib/array/to-strided-iterator]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/to-strided-iterator <!-- </related-links> --> </section> <!-- /.links -->
{ "content_hash": "3fbe5128c889808d1ff6da0c67c56970", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 287, "avg_line_length": 29.928, "alnum_prop": 0.7006148088746325, "repo_name": "stdlib-js/stdlib", "id": "4b1dff1728f811899456db24a6a38fcb454bba1e", "size": "7482", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "lib/node_modules/@stdlib/array/to-iterator/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "21739" }, { "name": "C", "bytes": "15336495" }, { "name": "C++", "bytes": "1349482" }, { "name": "CSS", "bytes": "58039" }, { "name": "Fortran", "bytes": "198059" }, { "name": "HTML", "bytes": "56181" }, { "name": "Handlebars", "bytes": "16114" }, { "name": "JavaScript", "bytes": "85975525" }, { "name": "Julia", "bytes": "1508654" }, { "name": "Makefile", "bytes": "4806816" }, { "name": "Python", "bytes": "3343697" }, { "name": "R", "bytes": "576612" }, { "name": "Shell", "bytes": "559315" }, { "name": "TypeScript", "bytes": "19309407" }, { "name": "WebAssembly", "bytes": "5980" } ], "symlink_target": "" }
require 'yaml' require 'fileutils' # path stuff current_dir = File.dirname(__FILE__) # load config cnf = YAML::load_file(File.join(current_dir, 'config.yml')) puts cnf.inspect # time stamp array tsa = [] # create img dir Dir.mkdir(File.join(cnf['img_dir'])) if not File.directory?(cnf['img_dir']) Dir.glob(File.join(cnf['img_dir'], '*.jpg')) do |f| m = File.basename(f).match(/img(\d*)\.jpg/) if m tsa << m[1].to_i end end # sort timestamps in reverse tsa = tsa.uniq.sort.reverse # select top n tsa = tsa[0, cnf['num_img']] # delete those that aren't needed Dir.glob(File.join(cnf['img_dir'], '*.jpg')) do |f| m = File.basename(f).match(/((img)|(thumb))(\d*)\.jpg/) if m if not tsa.include? m[4].to_i File.delete(f) puts "deleting #{f}" end end end # build images javascript imgs = [] tsa.each do |ts| imgs << [Time.at(ts).asctime, "img#{ts}.jpg","thumb#{ts}.jpg"] end js = "var imagearray = #{imgs.inspect};" # create js dir Dir.mkdir(File.join(cnf['js_dir'])) if not File.directory?(cnf['js_dir']) # write out outf = File.join(cnf['js_dir'], 'dataset.js') File.open(outf, 'w') {|f| f.write(js) } # copy latest img to latest File.delete(File.join(cnf['img_dir'], 'latest.jpg')) if File.exists?(File.join(cnf['img_dir'], 'latest.jpg')) if imgs.length > 0 FileUtils.cp(File.join(cnf['img_dir'], "img#{tsa[0]}.jpg"), File.join(cnf['img_dir'], 'latest.jpg')) end
{ "content_hash": "6aba73d4f5e2e97db9ce109df5b98bc6", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 109, "avg_line_length": 24.593220338983052, "alnum_prop": 0.6140592694693315, "repo_name": "AstromechZA/uct_cam_web_host", "id": "43c76c39b5c3090f9b51a1efc04a57d050c9f978", "size": "1451", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rebuild_img_listing.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "411" }, { "name": "JavaScript", "bytes": "360" }, { "name": "Ruby", "bytes": "1480" } ], "symlink_target": "" }
#include "ProducerStateTest.h" #include <activemq/state/ProducerState.h> #include <activemq/commands/ProducerInfo.h> #include <decaf/lang/Pointer.h> using namespace std; using namespace activemq; using namespace activemq::state; using namespace activemq::commands; using namespace decaf::lang; //////////////////////////////////////////////////////////////////////////////// void ProducerStateTest::test() { Pointer<ProducerId> id( new ProducerId ); id->setConnectionId( "CONNECTION" ); id->setSessionId( 42 ); id->setValue( 4096 ); Pointer<ProducerInfo> info( new ProducerInfo() ); info->setProducerId( id ); ProducerState state( info ); CPPUNIT_ASSERT( state.toString() != "NULL" ); CPPUNIT_ASSERT( info == state.getInfo() ); }
{ "content_hash": "e518f047fdddf1ea2542b40de5801622", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 26.689655172413794, "alnum_prop": 0.6330749354005168, "repo_name": "lleoha/activemq-cpp-debian", "id": "de5172adbde36757e1737ffc268762263192391d", "size": "1575", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/test/activemq/state/ProducerStateTest.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "475328" }, { "name": "C++", "bytes": "11850922" }, { "name": "Makefile", "bytes": "6404" }, { "name": "Shell", "bytes": "339395" } ], "symlink_target": "" }
package org.asn1s.io.ber.input; import org.asn1s.api.exception.Asn1Exception; import org.asn1s.api.type.Type.Family; import org.asn1s.api.value.Value; import org.jetbrains.annotations.NotNull; import java.io.IOException; final class SetOfBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.SET_OF; assert context.getTag().isConstructed(); return SequenceOfBerDecoder.readComponents( context ); } }
{ "content_hash": "33692deb869617ec7242b4366c8858da", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 88, "avg_line_length": 28.473684210526315, "alnum_prop": 0.789279112754159, "repo_name": "lastrix/asn1s", "id": "2a1ecfb4ac1a6e3624320c88b8e433a0cb8a7909", "size": "2486", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "asn1s-io/src/main/java/org/asn1s/io/ber/input/SetOfBerDecoder.java", "mode": "33188", "license": "mit", "language": [ { "name": "ANTLR", "bytes": "57172" }, { "name": "Java", "bytes": "1553719" } ], "symlink_target": "" }
<?php namespace Smalldb\TemplateSloth; class Slot { protected $sloth; protected $slot_name; protected $fragmentQueue; protected $serial = 1; public function __construct(string $slot_name, Sloth $sloth) { $this->slot_name = $slot_name; $this->sloth = $sloth; $this->fragmentQueue = new \SplPriorityQueue(); $this->fragmentQueue->setExtractFlags(\SplPriorityQueue::EXTR_DATA); } /** * Add a fragment into the slot queue. */ public function add(int $weight, string $template, array $arguments = []): self { // Penalty stabilizes sort used by the queue // lim_{$serial -> inf} $penalty = 0 $penalty = 1 - 100. / (100. + $this->serial); $this->fragmentQueue->insert([$template, $arguments], - $weight - $penalty); $this->serial++; return $this; } /** * Returns true if slot is empty. */ public function isEmpty(): bool { return $this->fragmentQueue->isEmpty(); } /** * Returns the fragment on top of the queue and removes it (shifts up). * When queue is empty, null is returned. */ public function nextFragment() { if ($this->fragmentQueue->isEmpty()) { return null; } else { return $this->fragmentQueue->extract(); } } }
{ "content_hash": "62a6aa12f75a9ca44fc140b7b80e4b53", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 80, "avg_line_length": 19.095238095238095, "alnum_prop": 0.6475477971737323, "repo_name": "smalldb/template-sloth", "id": "2cbfb4be7eee14799f855adf9052d92a989799b0", "size": "1832", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Slot.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "102" }, { "name": "PHP", "bytes": "14492" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- ~ The MIT License (MIT) ~ ~ Copyright (c) 2016 Kyriakos Alexandrou (Kiki) ~ ~ Permission is hereby granted, free of charge, to any person obtaining a copy ~ of this software and associated documentation files (the "Software"), to deal ~ in the Software without restriction, including without limitation the rights ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ~ copies of the Software, and to permit persons to whom the Software is ~ furnished to do so, subject to the following conditions: ~ ~ The above copyright notice and this permission notice shall be included in all ~ copies or substantial portions of the Software. ~ ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ~ SOFTWARE. --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <PreferenceCategory android:layout_width="wrap_content" android:layout_height="wrap_content" android:title="@string/pref_general"> <CheckBoxPreference android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="true" android:key="pref_run_in_background" android:summary="@string/pref_summary_run_in_background" android:title="@string/pref_title_run_in_background" /> <CheckBoxPreference android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="true" android:key="pref_periodical_scan" android:summary="@string/pref_summary_periodical_scan" android:title="@string/pref_title_periodical_scan" /> </PreferenceCategory> <PreferenceCategory android:layout_width="wrap_content" android:layout_height="wrap_content" android:title="@string/pref_spp"> <CheckBoxPreference android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="false" android:key="pref_clear_text_after_sending" android:summary="Clear text once sent" android:title="@string/pref_clear_text_after_sending" /> <CheckBoxPreference android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="true" android:key="pref_append_/r_at_end_of_data" android:summary="Send Carriage Return at the end of the data" android:title="@string/send_cr" /> </PreferenceCategory> </PreferenceScreen>
{ "content_hash": "9f74c77240a80f2b8e74cb5daa01ba69", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 82, "avg_line_length": 42.08, "alnum_prop": 0.6745880861850444, "repo_name": "KyriakosAlexandrou/Bluetooth-Toolkit", "id": "11784c1137610ce828b34b9ec5cdc5bf449141be", "size": "3156", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "app/src/main/res/xml/activity_settings.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "327870" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html lang="en"> <head> <!-- Generated by javadoc (17) --> <title>ACF (Paper) 0.5.1-SNAPSHOT API</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="description" content="index redirect"> <meta name="generator" content="javadoc/IndexRedirectWriter"> <link rel="canonical" href="co/aikar/commands/package-summary.html"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript">window.location.replace('co/aikar/commands/package-summary.html')</script> <noscript> <meta http-equiv="Refresh" content="0;co/aikar/commands/package-summary.html"> </noscript> </head> <body class="index-redirect-page"> <main role="main"> <noscript> <p>JavaScript is disabled on your browser.</p> </noscript> <p><a href="co/aikar/commands/package-summary.html">co/aikar/commands/package-summary.html</a></p> </main> </body> </html>
{ "content_hash": "a5941d8348106ce8673ada3abb7009fa", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 105, "avg_line_length": 39.16, "alnum_prop": 0.7313585291113381, "repo_name": "aikar/commands", "id": "a85daf0c9c3a1e13d2b26c048f8596163699719e", "size": "979", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/acf-paper/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "690481" }, { "name": "Shell", "bytes": "289" } ], "symlink_target": "" }
package cynthia.com.mikk_code_p2p.bean; import java.util.List; /** * Created by shkstart on 2016/12/2 0002. */ public class Index { public Product product; public List<Image> images; }
{ "content_hash": "50edbb38ca8f961d2f8986fcd20f85dd", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 41, "avg_line_length": 17.90909090909091, "alnum_prop": 0.6954314720812182, "repo_name": "Mikk-x/Mikk_Code_P2P", "id": "358d848633ee9f3a7b1affd988e4dee186902135", "size": "197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/cynthia/com/mikk_code_p2p/bean/Index.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "428172" } ], "symlink_target": "" }
$('#login').on('click', function(e) { e.preventDefault(); var $form = $(this).closest('form'); var $href = $form.attr('action'); var $post = $form.attr('method'); var $data = $form.serialize(); $.ajax({ dataType: "json", type: $post, url: $href, data: $data, success: function (data, textStatus, jqXHR) { if (data.success) { window.location.href = "show"; } else { $('<p id="error"></p>').insertAfter('#signIn'); $('#error').html(data.message); } }, error: function (jqXHR, textStatus, errorThrown) { console.log( errorThrown ); } }); });
{ "content_hash": "4d8825ba910269bbfd1209e8968beee4", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 67, "avg_line_length": 30.74074074074074, "alnum_prop": 0.4072289156626506, "repo_name": "oanaOtelea/project-symfony", "id": "8424cc62d124b609b28f40e33060cb3b094a58e7", "size": "830", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/js/login.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "5952" }, { "name": "CSS", "bytes": "76798" }, { "name": "HTML", "bytes": "32701" }, { "name": "JavaScript", "bytes": "17616" }, { "name": "PHP", "bytes": "135698" }, { "name": "Ruby", "bytes": "900" } ], "symlink_target": "" }
.class Lcom/ub/main/foodsale/FoodQuHuo$2; .super Ljava/lang/Object; .source "FoodQuHuo.java" # interfaces .implements Landroid/view/View$OnClickListener; # annotations .annotation system Ldalvik/annotation/EnclosingMethod; value = Lcom/ub/main/foodsale/FoodQuHuo;->onCreate(Landroid/os/Bundle;)V .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x0 name = null .end annotation # instance fields .field final synthetic this$0:Lcom/ub/main/foodsale/FoodQuHuo; # direct methods .method constructor <init>(Lcom/ub/main/foodsale/FoodQuHuo;)V .locals 0 .parameter .prologue .line 1 iput-object p1, p0, Lcom/ub/main/foodsale/FoodQuHuo$2;->this$0:Lcom/ub/main/foodsale/FoodQuHuo; .line 95 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method # virtual methods .method public onClick(Landroid/view/View;)V .locals 1 .parameter "arg0" .prologue .line 97 iget-object v0, p0, Lcom/ub/main/foodsale/FoodQuHuo$2;->this$0:Lcom/ub/main/foodsale/FoodQuHuo; #calls: Lcom/ub/main/foodsale/FoodQuHuo;->backDo()V invoke-static {v0}, Lcom/ub/main/foodsale/FoodQuHuo;->access$5(Lcom/ub/main/foodsale/FoodQuHuo;)V .line 98 iget-object v0, p0, Lcom/ub/main/foodsale/FoodQuHuo$2;->this$0:Lcom/ub/main/foodsale/FoodQuHuo; invoke-virtual {v0}, Lcom/ub/main/foodsale/FoodQuHuo;->finish()V .line 99 return-void .end method
{ "content_hash": "a1e9646a6a986850735da8f027173176", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 101, "avg_line_length": 25.661016949152543, "alnum_prop": 0.6908850726552179, "repo_name": "achellies/WaterEveryDay", "id": "91a45b06b23a207db90517334bd236f168b88183", "size": "1514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WaterEveryDay/Bin/ubox_android_ch_release_v2.2.1/smali/com/ub/main/foodsale/FoodQuHuo$2.smali", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "719444" }, { "name": "C++", "bytes": "1862724" }, { "name": "Java", "bytes": "19730" }, { "name": "Objective-C", "bytes": "31937" }, { "name": "Shell", "bytes": "324" } ], "symlink_target": "" }
define(function(require) { /* DEPENDENCIES */ var BaseDialog = require('utils/dialogs/dialog'); var TemplateHTML = require('hbs!./deploy/html'); var Sunstone = require('sunstone'); var DatastoresTable = require('tabs/datastores-tab/datatable'); var HostsTable = require('tabs/hosts-tab/datatable'); var Notifier = require('utils/notifier'); var Tips = require('utils/tips'); /* CONSTANTS */ var DIALOG_ID = require('./deploy/dialogId'); var TAB_ID = require('../tabId') /* CONSTRUCTOR */ function Dialog() { this.dialogId = DIALOG_ID; this.hostsTable = new HostsTable('deploy_vm', {'select': true}); this.datastoresTable = new DatastoresTable('deploy_vm_ds', { 'select': true, 'selectOptions': { 'filter_fn': function(ds) { return ds.TYPE == 1; } // Show system DS only } }); BaseDialog.call(this); }; Dialog.DIALOG_ID = DIALOG_ID; Dialog.prototype = Object.create(BaseDialog.prototype); Dialog.prototype.constructor = Dialog; Dialog.prototype.html = _html; Dialog.prototype.onShow = _onShow; Dialog.prototype.setup = _setup; return Dialog; /* FUNCTION DEFINITIONS */ function _html() { return TemplateHTML({ 'dialogId': this.dialogId, 'hostsTableHTML': this.hostsTable.dataTableHTML, 'datastoresTableHTML': this.datastoresTable.dataTableHTML }); } function _setup(context) { var that = this; that.hostsTable.initialize(); that.datastoresTable.initialize(); Tips.setup(context); $('#' + DIALOG_ID + 'Form', context).submit(function() { var extra_info = {}; if ($("#selected_resource_id_deploy_vm", context).val()) { extra_info['host_id'] = $("#selected_resource_id_deploy_vm", context).val(); } else { Notifier.notifyError(tr("You have not selected a host")); return false; } extra_info['ds_id'] = $("#selected_resource_id_deploy_vm_ds", context).val() || -1 extra_info['enforce'] = $("#enforce", this).is(":checked") ? true : false $.each(Sunstone.getDataTable(TAB_ID).elements(), function(index, elem) { Sunstone.runAction("VM.deploy_action", elem, extra_info); }); Sunstone.getDialog(DIALOG_ID).hide(); Sunstone.getDialog(DIALOG_ID).reset(); return false; }); return false; } function _onShow(dialog) { this.datastoresTable.resetResourceTableSelect(); this.hostsTable.resetResourceTableSelect(); return false; } });
{ "content_hash": "90b746a9b197f7dbbb0fd42d7c14fe83", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 88, "avg_line_length": 25.68686868686869, "alnum_prop": 0.6264254817145104, "repo_name": "tuxmea/one", "id": "8e68bd8a701ff9d97673f788d07ccea9c4e63f03", "size": "2543", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/sunstone/public/app/tabs/vms-tab/dialogs/deploy.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "177534" }, { "name": "C++", "bytes": "3030655" }, { "name": "CSS", "bytes": "76832" }, { "name": "Groff", "bytes": "112293" }, { "name": "HTML", "bytes": "29570" }, { "name": "Handlebars", "bytes": "334871" }, { "name": "Java", "bytes": "423082" }, { "name": "JavaScript", "bytes": "2877905" }, { "name": "Lex", "bytes": "10530" }, { "name": "Python", "bytes": "128459" }, { "name": "Ruby", "bytes": "2323732" }, { "name": "Shell", "bytes": "687043" }, { "name": "Yacc", "bytes": "34871" } ], "symlink_target": "" }
\section{sgb.h File Reference} \label{sgb.h}\index{sgb.h@{sgb.h}} Super Gameboy definitions. \subsection*{Functions} \begin{CompactItemize} \item \label{sgb.h_a0} \index{sgb_check@{sgb\_\-check}!sgb.h@{sgb.h}}\index{sgb.h@{sgb.h}!sgb_check@{sgb\_\-check}} {\bf UINT8} {\bf sgb\_\-check} (void) \begin{CompactList}\small\item\em Return a non-null value if running on Super Game\-Boy.\item\end{CompactList} \end{CompactItemize} \vspace{0.4cm}\hrule\vspace{0.2cm} \subsection*{Detailed Description} Super Gameboy definitions.
{ "content_hash": "063089f52ddb476b1d9e15b006513d52", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 110, "avg_line_length": 31, "alnum_prop": 0.7248576850094877, "repo_name": "Maikel-Ortega/zurrapagb", "id": "227b1a0ca1914ecd4d11b694084787b40bd2c1fb", "size": "527", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GBDK/doc/libc/latex/sgb.h.tex", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "296096" }, { "name": "Batchfile", "bytes": "3502" }, { "name": "C", "bytes": "311462" }, { "name": "C++", "bytes": "34305" }, { "name": "CSS", "bytes": "15590" }, { "name": "Groff", "bytes": "46408" }, { "name": "HTML", "bytes": "951818" }, { "name": "JavaScript", "bytes": "3937" }, { "name": "Makefile", "bytes": "14321" }, { "name": "TeX", "bytes": "83586" } ], "symlink_target": "" }
package io.cattle.platform.allocator.constraint; import io.cattle.platform.allocator.service.AllocationAttempt; import io.cattle.platform.allocator.service.AllocationCandidate; import io.cattle.platform.allocator.service.DiskInfo; import io.cattle.platform.allocator.util.AllocatorUtils; import io.cattle.platform.core.model.Instance; import io.cattle.platform.object.ObjectManager; import java.util.Map; import java.util.Set; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DiskSizeConstraint extends HardConstraint implements Constraint { private static final Logger log = LoggerFactory.getLogger(DiskSizeConstraint.class); private ObjectManager objectManager; public DiskSizeConstraint(ObjectManager objMgr) { this.objectManager = objMgr; } @Override public boolean matches(AllocationAttempt attempt, AllocationCandidate candidate) { Instance instance = attempt.getInstance(); if (instance == null) { return false; } Set<Long> hostIds = candidate.getHosts(); // if one of the host does not have enough free space then return false for (Long hostId : hostIds) { Map<Pair<String, Long>, DiskInfo> volumeToDiskMapping = AllocatorUtils.allocateDiskForVolumes(hostId, instance, this.objectManager); // if no disk with big enough free space for this host, then // candidate is no good if (volumeToDiskMapping == null) { log.debug("Scheduling instance [{}] to host [{}] rejected", attempt.getInstanceId(), hostId); return false; } } return true; } @Override public String toString() { return String.format("host needs more free disk space"); } }
{ "content_hash": "1d472e7386ef7dab1aa4a8f9fcf96c0e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 113, "avg_line_length": 33.89090909090909, "alnum_prop": 0.6915236051502146, "repo_name": "kaos/cattle", "id": "70db19184e7281bb5b331a5fea123dcbf7eae631", "size": "1864", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/iaas/allocator/src/main/java/io/cattle/platform/allocator/constraint/DiskSizeConstraint.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "15536" }, { "name": "Java", "bytes": "6147177" }, { "name": "Python", "bytes": "820600" }, { "name": "Shell", "bytes": "48203" } ], "symlink_target": "" }
package com.farmafene.cas.integration.wss; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.dom.handler.RequestData; import org.apache.wss4j.dom.validate.Credential; import org.apache.wss4j.dom.validate.Validator; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage; import org.jasig.cas.client.validation.Assertion; import org.jasig.cas.client.validation.Cas20ProxyTicketValidator; import org.jasig.cas.client.validation.TicketValidationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; public class Cas20BinaryTokenValidator implements InitializingBean, Validator { private static final Logger logger = LoggerFactory .getLogger(Cas20BinaryTokenValidator.class); private String service; private String casServerUrlPrefix; private String proxyCallbackUrl; private ProxyGrantingTicketStorage proxyGrantingTicketStorage; public Cas20BinaryTokenValidator() { } /** * {@inheritDoc} * * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { Assert.notNull(service, "Debe establecerse el servicio"); Assert.notNull(casServerUrlPrefix, "Debe establecerse servicio de CAS"); if (null != proxyCallbackUrl) { Assert.notNull(proxyGrantingTicketStorage); } } /** * {@inheritDoc} * * @see org.apache.wss4j.dom.validate.Validator#validate(org.apache.wss4j.dom.validate.Credential, * org.apache.wss4j.dom.handler.RequestData) */ @Override public Credential validate(Credential credential, RequestData data) throws WSSecurityException { String ticket = new String(credential.getBinarySecurityToken() .getToken()); logger.info("=========================================================================="); logger.info("Estamos Validando el token {}", ticket); logger.info("=========================================================================="); Assertion assertion = null; final CasTokenPrincipal principal = new CasTokenPrincipal(); try { Cas20ProxyTicketValidator ticketValidator = new Cas20ProxyTicketValidator( casServerUrlPrefix); if (null != proxyCallbackUrl) { ProxyGrantingTicketStorageDelegate proxyGrantingTicketStorageWrapper = new ProxyGrantingTicketStorageDelegate(); proxyGrantingTicketStorageWrapper.setPrincipal(principal); proxyGrantingTicketStorageWrapper .setProxyGrantingTicketStorage(proxyGrantingTicketStorage); ticketValidator.setProxyCallbackUrl(proxyCallbackUrl); ticketValidator .setProxyGrantingTicketStorage(proxyGrantingTicketStorageWrapper); ticketValidator.setAcceptAnyProxy(true); } assertion = ticketValidator.validate(ticket, service); } catch (TicketValidationException e) { WSSecurityException wsse = new WSSecurityException( WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); wsse.initCause(e); throw wsse; } principal.setCasServerUrlPrefix(casServerUrlPrefix); principal.setAssertion(assertion); principal.setTokenElement(credential.getBinarySecurityToken() .getElement()); credential.setPrincipal(principal); return credential; } /** * @return the casServerUrlPrefix */ public String getCasServerUrlPrefix() { return casServerUrlPrefix; } /** * @param casServerUrlPrefix * the casServerUrlPrefix to set */ public void setCasServerUrlPrefix(String casServerUrlPrefix) { this.casServerUrlPrefix = casServerUrlPrefix; } /** * @return the service */ public String getService() { return service; } /** * @param service * the service to set */ public void setService(String service) { this.service = service; } /** * @return the proxyCallbackUrl */ public String getProxyCallbackUrl() { return proxyCallbackUrl; } /** * @param proxyCallbackUrl * the proxyCallbackUrl to set */ public void setProxyCallbackUrl(String proxyCallbackUrl) { this.proxyCallbackUrl = proxyCallbackUrl; } /** * @return the proxyGrantingTicketStorage */ public ProxyGrantingTicketStorage getProxyGrantingTicketStorage() { return proxyGrantingTicketStorage; } /** * @param proxyGrantingTicketStorage * the proxyGrantingTicketStorage to set */ public void setProxyGrantingTicketStorage( ProxyGrantingTicketStorage proxyGrantingTicketStorage) { this.proxyGrantingTicketStorage = proxyGrantingTicketStorage; } }
{ "content_hash": "8fcabe2049882313aebae22092db1aca", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 116, "avg_line_length": 31.783783783783782, "alnum_prop": 0.7204506802721088, "repo_name": "venanciolm/cas-server", "id": "851cfb623069c7b39d3731922c922c1c395d97c7", "size": "5934", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cas-integration/src/main/java/com/farmafene/cas/integration/wss/Cas20BinaryTokenValidator.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19048" }, { "name": "Java", "bytes": "247506" }, { "name": "JavaScript", "bytes": "15405" } ], "symlink_target": "" }
(function() { 'use strict'; angular.module('calendar', [ 'calendar.events' ]); })();
{ "content_hash": "61be088b42356f41037292ccfe9e1d49", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 32, "avg_line_length": 13.25, "alnum_prop": 0.49056603773584906, "repo_name": "yanivefraim/google-calendar-angular-material", "id": "15177c699eb1a7f635035611934606a7c7ba89ed", "size": "106", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/client/app/calendar.module.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1523" }, { "name": "HTML", "bytes": "1005" }, { "name": "JavaScript", "bytes": "3406" } ], "symlink_target": "" }
'use strict'; var Image = require('Image'); var NativeMethodsMixin = require('NativeMethodsMixin'); var React = require('React'); var PropTypes = require('prop-types'); var StyleSheet = require('StyleSheet'); var ViewPropTypes = require('ViewPropTypes'); var createReactClass = require('create-react-class'); var requireNativeComponent = require('requireNativeComponent'); /** * Use `ProgressViewIOS` to render a UIProgressView on iOS. */ // $FlowFixMe(>=0.41.0) var ProgressViewIOS = createReactClass({ mixins: [NativeMethodsMixin], propTypes: { ...ViewPropTypes, /** * The progress bar style. */ progressViewStyle: PropTypes.oneOf(['default', 'bar']), /** * The progress value (between 0 and 1). */ progress: PropTypes.number, /** * The tint color of the progress bar itself. */ progressTintColor: PropTypes.string, /** * The tint color of the progress bar track. */ trackTintColor: PropTypes.string, /** * A stretchable image to display as the progress bar. */ progressImage: Image.propTypes.source, /** * A stretchable image to display behind the progress bar. */ trackImage: Image.propTypes.source, }, render: function() { return ( <RCTProgressView {...this.props} style={[styles.progressView, this.props.style]} /> ); } }); var styles = StyleSheet.create({ progressView: { height: 2, }, }); var RCTProgressView = requireNativeComponent( 'RCTProgressView', ProgressViewIOS ); module.exports = ProgressViewIOS;
{ "content_hash": "93de8b32f8a2b2f8c7c0c4918c382026", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 63, "avg_line_length": 21.346666666666668, "alnum_prop": 0.6477201748906933, "repo_name": "VowelWeb/CoinTradePros.com", "id": "0a99366680df7df853a4a11789c7f72620af73ad", "size": "1956", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MobileApp/node_modules/react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4048" }, { "name": "Java", "bytes": "1931611" }, { "name": "JavaScript", "bytes": "68832" }, { "name": "Objective-C", "bytes": "4426" }, { "name": "Python", "bytes": "1736" } ], "symlink_target": "" }
namespace ZE { IMPLEMENT_CLASS_1(Event_Physics_BASE, Event); IMPLEMENT_CLASS_1(Event_Physics_PREUPDATE, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_POSTUPDATE, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_UPDATE, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_ONCOLLIDE, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_UPDATE_TRANSFORM, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_ON_TRIGGER, Event_Physics_BASE); IMPLEMENT_CLASS_1(Event_Physics_ON_BEGIN_TRIGGER, Event_Physics_ON_TRIGGER); IMPLEMENT_CLASS_1(Event_Physics_ON_END_TRIGGER, Event_Physics_ON_TRIGGER); }
{ "content_hash": "d1de306c01b12ebdf193d21663cc5af6", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 77, "avg_line_length": 51.083333333333336, "alnum_prop": 0.7911908646003263, "repo_name": "azon04/ZEngine", "id": "a7c7cc3d6c9eca4eeafbd931029ef198652452a1", "size": "667", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ZooidEngine/ZooidEngine/Physics/PhysicsEvents.cpp", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
extern "C" { #endif #define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES SODIUM_EXPORT size_t crypto_auth_bytes(void); #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES SODIUM_EXPORT size_t crypto_auth_keybytes(void); #define crypto_auth_PRIMITIVE "hmacsha512256" SODIUM_EXPORT const char *crypto_auth_primitive(void); SODIUM_EXPORT int crypto_auth(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]) __attribute__ ((nonnull)); #ifdef __cplusplus } #endif #endif
{ "content_hash": "8591349ac7f659bf74253a3b9d9606b8", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 26.88235294117647, "alnum_prop": 0.6980306345733042, "repo_name": "lmctv/pynacl", "id": "d0fc8ee268808d4be8e9c25fed2b8924d14b2429", "size": "1131", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "src/libsodium/src/libsodium/include/sodium/crypto_auth.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "102052" }, { "name": "Batchfile", "bytes": "4482" }, { "name": "C", "bytes": "4440037" }, { "name": "C++", "bytes": "91159" }, { "name": "CMake", "bytes": "9743" }, { "name": "M4", "bytes": "75163" }, { "name": "Makefile", "bytes": "614527" }, { "name": "Objective-C", "bytes": "166255" }, { "name": "PHP", "bytes": "563" }, { "name": "Python", "bytes": "310893" }, { "name": "Shell", "bytes": "766357" }, { "name": "Visual Basic", "bytes": "294" } ], "symlink_target": "" }
'use strict'; module.exports = require('./src/limber');
{ "content_hash": "ef1b12c2214eb641bedf79f029555762", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 41, "avg_line_length": 28, "alnum_prop": 0.6785714285714286, "repo_name": "JoshuaWise/limber", "id": "542e5a3aa429dba8afe52fc41fd6c94afd28888c", "size": "56", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "38115" }, { "name": "JavaScript", "bytes": "9618" } ], "symlink_target": "" }
#include "LocalResourceGeneric.hpp" //! Include logging capabilities #include "../../Globals.hpp" #include "../../Debug/Logger.hpp" namespace SDL2_Engine { namespace ResourceTypes { /* LocalResource (Generic) : dispose - Unload resource information Created: 04/10/2017 Modified: 04/10/2017 */ void __LocalResource<Generic>::dispose() { //Check there is data to delete if (mData) { //Delete the data delete[] mData; //Reset the values mData = nullptr; mSize = 0; //Set the status flag mStatus = EResourceLoadStatus::Unloaded; } } /* LocalResource (Generic) : Constructor - Initialise with default values Created: 04/10/2017 Modified: 04/10/2017 param[in] pPath - The path of the data to load */ __LocalResource<Generic>::__LocalResource(const char* pPath) : ILocalResourceBase(EResourceType::Generic), mData(nullptr) { //Attempt to open the file FILE* file; fopen_s(&file, pPath, "rb"); //Check the file was opened if (!file) { //Create a character buffer to store error information in char buffer[512] = { '\0' }; //Get the error information strerror_s(buffer, errno); //Output error message Globals::get<Debug::Logger>().logError("Local Resource (Generic) failed to open the file '%s'. Error: %s", pPath, buffer); //Flag error status mStatus = EResourceLoadStatus::Error; return; } //Seek to the end of the file fseek(file, 0, SEEK_END); //Get the size of the file mSize = ftell(file); //Seek back to the start of the file fseek(file, 0, SEEK_SET); //Create the resource's data array mData = new char[mSize + 1]; //Read in the field data fread(mData, sizeof(char), mSize, file); //Close the file fclose(file); //Null terminate the stream mData[mSize] = '\0'; //Flag loaded mStatus = EResourceLoadStatus::Loaded; } } }
{ "content_hash": "1e14972e8eb6c0e04d990ffae9eae68c", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 126, "avg_line_length": 23.341463414634145, "alnum_prop": 0.648380355276907, "repo_name": "MitchCroft/SDL2_Engine", "id": "56bb8160b33a2b25390ae5db79cd2069e7d939d1", "size": "1914", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SDL2_Engine/Projects/SDL2_Engine/src/Resources/ResourceTypes/LocalResourceGeneric.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1433" }, { "name": "C", "bytes": "1644975" }, { "name": "C++", "bytes": "5911912" }, { "name": "CMake", "bytes": "32474" }, { "name": "CSS", "bytes": "16267" }, { "name": "HTML", "bytes": "7685340" }, { "name": "JavaScript", "bytes": "3422" }, { "name": "Objective-C", "bytes": "61345" } ], "symlink_target": "" }
long double __ieee754_sqrtl (long double x) { fputs ("__ieee754_sqrtl not implemented\n", stderr); __set_errno (ENOSYS); return 0.0; } strong_alias (__ieee754_sqrtl, __sqrtl_finite) stub_warning (sqrtl) #include <stub-tag.h>
{ "content_hash": "36346c5cd4968363bce22c09a873e318", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 21.09090909090909, "alnum_prop": 0.6810344827586207, "repo_name": "endplay/omniplay", "id": "af9c2b51bf2aeaa331bb7dfc999371d991e6a7d6", "size": "289", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "eglibc-2.15/math/e_sqrtl.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ASP", "bytes": "4528" }, { "name": "Assembly", "bytes": "17491433" }, { "name": "Awk", "bytes": "79791" }, { "name": "Batchfile", "bytes": "903" }, { "name": "C", "bytes": "444772157" }, { "name": "C++", "bytes": "10631343" }, { "name": "GDB", "bytes": "17950" }, { "name": "HTML", "bytes": "47935" }, { "name": "Java", "bytes": "2193" }, { "name": "Lex", "bytes": "44513" }, { "name": "M4", "bytes": "9029" }, { "name": "Makefile", "bytes": "1758605" }, { "name": "Objective-C", "bytes": "5278898" }, { "name": "Perl", "bytes": "649746" }, { "name": "Perl 6", "bytes": "1101" }, { "name": "Python", "bytes": "585875" }, { "name": "RPC", "bytes": "97869" }, { "name": "Roff", "bytes": "2522798" }, { "name": "Scilab", "bytes": "21433" }, { "name": "Shell", "bytes": "426172" }, { "name": "TeX", "bytes": "283872" }, { "name": "UnrealScript", "bytes": "6143" }, { "name": "XS", "bytes": "1240" }, { "name": "Yacc", "bytes": "93190" }, { "name": "sed", "bytes": "9202" } ], "symlink_target": "" }
.class final Lorg/codeaurora/ims/csvt/CallForwardInfoP$1; .super Ljava/lang/Object; .source "CallForwardInfoP.java" # interfaces .implements Landroid/os/Parcelable$Creator; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lorg/codeaurora/ims/csvt/CallForwardInfoP; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x8 name = null .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Object;", "Landroid/os/Parcelable$Creator", "<", "Lorg/codeaurora/ims/csvt/CallForwardInfoP;", ">;" } .end annotation # direct methods .method constructor <init>()V .locals 0 .prologue .line 61 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method # virtual methods .method public bridge synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object; .locals 1 .prologue .line 61 invoke-virtual {p0, p1}, Lorg/codeaurora/ims/csvt/CallForwardInfoP$1;->createFromParcel(Landroid/os/Parcel;)Lorg/codeaurora/ims/csvt/CallForwardInfoP; move-result-object v0 return-object v0 .end method .method public createFromParcel(Landroid/os/Parcel;)Lorg/codeaurora/ims/csvt/CallForwardInfoP; .locals 1 .param p1, "in" # Landroid/os/Parcel; .prologue .line 65 new-instance v0, Lorg/codeaurora/ims/csvt/CallForwardInfoP; invoke-direct {v0, p1}, Lorg/codeaurora/ims/csvt/CallForwardInfoP;-><init>(Landroid/os/Parcel;)V return-object v0 .end method .method public bridge synthetic newArray(I)[Ljava/lang/Object; .locals 1 .prologue .line 61 invoke-virtual {p0, p1}, Lorg/codeaurora/ims/csvt/CallForwardInfoP$1;->newArray(I)[Lorg/codeaurora/ims/csvt/CallForwardInfoP; move-result-object v0 return-object v0 .end method .method public newArray(I)[Lorg/codeaurora/ims/csvt/CallForwardInfoP; .locals 1 .param p1, "size" # I .prologue .line 70 new-array v0, p1, [Lorg/codeaurora/ims/csvt/CallForwardInfoP; return-object v0 .end method
{ "content_hash": "a5fa1c1f70b15c60fb7142883d327be7", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 154, "avg_line_length": 23.820224719101123, "alnum_prop": 0.7099056603773585, "repo_name": "Liberations/Flyme5_devices_base_cm", "id": "55d4680224436a9d84c745754820d60df87fb4ba", "size": "2120", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "vendor/aosp/telephony-common.jar.out/smali/org/codeaurora/ims/csvt/CallForwardInfoP$1.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "GLSL", "bytes": "1500" }, { "name": "HTML", "bytes": "96769" }, { "name": "Makefile", "bytes": "11209" }, { "name": "Python", "bytes": "1195" }, { "name": "Shell", "bytes": "55270" }, { "name": "Smali", "bytes": "160321888" } ], "symlink_target": "" }
AWS = {}; /** * Constructs a service interface and a low-level {Client}. Use the `client` * property to make API calls. Each API operation is exposed as a function on * the `client`. * * ### Sending a Request Using SNS * * ```js * svc = new AWS.SNS(); * svc.client.OPERATION_NAME(params, function (err, data) { * if (err) { * console.log(err); // an error occurred * } else { * console.log(data); // successful response * } * }); * ``` * * @!method constructor(options) * Constructs a service interface. The returned service will have a {client} * property that provides access to the API operations. * @option (see AWS.SNS.Client.constructor) * * @!attribute client * @return [AWS.SNS.Client] A client that provides one method for each * API operation. * * @see AWS.SNS.Client * */ AWS.SNS = inherit({}) /** * The low-level SNS client class. This class provides one function * for each API operation on the service. * * @!method addPermission(params, callback) * Calls the AddPermission API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic whose access control policy you wish to modify. * * `Label` &mdash; **required** &mdash; (`String`) A unique * identifier for the new policy statement. * * `AWSAccountId` &mdash; **required** &mdash; (`Array<String>`) * The AWS account IDs of the users (principals) who will be given * access to the specified actions. The users must have AWS * accounts, but do not need to be signed up for this service. * * `ActionName` &mdash; **required** &mdash; (`Array<String>`) The * action you want to allow for the specified principal(s). * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method confirmSubscription(params, callback) * Calls the ConfirmSubscription API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic for which you wish to confirm a subscription. * * `Token` &mdash; **required** &mdash; (`String`) Short-lived * token sent to an endpoint during the Subscribe action. * * `AuthenticateOnUnsubscribe` &mdash; (`String`) Indicates that * you want to disallow unauthenticated unsubscribes of the * subscription. If value of this parameter is "true" and the * request has an AWS signature then only the topic owner and the * subscription owner will be permitted to unsubscribe the * endpoint. The unsubscribe action will require AWS * authentication. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `SubscriptionArn` &mdash; (`String`) The ARN of the created * subscription. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method createTopic(params, callback) * Calls the CreateTopic API operation. * @param params [Object] * * `Name` &mdash; **required** &mdash; (`String`) The name of the * topic you want to create. Constraints: Topic names must be made * up of only uppercase and lowercase ASCII letters, numbers, and * hyphens, and must be between 1 and 256 characters long. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `TopicArn` &mdash; (`String`) The Amazon Resource Name (ARN) * assigned to the created topic. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method deleteTopic(params, callback) * Calls the DeleteTopic API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic you want to delete. * http://sns.us-east-1.amazonaws.com/ * ?TopicArn=arn%3Aaws%3Asns%3Aus-east-1%3A123456789012%3AMy-Topic * &Action=DeleteTopic &SignatureVersion=2 * &SignatureMethod=HmacSHA256 * &Timestamp=2010-03-31T12%3A00%3A00.000Z &AWSAccessKeyId=(AWS * Access Key ID) * &Signature=DjHBa%2BbYCKQAzctOPnLP7MbHnrHT3%2FK3kFEZjwcf9%2FU%3D * fba800b9-3765-11df-8cf3-c58c53254dfb * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method getSubscriptionAttributes(params, callback) * Calls the GetSubscriptionAttributes API operation. * @param params [Object] * * `SubscriptionArn` &mdash; **required** &mdash; (`String`) The * ARN of the subscription whose properties you want to get. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `Attributes` &mdash; (`Object<String>`) A map of the * subscription's attributes. Attributes in this map include the * following: SubscriptionArn -- the subscription's ARN TopicArn -- * the topic ARN which the subscription is associated with Owner -- * the AWS account ID of the subscription's owner * ConfirmationWasAuthenticated -- True if the subscription * confirmation request was authenticated DeliveryPolicy -- the * JSON serialization of the subscription's delivery policy * EffectiveDeliveryPolicy -- the JSON serialization of the * effective delivery policy which takes into the topic delivery * policy and account system defaults * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method getTopicAttributes(params, callback) * Calls the GetTopicAttributes API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic whose properties you want to get. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `Attributes` &mdash; (`Object<String>`) A map of the topic's * attributes. Attributes in this map include the following: * TopicArn -- the topic's ARN Owner -- the AWS account ID of the * topic's owner Policy -- the JSON serialization of the topic's * access control policy DisplayName -- the human-readable name * used in the "From" field for notifications to email and * email-json endpoints SubscriptionsPending -- the number of * subscriptions pending confirmation on this topic * SubscriptionsConfirmed -- the number of confirmed subscriptions * on this topic SubscriptionsDeleted -- the number of deleted * subscriptions on this topic DeliveryPolicy -- the JSON * serialization of the topic's delivery policy * EffectiveDeliveryPolicy -- the JSON serialization of the * effective delivery policy which takes into account system * defaults * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method listSubscriptions(params, callback) * Calls the ListSubscriptions API operation. * @param params [Object] * * `NextToken` &mdash; (`String`) Token returned by the previous * ListSubscriptions request. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `Subscriptions` &mdash; (`Array<Object>`) A list of * subscriptions. * * `SubscriptionArn` &mdash; (`String`) The subscription's ARN. * * `Owner` &mdash; (`String`) The subscription's owner. * * `Protocol` &mdash; (`String`) The subscription's protocol. * * `Endpoint` &mdash; (`String`) The subscription's endpoint * (format depends on the protocol). * * `TopicArn` &mdash; (`String`) The ARN of the subscription's * topic. * * `NextToken` &mdash; (`String`) Token to pass along to the next * ListSubscriptions request. This element is returned if there are * more subscriptions to retrieve. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method listSubscriptionsByTopic(params, callback) * Calls the ListSubscriptionsByTopic API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic for which you wish to find subscriptions. * * `NextToken` &mdash; (`String`) Token returned by the previous * ListSubscriptionsByTopic request. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `Subscriptions` &mdash; (`Array<Object>`) A list of * subscriptions. * * `SubscriptionArn` &mdash; (`String`) The subscription's ARN. * * `Owner` &mdash; (`String`) The subscription's owner. * * `Protocol` &mdash; (`String`) The subscription's protocol. * * `Endpoint` &mdash; (`String`) The subscription's endpoint * (format depends on the protocol). * * `TopicArn` &mdash; (`String`) The ARN of the subscription's * topic. * * `NextToken` &mdash; (`String`) Token to pass along to the next * ListSubscriptionsByTopic request. This element is returned if * there are more subscriptions to retrieve. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method listTopics(params, callback) * Calls the ListTopics API operation. * @param params [Object] * * `NextToken` &mdash; (`String`) Token returned by the previous * ListTopics request. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `Topics` &mdash; (`Array<Object>`) A list of topic ARNs. * * `TopicArn` &mdash; (`String`) The topic's ARN. * * `NextToken` &mdash; (`String`) Token to pass along to the next * ListTopics request. This element is returned if there are * additional topics to retrieve. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method publish(params, callback) * Calls the Publish API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The topic you * want to publish to. * * `Message` &mdash; **required** &mdash; (`String`) The message * you want to send to the topic. Constraints: Messages must be * UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 * characters). * * `Subject` &mdash; (`String`) Optional parameter to be used as * the "Subject" line of when the message is delivered to e-mail * endpoints. This field will also be included, if present, in the * standard JSON messages delivered to other endpoints. * Constraints: Subjects must be ASCII text that begins with a * letter, number or punctuation mark; must not include line breaks * or control characters; and must be less than 100 characters * long. * * `MessageStructure` &mdash; (`String`) Optional parameter. It * will have one valid value: "json". If this option, Message is * present and set to "json", the value of Message must: be a * syntactically valid JSON object. It must contain at least a top * level JSON key of "default" with a value that is a string. For * any other top level key that matches one of our transport * protocols (e.g. "http"), then the corresponding value (if it is * a string) will be used for the message published for that * protocol Constraints: Keys in the JSON object that correspond to * supported transport protocols must have simple JSON string * values. The values will be parsed (unescaped) before they are * used in outgoing messages. Typically, outbound notifications are * JSON encoded (meaning, the characters will be reescaped for * sending). JSON strings are UTF-8. Values have a minimum length * of 0 (the empty string, "", is allowed). Values have a maximum * length bounded by the overall message size (so, including * multiple protocols may limit message sizes). Non-string values * will cause the key to be ignored. Keys that do not correspond to * supported transport protocols will be ignored. Duplicate keys * are not allowed. Failure to parse or validate any key or value * in the message will cause the Publish call to return an error * (no partial delivery). * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `MessageId` &mdash; (`String`) Unique identifier assigned to the * published message. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method removePermission(params, callback) * Calls the RemovePermission API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic whose access control policy you wish to modify. * * `Label` &mdash; **required** &mdash; (`String`) The unique label * of the statement you want to remove. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method setSubscriptionAttributes(params, callback) * Calls the SetSubscriptionAttributes API operation. * @param params [Object] * * `SubscriptionArn` &mdash; **required** &mdash; (`String`) The * ARN of the subscription to modify. * * `AttributeName` &mdash; **required** &mdash; (`String`) The name * of the attribute you want to set. Only a subset of the * subscriptions attributes are mutable. Valid values: * DeliveryPolicy * * `AttributeValue` &mdash; **required** &mdash; (`String`) The new * value for the attribute. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method setTopicAttributes(params, callback) * Calls the SetTopicAttributes API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * the topic to modify. * * `AttributeName` &mdash; **required** &mdash; (`String`) The name * of the attribute you want to set. Only a subset of the topic's * attributes are mutable. Valid values: Policy | DisplayName * * `AttributeValue` &mdash; **required** &mdash; (`String`) The new * value for the attribute. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method subscribe(params, callback) * Calls the Subscribe API operation. * @param params [Object] * * `TopicArn` &mdash; **required** &mdash; (`String`) The ARN of * topic you want to subscribe to. * * `Protocol` &mdash; **required** &mdash; (`String`) The protocol * you want to use. Supported protocols include: http -- delivery * of JSON-encoded message via HTTP POST https -- delivery of * JSON-encoded message via HTTPS POST email -- delivery of message * via SMTP email-json -- delivery of JSON-encoded message via SMTP * sqs -- delivery of JSON-encoded message to an Amazon SQS queue * * `Endpoint` &mdash; **required** &mdash; (`String`) The endpoint * that you want to receive notifications. Endpoints vary by * protocol: For the http protocol, the endpoint is an URL * beginning with "http://" For the https protocol, the endpoint is * a URL beginning with "https://" For the email protocol, the * endpoint is an e-mail address For the email-json protocol, the * endpoint is an e-mail address For the sqs protocol, the endpoint * is the ARN of an Amazon SQS queue * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * The `data` object has the following properties: * * * `SubscriptionArn` &mdash; (`String`) The ARN of the * subscription, if the service was able to create a subscription * immediately (without requiring endpoint owner confirmation). * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * @!method unsubscribe(params, callback) * Calls the Unsubscribe API operation. * @param params [Object] * * `SubscriptionArn` &mdash; **required** &mdash; (`String`) The * ARN of the subscription to be deleted. * @callback callback function(err, data) * Called when a response from the service is returned. If a * callback is not supplied, you must call {AWS.Request.send} * on the returned request object to initiate the request. * @param err [Object] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @return [AWS.Request] a handle to the operation request for * subsequent event callback registration. * * * @!method constructor(options) * Constructs a service client object. This client has one method for * each API operation. * @option options [String] endpoint The endpoint URI to send requests * to. The default endpoint is built from the configured `region`. * The endpoint should be a string like `'https://s3.amazonaws.com'`. * @option (see AWS.Config.constructor) * * @!attribute endpoint * @return [AWS.Endpoint] an Endpoint object representing' * the endpoint URL for service requests.' * */ AWS.SNS.Client = inherit({});
{ "content_hash": "6895f97e1704ff29e68618d37f2d6787", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 79, "avg_line_length": 52.452991452991455, "alnum_prop": 0.6713377871924393, "repo_name": "exhibia/exhibia", "id": "121237c16bbac8b58a242ee4e32facdeebd0b6f2", "size": "25137", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/db/node_modules/aws-sdk/doc-src/sns.docs.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "9307" }, { "name": "JavaScript", "bytes": "126410" }, { "name": "PHP", "bytes": "2449281" }, { "name": "Shell", "bytes": "2611" } ], "symlink_target": "" }
package org.apache.hadoop.yarn.client.cli; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.text.DecimalFormat; import java.util.EnumSet; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.MissingArgumentException; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.util.ToolRunner; import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport; import org.apache.hadoop.yarn.api.records.ContainerReport; import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.util.ConverterUtils; import com.google.common.annotations.VisibleForTesting; @Private @Unstable public class ApplicationCLI extends YarnCLI { private static final String APPLICATIONS_PATTERN = "%30s\t%20s\t%20s\t%10s\t%10s\t%18s\t%18s\t%15s\t%35s" + System.getProperty("line.separator"); private static final String APPLICATION_ATTEMPTS_PATTERN = "%30s\t%20s\t%35s\t%35s" + System.getProperty("line.separator"); private static final String CONTAINER_PATTERN = "%30s\t%20s\t%20s\t%20s\t%20s\t%35s" + System.getProperty("line.separator"); private static final String APP_TYPE_CMD = "appTypes"; private static final String APP_STATE_CMD = "appStates"; private static final String ALLSTATES_OPTION = "ALL"; private static final String QUEUE_CMD = "queue"; public static final String APPLICATION = "application"; public static final String APPLICATION_ATTEMPT = "applicationattempt"; public static final String CONTAINER = "container"; private boolean allAppStates; public static void main(String[] args) throws Exception { ApplicationCLI cli = new ApplicationCLI(); cli.setSysOutPrintStream(System.out); cli.setSysErrPrintStream(System.err); int res = ToolRunner.run(cli, args); cli.stop(); System.exit(res); } @Override public int run(String[] args) throws Exception { Options opts = new Options(); String title = null; if (args.length > 0 && args[0].equalsIgnoreCase(APPLICATION)) { title = APPLICATION; opts.addOption(STATUS_CMD, true, "Prints the status of the application."); opts.addOption(LIST_CMD, false, "List applications. " + "Supports optional use of -appTypes to filter applications " + "based on application type, " + "and -appStates to filter applications based on application state."); opts.addOption(KILL_CMD, true, "Kills the application."); opts.addOption(MOVE_TO_QUEUE_CMD, true, "Moves the application to a " + "different queue."); opts.addOption(QUEUE_CMD, true, "Works with the movetoqueue command to" + " specify which queue to move an application to."); opts.addOption(HELP_CMD, false, "Displays help for all commands."); Option appTypeOpt = new Option(APP_TYPE_CMD, true, "Works with -list to " + "filter applications based on " + "input comma-separated list of application types."); appTypeOpt.setValueSeparator(','); appTypeOpt.setArgs(Option.UNLIMITED_VALUES); appTypeOpt.setArgName("Types"); opts.addOption(appTypeOpt); Option appStateOpt = new Option(APP_STATE_CMD, true, "Works with -list " + "to filter applications based on input comma-separated list of " + "application states. " + getAllValidApplicationStates()); appStateOpt.setValueSeparator(','); appStateOpt.setArgs(Option.UNLIMITED_VALUES); appStateOpt.setArgName("States"); opts.addOption(appStateOpt); opts.getOption(KILL_CMD).setArgName("Application ID"); opts.getOption(MOVE_TO_QUEUE_CMD).setArgName("Application ID"); opts.getOption(QUEUE_CMD).setArgName("Queue Name"); opts.getOption(STATUS_CMD).setArgName("Application ID"); } else if (args.length > 0 && args[0].equalsIgnoreCase(APPLICATION_ATTEMPT)) { title = APPLICATION_ATTEMPT; opts.addOption(STATUS_CMD, true, "Prints the status of the application attempt."); opts.addOption(LIST_CMD, true, "List application attempts for aplication."); opts.addOption(HELP_CMD, false, "Displays help for all commands."); opts.getOption(STATUS_CMD).setArgName("Application Attempt ID"); opts.getOption(LIST_CMD).setArgName("Application ID"); } else if (args.length > 0 && args[0].equalsIgnoreCase(CONTAINER)) { title = CONTAINER; opts.addOption(STATUS_CMD, true, "Prints the status of the container."); opts.addOption(LIST_CMD, true, "List containers for application attempt."); opts.addOption(HELP_CMD, false, "Displays help for all commands."); opts.getOption(STATUS_CMD).setArgName("Container ID"); opts.getOption(LIST_CMD).setArgName("Application Attempt ID"); } int exitCode = -1; CommandLine cliParser = null; try { cliParser = new GnuParser().parse(opts, args); } catch (MissingArgumentException ex) { sysout.println("Missing argument for options"); printUsage(title, opts); return exitCode; } if (cliParser.hasOption(STATUS_CMD)) { if (args.length != 3) { printUsage(title, opts); return exitCode; } if (args[0].equalsIgnoreCase(APPLICATION)) { printApplicationReport(cliParser.getOptionValue(STATUS_CMD)); } else if (args[0].equalsIgnoreCase(APPLICATION_ATTEMPT)) { printApplicationAttemptReport(cliParser.getOptionValue(STATUS_CMD)); } else if (args[0].equalsIgnoreCase(CONTAINER)) { printContainerReport(cliParser.getOptionValue(STATUS_CMD)); } } else if (cliParser.hasOption(LIST_CMD)) { if (args[0].equalsIgnoreCase(APPLICATION)) { allAppStates = false; Set<String> appTypes = new HashSet<String>(); if (cliParser.hasOption(APP_TYPE_CMD)) { String[] types = cliParser.getOptionValues(APP_TYPE_CMD); if (types != null) { for (String type : types) { if (!type.trim().isEmpty()) { appTypes.add(type.toUpperCase().trim()); } } } } EnumSet<YarnApplicationState> appStates = EnumSet .noneOf(YarnApplicationState.class); if (cliParser.hasOption(APP_STATE_CMD)) { String[] states = cliParser.getOptionValues(APP_STATE_CMD); if (states != null) { for (String state : states) { if (!state.trim().isEmpty()) { if (state.trim().equalsIgnoreCase(ALLSTATES_OPTION)) { allAppStates = true; break; } try { appStates.add(YarnApplicationState.valueOf(state .toUpperCase().trim())); } catch (IllegalArgumentException ex) { sysout.println("The application state " + state + " is invalid."); sysout.println(getAllValidApplicationStates()); return exitCode; } } } } } listApplications(appTypes, appStates); } else if (args[0].equalsIgnoreCase(APPLICATION_ATTEMPT)) { if (args.length != 3) { printUsage(title, opts); return exitCode; } listApplicationAttempts(cliParser.getOptionValue(LIST_CMD)); } else if (args[0].equalsIgnoreCase(CONTAINER)) { if (args.length != 3) { printUsage(title, opts); return exitCode; } listContainers(cliParser.getOptionValue(LIST_CMD)); } } else if (cliParser.hasOption(KILL_CMD)) { if (args.length != 3) { printUsage(title, opts); return exitCode; } try{ killApplication(cliParser.getOptionValue(KILL_CMD)); } catch (ApplicationNotFoundException e) { return exitCode; } } else if (cliParser.hasOption(MOVE_TO_QUEUE_CMD)) { if (!cliParser.hasOption(QUEUE_CMD)) { printUsage(title, opts); return exitCode; } moveApplicationAcrossQueues(cliParser.getOptionValue(MOVE_TO_QUEUE_CMD), cliParser.getOptionValue(QUEUE_CMD)); } else if (cliParser.hasOption(HELP_CMD)) { printUsage(title, opts); return 0; } else { syserr.println("Invalid Command Usage : "); printUsage(title, opts); } return 0; } /** * It prints the usage of the command * * @param opts */ @VisibleForTesting void printUsage(String title, Options opts) { new HelpFormatter().printHelp(title, opts); } /** * Prints the application attempt report for an application attempt id. * * @param applicationAttemptId * @throws YarnException */ private void printApplicationAttemptReport(String applicationAttemptId) throws YarnException, IOException { ApplicationAttemptReport appAttemptReport = client .getApplicationAttemptReport(ConverterUtils .toApplicationAttemptId(applicationAttemptId)); // Use PrintWriter.println, which uses correct platform line ending. ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter appAttemptReportStr = new PrintWriter(baos); if (appAttemptReport != null) { appAttemptReportStr.println("Application Attempt Report : "); appAttemptReportStr.print("\tApplicationAttempt-Id : "); appAttemptReportStr.println(appAttemptReport.getApplicationAttemptId()); appAttemptReportStr.print("\tState : "); appAttemptReportStr.println(appAttemptReport .getYarnApplicationAttemptState()); appAttemptReportStr.print("\tAMContainer : "); appAttemptReportStr.println(appAttemptReport.getAMContainerId() .toString()); appAttemptReportStr.print("\tTracking-URL : "); appAttemptReportStr.println(appAttemptReport.getTrackingUrl()); appAttemptReportStr.print("\tRPC Port : "); appAttemptReportStr.println(appAttemptReport.getRpcPort()); appAttemptReportStr.print("\tAM Host : "); appAttemptReportStr.println(appAttemptReport.getHost()); appAttemptReportStr.print("\tDiagnostics : "); appAttemptReportStr.print(appAttemptReport.getDiagnostics()); } else { appAttemptReportStr.print("Application Attempt with id '" + applicationAttemptId + "' doesn't exist in History Server."); } appAttemptReportStr.close(); sysout.println(baos.toString("UTF-8")); } /** * Prints the container report for an container id. * * @param containerId * @throws YarnException */ private void printContainerReport(String containerId) throws YarnException, IOException { ContainerReport containerReport = client.getContainerReport((ConverterUtils .toContainerId(containerId))); // Use PrintWriter.println, which uses correct platform line ending. ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter containerReportStr = new PrintWriter(baos); if (containerReport != null) { containerReportStr.println("Container Report : "); containerReportStr.print("\tContainer-Id : "); containerReportStr.println(containerReport.getContainerId()); containerReportStr.print("\tStart-Time : "); containerReportStr.println(containerReport.getCreationTime()); containerReportStr.print("\tFinish-Time : "); containerReportStr.println(containerReport.getFinishTime()); containerReportStr.print("\tState : "); containerReportStr.println(containerReport.getContainerState()); containerReportStr.print("\tLOG-URL : "); containerReportStr.println(containerReport.getLogUrl()); containerReportStr.print("\tHost : "); containerReportStr.println(containerReport.getAssignedNode()); containerReportStr.print("\tDiagnostics : "); containerReportStr.print(containerReport.getDiagnosticsInfo()); } else { containerReportStr.print("Container with id '" + containerId + "' doesn't exist in Hostory Server."); } containerReportStr.close(); sysout.println(baos.toString("UTF-8")); } /** * Lists the applications matching the given application Types And application * States present in the Resource Manager * * @param appTypes * @param appStates * @throws YarnException * @throws IOException */ private void listApplications(Set<String> appTypes, EnumSet<YarnApplicationState> appStates) throws YarnException, IOException { PrintWriter writer = new PrintWriter(sysout); if (allAppStates) { for (YarnApplicationState appState : YarnApplicationState.values()) { appStates.add(appState); } } else { if (appStates.isEmpty()) { appStates.add(YarnApplicationState.RUNNING); appStates.add(YarnApplicationState.ACCEPTED); appStates.add(YarnApplicationState.SUBMITTED); } } List<ApplicationReport> appsReport = client.getApplications(appTypes, appStates); writer.println("Total number of applications (application-types: " + appTypes + " and states: " + appStates + ")" + ":" + appsReport.size()); writer.printf(APPLICATIONS_PATTERN, "Application-Id", "Application-Name", "Application-Type", "User", "Queue", "State", "Final-State", "Progress", "Tracking-URL"); for (ApplicationReport appReport : appsReport) { DecimalFormat formatter = new DecimalFormat("###.##%"); String progress = formatter.format(appReport.getProgress()); writer.printf(APPLICATIONS_PATTERN, appReport.getApplicationId(), appReport.getName(), appReport.getApplicationType(), appReport .getUser(), appReport.getQueue(), appReport .getYarnApplicationState(), appReport.getFinalApplicationStatus(), progress, appReport .getOriginalTrackingUrl()); } writer.flush(); } /** * Kills the application with the application id as appId * * @param applicationId * @throws YarnException * @throws IOException */ private void killApplication(String applicationId) throws YarnException, IOException { ApplicationId appId = ConverterUtils.toApplicationId(applicationId); ApplicationReport appReport = null; try { appReport = client.getApplicationReport(appId); } catch (ApplicationNotFoundException e) { sysout.println("Application with id '" + applicationId + "' doesn't exist in RM."); throw e; } if (appReport.getYarnApplicationState() == YarnApplicationState.FINISHED || appReport.getYarnApplicationState() == YarnApplicationState.KILLED || appReport.getYarnApplicationState() == YarnApplicationState.FAILED) { sysout.println("Application " + applicationId + " has already finished "); } else { sysout.println("Killing application " + applicationId); client.killApplication(appId); } } /** * Moves the application with the given ID to the given queue. */ private void moveApplicationAcrossQueues(String applicationId, String queue) throws YarnException, IOException { ApplicationId appId = ConverterUtils.toApplicationId(applicationId); ApplicationReport appReport = client.getApplicationReport(appId); if (appReport.getYarnApplicationState() == YarnApplicationState.FINISHED || appReport.getYarnApplicationState() == YarnApplicationState.KILLED || appReport.getYarnApplicationState() == YarnApplicationState.FAILED) { sysout.println("Application " + applicationId + " has already finished "); } else { sysout.println("Moving application " + applicationId + " to queue " + queue); client.moveApplicationAcrossQueues(appId, queue); sysout.println("Successfully completed move."); } } /** * Prints the application report for an application id. * * @param applicationId * @throws YarnException */ private void printApplicationReport(String applicationId) throws YarnException, IOException { ApplicationReport appReport = client.getApplicationReport(ConverterUtils .toApplicationId(applicationId)); // Use PrintWriter.println, which uses correct platform line ending. ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter appReportStr = new PrintWriter(baos); if (appReport != null) { appReportStr.println("Application Report : "); appReportStr.print("\tApplication-Id : "); appReportStr.println(appReport.getApplicationId()); appReportStr.print("\tApplication-Name : "); appReportStr.println(appReport.getName()); appReportStr.print("\tApplication-Type : "); appReportStr.println(appReport.getApplicationType()); appReportStr.print("\tUser : "); appReportStr.println(appReport.getUser()); appReportStr.print("\tQueue : "); appReportStr.println(appReport.getQueue()); appReportStr.print("\tStart-Time : "); appReportStr.println(appReport.getStartTime()); appReportStr.print("\tFinish-Time : "); appReportStr.println(appReport.getFinishTime()); appReportStr.print("\tProgress : "); DecimalFormat formatter = new DecimalFormat("###.##%"); String progress = formatter.format(appReport.getProgress()); appReportStr.println(progress); appReportStr.print("\tState : "); appReportStr.println(appReport.getYarnApplicationState()); appReportStr.print("\tFinal-State : "); appReportStr.println(appReport.getFinalApplicationStatus()); appReportStr.print("\tTracking-URL : "); appReportStr.println(appReport.getOriginalTrackingUrl()); appReportStr.print("\tRPC Port : "); appReportStr.println(appReport.getRpcPort()); appReportStr.print("\tAM Host : "); appReportStr.println(appReport.getHost()); appReportStr.print("\tAggregate Resource Allocation : "); ApplicationResourceUsageReport usageReport = appReport.getApplicationResourceUsageReport(); if (usageReport != null) { //completed app report in the timeline server doesn't have usage report appReportStr.print(usageReport.getMemorySeconds() + " MB-seconds, "); appReportStr.println(usageReport.getVcoreSeconds() + " vcore-seconds"); } else { appReportStr.println("N/A"); } appReportStr.print("\tLog Aggregation Status : "); appReportStr.println(appReport.getLogAggregationStatus() == null ? "N/A" : appReport.getLogAggregationStatus()); appReportStr.print("\tDiagnostics : "); appReportStr.print(appReport.getDiagnostics()); } else { appReportStr.print("Application with id '" + applicationId + "' doesn't exist in RM."); } appReportStr.close(); sysout.println(baos.toString("UTF-8")); } private String getAllValidApplicationStates() { StringBuilder sb = new StringBuilder(); sb.append("The valid application state can be" + " one of the following: "); sb.append(ALLSTATES_OPTION + ","); for (YarnApplicationState appState : YarnApplicationState.values()) { sb.append(appState + ","); } String output = sb.toString(); return output.substring(0, output.length() - 1); } /** * Lists the application attempts matching the given applicationid * * @param applicationId * @throws YarnException * @throws IOException */ private void listApplicationAttempts(String applicationId) throws YarnException, IOException { PrintWriter writer = new PrintWriter(sysout); List<ApplicationAttemptReport> appAttemptsReport = client .getApplicationAttempts(ConverterUtils.toApplicationId(applicationId)); writer.println("Total number of application attempts " + ":" + appAttemptsReport.size()); writer.printf(APPLICATION_ATTEMPTS_PATTERN, "ApplicationAttempt-Id", "State", "AM-Container-Id", "Tracking-URL"); for (ApplicationAttemptReport appAttemptReport : appAttemptsReport) { writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport .getApplicationAttemptId(), appAttemptReport .getYarnApplicationAttemptState(), appAttemptReport .getAMContainerId().toString(), appAttemptReport.getTrackingUrl()); } writer.flush(); } /** * Lists the containers matching the given application attempts * * @param appAttemptId * @throws YarnException * @throws IOException */ private void listContainers(String appAttemptId) throws YarnException, IOException { PrintWriter writer = new PrintWriter(sysout); List<ContainerReport> appsReport = client .getContainers(ConverterUtils.toApplicationAttemptId(appAttemptId)); writer.println("Total number of containers " + ":" + appsReport.size()); writer.printf(CONTAINER_PATTERN, "Container-Id", "Start Time", "Finish Time", "State", "Host", "LOG-URL"); for (ContainerReport containerReport : appsReport) { writer.printf(CONTAINER_PATTERN, containerReport.getContainerId(), containerReport.getCreationTime(), containerReport.getFinishTime(), containerReport.getContainerState(), containerReport .getAssignedNode(), containerReport.getLogUrl()); } writer.flush(); } }
{ "content_hash": "0d0cfb46c7db6ceafb004cd64e3dd611", "timestamp": "", "source": "github", "line_count": 533, "max_line_length": 83, "avg_line_length": 41.45403377110694, "alnum_prop": 0.6806064720525006, "repo_name": "wankunde/cloudera_hadoop", "id": "5de3d0cee0c705b6c9daaac7808fb7fd430893ce", "size": "22901", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "95943" }, { "name": "Batchfile", "bytes": "63910" }, { "name": "C", "bytes": "1745962" }, { "name": "C++", "bytes": "2134903" }, { "name": "CMake", "bytes": "55692" }, { "name": "CSS", "bytes": "53463" }, { "name": "HTML", "bytes": "2441631" }, { "name": "Java", "bytes": "59302604" }, { "name": "JavaScript", "bytes": "46290" }, { "name": "M4", "bytes": "39811" }, { "name": "Makefile", "bytes": "57929" }, { "name": "Objective-C", "bytes": "118273" }, { "name": "PHP", "bytes": "152555" }, { "name": "Perl", "bytes": "159384" }, { "name": "Python", "bytes": "714987" }, { "name": "Ruby", "bytes": "28847" }, { "name": "Shell", "bytes": "446018" }, { "name": "Smalltalk", "bytes": "56562" }, { "name": "TLA", "bytes": "14993" }, { "name": "TeX", "bytes": "45082" }, { "name": "Thrift", "bytes": "3965" }, { "name": "XSLT", "bytes": "41310" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, shrink-to-fit=no"> <title>ListView</title> <script src="listview.js"></script> <style> body { margin: 1em; } .listview { border: #333 1px solid; border-color: #999 #ccc #ccc #999; border-radius: 1px; box-sizing: border-box; margin: 1em 0; } .listview[data-listview-orientation="vertical"] > .listview-inner { width: 100%; } .listview[data-listview-orientation="horizontal"] > .listview-inner { height: 100%; } .listview > .listview-inner > * { padding: 0.5em 1em; } .listview[data-listview-orientation="vertical"] > .listview-inner > * { border-bottom: #eee 1px solid; } .listview[data-listview-orientation="vertical"] > .listview-inner > :last-child { border-bottom: none; } .listview[data-listview-orientation="horizontal"] > .listview-inner > * { border-right: #eee 1px solid; } .listview[data-listview-orientation="horizontal"] > .listview-inner > :last-child { border-bottom: none; } </style> <script> function eventLogger(event) { console.log(event); var className = 'event-logger-' + event.type; var el = document.getElementsByClassName(className)[0]; if (!el) { el = document.createElement('p'); el.className = 'event-logger ' + className; el.textContent = event.type; el.dataset.eventLoggerCount = 0; document.body.appendChild(el); } el.dataset.eventLoggerCount++; el.classList.add('highlight'); setTimeout(function () { el.classList.remove('highlight'); }, 1); } </script> </head> <body> <p>Primes:</p> <div id="lv1" tabindex="0" style="height: 20em"></div> <script> var primesAdapter = new ListView.PrimesAdapter(); var lv1 = new ListView(document.getElementById('lv1'), primesAdapter); lv1.container.addEventListener('lv-scroll-animation', eventLogger); lv1.container.addEventListener('lv-scroll-stop', eventLogger); lv1.container.addEventListener('lv-get-view', eventLogger); lv1.container.addEventListener('lv-draw', eventLogger); </script> <p>Randoms:</p> <div id="lv2" tabindex="0" data-listview-orientation="horizontal"></div> <script> var randomAdapter = { len: 30, getView: function (i) { var res = document.createElement('div'); res.textContent = Math.round(Number.MAX_SAFE_INTEGER * Math.random()); return res; }, }; var lv2 = new ListView(document.getElementById('lv2'), randomAdapter); lv2.container.addEventListener('lv-scroll-animation', eventLogger); lv2.container.addEventListener('lv-scroll-stop', eventLogger); lv2.container.addEventListener('lv-get-view', eventLogger); lv2.container.addEventListener('lv-draw', eventLogger); </script> <style> .event-logger { color: #000; transition: color 1s ease; } .event-logger.highlight { color: #0c0; transition: all 0s ease; } .event-logger:after { content: attr(data-event-logger-count); margin-left: 1em; color: #fff; background: #333; border-radius: 0.3em; padding: 0.2em 0.5em; } </style> </body> </html>
{ "content_hash": "1c73fb536ebe4562c92feb634b6498b0", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 103, "avg_line_length": 23.919354838709676, "alnum_prop": 0.7097100472016183, "repo_name": "bbars/utils", "id": "ea2211d7fc82160fa913eac521a027cebb99477a", "size": "2966", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js-listview/example.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "52116" }, { "name": "JavaScript", "bytes": "149606" }, { "name": "PHP", "bytes": "27293" } ], "symlink_target": "" }
FROM tomcat:8-jre8 # RUN apt-get update && apt-get install -y apt-utils && apt-get install -y telnet # This gives us envsubst, which we use for tomcat configuration. RUN apt-get update && apt-get install -y gettext-base RUN rm -rf /usr/local/tomcat/webapps/* COPY ROOT.war /usr/local/tomcat/webapps/ROOT.war COPY ServerConfig-template.groovy /tmp/ServerConfig-template.groovy COPY docker-entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] CMD ["catalina.sh", "run"]
{ "content_hash": "6e28ffaece367b1e5356b0aa05ce1230", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 81, "avg_line_length": 23.318181818181817, "alnum_prop": 0.7446393762183235, "repo_name": "SRA-18F-GSA-Agile-Services/checkFDA", "id": "b58cf4165cdc6ce071180fe6fc454a477f112f47", "size": "513", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docker/tomcat/Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3500364" }, { "name": "Groovy", "bytes": "167561" }, { "name": "HTML", "bytes": "114123" }, { "name": "JavaScript", "bytes": "3714386" }, { "name": "Shell", "bytes": "2439" } ], "symlink_target": "" }
SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -- -- Name: hstore; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public; -- -- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs'; -- -- Name: special_action; Type: TYPE; Schema: public; Owner: - -- CREATE TYPE public.special_action AS ENUM ( 'dump_info', 'emergency_lock', 'emergency_unlock', 'power_off', 'read_status', 'reboot', 'sync', 'take_photo' ); SET default_tablespace = ''; -- -- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.active_storage_attachments ( id bigint NOT NULL, name character varying NOT NULL, record_type character varying NOT NULL, record_id bigint NOT NULL, blob_id bigint NOT NULL, created_at timestamp without time zone NOT NULL ); -- -- Name: active_storage_attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.active_storage_attachments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: active_storage_attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.active_storage_attachments_id_seq OWNED BY public.active_storage_attachments.id; -- -- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.active_storage_blobs ( id bigint NOT NULL, key character varying NOT NULL, filename character varying NOT NULL, content_type character varying, metadata text, byte_size bigint NOT NULL, checksum character varying NOT NULL, created_at timestamp without time zone NOT NULL ); -- -- Name: active_storage_blobs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.active_storage_blobs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: active_storage_blobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id; -- -- Name: alerts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.alerts ( id bigint NOT NULL, problem_tag character varying NOT NULL, priority integer DEFAULT 100 NOT NULL, slug character varying NOT NULL, device_id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: alerts_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.alerts_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: alerts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.alerts_id_seq OWNED BY public.alerts.id; -- -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.ar_internal_metadata ( key character varying NOT NULL, value character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL ); -- -- Name: arg_names; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.arg_names ( id bigint NOT NULL, value character varying NOT NULL ); -- -- Name: arg_names_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.arg_names_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: arg_names_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.arg_names_id_seq OWNED BY public.arg_names.id; -- -- Name: arg_sets; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.arg_sets ( id bigint NOT NULL, fragment_id bigint NOT NULL, node_id bigint NOT NULL ); -- -- Name: arg_sets_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.arg_sets_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: arg_sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.arg_sets_id_seq OWNED BY public.arg_sets.id; -- -- Name: delayed_jobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.delayed_jobs ( id integer NOT NULL, priority integer DEFAULT 0 NOT NULL, attempts integer DEFAULT 0 NOT NULL, handler text NOT NULL, last_error text, run_at timestamp without time zone, locked_at timestamp without time zone, failed_at timestamp without time zone, locked_by character varying, queue character varying, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: delayed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.delayed_jobs_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: delayed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.delayed_jobs_id_seq OWNED BY public.delayed_jobs.id; -- -- Name: devices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.devices ( id integer NOT NULL, name character varying DEFAULT 'FarmBot'::character varying, max_log_count integer DEFAULT 1000, max_images_count integer DEFAULT 450, timezone character varying(280), last_saw_api timestamp without time zone, last_saw_mq timestamp without time zone, fbos_version character varying(15), throttled_until timestamp without time zone, throttled_at timestamp without time zone, mounted_tool_id bigint, created_at timestamp without time zone, updated_at timestamp without time zone, serial_number character varying(32), mqtt_rate_limit_email_sent_at timestamp without time zone, last_ota timestamp without time zone, last_ota_checkup timestamp without time zone, ota_hour integer DEFAULT 3, needs_reset boolean DEFAULT false, first_saw_api timestamp without time zone, ota_hour_utc integer ); -- -- Name: devices_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.devices_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: devices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.devices_id_seq OWNED BY public.devices.id; -- -- Name: edge_nodes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.edge_nodes ( id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, sequence_id bigint NOT NULL, primary_node_id bigint NOT NULL, kind character varying(50), value character varying(300) ); -- -- Name: edge_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.edge_nodes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: edge_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.edge_nodes_id_seq OWNED BY public.edge_nodes.id; -- -- Name: farm_events; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.farm_events ( id integer NOT NULL, device_id integer, start_time timestamp without time zone, end_time timestamp without time zone, repeat integer, time_unit character varying, executable_type character varying(280), executable_id integer, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: farm_events_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.farm_events_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: farm_events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.farm_events_id_seq OWNED BY public.farm_events.id; -- -- Name: farmware_envs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.farmware_envs ( id bigint NOT NULL, device_id bigint, key character varying(100), value character varying(300), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: farmware_envs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.farmware_envs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: farmware_envs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.farmware_envs_id_seq OWNED BY public.farmware_envs.id; -- -- Name: farmware_installations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.farmware_installations ( id bigint NOT NULL, device_id bigint, url character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, package character varying(80), package_error character varying ); -- -- Name: farmware_installations_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.farmware_installations_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: farmware_installations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.farmware_installations_id_seq OWNED BY public.farmware_installations.id; -- -- Name: fbos_configs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.fbos_configs ( id bigint NOT NULL, device_id bigint, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, auto_sync boolean DEFAULT true, beta_opt_in boolean DEFAULT false, disable_factory_reset boolean DEFAULT true, firmware_input_log boolean DEFAULT false, firmware_output_log boolean DEFAULT false, sequence_body_log boolean DEFAULT false, sequence_complete_log boolean DEFAULT false, sequence_init_log boolean DEFAULT false, network_not_found_timer integer, firmware_hardware character varying, api_migrated boolean DEFAULT true, os_auto_update boolean DEFAULT true, arduino_debug_messages boolean DEFAULT false, firmware_path character varying, firmware_debug_log boolean DEFAULT false, update_channel character varying(7) DEFAULT 'stable'::character varying, boot_sequence_id integer, safe_height integer DEFAULT 0, soil_height integer DEFAULT 0 ); -- -- Name: fbos_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.fbos_configs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: fbos_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.fbos_configs_id_seq OWNED BY public.fbos_configs.id; -- -- Name: firmware_configs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.firmware_configs ( id bigint NOT NULL, device_id bigint, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, encoder_enabled_x integer DEFAULT 0, encoder_enabled_y integer DEFAULT 0, encoder_enabled_z integer DEFAULT 0, encoder_invert_x integer DEFAULT 0, encoder_invert_y integer DEFAULT 0, encoder_invert_z integer DEFAULT 0, encoder_missed_steps_decay_x integer DEFAULT 5, encoder_missed_steps_decay_y integer DEFAULT 5, encoder_missed_steps_decay_z integer DEFAULT 5, encoder_missed_steps_max_x integer DEFAULT 5, encoder_missed_steps_max_y integer DEFAULT 5, encoder_missed_steps_max_z integer DEFAULT 5, encoder_scaling_x integer DEFAULT 5556, encoder_scaling_y integer DEFAULT 5556, encoder_scaling_z integer DEFAULT 5556, encoder_type_x integer DEFAULT 0, encoder_type_y integer DEFAULT 0, encoder_type_z integer DEFAULT 0, encoder_use_for_pos_x integer DEFAULT 0, encoder_use_for_pos_y integer DEFAULT 0, encoder_use_for_pos_z integer DEFAULT 0, movement_axis_nr_steps_x integer DEFAULT 0, movement_axis_nr_steps_y integer DEFAULT 0, movement_axis_nr_steps_z integer DEFAULT 0, movement_enable_endpoints_x integer DEFAULT 0, movement_enable_endpoints_y integer DEFAULT 0, movement_enable_endpoints_z integer DEFAULT 0, movement_home_at_boot_x integer DEFAULT 0, movement_home_at_boot_y integer DEFAULT 0, movement_home_at_boot_z integer DEFAULT 0, movement_home_spd_x integer DEFAULT 50, movement_home_spd_y integer DEFAULT 50, movement_home_spd_z integer DEFAULT 50, movement_home_up_x integer DEFAULT 0, movement_home_up_y integer DEFAULT 0, movement_home_up_z integer DEFAULT 1, movement_invert_endpoints_x integer DEFAULT 0, movement_invert_endpoints_y integer DEFAULT 0, movement_invert_endpoints_z integer DEFAULT 0, movement_invert_motor_x integer DEFAULT 0, movement_invert_motor_y integer DEFAULT 0, movement_invert_motor_z integer DEFAULT 0, movement_keep_active_x integer DEFAULT 1, movement_keep_active_y integer DEFAULT 1, movement_keep_active_z integer DEFAULT 1, movement_max_spd_x integer DEFAULT 400, movement_max_spd_y integer DEFAULT 400, movement_max_spd_z integer DEFAULT 400, movement_min_spd_x integer DEFAULT 50, movement_min_spd_y integer DEFAULT 50, movement_min_spd_z integer DEFAULT 50, movement_secondary_motor_invert_x integer DEFAULT 1, movement_secondary_motor_x integer DEFAULT 1, movement_step_per_mm_x double precision DEFAULT 5, movement_step_per_mm_y double precision DEFAULT 5, movement_step_per_mm_z double precision DEFAULT 25, movement_steps_acc_dec_x integer DEFAULT 300, movement_steps_acc_dec_y integer DEFAULT 300, movement_steps_acc_dec_z integer DEFAULT 300, movement_stop_at_home_x integer DEFAULT 1, movement_stop_at_home_y integer DEFAULT 1, movement_stop_at_home_z integer DEFAULT 1, movement_stop_at_max_x integer DEFAULT 1, movement_stop_at_max_y integer DEFAULT 1, movement_stop_at_max_z integer DEFAULT 1, movement_timeout_x integer DEFAULT 120, movement_timeout_y integer DEFAULT 120, movement_timeout_z integer DEFAULT 120, param_config_ok integer DEFAULT 0, param_e_stop_on_mov_err integer DEFAULT 0, param_mov_nr_retry integer DEFAULT 3, param_test integer DEFAULT 0, param_use_eeprom integer DEFAULT 1, param_version integer DEFAULT 1, pin_guard_1_active_state integer DEFAULT 1, pin_guard_1_pin_nr integer DEFAULT 0, pin_guard_1_time_out integer DEFAULT 60, pin_guard_2_active_state integer DEFAULT 1, pin_guard_2_pin_nr integer DEFAULT 0, pin_guard_2_time_out integer DEFAULT 60, pin_guard_3_active_state integer DEFAULT 1, pin_guard_3_pin_nr integer DEFAULT 0, pin_guard_3_time_out integer DEFAULT 60, pin_guard_4_active_state integer DEFAULT 1, pin_guard_4_pin_nr integer DEFAULT 0, pin_guard_4_time_out integer DEFAULT 60, pin_guard_5_active_state integer DEFAULT 1, pin_guard_5_pin_nr integer DEFAULT 0, pin_guard_5_time_out integer DEFAULT 60, api_migrated boolean DEFAULT true, movement_invert_2_endpoints_x integer DEFAULT 0, movement_invert_2_endpoints_y integer DEFAULT 0, movement_invert_2_endpoints_z integer DEFAULT 0, movement_microsteps_x integer DEFAULT 1, movement_microsteps_y integer DEFAULT 1, movement_microsteps_z integer DEFAULT 1, movement_motor_current_x integer DEFAULT 600, movement_motor_current_y integer DEFAULT 600, movement_motor_current_z integer DEFAULT 600, movement_stall_sensitivity_x integer DEFAULT 63, movement_stall_sensitivity_y integer DEFAULT 63, movement_stall_sensitivity_z integer DEFAULT 63, movement_min_spd_z2 integer DEFAULT 50, movement_max_spd_z2 integer DEFAULT 400, movement_steps_acc_dec_z2 integer DEFAULT 300 ); -- -- Name: firmware_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.firmware_configs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: firmware_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.firmware_configs_id_seq OWNED BY public.firmware_configs.id; -- -- Name: folders; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.folders ( id bigint NOT NULL, device_id bigint NOT NULL, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, color character varying(20) NOT NULL, name character varying(40) NOT NULL, parent_id integer ); -- -- Name: folders_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.folders_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: folders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.folders_id_seq OWNED BY public.folders.id; -- -- Name: fragments; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.fragments ( id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, device_id bigint, owner_type character varying NOT NULL, owner_id bigint NOT NULL ); -- -- Name: fragments_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.fragments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: fragments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.fragments_id_seq OWNED BY public.fragments.id; -- -- Name: global_bulletins; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.global_bulletins ( id bigint NOT NULL, href character varying, href_label character varying, slug character varying, title character varying, type character varying, content text, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: global_bulletins_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.global_bulletins_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: global_bulletins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.global_bulletins_id_seq OWNED BY public.global_bulletins.id; -- -- Name: global_configs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.global_configs ( id bigint NOT NULL, key character varying, value text, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: global_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.global_configs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: global_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.global_configs_id_seq OWNED BY public.global_configs.id; -- -- Name: images; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.images ( id integer NOT NULL, device_id integer, meta text, attachment_processed_at timestamp without time zone, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, attachment_file_name character varying, attachment_content_type character varying, attachment_file_size integer, attachment_updated_at timestamp without time zone ); -- -- Name: images_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.images_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.images_id_seq OWNED BY public.images.id; -- -- Name: points; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.points ( id integer NOT NULL, radius double precision DEFAULT 25.0 NOT NULL, x double precision NOT NULL, y double precision NOT NULL, z double precision DEFAULT 0.0 NOT NULL, device_id integer NOT NULL, meta public.hstore, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, name character varying DEFAULT 'untitled'::character varying NOT NULL, pointer_type character varying(280) NOT NULL, planted_at timestamp without time zone, openfarm_slug character varying(280) DEFAULT '50'::character varying NOT NULL, plant_stage character varying(10) DEFAULT 'planned'::character varying, tool_id integer, pullout_direction integer DEFAULT 0, migrated_at timestamp without time zone, discarded_at timestamp without time zone, gantry_mounted boolean DEFAULT false ); -- -- Name: sequences; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.sequences ( id integer NOT NULL, device_id integer, name character varying NOT NULL, color character varying, kind character varying(280) DEFAULT 'sequence'::character varying, updated_at timestamp without time zone, created_at timestamp without time zone, migrated_nodes boolean DEFAULT false, folder_id bigint ); -- -- Name: in_use_points; Type: VIEW; Schema: public; Owner: - -- CREATE VIEW public.in_use_points AS SELECT points.x, points.y, points.z, sequences.id AS sequence_id, edge_nodes.id AS edge_node_id, points.device_id, (edge_nodes.value)::integer AS point_id, points.pointer_type, points.name AS pointer_name, sequences.name AS sequence_name FROM ((public.edge_nodes JOIN public.sequences ON ((edge_nodes.sequence_id = sequences.id))) JOIN public.points ON (((edge_nodes.value)::integer = points.id))) WHERE ((edge_nodes.kind)::text = 'pointer_id'::text); -- -- Name: tools; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.tools ( id integer NOT NULL, name character varying(280), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, device_id integer ); -- -- Name: in_use_tools; Type: VIEW; Schema: public; Owner: - -- CREATE VIEW public.in_use_tools AS SELECT tools.id AS tool_id, tools.name AS tool_name, sequences.name AS sequence_name, sequences.id AS sequence_id, sequences.device_id FROM ((public.edge_nodes JOIN public.sequences ON ((edge_nodes.sequence_id = sequences.id))) JOIN public.tools ON (((edge_nodes.value)::integer = tools.id))) WHERE ((edge_nodes.kind)::text = 'tool_id'::text); -- -- Name: kinds; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.kinds ( id bigint NOT NULL, value character varying NOT NULL ); -- -- Name: kinds_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.kinds_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: kinds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.kinds_id_seq OWNED BY public.kinds.id; -- -- Name: logs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.logs ( id integer NOT NULL, message text, meta text, channels character varying(280), device_id integer, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, type character varying(10) DEFAULT 'info'::character varying, major_version integer, minor_version integer, verbosity integer DEFAULT 1, x double precision, y double precision, z double precision, sent_at timestamp without time zone ); -- -- Name: logs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.logs_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.logs_id_seq OWNED BY public.logs.id; -- -- Name: nodes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.nodes ( id bigint NOT NULL, fragment_id bigint NOT NULL, kind_id bigint NOT NULL, body_id integer, next_id integer, parent_id integer ); -- -- Name: nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.nodes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.nodes_id_seq OWNED BY public.nodes.id; -- -- Name: peripherals; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.peripherals ( id integer NOT NULL, device_id integer, pin integer, label character varying(280), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, mode integer DEFAULT 0 ); -- -- Name: peripherals_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.peripherals_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: peripherals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.peripherals_id_seq OWNED BY public.peripherals.id; -- -- Name: pin_bindings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.pin_bindings ( id bigint NOT NULL, device_id bigint, pin_num integer, sequence_id bigint, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, special_action public.special_action ); -- -- Name: pin_bindings_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.pin_bindings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: pin_bindings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.pin_bindings_id_seq OWNED BY public.pin_bindings.id; -- -- Name: plant_templates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.plant_templates ( id bigint NOT NULL, saved_garden_id bigint NOT NULL, device_id bigint NOT NULL, radius double precision DEFAULT 25.0 NOT NULL, x double precision NOT NULL, y double precision NOT NULL, z double precision DEFAULT 0.0 NOT NULL, name character varying DEFAULT 'untitled'::character varying NOT NULL, openfarm_slug character varying(280) DEFAULT 'null'::character varying NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: plant_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.plant_templates_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: plant_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.plant_templates_id_seq OWNED BY public.plant_templates.id; -- -- Name: point_group_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.point_group_items ( id bigint NOT NULL, point_group_id bigint NOT NULL, point_id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: point_group_items_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.point_group_items_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: point_group_items_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.point_group_items_id_seq OWNED BY public.point_group_items.id; -- -- Name: point_groups; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.point_groups ( id bigint NOT NULL, name character varying(80) NOT NULL, device_id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, sort_type character varying(20) DEFAULT 'xy_ascending'::character varying, criteria text ); -- -- Name: point_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.point_groups_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: point_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.point_groups_id_seq OWNED BY public.point_groups.id; -- -- Name: points_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.points_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: points_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.points_id_seq OWNED BY public.points.id; -- -- Name: primary_nodes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.primary_nodes ( id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, sequence_id bigint NOT NULL, kind character varying(50), child_id bigint, parent_id bigint, parent_arg_name character varying(50), next_id bigint, body_id bigint, comment character varying(240) ); -- -- Name: primary_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.primary_nodes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: primary_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.primary_nodes_id_seq OWNED BY public.primary_nodes.id; -- -- Name: primitive_pairs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.primitive_pairs ( id bigint NOT NULL, fragment_id bigint NOT NULL, arg_name_id bigint NOT NULL, arg_set_id bigint NOT NULL, primitive_id bigint NOT NULL ); -- -- Name: primitive_pairs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.primitive_pairs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: primitive_pairs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.primitive_pairs_id_seq OWNED BY public.primitive_pairs.id; -- -- Name: primitives; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.primitives ( id bigint NOT NULL, fragment_id bigint NOT NULL, value character varying NOT NULL ); -- -- Name: primitives_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.primitives_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: primitives_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.primitives_id_seq OWNED BY public.primitives.id; -- -- Name: regimen_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.regimen_items ( id integer NOT NULL, time_offset bigint, regimen_id integer, sequence_id integer, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: regimen_items_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.regimen_items_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: regimen_items_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.regimen_items_id_seq OWNED BY public.regimen_items.id; -- -- Name: regimens; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.regimens ( id integer NOT NULL, color character varying, name character varying(280), device_id integer, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: regimens_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.regimens_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: regimens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.regimens_id_seq OWNED BY public.regimens.id; -- -- Name: releases; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.releases ( id bigint NOT NULL, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, image_url character varying, version character varying, platform character varying, channel character varying ); -- -- Name: releases_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.releases_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.releases_id_seq OWNED BY public.releases.id; -- -- Name: resource_update_steps; Type: VIEW; Schema: public; Owner: - -- CREATE VIEW public.resource_update_steps AS WITH resource_type AS ( SELECT edge_nodes.primary_node_id, edge_nodes.kind, edge_nodes.value FROM public.edge_nodes WHERE (((edge_nodes.kind)::text = 'resource_type'::text) AND ((edge_nodes.value)::text = ANY (ARRAY[('"GenericPointer"'::character varying)::text, ('"ToolSlot"'::character varying)::text, ('"Plant"'::character varying)::text]))) ), resource_id AS ( SELECT edge_nodes.primary_node_id, edge_nodes.kind, edge_nodes.value, edge_nodes.sequence_id FROM public.edge_nodes WHERE ((edge_nodes.kind)::text = 'resource_id'::text) ), user_sequence AS ( SELECT sequences.name, sequences.id FROM public.sequences ) SELECT j1.sequence_id, j1.primary_node_id, (j1.value)::bigint AS point_id, j3.name AS sequence_name FROM ((resource_id j1 JOIN resource_type j2 ON ((j1.primary_node_id = j2.primary_node_id))) JOIN user_sequence j3 ON ((j3.id = j1.sequence_id))); -- -- Name: saved_gardens; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.saved_gardens ( id bigint NOT NULL, name character varying NOT NULL, device_id bigint NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: saved_gardens_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.saved_gardens_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: saved_gardens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.saved_gardens_id_seq OWNED BY public.saved_gardens.id; -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.schema_migrations ( version character varying NOT NULL ); -- -- Name: sensor_readings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.sensor_readings ( id bigint NOT NULL, device_id bigint, x double precision, y double precision, z double precision, value integer, pin integer, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, mode integer DEFAULT 0, read_at timestamp without time zone ); -- -- Name: sensor_readings_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.sensor_readings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: sensor_readings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.sensor_readings_id_seq OWNED BY public.sensor_readings.id; -- -- Name: sensors; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.sensors ( id bigint NOT NULL, device_id bigint, pin integer, label character varying, mode integer, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); -- -- Name: sensors_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.sensors_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: sensors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.sensors_id_seq OWNED BY public.sensors.id; -- -- Name: sequence_usage_reports; Type: VIEW; Schema: public; Owner: - -- CREATE VIEW public.sequence_usage_reports AS SELECT sequences.id AS sequence_id, ( SELECT count(*) AS count FROM public.edge_nodes WHERE (((edge_nodes.kind)::text = 'sequence_id'::text) AND ((edge_nodes.value)::integer = sequences.id))) AS edge_node_count, ( SELECT count(*) AS count FROM public.farm_events WHERE ((farm_events.executable_id = sequences.id) AND ((farm_events.executable_type)::text = 'Sequence'::text))) AS farm_event_count, ( SELECT count(*) AS count FROM public.regimen_items WHERE (regimen_items.sequence_id = sequences.id)) AS regimen_items_count FROM public.sequences; -- -- Name: sequences_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.sequences_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: sequences_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.sequences_id_seq OWNED BY public.sequences.id; -- -- Name: standard_pairs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.standard_pairs ( id bigint NOT NULL, fragment_id bigint NOT NULL, arg_name_id bigint NOT NULL, arg_set_id bigint NOT NULL, node_id bigint NOT NULL ); -- -- Name: standard_pairs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.standard_pairs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: standard_pairs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.standard_pairs_id_seq OWNED BY public.standard_pairs.id; -- -- Name: token_issuances; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.token_issuances ( id bigint NOT NULL, device_id bigint NOT NULL, exp integer NOT NULL, jti character varying(45) NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, aud character varying(8) DEFAULT 'unknown'::character varying ); -- -- Name: token_issuances_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.token_issuances_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: token_issuances_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.token_issuances_id_seq OWNED BY public.token_issuances.id; -- -- Name: tools_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.tools_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: tools_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.tools_id_seq OWNED BY public.tools.id; -- -- Name: users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.users ( id integer NOT NULL, device_id integer, name character varying, email character varying(280) DEFAULT ''::character varying NOT NULL, encrypted_password character varying DEFAULT ''::character varying NOT NULL, sign_in_count integer DEFAULT 0 NOT NULL, current_sign_in_at timestamp without time zone, last_sign_in_at timestamp without time zone, current_sign_in_ip character varying, last_sign_in_ip character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, confirmed_at timestamp without time zone, confirmation_token character varying, agreed_to_terms_at timestamp without time zone, confirmation_sent_at timestamp without time zone, unconfirmed_email character varying, inactivity_warning_sent_at timestamp without time zone ); -- -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.users_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- -- Name: web_app_configs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.web_app_configs ( id bigint NOT NULL, device_id bigint, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, confirm_step_deletion boolean DEFAULT false, disable_animations boolean DEFAULT false, disable_i18n boolean DEFAULT false, display_trail boolean DEFAULT false, dynamic_map boolean DEFAULT false, encoder_figure boolean DEFAULT false, hide_webcam_widget boolean DEFAULT false, legend_menu_open boolean DEFAULT true, raw_encoders boolean DEFAULT false, scaled_encoders boolean DEFAULT false, show_spread boolean DEFAULT true, show_farmbot boolean DEFAULT true, show_plants boolean DEFAULT true, show_points boolean DEFAULT true, x_axis_inverted boolean DEFAULT false, y_axis_inverted boolean DEFAULT false, z_axis_inverted boolean DEFAULT false, bot_origin_quadrant integer DEFAULT 2, zoom_level integer DEFAULT '-2'::integer, success_log integer DEFAULT 1, busy_log integer DEFAULT 1, warn_log integer DEFAULT 1, error_log integer DEFAULT 1, info_log integer DEFAULT 1, fun_log integer DEFAULT 1, debug_log integer DEFAULT 1, stub_config boolean DEFAULT false, show_first_party_farmware boolean DEFAULT false, enable_browser_speak boolean DEFAULT false, show_images boolean DEFAULT false, photo_filter_begin character varying, photo_filter_end character varying, discard_unsaved boolean DEFAULT false, xy_swap boolean DEFAULT false, home_button_homing boolean DEFAULT true, show_motor_plot boolean DEFAULT false, show_historic_points boolean DEFAULT false, show_sensor_readings boolean DEFAULT false, show_dev_menu boolean DEFAULT false, internal_use text, time_format_24_hour boolean DEFAULT false, show_pins boolean DEFAULT false, disable_emergency_unlock_confirmation boolean DEFAULT false, map_size_x integer DEFAULT 2900, map_size_y integer DEFAULT 1400, expand_step_options boolean DEFAULT false, hide_sensors boolean DEFAULT false, confirm_plant_deletion boolean DEFAULT true, confirm_sequence_deletion boolean DEFAULT true, discard_unsaved_sequences boolean DEFAULT false, user_interface_read_only_mode boolean DEFAULT false, assertion_log integer DEFAULT 1, show_zones boolean DEFAULT false, show_weeds boolean DEFAULT false, display_map_missed_steps boolean DEFAULT false, time_format_seconds boolean DEFAULT false, crop_images boolean DEFAULT false, show_camera_view_area boolean DEFAULT false, view_celery_script boolean DEFAULT false, highlight_modified_settings boolean DEFAULT false ); -- -- Name: web_app_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.web_app_configs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: web_app_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.web_app_configs_id_seq OWNED BY public.web_app_configs.id; -- -- Name: webcam_feeds; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.webcam_feeds ( id bigint NOT NULL, device_id bigint, url character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, name character varying(80) DEFAULT 'Webcam Feed'::character varying ); -- -- Name: webcam_feeds_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.webcam_feeds_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: webcam_feeds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.webcam_feeds_id_seq OWNED BY public.webcam_feeds.id; -- -- Name: active_storage_attachments id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_attachments ALTER COLUMN id SET DEFAULT nextval('public.active_storage_attachments_id_seq'::regclass); -- -- Name: active_storage_blobs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_blobs ALTER COLUMN id SET DEFAULT nextval('public.active_storage_blobs_id_seq'::regclass); -- -- Name: alerts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.alerts ALTER COLUMN id SET DEFAULT nextval('public.alerts_id_seq'::regclass); -- -- Name: arg_names id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.arg_names ALTER COLUMN id SET DEFAULT nextval('public.arg_names_id_seq'::regclass); -- -- Name: arg_sets id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.arg_sets ALTER COLUMN id SET DEFAULT nextval('public.arg_sets_id_seq'::regclass); -- -- Name: delayed_jobs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.delayed_jobs ALTER COLUMN id SET DEFAULT nextval('public.delayed_jobs_id_seq'::regclass); -- -- Name: devices id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.devices ALTER COLUMN id SET DEFAULT nextval('public.devices_id_seq'::regclass); -- -- Name: edge_nodes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.edge_nodes ALTER COLUMN id SET DEFAULT nextval('public.edge_nodes_id_seq'::regclass); -- -- Name: farm_events id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farm_events ALTER COLUMN id SET DEFAULT nextval('public.farm_events_id_seq'::regclass); -- -- Name: farmware_envs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_envs ALTER COLUMN id SET DEFAULT nextval('public.farmware_envs_id_seq'::regclass); -- -- Name: farmware_installations id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_installations ALTER COLUMN id SET DEFAULT nextval('public.farmware_installations_id_seq'::regclass); -- -- Name: fbos_configs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.fbos_configs ALTER COLUMN id SET DEFAULT nextval('public.fbos_configs_id_seq'::regclass); -- -- Name: firmware_configs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.firmware_configs ALTER COLUMN id SET DEFAULT nextval('public.firmware_configs_id_seq'::regclass); -- -- Name: folders id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.folders ALTER COLUMN id SET DEFAULT nextval('public.folders_id_seq'::regclass); -- -- Name: fragments id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.fragments ALTER COLUMN id SET DEFAULT nextval('public.fragments_id_seq'::regclass); -- -- Name: global_bulletins id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.global_bulletins ALTER COLUMN id SET DEFAULT nextval('public.global_bulletins_id_seq'::regclass); -- -- Name: global_configs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.global_configs ALTER COLUMN id SET DEFAULT nextval('public.global_configs_id_seq'::regclass); -- -- Name: images id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.images ALTER COLUMN id SET DEFAULT nextval('public.images_id_seq'::regclass); -- -- Name: kinds id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.kinds ALTER COLUMN id SET DEFAULT nextval('public.kinds_id_seq'::regclass); -- -- Name: logs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.logs ALTER COLUMN id SET DEFAULT nextval('public.logs_id_seq'::regclass); -- -- Name: nodes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nodes ALTER COLUMN id SET DEFAULT nextval('public.nodes_id_seq'::regclass); -- -- Name: peripherals id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.peripherals ALTER COLUMN id SET DEFAULT nextval('public.peripherals_id_seq'::regclass); -- -- Name: pin_bindings id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pin_bindings ALTER COLUMN id SET DEFAULT nextval('public.pin_bindings_id_seq'::regclass); -- -- Name: plant_templates id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.plant_templates ALTER COLUMN id SET DEFAULT nextval('public.plant_templates_id_seq'::regclass); -- -- Name: point_group_items id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_group_items ALTER COLUMN id SET DEFAULT nextval('public.point_group_items_id_seq'::regclass); -- -- Name: point_groups id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_groups ALTER COLUMN id SET DEFAULT nextval('public.point_groups_id_seq'::regclass); -- -- Name: points id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.points ALTER COLUMN id SET DEFAULT nextval('public.points_id_seq'::regclass); -- -- Name: primary_nodes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primary_nodes ALTER COLUMN id SET DEFAULT nextval('public.primary_nodes_id_seq'::regclass); -- -- Name: primitive_pairs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primitive_pairs ALTER COLUMN id SET DEFAULT nextval('public.primitive_pairs_id_seq'::regclass); -- -- Name: primitives id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primitives ALTER COLUMN id SET DEFAULT nextval('public.primitives_id_seq'::regclass); -- -- Name: regimen_items id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.regimen_items ALTER COLUMN id SET DEFAULT nextval('public.regimen_items_id_seq'::regclass); -- -- Name: regimens id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.regimens ALTER COLUMN id SET DEFAULT nextval('public.regimens_id_seq'::regclass); -- -- Name: releases id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.releases ALTER COLUMN id SET DEFAULT nextval('public.releases_id_seq'::regclass); -- -- Name: saved_gardens id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.saved_gardens ALTER COLUMN id SET DEFAULT nextval('public.saved_gardens_id_seq'::regclass); -- -- Name: sensor_readings id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensor_readings ALTER COLUMN id SET DEFAULT nextval('public.sensor_readings_id_seq'::regclass); -- -- Name: sensors id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensors ALTER COLUMN id SET DEFAULT nextval('public.sensors_id_seq'::regclass); -- -- Name: sequences id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sequences ALTER COLUMN id SET DEFAULT nextval('public.sequences_id_seq'::regclass); -- -- Name: standard_pairs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.standard_pairs ALTER COLUMN id SET DEFAULT nextval('public.standard_pairs_id_seq'::regclass); -- -- Name: token_issuances id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.token_issuances ALTER COLUMN id SET DEFAULT nextval('public.token_issuances_id_seq'::regclass); -- -- Name: tools id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.tools ALTER COLUMN id SET DEFAULT nextval('public.tools_id_seq'::regclass); -- -- Name: users id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -- -- Name: web_app_configs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.web_app_configs ALTER COLUMN id SET DEFAULT nextval('public.web_app_configs_id_seq'::regclass); -- -- Name: webcam_feeds id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.webcam_feeds ALTER COLUMN id SET DEFAULT nextval('public.webcam_feeds_id_seq'::regclass); -- -- Name: active_storage_attachments active_storage_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_attachments ADD CONSTRAINT active_storage_attachments_pkey PRIMARY KEY (id); -- -- Name: active_storage_blobs active_storage_blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_blobs ADD CONSTRAINT active_storage_blobs_pkey PRIMARY KEY (id); -- -- Name: alerts alerts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.alerts ADD CONSTRAINT alerts_pkey PRIMARY KEY (id); -- -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.ar_internal_metadata ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key); -- -- Name: arg_names arg_names_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.arg_names ADD CONSTRAINT arg_names_pkey PRIMARY KEY (id); -- -- Name: arg_sets arg_sets_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.arg_sets ADD CONSTRAINT arg_sets_pkey PRIMARY KEY (id); -- -- Name: delayed_jobs delayed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.delayed_jobs ADD CONSTRAINT delayed_jobs_pkey PRIMARY KEY (id); -- -- Name: devices devices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.devices ADD CONSTRAINT devices_pkey PRIMARY KEY (id); -- -- Name: edge_nodes edge_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.edge_nodes ADD CONSTRAINT edge_nodes_pkey PRIMARY KEY (id); -- -- Name: farm_events farm_events_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farm_events ADD CONSTRAINT farm_events_pkey PRIMARY KEY (id); -- -- Name: farmware_envs farmware_envs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_envs ADD CONSTRAINT farmware_envs_pkey PRIMARY KEY (id); -- -- Name: farmware_installations farmware_installations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_installations ADD CONSTRAINT farmware_installations_pkey PRIMARY KEY (id); -- -- Name: fbos_configs fbos_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.fbos_configs ADD CONSTRAINT fbos_configs_pkey PRIMARY KEY (id); -- -- Name: firmware_configs firmware_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.firmware_configs ADD CONSTRAINT firmware_configs_pkey PRIMARY KEY (id); -- -- Name: folders folders_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.folders ADD CONSTRAINT folders_pkey PRIMARY KEY (id); -- -- Name: fragments fragments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.fragments ADD CONSTRAINT fragments_pkey PRIMARY KEY (id); -- -- Name: global_bulletins global_bulletins_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.global_bulletins ADD CONSTRAINT global_bulletins_pkey PRIMARY KEY (id); -- -- Name: global_configs global_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.global_configs ADD CONSTRAINT global_configs_pkey PRIMARY KEY (id); -- -- Name: images images_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.images ADD CONSTRAINT images_pkey PRIMARY KEY (id); -- -- Name: kinds kinds_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.kinds ADD CONSTRAINT kinds_pkey PRIMARY KEY (id); -- -- Name: logs logs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.logs ADD CONSTRAINT logs_pkey PRIMARY KEY (id); -- -- Name: nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nodes ADD CONSTRAINT nodes_pkey PRIMARY KEY (id); -- -- Name: peripherals peripherals_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.peripherals ADD CONSTRAINT peripherals_pkey PRIMARY KEY (id); -- -- Name: pin_bindings pin_bindings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pin_bindings ADD CONSTRAINT pin_bindings_pkey PRIMARY KEY (id); -- -- Name: plant_templates plant_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.plant_templates ADD CONSTRAINT plant_templates_pkey PRIMARY KEY (id); -- -- Name: point_group_items point_group_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_group_items ADD CONSTRAINT point_group_items_pkey PRIMARY KEY (id); -- -- Name: point_groups point_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_groups ADD CONSTRAINT point_groups_pkey PRIMARY KEY (id); -- -- Name: points points_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.points ADD CONSTRAINT points_pkey PRIMARY KEY (id); -- -- Name: primary_nodes primary_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primary_nodes ADD CONSTRAINT primary_nodes_pkey PRIMARY KEY (id); -- -- Name: primitive_pairs primitive_pairs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primitive_pairs ADD CONSTRAINT primitive_pairs_pkey PRIMARY KEY (id); -- -- Name: primitives primitives_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primitives ADD CONSTRAINT primitives_pkey PRIMARY KEY (id); -- -- Name: regimen_items regimen_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.regimen_items ADD CONSTRAINT regimen_items_pkey PRIMARY KEY (id); -- -- Name: regimens regimens_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.regimens ADD CONSTRAINT regimens_pkey PRIMARY KEY (id); -- -- Name: releases releases_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.releases ADD CONSTRAINT releases_pkey PRIMARY KEY (id); -- -- Name: saved_gardens saved_gardens_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.saved_gardens ADD CONSTRAINT saved_gardens_pkey PRIMARY KEY (id); -- -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.schema_migrations ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); -- -- Name: sensor_readings sensor_readings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensor_readings ADD CONSTRAINT sensor_readings_pkey PRIMARY KEY (id); -- -- Name: sensors sensors_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensors ADD CONSTRAINT sensors_pkey PRIMARY KEY (id); -- -- Name: sequences sequences_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sequences ADD CONSTRAINT sequences_pkey PRIMARY KEY (id); -- -- Name: standard_pairs standard_pairs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.standard_pairs ADD CONSTRAINT standard_pairs_pkey PRIMARY KEY (id); -- -- Name: token_issuances token_issuances_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.token_issuances ADD CONSTRAINT token_issuances_pkey PRIMARY KEY (id); -- -- Name: tools tools_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.tools ADD CONSTRAINT tools_pkey PRIMARY KEY (id); -- -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ADD CONSTRAINT users_pkey PRIMARY KEY (id); -- -- Name: web_app_configs web_app_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.web_app_configs ADD CONSTRAINT web_app_configs_pkey PRIMARY KEY (id); -- -- Name: webcam_feeds webcam_feeds_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.webcam_feeds ADD CONSTRAINT webcam_feeds_pkey PRIMARY KEY (id); -- -- Name: delayed_jobs_priority; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX delayed_jobs_priority ON public.delayed_jobs USING btree (priority, run_at); -- -- Name: index_active_storage_attachments_on_blob_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_active_storage_attachments_on_blob_id ON public.active_storage_attachments USING btree (blob_id); -- -- Name: index_active_storage_attachments_uniqueness; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active_storage_attachments USING btree (record_type, record_id, name, blob_id); -- -- Name: index_active_storage_blobs_on_key; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key); -- -- Name: index_alerts_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_alerts_on_device_id ON public.alerts USING btree (device_id); -- -- Name: index_arg_sets_on_fragment_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_arg_sets_on_fragment_id ON public.arg_sets USING btree (fragment_id); -- -- Name: index_arg_sets_on_node_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_arg_sets_on_node_id ON public.arg_sets USING btree (node_id); -- -- Name: index_devices_on_mounted_tool_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_devices_on_mounted_tool_id ON public.devices USING btree (mounted_tool_id); -- -- Name: index_devices_on_timezone; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_devices_on_timezone ON public.devices USING btree (timezone); -- -- Name: index_edge_nodes_on_kind_and_value; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_edge_nodes_on_kind_and_value ON public.edge_nodes USING btree (kind, value); -- -- Name: index_edge_nodes_on_primary_node_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_edge_nodes_on_primary_node_id ON public.edge_nodes USING btree (primary_node_id); -- -- Name: index_edge_nodes_on_sequence_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_edge_nodes_on_sequence_id ON public.edge_nodes USING btree (sequence_id); -- -- Name: index_farm_events_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_farm_events_on_device_id ON public.farm_events USING btree (device_id); -- -- Name: index_farm_events_on_end_time; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_farm_events_on_end_time ON public.farm_events USING btree (end_time); -- -- Name: index_farm_events_on_executable_type_and_executable_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_farm_events_on_executable_type_and_executable_id ON public.farm_events USING btree (executable_type, executable_id); -- -- Name: index_farmware_envs_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_farmware_envs_on_device_id ON public.farmware_envs USING btree (device_id); -- -- Name: index_farmware_installations_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_farmware_installations_on_device_id ON public.farmware_installations USING btree (device_id); -- -- Name: index_fbos_configs_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_fbos_configs_on_device_id ON public.fbos_configs USING btree (device_id); -- -- Name: index_firmware_configs_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_firmware_configs_on_device_id ON public.firmware_configs USING btree (device_id); -- -- Name: index_folders_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_folders_on_device_id ON public.folders USING btree (device_id); -- -- Name: index_fragments_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_fragments_on_device_id ON public.fragments USING btree (device_id); -- -- Name: index_fragments_on_owner_type_and_owner_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_fragments_on_owner_type_and_owner_id ON public.fragments USING btree (owner_type, owner_id); -- -- Name: index_global_configs_on_key; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_global_configs_on_key ON public.global_configs USING btree (key); -- -- Name: index_images_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_images_on_device_id ON public.images USING btree (device_id); -- -- Name: index_logs_on_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_created_at ON public.logs USING btree (created_at); -- -- Name: index_logs_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_device_id ON public.logs USING btree (device_id); -- -- Name: index_logs_on_device_id_and_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_device_id_and_created_at ON public.logs USING btree (device_id, created_at); -- -- Name: index_logs_on_sent_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_sent_at ON public.logs USING btree (sent_at); -- -- Name: index_logs_on_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_type ON public.logs USING btree (type); -- -- Name: index_logs_on_updated_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_updated_at ON public.logs USING btree (updated_at); -- -- Name: index_logs_on_verbosity; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_verbosity ON public.logs USING btree (verbosity); -- -- Name: index_logs_on_verbosity_and_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_logs_on_verbosity_and_type ON public.logs USING btree (verbosity, type); -- -- Name: index_nodes_on_fragment_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_nodes_on_fragment_id ON public.nodes USING btree (fragment_id); -- -- Name: index_nodes_on_kind_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_nodes_on_kind_id ON public.nodes USING btree (kind_id); -- -- Name: index_peripherals_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_peripherals_on_device_id ON public.peripherals USING btree (device_id); -- -- Name: index_peripherals_on_mode; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_peripherals_on_mode ON public.peripherals USING btree (mode); -- -- Name: index_pin_bindings_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_pin_bindings_on_device_id ON public.pin_bindings USING btree (device_id); -- -- Name: index_pin_bindings_on_sequence_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_pin_bindings_on_sequence_id ON public.pin_bindings USING btree (sequence_id); -- -- Name: index_plant_templates_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_plant_templates_on_device_id ON public.plant_templates USING btree (device_id); -- -- Name: index_plant_templates_on_saved_garden_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_plant_templates_on_saved_garden_id ON public.plant_templates USING btree (saved_garden_id); -- -- Name: index_point_group_items_on_point_group_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_point_group_items_on_point_group_id ON public.point_group_items USING btree (point_group_id); -- -- Name: index_point_group_items_on_point_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_point_group_items_on_point_id ON public.point_group_items USING btree (point_id); -- -- Name: index_point_groups_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_point_groups_on_device_id ON public.point_groups USING btree (device_id); -- -- Name: index_points_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_points_on_device_id ON public.points USING btree (device_id); -- -- Name: index_points_on_device_id_and_tool_id; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_points_on_device_id_and_tool_id ON public.points USING btree (device_id, tool_id); -- -- Name: index_points_on_discarded_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_points_on_discarded_at ON public.points USING btree (discarded_at); -- -- Name: index_points_on_id_and_pointer_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_points_on_id_and_pointer_type ON public.points USING btree (id, pointer_type); -- -- Name: index_points_on_meta; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_points_on_meta ON public.points USING gin (meta); -- -- Name: index_points_on_tool_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_points_on_tool_id ON public.points USING btree (tool_id); -- -- Name: index_primary_nodes_on_body_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primary_nodes_on_body_id ON public.primary_nodes USING btree (body_id); -- -- Name: index_primary_nodes_on_child_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primary_nodes_on_child_id ON public.primary_nodes USING btree (child_id); -- -- Name: index_primary_nodes_on_next_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primary_nodes_on_next_id ON public.primary_nodes USING btree (next_id); -- -- Name: index_primary_nodes_on_parent_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primary_nodes_on_parent_id ON public.primary_nodes USING btree (parent_id); -- -- Name: index_primary_nodes_on_sequence_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primary_nodes_on_sequence_id ON public.primary_nodes USING btree (sequence_id); -- -- Name: index_primitive_pairs_on_arg_name_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primitive_pairs_on_arg_name_id ON public.primitive_pairs USING btree (arg_name_id); -- -- Name: index_primitive_pairs_on_arg_set_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primitive_pairs_on_arg_set_id ON public.primitive_pairs USING btree (arg_set_id); -- -- Name: index_primitive_pairs_on_fragment_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primitive_pairs_on_fragment_id ON public.primitive_pairs USING btree (fragment_id); -- -- Name: index_primitive_pairs_on_primitive_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primitive_pairs_on_primitive_id ON public.primitive_pairs USING btree (primitive_id); -- -- Name: index_primitives_on_fragment_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_primitives_on_fragment_id ON public.primitives USING btree (fragment_id); -- -- Name: index_regimen_items_on_regimen_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_regimen_items_on_regimen_id ON public.regimen_items USING btree (regimen_id); -- -- Name: index_regimen_items_on_sequence_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_regimen_items_on_sequence_id ON public.regimen_items USING btree (sequence_id); -- -- Name: index_regimens_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_regimens_on_device_id ON public.regimens USING btree (device_id); -- -- Name: index_saved_gardens_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_saved_gardens_on_device_id ON public.saved_gardens USING btree (device_id); -- -- Name: index_sensor_readings_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_sensor_readings_on_device_id ON public.sensor_readings USING btree (device_id); -- -- Name: index_sensors_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_sensors_on_device_id ON public.sensors USING btree (device_id); -- -- Name: index_sequences_on_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_sequences_on_created_at ON public.sequences USING btree (created_at); -- -- Name: index_sequences_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_sequences_on_device_id ON public.sequences USING btree (device_id); -- -- Name: index_sequences_on_folder_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_sequences_on_folder_id ON public.sequences USING btree (folder_id); -- -- Name: index_standard_pairs_on_arg_name_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_standard_pairs_on_arg_name_id ON public.standard_pairs USING btree (arg_name_id); -- -- Name: index_standard_pairs_on_arg_set_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_standard_pairs_on_arg_set_id ON public.standard_pairs USING btree (arg_set_id); -- -- Name: index_standard_pairs_on_fragment_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_standard_pairs_on_fragment_id ON public.standard_pairs USING btree (fragment_id); -- -- Name: index_standard_pairs_on_node_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_standard_pairs_on_node_id ON public.standard_pairs USING btree (node_id); -- -- Name: index_token_issuances_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_token_issuances_on_device_id ON public.token_issuances USING btree (device_id); -- -- Name: index_token_issuances_on_exp; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_token_issuances_on_exp ON public.token_issuances USING btree (exp); -- -- Name: index_token_issuances_on_jti_and_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_token_issuances_on_jti_and_device_id ON public.token_issuances USING btree (jti, device_id); -- -- Name: index_tools_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_tools_on_device_id ON public.tools USING btree (device_id); -- -- Name: index_users_on_agreed_to_terms_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_agreed_to_terms_at ON public.users USING btree (agreed_to_terms_at); -- -- Name: index_users_on_confirmation_token; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_confirmation_token ON public.users USING btree (confirmation_token); -- -- Name: index_users_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_device_id ON public.users USING btree (device_id); -- -- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email); -- -- Name: index_web_app_configs_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_web_app_configs_on_device_id ON public.web_app_configs USING btree (device_id); -- -- Name: index_webcam_feeds_on_device_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_webcam_feeds_on_device_id ON public.webcam_feeds USING btree (device_id); -- -- Name: farm_events farm_events_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farm_events ADD CONSTRAINT farm_events_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: sensor_readings fk_rails_04297fb1ff; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensor_readings ADD CONSTRAINT fk_rails_04297fb1ff FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: pin_bindings fk_rails_1f1c3b6979; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pin_bindings ADD CONSTRAINT fk_rails_1f1c3b6979 FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: folders fk_rails_58e285f76e; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.folders ADD CONSTRAINT fk_rails_58e285f76e FOREIGN KEY (parent_id) REFERENCES public.folders(id); -- -- Name: sensors fk_rails_92e56bf2fb; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sensors ADD CONSTRAINT fk_rails_92e56bf2fb FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: points fk_rails_a62cbb8aca; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.points ADD CONSTRAINT fk_rails_a62cbb8aca FOREIGN KEY (tool_id) REFERENCES public.tools(id); -- -- Name: farmware_envs fk_rails_ab55c3a1d1; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_envs ADD CONSTRAINT fk_rails_ab55c3a1d1 FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: primary_nodes fk_rails_bca7fee3b9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.primary_nodes ADD CONSTRAINT fk_rails_bca7fee3b9 FOREIGN KEY (sequence_id) REFERENCES public.sequences(id); -- -- Name: alerts fk_rails_c0132c78be; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.alerts ADD CONSTRAINT fk_rails_c0132c78be FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: active_storage_attachments fk_rails_c3b3935057; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_attachments ADD CONSTRAINT fk_rails_c3b3935057 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id); -- -- Name: farmware_installations fk_rails_c72f38683f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.farmware_installations ADD CONSTRAINT fk_rails_c72f38683f FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: edge_nodes fk_rails_c86213fd78; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.edge_nodes ADD CONSTRAINT fk_rails_c86213fd78 FOREIGN KEY (sequence_id) REFERENCES public.sequences(id); -- -- Name: points fk_rails_d6f3cdbe9a; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.points ADD CONSTRAINT fk_rails_d6f3cdbe9a FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: token_issuances fk_rails_e202a61188; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.token_issuances ADD CONSTRAINT fk_rails_e202a61188 FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: devices fk_rails_eef5afaff7; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.devices ADD CONSTRAINT fk_rails_eef5afaff7 FOREIGN KEY (mounted_tool_id) REFERENCES public.tools(id); -- -- Name: pin_bindings fk_rails_f72ee24d98; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pin_bindings ADD CONSTRAINT fk_rails_f72ee24d98 FOREIGN KEY (sequence_id) REFERENCES public.sequences(id); -- -- Name: peripherals fk_rails_fdaad0007f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.peripherals ADD CONSTRAINT fk_rails_fdaad0007f FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: fragments fragments_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.fragments ADD CONSTRAINT fragments_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: logs logs_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.logs ADD CONSTRAINT logs_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: plant_templates plant_templates_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.plant_templates ADD CONSTRAINT plant_templates_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: plant_templates plant_templates_saved_garden_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.plant_templates ADD CONSTRAINT plant_templates_saved_garden_id_fk FOREIGN KEY (saved_garden_id) REFERENCES public.saved_gardens(id); -- -- Name: point_group_items point_group_items_point_group_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_group_items ADD CONSTRAINT point_group_items_point_group_id_fk FOREIGN KEY (point_group_id) REFERENCES public.point_groups(id); -- -- Name: point_group_items point_group_items_point_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_group_items ADD CONSTRAINT point_group_items_point_id_fk FOREIGN KEY (point_id) REFERENCES public.points(id); -- -- Name: point_groups point_groups_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.point_groups ADD CONSTRAINT point_groups_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: saved_gardens saved_gardens_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.saved_gardens ADD CONSTRAINT saved_gardens_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: tools tools_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.tools ADD CONSTRAINT tools_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- Name: users users_device_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ADD CONSTRAINT users_device_id_fk FOREIGN KEY (device_id) REFERENCES public.devices(id); -- -- PostgreSQL database dump complete -- SET search_path TO "$user", public; INSERT INTO "schema_migrations" (version) VALUES ('20170629160248'), ('20170703010946'), ('20170807143633'), ('20170814084814'), ('20170818163411'), ('20170918173928'), ('20171003143906'), ('20171003144428'), ('20171017200333'), ('20171031184914'), ('20180104215253'), ('20180105175215'), ('20180109070610'), ('20180109165402'), ('20180121191538'), ('20180122203010'), ('20180124194814'), ('20180126141955'), ('20180201031848'), ('20180201153221'), ('20180202165503'), ('20180205173255'), ('20180209134752'), ('20180211161515'), ('20180213175531'), ('20180215064728'), ('20180215171709'), ('20180215205625'), ('20180215224528'), ('20180216205047'), ('20180217173606'), ('20180226164100'), ('20180227172811'), ('20180228144634'), ('20180301222052'), ('20180305170608'), ('20180306195021'), ('20180310220435'), ('20180315205136'), ('20180323190601'), ('20180325220047'), ('20180325222824'), ('20180326160853'), ('20180328200512'), ('20180328212540'), ('20180330130914'), ('20180330143232'), ('20180401141611'), ('20180403211523'), ('20180404165355'), ('20180407131311'), ('20180409150813'), ('20180410160336'), ('20180410180929'), ('20180410192539'), ('20180411122627'), ('20180411175813'), ('20180412144034'), ('20180412191221'), ('20180412224141'), ('20180413125139'), ('20180413145332'), ('20180417123713'), ('20180418205557'), ('20180419164627'), ('20180423171551'), ('20180423202520'), ('20180430161447'), ('20180501121046'), ('20180502050250'), ('20180508141310'), ('20180518131709'), ('20180520201349'), ('20180521140428'), ('20180521195953'), ('20180524161501'), ('20180606131907'), ('20180609144559'), ('20180615153318'), ('20180713182937'), ('20180716163108'), ('20180719143412'), ('20180720021451'), ('20180726145505'), ('20180726165546'), ('20180727152741'), ('20180813185430'), ('20180815143819'), ('20180829211322'), ('20180910143055'), ('20180920194120'), ('20180925203846'), ('20180926161918'), ('20181014221342'), ('20181019023351'), ('20181025182807'), ('20181112010427'), ('20181126175951'), ('20181204005038'), ('20181208035706'), ('20190103211708'), ('20190103213956'), ('20190108211419'), ('20190209133811'), ('20190212215842'), ('20190307205648'), ('20190401212119'), ('20190411152319'), ('20190411171401'), ('20190411222900'), ('20190416035406'), ('20190417165636'), ('20190419001321'), ('20190419052844'), ('20190419174728'), ('20190419174811'), ('20190501143201'), ('20190502163453'), ('20190504170018'), ('20190512015442'), ('20190513221836'), ('20190515185612'), ('20190515205442'), ('20190603233157'), ('20190605185311'), ('20190607192429'), ('20190613190531'), ('20190613215319'), ('20190621160042'), ('20190621202204'), ('20190701155706'), ('20190709194037'), ('20190715214412'), ('20190722160305'), ('20190729134954'), ('20190804194135'), ('20190804194154'), ('20190823164837'), ('20190918185359'), ('20190924190539'), ('20190930202839'), ('20191002125625'), ('20191107170431'), ('20191119204916'), ('20191203163621'), ('20191219212755'), ('20191220010646'), ('20200116140201'), ('20200204192005'), ('20200204230135'), ('20200323235926'), ('20200412152208'), ('20200616172612'), ('20200621012312'), ('20200623161209'), ('20200629181002'), ('20200630190226'), ('20200704150931'), ('20200801150609'), ('20200804150609'), ('20200807182602'), ('20200823211337'), ('20200902141446'), ('20200907153510'), ('20200910175338'), ('20200914165414');
{ "content_hash": "9746a150a32823e99e26e4a9c397d0a8", "timestamp": "", "source": "github", "line_count": 3462, "max_line_length": 238, "avg_line_length": 24.941074523396882, "alnum_prop": 0.7069927964236907, "repo_name": "FarmBot/Farmbot-Web-API", "id": "cd00774a28de9dd61d1bf3b1e7dccb465cd13124", "size": "86346", "binary": false, "copies": "1", "ref": "refs/heads/soil_height", "path": "db/structure.sql", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "62380" }, { "name": "HTML", "bytes": "28417" }, { "name": "JavaScript", "bytes": "101562" }, { "name": "Ruby", "bytes": "268353" }, { "name": "Shell", "bytes": "610" }, { "name": "TypeScript", "bytes": "604078" } ], "symlink_target": "" }
# NFake NFake is a mocking library for the .NET framework. **This is currently a prototype and therefore not applicable for production use!** # Copyright Copyright © Martin Tamme. See LICENSE for details.
{ "content_hash": "04e6e7e5f9f5d5170cc88fd4223b4379", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 82, "avg_line_length": 23.333333333333332, "alnum_prop": 0.7619047619047619, "repo_name": "mtamme/NFake", "id": "e88f4ba592385feab46689e1a5954e9d81302ebc", "size": "213", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "56602" } ], "symlink_target": "" }
javascript: window.open('http://downforeveryoneorjustme.com/' + location.href.replace('http://','').replace('https://',''), '_blank'); if (location.href != "http://nywillb.github.io/isItUp") { javascript: window.open('http://downforeveryoneorjustme.com/' + location.href.replace('http://','').replace('https://',''), '_blank'); } else { alert("Whoops, try dragging this button to your bookmark bar without clicking it!"); }
{ "content_hash": "b2bef6ac16ba348d43611ff7a4589631", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 138, "avg_line_length": 72, "alnum_prop": 0.6689814814814815, "repo_name": "nywillb/isItUp", "id": "92b2adc8ecb88fb4727741729d49d7669a973f09", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bookmarklet.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "432" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>jQuery Slidestep plugin</title> <meta name="description" content=""> <meta name="author" content=""> <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0"/> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/main.css" rel="stylesheet"> <link href="css/slidestep.css" rel="stylesheet"> <script src="js/jquery-1.8.1.min.js"></script><!-- <script src="js/set.js"></script> <script src="js/draggable.js"></script>--> <script src="js/jquery.slidestep.min.js"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"></script> <script> $(document).ready(function() { window.prettyPrint && prettyPrint(); }); </script> <style> h3 {color: #3a87ad; } /* @group prettyprint */ .com { color: #93a1a1; } .lit { color: #195f91; } .pun, .opn, .clo { color: #93a1a1; } .fun { color: #dc322f; } .str, .atv { color: #D14; } .kwd, .linenums .tag { color: #1e347b; } .typ, .atn, .dec, .var { color: teal; } .pln { color: #48484c; } .prettyprint { padding: 8px; background-color: #f7f7f9; border: 1px solid #e1e1e8; } .prettyprint.linenums { -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin: 0 0 0 33px; /* IE indents via margin-left */ } ol.linenums li { padding-left: 12px; color: #bebec5; line-height: 18px; text-shadow: 0 1px 0 #fff; } /* @end */ </style> </head> <body> <div class="container"> <div class="page-header"> <h1>jQuery Slidestep plugin</h1> </div> <p> jQuery Slidestep is an alternative slider/stepper to the normally used <a href="http://jqueryui.com/demos/slider/" target="jqueryui-slider">jQuery UI slider</a>.<br /> In addition to support the standard behaviours/options of a slider it also supports the following: <ul> <li>Specifying non-distributed values.</li> <li>Slide on click, move the handle to the point clicked on the slider.</li> <li>Magnetize, snap the handle to the nearest value on the slider when dragging.</li> <li>Automatically takes into account the width of the handle as part of the area used for the slider <small>(can be toggled off)</small>.</li> <li>Debug options such as grid/log to make development and testing easier.</li> </ul> </p> <h2>Demos</h2> <h3>Basic example</h3> <div class="row"> <div class="span6"> <pre class="prettyprint linenums"> $('#slider-one').slidestep({ step: 5, value: 20, onChange: function(data) { … } }); </pre> </div> <div class="span6"> <div id="slider-one" class="slider"></div><br /> </div> <div class="span4"> <form id="slider-one-value" class="form-search" autocomplete="off"> <input type="text" class="input-small"> <button type="button" class="btn">Update</button><br /><br /> <span class="help-block">Value will always snap to the nearest value in the set of items.</span> </form> </div> <div class="span2"> <form id="slider-one-options" class="form-inline" autocomplete="off"> <label class="checkbox"><input class="grid" type="checkbox"> Show grid</label> <label class="checkbox"><input class="slideOnClick" type="checkbox"> Slide on click</label> <label class="checkbox"><input class="magnetize" type="checkbox"> Magnetize</label> </form> </div> <script> $('#slider-one').slidestep({ step: 5, value: 20, onChange: function(data) { $('#slider-one-value input[type=text]').val(data.pos.val); } }); // toggle grid $('#slider-one-options .grid').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-one').data('slidestep').grid(value); }); // toggle slide on click $('#slider-one-options .slideOnClick').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-one').data('slidestep').slideOnClick(value); }); // toggle magnetize $('#slider-one-options .magnetize').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-one').data('slidestep').magnetize(value); }); // toggle update value $('#slider-one-value .btn').on('click', function(event) { var value = Number($('#slider-one-value input').val()); $('#slider-one').data('slidestep').value(value); }); </script> </div> <br /> <br /> <h3>Non uniform example</h3> <div class="row"> <div class="span6"> <pre class="prettyprint linenums"> $('#slider-two').slidestep({ step: 5, value: 10, items: [0, 15, 45, 50, 80, 90, 100], grid: true, magnetize: true, slideOnClick: true, onChange: function(data) { … } });</pre> </div> <div class="span6"> <div id="slider-two" class="slider"></div><br /> </div> <div class="span4"> <form id="slider-two-value" class="form-search" autocomplete="off"> <input type="text" class="input-small"> <button type="button" class="btn">Update</button><br /><br /> <span class="help-block">Value will always snap to the nearest value in the set of items.</span> </form> </div> <div class="span2"> <form id="slider-two-options" class="form-inline" autocomplete="off"> <label class="checkbox"><input class="grid" type="checkbox" checked="checked"> Show grid</label> <label class="checkbox"><input class="slideOnClick" type="checkbox" checked="checked"> Slide on click</label> <label class="checkbox"><input class="magnetize" type="checkbox" checked="checked"> Magnetize</label> </form> </div> <script> $('#slider-two').slidestep({ step: 5, value: 10, items: [0, 15, 45, 50, 80, 90, 100], grid: true, magnetize: true, slideOnClick: true, onChange: function(data) { $('#slider-two-value input[type=text]').val(data.pos.val); } }); // toggle grid $('#slider-two-options .grid').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-two').data('slidestep').grid(value); }); // toggle slide on click $('#slider-two-options .slideOnClick').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-two').data('slidestep').slideOnClick(value); }); // toggle magnetize $('#slider-two-options .magnetize').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-two').data('slidestep').magnetize(value); }); // toggle update value $('#slider-two-value .btn').on('click', function(event) { var value = Number($('#slider-two-value input').val()); $('#slider-two').data('slidestep').value(value); }); </script> </div> <br /> <br /> <h3>Toggle adjust offset example</h3> <div class="row"> <div class="span6"> <pre class="prettyprint linenums"> $('#slider-three').slidestep({ min: 0, max: 50, step: 1, grid: true, adjustOffset: false, /* default true */ onChange: function(data) { … } });</pre> </div> <div class="span6"> <div id="slider-three" class="slider large step"></div><br /> </div> <div class="span4"> <form id="slider-three-value" class="form-search" autocomplete="off"> <input type="text" class="input-small"> <button type="button" class="btn">Update</button><br /><br /> <span class="help-block">Value will always snap to a value in the distributed set of values.</span> </form> </div> <div class="span2"> <form id="slider-three-options" class="form-inline" autocomplete="off"> <label class="checkbox"><input class="adjustOffset" type="checkbox"> Adjust offset</label> <label class="checkbox"><input class="grid" type="checkbox" checked="checked"> Show grid</label> <!-- <label class="checkbox"><input class="slideOnClick" type="checkbox"> Slide on click</label> <label class="checkbox"><input class="magnetize" type="checkbox"> Magnetize</label> --> </form> </div> <script> $('#slider-three').slidestep({ min: 0, max: 30, step: 3, grid: true, adjustOffset: false /* default value true */, onChange: function(data) { $('#slider-three-value input[type=text]').val(data.pos.val); } }); // adjust offset $('#slider-three-options .adjustOffset').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-three').data('slidestep').adjustOffset(value); }); // toggle grid $('#slider-three-options .grid').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-three').data('slidestep').grid(value); }); // toggle slide on click $('#slider-three-options .slideOnClick').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-three').data('slidestep').slideOnClick(value); }); // toggle magnetize $('#slider-three-options .magnetize').on('click', function(event) { var value = $(this).is(':checked'); $('#slider-three').data('slidestep').magnetize(value); }); // toggle update value $('#slider-three-value .btn').on('click', function(event) { var value = Number($('#slider-three-value input').val()); $('#slider-three').data('slidestep').value(value); }); </script> </div> </div> <br /> <br /> </body> </html>
{ "content_hash": "63059fe899e28f86c11d30ada299b2e5", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 172, "avg_line_length": 33.31921824104234, "alnum_prop": 0.5809952096979177, "repo_name": "cristobal/Slidestep", "id": "596fcbed8229c8df089ec360f93c7f08da9c93c0", "size": "10235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "36487" } ], "symlink_target": "" }
@implementation XHTextFieldTableViewCell @end
{ "content_hash": "246f58e7cb3d8d88fe22e0168248f64a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 40, "avg_line_length": 15.666666666666666, "alnum_prop": 0.8723404255319149, "repo_name": "JackTeam/XHSetting", "id": "caf7d88f5af3c4e43c5b6f9c43065cc7d1c601fd", "size": "430", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/XHTextFieldTableViewCell.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "60601" }, { "name": "Ruby", "bytes": "586" } ], "symlink_target": "" }
package com.example.effervescencemmxiv; import java.util.ArrayList; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; public class FavouriteEvents extends Activity { ArrayList<String> s, s1; ListView lv; int c; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_favourite_events); //tv = (TextView) findViewById(R.id.tvinfo); Favourites info = new Favourites(this); ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); info.openandwrite(); s = info.getData(0); s1 = info.getData(1); //String s1 = info.getData(1); info.close(); c = s.size(); lv = (ListView)findViewById(R.id.listView1); //String ex[] = {"1", "2", "3", s}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(FavouriteEvents.this, R.layout.custom_layout, R.id.tv, s); //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, s); lv.setAdapter(adapter); //setListAdapter(new ArrayAdapter <String>(FavouriteEvents.this, android.R.layout.simple_list_item_1, s)); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String s2 = s1.get(position); startActivity(new Intent(s2)); } }); } /*@Override public void onStart() { super.onStart(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); }*/ @Override public boolean onOptionsItemSelected(MenuItem item){ Intent myIntent = new Intent(getApplicationContext(), Effervescence.class); startActivityForResult(myIntent, 0); finish(); return true; } /*@Override protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub super.onListItemClick(l, v, position, id); }*/ @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.favourite_events, menu); return true; } }
{ "content_hash": "6e01856442d56bc45a3a3475901704ca", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 126, "avg_line_length": 29.04494382022472, "alnum_prop": 0.6943907156673114, "repo_name": "RonishKalia/EffervescenceMM14", "id": "c1fccd878b8448bcb85ce7969d17a74b341db132", "size": "2585", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/com/example/effervescencemmxiv/FavouriteEvents.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "435577" } ], "symlink_target": "" }
#include <assert.h> #include <stdlib.h> #include "memory.h" #include "reservation.h" #include "tm.h" /* ============================================================================= * DECLARATION OF TM_CALLABLE FUNCTIONS * ============================================================================= */ static TM_CALLABLE void checkReservation (TM_ARGDECL reservation_t* reservationPtr); /* ============================================================================= * reservation_info_alloc * -- Returns NULL on failure * ============================================================================= */ reservation_info_t* reservation_info_alloc (TM_ARGDECL reservation_type_t type, long id, long price) { reservation_info_t* reservationInfoPtr; reservationInfoPtr = (reservation_info_t*)TM_MALLOC(sizeof(reservation_info_t)); if (reservationInfoPtr != NULL) { reservationInfoPtr->type = type; reservationInfoPtr->id = id; reservationInfoPtr->price = price; } return reservationInfoPtr; } /* ============================================================================= * reservation_info_free * ============================================================================= */ void reservation_info_free (TM_ARGDECL reservation_info_t* reservationInfoPtr) { TM_FREE(reservationInfoPtr); } /* ============================================================================= * reservation_info_compare * -- Returns -1 if A < B, 0 if A = B, 1 if A > B * ============================================================================= */ long reservation_info_compare (reservation_info_t* aPtr, reservation_info_t* bPtr) { long typeDiff; typeDiff = aPtr->type - bPtr->type; return ((typeDiff != 0) ? (typeDiff) : (aPtr->id - bPtr->id)); } /* ============================================================================= * checkReservation * -- Check if consistent * ============================================================================= */ static void checkReservation (TM_ARGDECL reservation_t* reservationPtr) { long numUsed = (long)TM_SHARED_READ_L(reservationPtr->numUsed); if (numUsed < 0) { TM_RESTART(); } long numFree = (long)TM_SHARED_READ_L(reservationPtr->numFree); if (numFree < 0) { TM_RESTART(); } long numTotal = (long)TM_SHARED_READ_L(reservationPtr->numTotal); if (numTotal < 0) { TM_RESTART(); } if ((numUsed + numFree) != numTotal) { TM_RESTART(); } long price = (long)TM_SHARED_READ_L(reservationPtr->price); if (price < 0) { TM_RESTART(); } } #define CHECK_RESERVATION(reservation) \ checkReservation(TM_ARG reservation) static void checkReservation_seq (reservation_t* reservationPtr) { assert(reservationPtr->numUsed >= 0); assert(reservationPtr->numFree >= 0); assert(reservationPtr->numTotal >= 0); assert((reservationPtr->numUsed + reservationPtr->numFree) == (reservationPtr->numTotal)); assert(reservationPtr->price >= 0); } /* ============================================================================= * reservation_alloc * -- Returns NULL on failure * ============================================================================= */ reservation_t* reservation_alloc (TM_ARGDECL long id, long numTotal, long price) { reservation_t* reservationPtr; reservationPtr = (reservation_t*)TM_MALLOC(sizeof(reservation_t)); if (reservationPtr != NULL) { reservationPtr->id = id; reservationPtr->numUsed = 0; reservationPtr->numFree = numTotal; reservationPtr->numTotal = numTotal; reservationPtr->price = price; CHECK_RESERVATION(reservationPtr); } return reservationPtr; } reservation_t* reservation_alloc_seq (long id, long numTotal, long price) { reservation_t* reservationPtr; reservationPtr = (reservation_t*)SEQ_MALLOC(sizeof(reservation_t)); if (reservationPtr != NULL) { reservationPtr->id = id; reservationPtr->numUsed = 0; reservationPtr->numFree = numTotal; reservationPtr->numTotal = numTotal; reservationPtr->price = price; checkReservation_seq(reservationPtr); } return reservationPtr; } /* ============================================================================= * reservation_addToTotal * -- Adds if 'num' > 0, removes if 'num' < 0; * -- Returns true on success, else false * ============================================================================= */ bool reservation_addToTotal (TM_ARGDECL reservation_t* reservationPtr, long num) { long numFree = (long)TM_SHARED_READ_L(reservationPtr->numFree); if (numFree + num < 0) { return false; } TM_SHARED_WRITE_L(reservationPtr->numFree, (numFree + num)); TM_SHARED_WRITE_L(reservationPtr->numTotal, ((long)TM_SHARED_READ_L(reservationPtr->numTotal) + num)); CHECK_RESERVATION(reservationPtr); return true; } bool reservation_addToTotal_seq (reservation_t* reservationPtr, long num) { if (reservationPtr->numFree + num < 0) { return false; } reservationPtr->numFree += num; reservationPtr->numTotal += num; checkReservation_seq(reservationPtr); return true; } /* ============================================================================= * reservation_make * -- Returns true on success, else false * ============================================================================= */ bool reservation_make (TM_ARGDECL reservation_t* reservationPtr) { long numFree = (long)TM_SHARED_READ_L(reservationPtr->numFree); if (numFree < 1) { return false; } TM_SHARED_WRITE_L(reservationPtr->numUsed, ((long)TM_SHARED_READ_L(reservationPtr->numUsed) + 1)); TM_SHARED_WRITE_L(reservationPtr->numFree, (numFree - 1)); CHECK_RESERVATION(reservationPtr); return true; } bool reservation_make_seq (reservation_t* reservationPtr) { if (reservationPtr->numFree < 1) { return false; } reservationPtr->numUsed++; reservationPtr->numFree--; checkReservation_seq(reservationPtr); return true; } /* ============================================================================= * reservation_cancel * -- Returns true on success, else false * ============================================================================= */ bool reservation_cancel (TM_ARGDECL reservation_t* reservationPtr) { long numUsed = (long)TM_SHARED_READ_L(reservationPtr->numUsed); if (numUsed < 1) { return false; } TM_SHARED_WRITE_L(reservationPtr->numUsed, (numUsed - 1)); TM_SHARED_WRITE_L(reservationPtr->numFree, ((long)TM_SHARED_READ_L(reservationPtr->numFree) + 1)); CHECK_RESERVATION(reservationPtr); return true; } bool reservation_cancel_seq (reservation_t* reservationPtr) { if (reservationPtr->numUsed < 1) { return false; } reservationPtr->numUsed--; reservationPtr->numFree++; checkReservation_seq(reservationPtr); return true; } /* ============================================================================= * reservation_updatePrice * -- Failure if 'price' < 0 * -- Returns true on success, else false * ============================================================================= */ bool reservation_updatePrice (TM_ARGDECL reservation_t* reservationPtr, long newPrice) { if (newPrice < 0) { return false; } TM_SHARED_WRITE_L(reservationPtr->price, newPrice); CHECK_RESERVATION(reservationPtr); return true; } bool reservation_updatePrice_seq (reservation_t* reservationPtr, long newPrice) { if (newPrice < 0) { return false; } reservationPtr->price = newPrice; checkReservation_seq(reservationPtr); return true; } /* ============================================================================= * reservation_compare * -- Returns -1 if A < B, 0 if A = B, 1 if A > B * ============================================================================= */ long reservation_compare (reservation_t* aPtr, reservation_t* bPtr) { return (aPtr->id - bPtr->id); } /* ============================================================================= * reservation_hash * ============================================================================= */ unsigned long reservation_hash (reservation_t* reservationPtr) { /* Separate tables for cars, flights, etc, so no need to use 'type' */ return (unsigned long)reservationPtr->id; } /* ============================================================================= * reservation_free * ============================================================================= */ void reservation_free (TM_ARGDECL reservation_t* reservationPtr) { TM_FREE(reservationPtr); } /* ============================================================================= * TEST_RESERVATION * ============================================================================= */ #ifdef TEST_RESERVATION #include <assert.h> #include <stdio.h> int main () { reservation_info_t* reservationInfo1Ptr; reservation_info_t* reservationInfo2Ptr; reservation_info_t* reservationInfo3Ptr; reservation_t* reservation1Ptr; reservation_t* reservation2Ptr; reservation_t* reservation3Ptr; assert(memory_init(1, 4, 2)); puts("Starting..."); reservationInfo1Ptr = reservation_info_alloc(0, 0, 0); reservationInfo2Ptr = reservation_info_alloc(0, 0, 1); reservationInfo3Ptr = reservation_info_alloc(2, 0, 1); /* Test compare */ assert(reservation_info_compare(reservationInfo1Ptr, reservationInfo2Ptr) == 0); assert(reservation_info_compare(reservationInfo1Ptr, reservationInfo3Ptr) > 0); assert(reservation_info_compare(reservationInfo2Ptr, reservationInfo3Ptr) > 0); reservation1Ptr = reservation_alloc(0, 0, 0); reservation2Ptr = reservation_alloc(0, 0, 1); reservation3Ptr = reservation_alloc(2, 0, 1); /* Test compare */ assert(reservation_compare(reservation1Ptr, reservation2Ptr) == 0); assert(reservation_compare(reservation1Ptr, reservation3Ptr) != 0); assert(reservation_compare(reservation2Ptr, reservation3Ptr) != 0); /* Cannot reserve if total is 0 */ assert(!reservation_make(reservation1Ptr)); /* Cannot cancel if used is 0 */ assert(!reservation_cancel(reservation1Ptr)); /* Cannot update with negative price */ assert(!reservation_updatePrice(reservation1Ptr, -1)); /* Cannot make negative total */ assert(!reservation_addToTotal(reservation1Ptr, -1)); /* Update total and price */ assert(reservation_addToTotal(reservation1Ptr, 1)); assert(reservation_updatePrice(reservation1Ptr, 1)); assert(reservation1Ptr->numUsed == 0); assert(reservation1Ptr->numFree == 1); assert(reservation1Ptr->numTotal == 1); assert(reservation1Ptr->price == 1); checkReservation(reservation1Ptr); /* Make and cancel reservation */ assert(reservation_make(reservation1Ptr)); assert(reservation_cancel(reservation1Ptr)); assert(!reservation_cancel(reservation1Ptr)); reservation_info_free(reservationInfo1Ptr); reservation_info_free(reservationInfo2Ptr); reservation_info_free(reservationInfo3Ptr); reservation_free(reservation1Ptr); reservation_free(reservation2Ptr); reservation_free(reservation3Ptr); puts("All tests passed."); return 0; } #endif /* TEST_RESERVATION */ /* ============================================================================= * * End of reservation.c * * ============================================================================= */
{ "content_hash": "21de90ba7b65672a630f7b6ca3d7dca1", "timestamp": "", "source": "github", "line_count": 441, "max_line_length": 84, "avg_line_length": 26.859410430839002, "alnum_prop": 0.5344871253693542, "repo_name": "jaingaurav/rstm", "id": "336e74c389c5b77eeacf1cf825cd9c16107874c6", "size": "14847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stamp-0.9.10/vacation/reservation.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "8349" }, { "name": "C", "bytes": "1311110" }, { "name": "C++", "bytes": "869336" }, { "name": "Java", "bytes": "11792" }, { "name": "Objective-C", "bytes": "29958" }, { "name": "Perl", "bytes": "3526" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Ajgl\Csv\Reader; /** * @author Antonio J. García Lagar <aj@garcialagar.es> */ class ReaderFactory implements ReaderFactoryInterface { public function createReader( string $type, string $filePath, string $delimiter = ReaderInterface::DELIMITER_DEFAULT, string $fileCharset = ReaderInterface::CHARSET_DEFAULT, string $mode = 'r' ): ReaderInterface { switch ($type) { case 'php': return new NativePhpReader($filePath, $delimiter, $fileCharset, $mode); break; case 'rfc': return new RfcReader($filePath, $delimiter, $fileCharset, $mode); break; default: throw new \InvalidArgumentException(sprintf("Unsupported reader type '%s'", $type)); break; } } }
{ "content_hash": "888cc2602201755fe4ddc53028a7e6f9", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 100, "avg_line_length": 27.151515151515152, "alnum_prop": 0.5792410714285714, "repo_name": "ajgarlag/AjglCsv", "id": "ad3274d1e5e60134728065a81e1534914b2243b4", "size": "1118", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Reader/ReaderFactory.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "44462" } ], "symlink_target": "" }
namespace Azure.ResourceManager.Relay.Models { /// <summary> SKU of the namespace. </summary> public partial class RelaySku { /// <summary> Initializes a new instance of RelaySku. </summary> /// <param name="name"> Name of this SKU. </param> public RelaySku(RelaySkuName name) { Name = name; } /// <summary> Initializes a new instance of RelaySku. </summary> /// <param name="name"> Name of this SKU. </param> /// <param name="tier"> The tier of this SKU. </param> internal RelaySku(RelaySkuName name, RelaySkuTier? tier) { Name = name; Tier = tier; } /// <summary> Name of this SKU. </summary> public RelaySkuName Name { get; set; } /// <summary> The tier of this SKU. </summary> public RelaySkuTier? Tier { get; set; } } }
{ "content_hash": "931a8999bb2117f08526049e1a1d7fc5", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 72, "avg_line_length": 33.2962962962963, "alnum_prop": 0.5583982202447163, "repo_name": "Azure/azure-sdk-for-net", "id": "25cf799785b2364367bd88396502e8a08ac1a94e", "size": "1037", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/relay/Azure.ResourceManager.Relay/src/Generated/Models/RelaySku.cs", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
version=$1 base_directory=/Users/wpantoja/Repositories/PayPal_Github/FoundationClient/wallet-sdk-android echo Version = $version echo Base Directory = $base_directory cd $base_directory rm -rf $base_directory/collate/$version mkdir -p $base_directory/collate/$version for i in $(find . -mindepth 4 -type d -name aar | awk -F/ '{ print $2 }') ; do cp $base_directory/$i/build/outputs/aar/*-$version*.aar $base_directory/collate/$version; done
{ "content_hash": "0926de03d946eb8ae7f784c5fb229e95", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 173, "avg_line_length": 25.11111111111111, "alnum_prop": 0.7345132743362832, "repo_name": "cybergrouch/lange_bin_folder", "id": "b3d029e6681045b656f032ba2d2516b2c74bbcea", "size": "465", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "collateWEX.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Shell", "bytes": "13289" } ], "symlink_target": "" }
<?php /* * Original Author: Aftab naveed * Modified By: @dbashyal */ class Utility { public static function convertCsvToArray($fileName, $delimiter = ',', $header = null) { if (!file_exists($fileName) || !is_readable($fileName)) { return false; } $data = array(); if (($handle = fopen($fileName, 'r')) !== FALSE) { while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) { if (!$header) { $header = array_map('trim',$row); } else { $data[] = array_combine($header, $row); } } fclose($handle); return $data; } return false; } }
{ "content_hash": "7e4b007a6e443bbac164bf30599e5e41", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 89, "avg_line_length": 26.24137931034483, "alnum_prop": 0.442838370565046, "repo_name": "dbashyal/Merge_Payment_Transaction_Logs", "id": "c45474b099cd51e8c1b04825eb041c61a8150208", "size": "761", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "utility.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "12521" } ], "symlink_target": "" }
import sys sys.path.append('simulations/') import argparse import matplotlib.pyplot as plt import seaborn as sns import numpy as np import tempfile import tensorflow as tf from tf_rl.controller import DiscreteDeepQ from tf_rl.models import MLP from planning import Planning from maddux.predefined_environments import get_medium_environment def main(desired_iterations, save_path): # Define a log file to use with tensorboard # Not that we currently make use of tensorboard at all LOG_DIR = tempfile.mkdtemp() print "Tensorboard Log: " + LOG_DIR + '\n' # The directory to save the animations to SAVE_DIR = save_path # Define the simulation sim = Planning(get_medium_environment()) # Tensorflow! tf.reset_default_graph() session = tf.InteractiveSession() journalist = tf.train.SummaryWriter(LOG_DIR) brain = MLP([sim.observation_size,], [200, 200, sim.num_actions], [tf.tanh, tf.tanh, tf.identity]) optimizer = tf.train.RMSPropOptimizer(learning_rate= 0.001, decay=0.9) # DiscreteDeepQ object current_controller = DiscreteDeepQ(sim.observation_size, sim.num_actions, brain, optimizer, session, random_action_probability=0.1, discount_rate=0.9, exploration_period=1000, max_experience=10000, store_every_nth=1, train_every_nth=1, summary_writer=journalist) # Initialize the session session.run(tf.initialize_all_variables()) session.run(current_controller.target_network_update) journalist.add_graph(session.graph) # Run the simulation and let the robot learn num_simulations = 0 iterations_needed = [] total_rewards = [] try: for game_idx in range(desired_iterations+1): current_random_prob = current_controller.random_action_probability update_random_prob = game_idx != 0 and game_idx % 50 == 0 if update_random_prob and 0.01 < current_random_prob <= 0.1: current_controller.random_action_probability = current_random_prob - 0.01 elif update_random_prob and 0.1 < current_random_prob: current_controller.random_action_probability = current_random_prob - 0.1 game = Planning(get_medium_environment()) game_iterations = 0 observation = game.observe() while not game.is_over(): action = current_controller.action(observation) reward = game.collect_reward(action) new_observation = game.observe() current_controller.store(observation, action, reward, new_observation) current_controller.training_step() observation = new_observation game_iterations += 1 total_rewards.append(sum(game.collected_rewards)) iterations_needed.append(game_iterations) rewards = [] if game_idx % 10 == 0: print "\rGame %d:\nIterations before end: %d." % (game_idx, game_iterations) if game.hit_target: print "Hit target!" print "Total Rewards: %s\n" % (sum(game.collected_rewards)) if SAVE_DIR is not None: game.save_path(SAVE_DIR, game_idx) except KeyboardInterrupt: print "Interrupted" # Plot the iterations and reward plt.figure(figsize=(12, 8)) plt.plot(total_rewards, label='Reward') plt.legend() plt.show() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Run RL on easy environment') parser.add_argument('--i', dest='iterations', metavar='N', default=1000, type=int, help='number of iterations of RL to run') parser.add_argument('--s', dest='save_path', metavar='S', default=None, help='the dir to save the joint config to animate later') args = parser.parse_args() main(args.iterations, args.save_path)
{ "content_hash": "4cba055af21217935d9b4f578d216ab3", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 133, "avg_line_length": 40.878787878787875, "alnum_prop": 0.625648628613788, "repo_name": "bcaine/maddux", "id": "8dcc6924b765d55759a195e57c848eb1af348f94", "size": "4047", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "experiments/reinforcement_learning/iteration_planning/medium_planning.py", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "172249" }, { "name": "Python", "bytes": "63731" }, { "name": "Shell", "bytes": "449" } ], "symlink_target": "" }
DVBCQGY3 ;;ALB-CIOFO/SBW - Gynecological Conditions Questionaire (Continued); 7/JUL/2011 ;;2.7;AMIE;**174**;Apr 10, 1995;Build 2 ; TXT ; ;; 15. Tumors and neoplasms ;; a. Does the Veteran have a benign or malignant neoplasm or metastases related ;; to any of the diagnoses in the Diagnosis section? ;; ___ Yes ___ No ;; If yes, complete the following: ;;^TOF^ ;; b. Is the neoplasm ;; ___ Benign ___ Malignant ;; ;; c. Has the Veteran completed treatment or is the Veteran currently undergoing ;; treatment for a benign or malignant neoplasm or metastases? ;; ___ Yes ___ No; watchful waiting ;; If yes, indicate type of treatment the Veteran is currently undergoing or ;; has completed (check all that apply): ;; ___ Treatment completed; currently in watchful waiting status ;; ___ Surgery ;; If checked, describe: ___________________ ;; Date(s) of surgery: __________ ;; ___ Radiation therapy ;; Date of most recent treatment: ___________ ;; Date of completion of treatment or anticipated date of completion: ;; _________ ;; ___ Antineoplastic chemotherapy ;; Date of most recent treatment: ___________ ;; Date of completion of treatment or anticipated date of completion: ;; _________ ;; ___ Other therapeutic procedure ;; If checked, describe procedure: ___________________ ;; Date of most recent procedure: __________ ;; ___ Other therapeutic treatment ;; If checked, describe treatment: ;; Date of completion of treatment or anticipated date of completion: ;; _________ ;; ;; d. Does the Veteran currently have any residual conditions or complications ;; due to the neoplasm (including metastases) or its treatment, other than those ;; already documented in the report above? ;; ___ Yes ___ No ;; If yes, list residual conditions and complications (brief summary): _________ ;; _____________________________________________________________________________ ;; ;; e. If there are additional benign or malignant neoplasms or metastases ;; related to any of the diagnoses in the Diagnosis section, describe using the ;; above format: _______________________________________________________________ ;; ;; 16. Other pertinent physical findings, complications, conditions, signs ;; and/or symptoms ;; a. Does the Veteran have any scars (surgical or otherwise) related to any ;; conditions or to the treatment of any conditions listed in the Diagnosis ;; section above? ;; ___ Yes ___ No ;; If yes, are any of the scars painful and/or unstable, or is the total area ;; of all related scars greater than 39 square cm (6 square inches)? ;; ___ Yes ___ No ;; If yes, also complete a Scars Questionnaire. ;;^TOF^ ;; b. Does the Veteran have any other pertinent physical findings, ;; complications, conditions, signs and/or symptoms related to any conditions ;; listed in the Diagnosis section above? ;; ___ Yes ___ No ;; If yes, describe (brief summary): ___________________________________________ ;; ;; 17. Diagnostic testing ;; NOTE: If laboratory test results are in the medical record and reflect the ;; Veteran's current condition, repeat testing is not required. ;; ;; a. Has the Veteran had laparoscopy? ;; ___ Yes ___ No ;; If yes, provide date(s) and facility where performed, and results: __________ ;; _____________________________________________________________________________ ;; ;; b. Has the Veteran been diagnosed with anemia? ;; ___ Yes ___ No ;; If yes, provide most recent test results: ;; Hgb: _____ ;; Hct: _____ ;; Date of test: ___________ ;; ;; c. Has the Veteran had any other diagnostic testing and if so, are there ;; significant findings and/or results? ;; ___ Yes ___ No ;; If yes, provide type of test or procedure, date and results (brief summary): ;; ____________________________________________________________________________ ;; ;; 18. Functional impact ;; Does the Veteran's gynecological condition(s) impact her ability to work? ;; ___ Yes ___ No ;; If yes, describe impact of each of the Veteran's gynecological conditions, ;; providing one or more examples: _____________________________________________ ;; _____________________________________________________________________________ ;; ;; 19. Remarks, if any: ________________________________________________________ ;; ;; Physician signature: _______________________________________ Date: _________ ;; ;; Physician printed name: _______________________________________ ;; ;; Medical license #: _____________ ;; ;; Physician address: ____________________________________________ ;; ;; Phone: _________________________ Fax: _________________________ ;; ;; NOTE: VA may request additional medical information, including additional ;; examinations if necessary to complete VA's review of the Veteran's application. ;;^END^ Q
{ "content_hash": "4753ed49004feea3a54a149eecf55bbf", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 88, "avg_line_length": 45.126126126126124, "alnum_prop": 0.5450189658614494, "repo_name": "OSEHRA-Sandbox/VistA-M", "id": "bf624bfd2a3a1f6c72120aab20e6fa3dbae35874", "size": "5009", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Packages/Automated Medical Information Exchange/Routines/DVBCQGY3.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "M", "bytes": "117976276" }, { "name": "MATLAB", "bytes": "41" } ], "symlink_target": "" }
<?php use Flarum\Api\Controller as FlarumController; use Flarum\Api\Serializer\DiscussionSerializer; use Flarum\Api\Serializer\ForumSerializer; use Flarum\Discussion\Discussion; use Flarum\Discussion\Event\Saving; use Flarum\Discussion\Filter\DiscussionFilterer; use Flarum\Discussion\Search\DiscussionSearcher; use Flarum\Extend; use Flarum\Flags\Api\Controller\ListFlagsController; use Flarum\Http\RequestUtil; use Flarum\Post\Filter\PostFilterer; use Flarum\Tags\Access; use Flarum\Tags\Api\Controller; use Flarum\Tags\Api\Serializer\TagSerializer; use Flarum\Tags\Content; use Flarum\Tags\Event\DiscussionWasTagged; use Flarum\Tags\Filter\HideHiddenTagsFromAllDiscussionsPage; use Flarum\Tags\Filter\PostTagFilter; use Flarum\Tags\Listener; use Flarum\Tags\LoadForumTagsRelationship; use Flarum\Tags\Post\DiscussionTaggedPost; use Flarum\Tags\Query\TagFilterGambit; use Flarum\Tags\Tag; use Psr\Http\Message\ServerRequestInterface; $eagerLoadTagState = function ($query, ?ServerRequestInterface $request, array $relations) { if ($request && in_array('tags.state', $relations, true)) { $query->withStateFor(RequestUtil::getActor($request)); } }; return [ (new Extend\Frontend('forum')) ->js(__DIR__.'/js/dist/forum.js') ->css(__DIR__.'/less/forum.less') ->route('/t/{slug}', 'tag', Content\Tag::class) ->route('/tags', 'tags', Content\Tags::class), (new Extend\Frontend('admin')) ->js(__DIR__.'/js/dist/admin.js') ->css(__DIR__.'/less/admin.less'), (new Extend\Routes('api')) ->get('/tags', 'tags.index', Controller\ListTagsController::class) ->post('/tags', 'tags.create', Controller\CreateTagController::class) ->post('/tags/order', 'tags.order', Controller\OrderTagsController::class) ->get('/tags/{slug}', 'tags.show', Controller\ShowTagController::class) ->patch('/tags/{id}', 'tags.update', Controller\UpdateTagController::class) ->delete('/tags/{id}', 'tags.delete', Controller\DeleteTagController::class), (new Extend\Model(Discussion::class)) ->belongsToMany('tags', Tag::class, 'discussion_tag'), (new Extend\ApiSerializer(ForumSerializer::class)) ->hasMany('tags', TagSerializer::class) ->attribute('canBypassTagCounts', function (ForumSerializer $serializer) { return $serializer->getActor()->can('bypassTagCounts'); }), (new Extend\ApiSerializer(DiscussionSerializer::class)) ->hasMany('tags', TagSerializer::class) ->attribute('canTag', function (DiscussionSerializer $serializer, $model) { return $serializer->getActor()->can('tag', $model); }), (new Extend\ApiController(FlarumController\ListPostsController::class)) ->load('discussion.tags'), (new Extend\ApiController(ListFlagsController::class)) ->load('post.discussion.tags'), (new Extend\ApiController(FlarumController\ListDiscussionsController::class)) ->addInclude(['tags', 'tags.state', 'tags.parent']) ->loadWhere('tags', $eagerLoadTagState), (new Extend\ApiController(FlarumController\ShowDiscussionController::class)) ->addInclude(['tags', 'tags.state', 'tags.parent']) ->loadWhere('tags', $eagerLoadTagState), (new Extend\ApiController(FlarumController\CreateDiscussionController::class)) ->addInclude(['tags', 'tags.state', 'tags.parent']) ->loadWhere('tags', $eagerLoadTagState), (new Extend\ApiController(FlarumController\ShowForumController::class)) ->addInclude(['tags', 'tags.parent']) ->prepareDataForSerialization(LoadForumTagsRelationship::class), (new Extend\Settings()) ->serializeToForum('minPrimaryTags', 'flarum-tags.min_primary_tags') ->serializeToForum('maxPrimaryTags', 'flarum-tags.max_primary_tags') ->serializeToForum('minSecondaryTags', 'flarum-tags.min_secondary_tags') ->serializeToForum('maxSecondaryTags', 'flarum-tags.max_secondary_tags'), (new Extend\Policy()) ->modelPolicy(Discussion::class, Access\DiscussionPolicy::class) ->modelPolicy(Tag::class, Access\TagPolicy::class) ->globalPolicy(Access\GlobalPolicy::class), (new Extend\ModelVisibility(Discussion::class)) ->scopeAll(Access\ScopeDiscussionVisibilityForAbility::class), (new Extend\ModelVisibility(Tag::class)) ->scope(Access\ScopeTagVisibility::class), new Extend\Locales(__DIR__.'/locale'), (new Extend\View) ->namespace('tags', __DIR__.'/views'), (new Extend\Post) ->type(DiscussionTaggedPost::class), (new Extend\Event()) ->listen(Saving::class, Listener\SaveTagsToDatabase::class) ->listen(DiscussionWasTagged::class, Listener\CreatePostWhenTagsAreChanged::class) ->subscribe(Listener\UpdateTagMetadata::class), (new Extend\Filter(PostFilterer::class)) ->addFilter(PostTagFilter::class), (new Extend\Filter(DiscussionFilterer::class)) ->addFilter(TagFilterGambit::class) ->addFilterMutator(HideHiddenTagsFromAllDiscussionsPage::class), (new Extend\SimpleFlarumSearch(DiscussionSearcher::class)) ->addGambit(TagFilterGambit::class), ];
{ "content_hash": "f0c324a27cb6cf97ba21314bb2dd8483", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 92, "avg_line_length": 40.038167938931295, "alnum_prop": 0.6934223069590085, "repo_name": "flarum/tags", "id": "e4360e1211a0c1c0734e35d0568479df3b4c5234", "size": "5413", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "extend.php", "mode": "33188", "license": "mit", "language": [ { "name": "Blade", "bytes": "2239" }, { "name": "JavaScript", "bytes": "31013" }, { "name": "Less", "bytes": "11966" }, { "name": "PHP", "bytes": "141324" }, { "name": "TypeScript", "bytes": "31997" } ], "symlink_target": "" }
<html> <?php $this->load->helper('html'); echo doctype(); ?> <head> <?php echo meta('Content-type','text/html; charset=utf-8','equiv');?> <title>Appli_Frais</title> <link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url('/assets/img/logo_gsb.png'); ?>" /> <script src="<?php echo base_url('/assets/js/jquery-1.12.0.min.js'); ?>"></script> <script src="<?php echo base_url('/assets/js/bootstrap.min.js'); ?>"></script> <link rel="stylesheet" href="<?php echo base_url('/assets/css/general.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('/assets/css/bootstrap.min.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('/assets/css/bootstrap-theme.min.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('/assets/css/bootstrap-datetimepicker.min.css'); ?>" /> <script src="<?php echo base_url('/assets/js/bootstrap-datepicker.js'); ?>"></script> <script src="<?php echo base_url('/assets/js/general.js'); ?>"></script> </head> <body class="body"> <?php $this->load->view('nav_bar'); ?> <div id="menu_left" class="menu_left"> <ul id="menu_left_list"> <li style="text-align:center;height:100px;background-color: lightblue;"> <?php foreach ($query as $row): ?> <!-- s'il n'y a pas d'image on affiche une image par default --> <?php if ($row->img_profile == null): ?> <img id="menu_left_img" src="<?php echo base_url('/assets/img/default-user.png'); ?>"> <?php else: ?> <img id="menu_left_img" src="<?php echo base_url('/assets/img_profile/'.$row->img_profile); ?>"> <?php endif; ?> <?php endforeach; ?> </li> <li id="menu_left_welcome" ><span>Bonjour, <?= $id->login ?></span></li> <li ><a href="<?= base_url(); ?>"><span class="glyphicon glyphicon-home" ></span>Accueil</a></li> <li ><a href="<?= base_url("index.php/Consult"); ?>"><span class="glyphicon glyphicon-list-alt" ></span>Mes notes de frais</a></li> <li ><a href="<?= base_url("index.php/AddReport"); ?>"><span class="glyphicon glyphicon-plus" ></span>Ajouter une note</a></li> <li ><a href="<?= base_url("index.php/Profile"); ?>"><span class="glyphicon glyphicon-user"></span>Mon Profil</a></li> <li ><a href="<?= base_url("index.php/Contact"); ?>"><span class="glyphicon glyphicon-envelope"></span>Nous Contacter</a></li> <li style="bottom:40px;position:fixed;"><a href="<?= base_url("index.php/Auth/logout"); ?>"> <span class="glyphicon glyphicon-log-out"></span>Se déconnecter</a></li> </ul> </div> <div class="col-md-12 col-xs-12" id="content" style="margin-top: 100px;position:absolute;padding-left:0px;padding-right:0px;"> <div id="more" class="more"> <span class="glyphicon glyphicon-plus"></span> </div> <?php $this->load->view($content);?> </div> </body> </html>
{ "content_hash": "4caf04420d3c8666a432d191367a8ed8", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 176, "avg_line_length": 64.77083333333333, "alnum_prop": 0.5577356063042779, "repo_name": "elsac/GSB", "id": "496a7a98fd97ab778ee54676a31b7745e2711f66", "size": "3110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/template.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "240" }, { "name": "CSS", "bytes": "26777" }, { "name": "HTML", "bytes": "8091362" }, { "name": "JavaScript", "bytes": "57426" }, { "name": "PHP", "bytes": "1786437" } ], "symlink_target": "" }
using System.Collections.Generic; using System.Threading.Tasks; using SaasEcom.Core.Models; namespace SaasEcom.Core.Infrastructure.PaymentProcessor.Interfaces { /// <summary> /// Interface for CRUD related to credit cards with Stripe /// </summary> public interface ICardProvider { /// <summary> /// Adds the credit card asynchronous. /// </summary> /// <param name="user">The user.</param> /// <param name="card">The card.</param> /// <returns></returns> Task AddAsync(SaasEcomUser user, CreditCard card); /// <summary> /// Updates the credit card asynchronous. /// </summary> /// <param name="user">The user.</param> /// <param name="creditcard">The creditcard.</param> /// <returns></returns> Task UpdateAsync(SaasEcomUser user, CreditCard creditcard); /// <summary> /// Deletes the credit card asynchronous. /// </summary> /// <param name="customerId">The customer identifier.</param> /// <param name="custStripeId">The customer stripe identifier.</param> /// <param name="cardId">The card identifier.</param> /// <returns></returns> Task DeleteAsync(string customerId, string custStripeId, int cardId); /// <summary> /// Gets all the credit cards asynchronous. /// </summary> /// <param name="customerId">The customer identifier.</param> /// <returns>The list of credit cards</returns> Task<IList<CreditCard>> GetAllAsync(string customerId); /// <summary> /// Finds the credit card asynchronous. /// </summary> /// <param name="userId">The user identifier.</param> /// <param name="cardId">The card identifier.</param> /// <returns>The credit card</returns> Task<CreditCard> FindAsync(string userId, int? cardId); /// <summary> /// Check if the Card belong to user. /// </summary> /// <param name="cardId">The card identifier.</param> /// <param name="userId">The user identifier.</param> /// <returns>true or false</returns> Task<bool> CardBelongToUser(int cardId, string userId); } }
{ "content_hash": "a77140646c28b8af8c56cc4b41abce3e", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 78, "avg_line_length": 37.63333333333333, "alnum_prop": 0.5961027457927369, "repo_name": "haithemaraissia/saas-ecom", "id": "3c40d5ef68b00357f3effa7a17bf4df154f522ce", "size": "2260", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "SaasEcom.Core/Infrastructure/PaymentProcessor/Interfaces/ICardProvider.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "746" }, { "name": "C#", "bytes": "170141" }, { "name": "JavaScript", "bytes": "3322" }, { "name": "Pascal", "bytes": "29586" }, { "name": "PowerShell", "bytes": "92151" }, { "name": "Puppet", "bytes": "7489" } ], "symlink_target": "" }
layout: page title: Holder Champion Chemical Award Ceremony date: 2016-05-24 author: Benjamin Bowman tags: weekly links, java status: published summary: Maecenas non sodales lacus. Quisque. banner: images/banner/leisure-02.jpg booking: startDate: 03/03/2017 endDate: 03/07/2017 ctyhocn: DROCOHX groupCode: HCCAC published: true --- Aliquam feugiat lacus vitae elit euismod, ut volutpat sem dapibus. Duis porttitor, nulla ut luctus vehicula, justo ante maximus est, nec pharetra dolor quam ac dolor. Phasellus sed libero eu velit vestibulum venenatis ut nec metus. Vestibulum cursus, tortor eu auctor sollicitudin, ipsum ipsum placerat leo, suscipit dignissim dolor enim tincidunt lectus. Phasellus luctus ornare orci vitae sollicitudin. Phasellus fermentum in ante elementum pharetra. Duis vulputate augue nec elementum feugiat. Nunc efficitur ante eu velit sodales, in fringilla ipsum porta. * Nunc vel nisi vitae est venenatis pulvinar nec in dui * Praesent imperdiet elit vitae porttitor egestas * Quisque condimentum sem ac augue iaculis, vel malesuada metus laoreet. Vestibulum lacus lorem, efficitur ac metus id, faucibus varius massa. Vivamus non lectus non quam varius aliquet non non quam. Nunc nunc justo, pretium nec diam a, hendrerit scelerisque est. Sed posuere finibus justo, id luctus ligula sollicitudin id. Phasellus in ultrices risus. In hac habitasse platea dictumst. Integer dapibus molestie nisi, non posuere est congue et. Sed at rutrum lorem. Pellentesque vestibulum dolor vel aliquet sollicitudin. Sed lorem lacus, sagittis eu augue eget, finibus pretium libero. Mauris quis molestie risus. Ut pellentesque fermentum eros fringilla faucibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc viverra neque nec rutrum lacinia. Curabitur dictum nibh ac odio pretium facilisis. Nunc vitae purus eu odio accumsan porttitor sit amet sed massa.
{ "content_hash": "bb8787e17836779df383a8c45c897fb9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 833, "avg_line_length": 87.0909090909091, "alnum_prop": 0.8136743215031316, "repo_name": "KlishGroup/prose-pogs", "id": "bc40d0ed67a13c895ee46daf3506db9604e6ff1b", "size": "1920", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/D/DROCOHX/HCCAC/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
title: Monthly Update (08/02/2015) categories: - Misc tags: - monthly update # https://www.iconfinder.com/icons/5243659/electric_light_flashlight_light_pocket_torch_torch_icon thumbnail: thumbnail.svg --- In the monthly update, I bring you what I've been doing throughout the past month in regards to technology, computers and more with links to tutorials and guides. You will also find what I'm currently interested in for the following weeks. If something doesn’t have a link, I may cover it myself in the future because I couldn't find much about it online. <!-- more --> ## UniFi Controller on Linux I wrote a [post](/install-unifi-controller-ubuntu/) about it, maybe you should have a read? ## pfSense IGMP Proxy Does this even work? I'm trying to allow my Chromecast, printer and Plex to be available across VLANs through automatic discovery. So far, it doesn't seem to be working with any combination of upstreams/downstreams and network addresses. I've also tried Avahi as well. The best guide I could find is one [written by Cisco](http://www.cisco.com/c/en/us/td/docs/wireless/controller/technotes/7-6/chromecastDG76/ChromecastDG76.html) but is specific to their systems. ## Optimised website This website has gone through a big overhaul! The theme has been changed to [Fictive](https://theme.wordpress.com/themes/fictive/) with some custom CSS code I've written to hide the post styles, center the search bar and align any text sidebar widgets. ```css .hentry:before { background-color: rgba(0,0,0,0); content: ""; } .byline { display: none; } .textwidget > p { padding-left: 2em; } .search-field { width: 120%; } ``` The theme looks great overall. One wish I could make would be to center the entire theme and have another sidebar on the right. Furthermore I've added a few new plugins to enhance security and usability such as Wordfence, Scroll Top and reverted back to JetPack. ## Updated ESXi hosts I thought it was a good time to do some updates. Went straight to 5.5 U2 using the [_update-from-esxi5.5-5.5_update02.zip_](https://my.vmware.com/group/vmware/patch#search) file and the command: ```shell-session esxcli software vib update -d=[ZFS0]/esxi_patches/ESXi/update-from-esxi5.5-5.5_update02.zip ``` ## Updated pfSense to 2.2 release You can read about in my other [post](/upgrade-pfsense-2-2-vmware/) as well. ## Digital Ocean hosting for girlfriend My girlfriend is a veteran blogger but hasn't touched it in a while. Using the [GitHub student pack](https://education.github.com/pack/offers), we were able to get $100 credit on Digital Ocean for hosting on Ubuntu with WordPress preinstalled. Using SSL certificate offer from Namecheap also allowed me to get HTTPS up and running. ## Computer for girlfriend Currently in the process of building a new computer for my girlfriend. There'll be a post about it soon! ## Facebook Lite Facebook Lite is awesome. It's like Facebook but much smaller and less battery sucking. Only available on the [Google Play Store](https://play.google.com/store/apps/details?id=com.facebook.lite) in Bangladesh, Nepal, Nigeria, South Africa, Sudan, Sri Lanka, Vietnam, and Zimbabwe for now. You can still [download it here](http://www.apkmirror.com/apk/facebook-2/lite/facebook-lite-1-4-0-6-14-apk/). All the news sites like [CNET](http://www.cnet.com/au/how-to/get-facebook-lite-for-your-android-device/) and LifeHacker link the old version because they probably all copy each other. ## Currently Interested * Planning for new computer and SAN storage: When my current PC gets an upgrade, I may retire it as another ESXi host. If I do that, I may also look at getting started on Fibre Channel storage and a proper rack enclosure. * Got an Intel I350 T4 NIC as an early Valentine's Day present. Gonna have a lot of fun with it in pfSense doing some bridging and link aggregation. * Been playing around with Docker. Looking at the possibility of running SABnzbd, Couch, Sonarr etc. all on one virtual machine to save some memory. Would also be good to learn as a skill. * Going to go with Windows 8.1 on all my PCs. 8.1 sucks but can be made a lot better with a bunch of applications like [Start8](http://www.stardock.com/products/start8/) and [ModernMix](http://www.stardock.com/products/ModernMix/). Running things as Administrator is usually a pain but you can get around it by using the Administrator account by default from the very start (not recommended of course).
{ "content_hash": "c2b7327725e58c74af0066b4ad44f635", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 582, "avg_line_length": 51.91860465116279, "alnum_prop": 0.7659574468085106, "repo_name": "calvinbui/calvin.me", "id": "7715f0b8baa262298739314a8c86be4f5860e851", "size": "4482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "posts/2015/2015-02-07-monthly-update-08022015/index.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "37762" }, { "name": "SCSS", "bytes": "42656" }, { "name": "Shell", "bytes": "347" } ], "symlink_target": "" }
haxelib run flow build linux ver=`grep version project.flow | cut -d"'" -f2` cd bin mv linux64 IsometricEdit-${ver} tar -cvzf IsometricEdit-${ver}-linux.tar.gz IsometricEdit-* cd .. rm builds/*-linux.tar.gz mv bin/IsometricEdit-*.tar.gz builds/ rm -rf bin/IsometricEdit-*
{ "content_hash": "a09b94f5b19c06956944991343512591", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 30.22222222222222, "alnum_prop": 0.7352941176470589, "repo_name": "DjPale/IsometricEdit", "id": "9ffd62bef6001a3bda8748c708f987dc26e3150e", "size": "282", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build_linux.sh", "mode": "33261", "license": "mit", "language": [ { "name": "Haxe", "bytes": "91913" }, { "name": "Shell", "bytes": "966" } ], "symlink_target": "" }
package com.example.volley; import com.android.volley.toolbox.ImageLoader.ImageCache; import android.graphics.Bitmap; import android.support.v4.util.LruCache; /** * Klasa odpowiedzialna za przesy³anie bitmap z/na serwer. */ public class LruBitmapCache extends LruCache<String, Bitmap> implements ImageCache { public static int getDefaultLruCacheSize() { final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); final int cacheSize = maxMemory / 8; return cacheSize; } public LruBitmapCache() { this(getDefaultLruCacheSize()); } public LruBitmapCache(int sizeInKiloBytes) { super(sizeInKiloBytes); } @Override protected int sizeOf(String key, Bitmap value) { return value.getRowBytes() * value.getHeight() / 1024; } @Override public Bitmap getBitmap(String url) { return get(url); } @Override public void putBitmap(String url, Bitmap bitmap) { put(url, bitmap); } }
{ "content_hash": "62e3d840f56f6320930409457125bdee", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 72, "avg_line_length": 21.46511627906977, "alnum_prop": 0.7388949079089924, "repo_name": "maslokarol/KSGApp", "id": "902ecf9d7c3a3880560ec1e54e5e4cb0301246d1", "size": "923", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "KSGApp/src/com/example/volley/LruBitmapCache.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "31790" } ], "symlink_target": "" }
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // So that mojo is defined. import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; import 'chrome://nearby/app.js'; import {setContactManagerForTesting} from 'chrome://nearby/shared/nearby_contact_manager.m.js'; import {setNearbyShareSettingsForTesting} from 'chrome://nearby/shared/nearby_share_settings.m.js'; import {assertEquals, assertFalse, assertTrue} from '../chai_assert.js'; import {waitAfterNextRender} from '../test_util.js'; import {FakeContactManager} from './shared/fake_nearby_contact_manager.m.js'; import {FakeNearbyShareSettings} from './shared/fake_nearby_share_settings.m.js'; suite('ShareAppTest', function() { /** @type {!NearbyShareAppElement} */ let shareAppElement; /** @type {!nearbyShare.mojom.NearbyShareSettingsInterface} */ let fakeSettings; /** @param {!string} page Page to check if it is active. */ function isPageActive(page) { return shareAppElement.$$(`nearby-${page}-page`) .classList.contains('active'); } /** * This allows both sub-suites to share the same setup logic but with a * different enabled state which changes the routing of the first view. * @param {boolean} enabled The value of the enabled setting. * @param {boolean} isOnboardingComplete The value of the onboarding * completion state. */ function sharedSetup(enabled, isOnboardingComplete) { fakeSettings = new FakeNearbyShareSettings(); fakeSettings.setIsOnboardingComplete(!!isOnboardingComplete); fakeSettings.setEnabled(enabled); setNearbyShareSettingsForTesting(fakeSettings); let fakeContactManager = new FakeContactManager(); setContactManagerForTesting(fakeContactManager); fakeContactManager.setupContactRecords(); shareAppElement = /** @type {!NearbyShareAppElement} */ ( document.createElement('nearby-share-app')); document.body.appendChild(shareAppElement); } /** Shared teardown for both sub-suites. */ function sharedTeardown() { shareAppElement.remove(); } suite('EnabledTests', function() { setup(function() { sharedSetup(/*enabled=*/ true, /*isOnboardingComplete=*/ true); }); teardown(sharedTeardown); test('renders discovery page when enabled', async function() { assertEquals('NEARBY-SHARE-APP', shareAppElement.tagName); assertEquals(null, shareAppElement.$$('.active')); // We have to wait for settings to return from the mojo after which // the app will route to the correct page. await waitAfterNextRender(shareAppElement); assertTrue(isPageActive('discovery')); }); }); suite('DisabledTests', function() { teardown(sharedTeardown); test( 'enables feature and opens discovery if onboarding is complete', async function() { sharedSetup(/*enabled=*/ false, /*isOnboardingComplete=*/ true); assertEquals('NEARBY-SHARE-APP', shareAppElement.tagName); assertEquals(null, shareAppElement.$$('.active')); // We have to wait for settings to return from the mojo after which // the app will route to the correct page. await waitAfterNextRender(shareAppElement); const enabledResponse = await fakeSettings.getEnabled(); assertTrue(enabledResponse && enabledResponse.enabled); assertTrue(isPageActive('discovery')); }); test('renders onboarding page when disabled', async function() { sharedSetup(/*enabled=*/ false, /*isOnboardingComplete=*/ false); loadTimeData.overrideValues({ 'isOnePageOnboardingEnabled': false, }); assertEquals('NEARBY-SHARE-APP', shareAppElement.tagName); assertEquals(null, shareAppElement.$$('.active')); // We have to wait for settings to return from the mojo after which // the app will route to the correct page. await waitAfterNextRender(shareAppElement); assertTrue(isPageActive('onboarding')); }); test('renders one-page onboarding page when disabled', async function() { sharedSetup(/*enabled=*/ false, /*isOnboardingComplete=*/ false); loadTimeData.overrideValues({ 'isOnePageOnboardingEnabled': true, }); assertEquals('NEARBY-SHARE-APP', shareAppElement.tagName); assertEquals(null, shareAppElement.$$('.active')); // We have to wait for settings to return from the mojo after which // the app will route to the correct page. await waitAfterNextRender(shareAppElement); assertTrue(isPageActive('onboarding-one')); }); test('changes page on event', async function() { sharedSetup(/*enabled=*/ false, /*isOnboardingComplete=*/ false); assertEquals('NEARBY-SHARE-APP', shareAppElement.tagName); assertEquals(null, shareAppElement.$$('.active')); // We have to wait for settings to return from the mojo after which // the app will route to the correct page. await waitAfterNextRender(shareAppElement); assertTrue(isPageActive('onboarding-one')); shareAppElement.fire('change-page', {page: 'discovery'}); // Discovery page should now be active, other pages should not. assertTrue(isPageActive('discovery')); assertFalse(isPageActive('onboarding-one')); }); }); });
{ "content_hash": "2d8b60e65f79f220c2598dd17e0c6277", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 99, "avg_line_length": 40.82706766917293, "alnum_prop": 0.6946593001841621, "repo_name": "scheib/chromium", "id": "e152f96ec79aedc4819dcd60da02df695a7cb0e4", "size": "5430", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "chrome/test/data/webui/nearby_share/nearby_share_app_test.js", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
Level 1 Python Extra Tree Classifier - NOT USED IN FINAL SUBMISSION ================================================== ## Overview caret based code templates for training and testing models. Includes function to capture training run-time statistics. ## Model Based on sci-kit learn Extra Tree Classifier
{ "content_hash": "57b72a2c33c58ca319995390fa962027", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 78, "avg_line_length": 30.8, "alnum_prop": 0.6655844155844156, "repo_name": "jimthompson5802/kaggle-BNP-Paribas", "id": "37ee273e5e72fb29439d8398516b12ca1fcdb50e", "size": "308", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/L1_xtc1/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "174767" }, { "name": "Python", "bytes": "16828" }, { "name": "R", "bytes": "208548" }, { "name": "Shell", "bytes": "73" } ], "symlink_target": "" }
// This class is exported from the invologgerDll.dll class INVOLOGGERDLL_API CinvologgerDll { public: CinvologgerDll(void); // TODO: add your methods here. }; extern INVOLOGGERDLL_API int ninvologgerDll; INVOLOGGERDLL_API int fninvologgerDll(void); extern "C" __declspec(dllexport) int sdf(void); extern "C" __declspec(dllexport) int GetKey(void); extern "C" __declspec(dllexport) int SetHooks(void); extern "C" __declspec(dllexport) int Unhook(void);
{ "content_hash": "be714f435e1ea3d20ff54520b8222425", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 52, "avg_line_length": 28.058823529411764, "alnum_prop": 0.7274633123689728, "repo_name": "jsidewhite/Invogger", "id": "0f2a440deab09762b9517af80f2c54fd127d9033", "size": "1126", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "invologgerDll/invologgerDll/invologgerDll.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1396" }, { "name": "C#", "bytes": "314134" }, { "name": "C++", "bytes": "7598" }, { "name": "HLSL", "bytes": "9050" }, { "name": "ShaderLab", "bytes": "64604" } ], "symlink_target": "" }
**esp_mqtt** ========== This is MQTT client library for ESP8266, port from: [MQTT client library for Contiki](https://github.com/esar/contiki-mqtt) **Features:** * Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client). * Support multiple connection (to multiple hosts). * **Support SSL connection (max 1024 bit key size)** * Easy to setup and use **Usage** ```c #include "ets_sys.h" #include "driver/uart.h" #include "osapi.h" #include "mqtt.h" #include "wifi.h" #include "config.h" #include "debug.h" #include "gpio.h" #include "user_interface.h" MQTT_Client mqttClient; void wifiConnectCb(uint8_t status) { if(status == STATION_GOT_IP){ MQTT_Connect(&mqttClient); } } void mqttConnectedCb(uint32_t *args) { MQTT_Client* client = (MQTT_Client*)args; INFO("MQTT: Connected\r\n"); MQTT_Subscribe(client, "/mqtt/topic/1", 0); MQTT_Subscribe(client, "/mqtt/topic/2", 0); MQTT_Publish(client, "/mqtt/topic/2", "hello2", 6, 0, 0); MQTT_Publish(client, "/mqtt/topic/1", "hello1", 6, 0, 0); } void mqttDisconnectedCb(uint32_t *args) { MQTT_Client* client = (MQTT_Client*)args; INFO("MQTT: Disconnected\r\n"); } void mqttPublishedCb(uint32_t *args) { MQTT_Client* client = (MQTT_Client*)args; INFO("MQTT: Published\r\n"); } void mqttDataCb(uint32_t *args, const char* topic, uint32_t topic_len, const char *data, uint32_t data_len) { char topicBuf[64], dataBuf[64]; MQTT_Client* client = (MQTT_Client*)args; os_memcpy(topicBuf, topic, topic_len); topicBuf[topic_len] = 0; os_memcpy(dataBuf, data, data_len); dataBuf[data_len] = 0; INFO("MQTT topic: %s, data: %s \r\n", topicBuf, dataBuf); } void user_init(void) { uart_init(BIT_RATE_115200, BIT_RATE_115200); os_delay_us(1000000); CFG_Load(); MQTT_InitConnection(&mqttClient, sysCfg.mqtt_host, sysCfg.mqtt_port, sysCfg.security); MQTT_InitClient(&mqttClient, sysCfg.device_id, sysCfg.mqtt_user, sysCfg.mqtt_pass, sysCfg.mqtt_keepalive); MQTT_OnConnected(&mqttClient, mqttConnectedCb); MQTT_OnDisconnected(&mqttClient, mqttDisconnectedCb); MQTT_OnPublished(&mqttClient, mqttPublishedCb); MQTT_OnData(&mqttClient, mqttDataCb); WIFI_Connect(sysCfg.sta_ssid, sysCfg.sta_pwd, wifiConnectCb); INFO("\r\nSystem started ...\r\n"); } ``` **Publish message and Subscribe** ```c /* TRUE if success */ BOOL MQTT_Subscribe(MQTT_Client *client, char* topic, uint8_t qos); BOOL MQTT_Publish(MQTT_Client *client, const char* topic, const char* data, int data_length, int qos, int retain); ``` **Already support LWT: (Last Will and Testament)*** Setup in **MQTT_InitClient** file ***mqtt.c*** ```c char willTopic[] = "/lwt"; char willMessage[] = "offline"; mqttClient->connect_info.will_topic = willTopic; mqttClient->connect_info.will_message = willMessage; mqttClient->connect_info.will_qos = 0; mqttClient->connect_info.will_retain = 0; ``` **Default configuration** See: *include/user_config.h* and *include/config.c* If you want to load new default configurations, just change the value of CFG_HOLDER in ***include/user_config.h*** Now in the Makefile, it will erase section hold the user configuration at 0x3C000 ```bash flash: firmware/0x00000.bin firmware/0x40000.bin $(PYTHON) $(ESPTOOL) -p $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x3C000 $(BLANKER) 0x40000 firmware/0x40000.bin ``` **Create SSL Self sign** ``` openssl req -x509 -newkey rsa:1024 -keyout key.pem -out cert.pem -days XXX ``` **SSL Mqtt broker for test** ```javascript var mosca = require('mosca') var SECURE_KEY = __dirname + '/key.pem'; var SECURE_CERT = __dirname + '/cert.pem'; var ascoltatore = { //using ascoltatore type: 'mongo', url: 'mongodb://localhost:27017/mqtt', pubsubCollection: 'ascoltatori', mongo: {} }; var moscaSettings = { port: 1880, stats: false, backend: ascoltatore, persistence: { factory: mosca.persistence.Mongo, url: 'mongodb://localhost:27017/mqtt' }, secure : { keyPath: SECURE_KEY, certPath: SECURE_CERT, port: 1883 } }; var server = new mosca.Server(moscaSettings); server.on('ready', setup); server.on('clientConnected', function(client) { console.log('client connected', client.id); }); // fired when a message is received server.on('published', function(packet, client) { console.log('Published', packet.payload); }); // fired when the mqtt server is ready function setup() { console.log('Mosca server is up and running') } ``` **Be careful:** This library is not fully supported for too long messages. **Status:** *Alpha release.* [MQTT Broker for test](https://github.com/mcollina/mosca) [MQTT Client for test](https://chrome.google.com/webstore/detail/mqttlens/hemojaaeigabkbcookmlgmdigohjobjm?hl=en) **Contributing:** ***Feel free to contribute to the project in any way you like!*** **Requried:** esp_iot_sdk_v0.9.4_14_12_19 **Authors:** [Tuan PM](https://twitter.com/TuanPMT) **Donations** Invite me to a coffee [![Donate](https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JR9RVLFC4GE6J) **LICENSE - "MIT License"** Copyright (c) 2014-2015 Tuan PM, https://twitter.com/TuanPMT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "content_hash": "65a651b14293025a2519df3777f0e8aa", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 460, "avg_line_length": 29.729857819905213, "alnum_prop": 0.7208672086720868, "repo_name": "kanflo/esp8266-ghost", "id": "160aa4f10f1ae44958ad2ed6d6bdd72faf3daf1a", "size": "6273", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "esp8266/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "8448" }, { "name": "C", "bytes": "378557" }, { "name": "C++", "bytes": "823" }, { "name": "Makefile", "bytes": "7254" }, { "name": "Objective-C", "bytes": "73333" }, { "name": "Ruby", "bytes": "961" }, { "name": "Shell", "bytes": "12621" } ], "symlink_target": "" }
require File.expand_path('../base/boot', __FILE__) options = {} (server = Cfg[:server]) && (options[:server] = server) (port = Cfg[:port] ) && (options[:port ] = port ) puts App.urlmap App.run options
{ "content_hash": "d4c9576e7b035a2f53896d45f84a2c9a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 54, "avg_line_length": 26, "alnum_prop": 0.6057692307692307, "repo_name": "constellationsoftware/espresso", "id": "ed86c2337ca87e55fffb35843592fffe1b796804", "size": "208", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/base/app.rb", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
whatthechook ============ What The Chook Arduino project - monitoring chook pen.
{ "content_hash": "1da35febd000aa009c436d2f45d2fdcf", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 54, "avg_line_length": 20.5, "alnum_prop": 0.6829268292682927, "repo_name": "gcduino/whatthechook", "id": "db699de4a39c679f9e5764b2b7098455efcc1ee5", "size": "82", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "3153" } ], "symlink_target": "" }
package org.eclipse.om2m.sample.ipe.test_2; import org.eclipse.om2m.commons.constants.Constants; import org.eclipse.om2m.commons.obix.Bool; import org.eclipse.om2m.commons.obix.Contract; import org.eclipse.om2m.commons.obix.Int; import org.eclipse.om2m.commons.obix.Obj; import org.eclipse.om2m.commons.obix.Op; import org.eclipse.om2m.commons.obix.Str; import org.eclipse.om2m.commons.obix.Uri; import org.eclipse.om2m.commons.obix.io.ObixEncoder; public class ObixUtil { public final static int TEMPERATURE_SENSOR_TYPE = 1; public final static int AIR_HUMIDITY_SENSOR_TYPE = 2; public final static int LIGHT_SENSOR_TYPE = 3; public final static int HUMAN_APPEARANCE = 4; public static String getSensorDescriptorRep(String appId, String ipeId) { String prefix = "/" + Constants.CSE_ID + "/" + Constants.CSE_NAME + "/" + appId; Obj obj = new Obj(); Op opGet = new Op(); opGet.setName("GET"); opGet.setHref(new Uri(prefix + "/DATA/la")); opGet.setIs(new Contract("retrieve")); obj.add(opGet); Op opGetDirect = new Op(); opGetDirect.setName("GET(Direct)"); opGetDirect.setHref(new Uri(prefix + "?appId=" + appId + "&op=get")); opGetDirect.setIs(new Contract("execute")); obj.add(opGetDirect); Op switchOn = new Op(); switchOn.setName("switchOn(Direct)"); switchOn.setHref(new Uri(prefix + "?appId=" + appId + "&op=switchOn&timeDelay=0")); switchOn.setIs(new Contract("execute")); obj.add(switchOn); Op switchOff = new Op(); switchOff.setName("switchOff(Direct)"); switchOff.setHref(new Uri(prefix + "?appId=" + appId + "&op=switchOff&timeDelay=0")); switchOff.setIs(new Contract("execute")); obj.add(switchOff); Op timeResponse = new Op(); timeResponse.setName("timeResponse"); timeResponse.setHref(new Uri(prefix + "?appId=" + appId + "&op=timeResponse&timeDelay=5000")); timeResponse.setIs(new Contract("execute")); obj.add(timeResponse); return ObixEncoder.toString(obj); } public static String getActuatorDescriptorRep(String appId, String ipeId) { String prefix = "/" + Constants.CSE_ID + "/" + Constants.CSE_NAME + "/" + appId; Obj obj = new Obj(); Op opGet = new Op(); opGet.setName("GET"); opGet.setHref(new Uri(prefix + "/DATA/la")); opGet.setIs(new Contract("retrieve")); obj.add(opGet); Op opGetDirect = new Op(); opGetDirect.setName("GET(Direct)"); opGetDirect.setHref(new Uri(prefix + "?op=get")); opGetDirect.setIs(new Contract("execute")); obj.add(opGetDirect); Op opON = new Op(); opON.setName("ON"); opON.setHref(new Uri(prefix + "?op=true")); opON.setIs(new Contract("execute")); obj.add(opON); Op opOFF = new Op(); opOFF.setName("OFF"); opOFF.setHref(new Uri(prefix + "?op=false")); opOFF.setIs(new Contract("execute")); obj.add(opOFF); return ObixEncoder.toString(obj); } public static String getActuatorDataRep(boolean value) { Obj obj = new Obj(); obj.add(new Bool("data", value)); return ObixEncoder.toString(obj); } public static String getSensorDataRep(int value, int type, String appId, String ipeId, String clusterId) { Obj obj = new Obj(); obj.add(new Str("appId", appId)); String category = " "; String unit = ""; switch(type){ case TEMPERATURE_SENSOR_TYPE: category = "temperature"; unit = "celsius"; break; case AIR_HUMIDITY_SENSOR_TYPE: category = "air_humidity"; unit = "ratio"; break; case LIGHT_SENSOR_TYPE: category = "light"; unit = "ISO"; break; case HUMAN_APPEARANCE: category = "human_appearance"; unit = "s"; break; } obj.add(new Str("ipeId", ipeId)); obj.add(new Str("clusterId", clusterId)); obj.add(new Str("category", category)); obj.add(new Int("data", value)); obj.add(new Str("unit", unit)); return ObixEncoder.toString(obj); } public static String getDataSubscriber(){ // Obj obj = new Obj(); // obj.add(new Str("su", "http://0.0.0.0:9090/monitor")); // obj.add(new Int("nct", 2)); // return ObixEncoder.toString(obj); String s = "<m2m:sub xmlns:m2m=&quot;http://www.onem2m.org/xml/protocols&quot;>"+ "<nct>2</nct>"+ "<nu>http://0.0.0.0:9090/monitor</nu>"+ "</m2m:sub>"; return s; } public static String getMessage(String message) { Obj obj = new Obj(); obj.add(new Str("message", message)); return ObixEncoder.toString(obj); } }
{ "content_hash": "e0c02f90582fa3f3ccfc71af98578341", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 107, "avg_line_length": 29.828767123287673, "alnum_prop": 0.6711825487944891, "repo_name": "huanpc/IoT-1", "id": "1bdc363da825c63daa31cd2f9bbef91e61c8d2a6", "size": "4355", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docker/oneM2M/CSE_IPE/org.eclipse.om2m.sample.ipe.test_2/src/main/java/org/eclipse/om2m/sample/ipe/test_2/ObixUtil.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "447" }, { "name": "CSS", "bytes": "175618" }, { "name": "HTML", "bytes": "225304" }, { "name": "Java", "bytes": "1746124" }, { "name": "JavaScript", "bytes": "249520" }, { "name": "Python", "bytes": "6778003" }, { "name": "Shell", "bytes": "16840" } ], "symlink_target": "" }
namespace DotSpatial.Data { /// <summary> /// An enumeration listing the various valid shape types supported by Esri Shapefile formats /// </summary> public enum ShapeType : byte { /// <summary> /// 0 - No shape type specified, or the shapetype is invalid /// </summary> NullShape = 0, /// <summary> /// 1 - Each shape is a single point /// </summary> Point = 1, /// <summary> /// 3 - Each shape is a collection of vertices that should be connected to form a striaght line /// </summary> PolyLine = 3, /// <summary> /// 5 - Each shape is a closed linestring /// </summary> Polygon = 5, /// <summary> /// 8 - Each shape consists of severel, unconnected points /// </summary> MultiPoint = 8, /// <summary> /// 11 - Each shape is a point with a Z value /// </summary> PointZ = 11, /// <summary> /// 13 - Each shape is a linestring with each vertex having a z value /// </summary> PolyLineZ = 13, /// <summary> /// 15 - Each shape is a closed linestring with each vertex having a z value /// </summary> PolygonZ = 15, /// <summary> /// 18 - Each shape has several unconnected points, each of which has a z value /// </summary> MultiPointZ = 18, /// <summary> /// 21 - Each shape has several unconnected points, each of which has an m and z value /// </summary> PointM = 21, /// <summary> /// 23 - Each shape is made up of several points connected to form a line, each vertex having an m and z value /// </summary> PolyLineM = 23, /// <summary> /// 25 - Each shape is a closed linestring with each vertex having a z value and m value /// </summary> PolygonM = 25, /// <summary> /// 28 - Each shape has several unconnected points, each of which has a z value and m value /// </summary> MultiPointM = 28, /// <summary> /// 31 - Not sure what this does /// </summary> MultiPatch = 31 } }
{ "content_hash": "9d826cddecf47762b97ce2a8f8a966e6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 118, "avg_line_length": 29.658227848101266, "alnum_prop": 0.5053350405463082, "repo_name": "JasminMarinelli/DotSpatial", "id": "930f02255c1c41b25804a56971d0022969be92ad", "size": "3547", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/DotSpatial.Data/ShapeType.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "1639" }, { "name": "Batchfile", "bytes": "1711" }, { "name": "C#", "bytes": "18026874" }, { "name": "CSS", "bytes": "490" }, { "name": "HTML", "bytes": "8176" }, { "name": "JavaScript", "bytes": "133570" }, { "name": "Smalltalk", "bytes": "645990" }, { "name": "Visual Basic", "bytes": "628617" } ], "symlink_target": "" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE /** * Tag-closer extension for CodeMirror. * * This extension adds an "autoCloseTags" option that can be set to * either true to get the default behavior, or an object to further * configure its behavior. * * These are supported options: * * `whenClosing` (default true) * Whether to autoclose when the '/' of a closing tag is typed. * `whenOpening` (default true) * Whether to autoclose the tag when the final '>' of an opening * tag is typed. * `dontCloseTags` (default is empty tags for HTML, none for XML) * An array of tag names that should not be autoclosed. * `indentTags` (default is block tags for HTML, none for XML) * An array of tag names that should, when opened, cause a * blank line to be added inside the tag, and the blank line and * closing line to be indented. * * See demos/closetag.html for a usage example. */ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../fold/xml-fold")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../fold/xml-fold"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { if (old != CodeMirror.Init && old) cm.removeKeyMap("autoCloseTags"); if (!val) return; var map = {name: "autoCloseTags"}; if (typeof val != "object" || val.whenClosing) map["'/'"] = function(cm) { return autoCloseSlash(cm); }; if (typeof val != "object" || val.whenOpening) map["'>'"] = function(cm) { return autoCloseGT(cm); }; cm.addKeyMap(map); }); var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]; var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; function autoCloseGT(cm) { if (cm.getOption("disableInput")) return CodeMirror.Pass; var ranges = cm.listSelections(), replacements = []; for (var i = 0; i < ranges.length; i++) { if (!ranges[i].empty()) return CodeMirror.Pass; var pos = ranges[i].head, tok = cm.getTokenAt(pos); var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); var tagName = state.tagName; if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); var lowerTagName = tagName.toLowerCase(); // Don't process the '>' at the end of an end-tag or self-closing tag if (!tagName || tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) || tok.type == "tag" && state.type == "closeTag" || tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName /> dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || closingTagExists(cm, tagName, pos, state, true)) return CodeMirror.Pass; var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; replacements[i] = {indent: indent, text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">", newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)}; } for (var i = ranges.length - 1; i >= 0; i--) { var info = replacements[i]; cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+input"); var sel = cm.listSelections().slice(0); sel[i] = {head: info.newPos, anchor: info.newPos}; cm.setSelections(sel); if (info.indent) { cm.indentLine(info.newPos.line, null, true); cm.indentLine(info.newPos.line + 1, null, true); } } } function autoCloseCurrent(cm, typingSlash) { var ranges = cm.listSelections(), replacements = []; var head = typingSlash ? "/" : "</"; for (var i = 0; i < ranges.length; i++) { if (!ranges[i].empty()) return CodeMirror.Pass; var pos = ranges[i].head, tok = cm.getTokenAt(pos); var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" || tok.start != pos.ch - 1)) return CodeMirror.Pass; // Kludge to get around the fact that we are not in XML mode // when completing in JS/CSS snippet in htmlmixed mode. Does not // work for other XML embedded languages (there is no general // way to go from a mixed mode to its current XML state). if (inner.mode.name != "xml") { if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript") replacements[i] = head + "script>"; else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") replacements[i] = head + "style>"; else return CodeMirror.Pass; } else { if (!state.context || !state.context.tagName || closingTagExists(cm, state.context.tagName, pos, state)) return CodeMirror.Pass; replacements[i] = head + state.context.tagName + ">"; } } cm.replaceSelections(replacements, null, '+input'); ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line) cm.indentLine(ranges[i].head.line); } function autoCloseSlash(cm) { if (cm.getOption("disableInput")) return CodeMirror.Pass; return autoCloseCurrent(cm, true); } CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); }; function indexOf(collection, elt) { if (collection.indexOf) return collection.indexOf(elt); for (var i = 0, e = collection.length; i < e; ++i) if (collection[i] == elt) return i; return -1; } // If xml-fold is loaded, we use its functionality to try and verify // whether a given tag is actually unclosed. function closingTagExists(cm, tagName, pos, state, newTag) { if (!CodeMirror.scanForClosingTag) return false; var end = Math.min(cm.lastLine() + 1, pos.line + 500); var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); if (!nextClose || nextClose.tag != tagName) return false; var cx = state.context; // If the immediate wrapping context contains onCx instances of // the same tag, a closing tag only exists if there are at least // that many closing tags of that type following. for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; pos = nextClose.to; for (var i = 1; i < onCx; i++) { var next = CodeMirror.scanForClosingTag(cm, pos, null, end); if (!next || next.tag != tagName) return false; pos = next.to; } return true; } });
{ "content_hash": "bc86e77a9436f056e06ccf2bfc81919f", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 142, "avg_line_length": 45.81325301204819, "alnum_prop": 0.6090729783037475, "repo_name": "zackexplosion/HackMD", "id": "4ab36ccedfa5a571096491cb75f23123becb27e1", "size": "7605", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/vendor/codemirror/addon/edit/closetag.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "826306" }, { "name": "HTML", "bytes": "11257" }, { "name": "JavaScript", "bytes": "153234" }, { "name": "Shell", "bytes": "390" } ], "symlink_target": "" }
import React from 'react'; import SearchBar from '../index'; import { renderWithWrapper } from '../../../.ci/testHelper'; describe('SearchBar wrapper component', () => { it('should match snapshot', () => { const component = renderWithWrapper(<SearchBar />); expect(component).not.toBeNull(); expect(component.toJSON()).toMatchSnapshot(); }); it('should render an iOS SearchBar', () => { const component = renderWithWrapper(<SearchBar platform="ios" />); expect(component).not.toBeNull(); expect(component.toJSON()).toMatchSnapshot(); }); it('should render an Android SearchBar', () => { const component = renderWithWrapper(<SearchBar platform="android" />); expect(component).not.toBeNull(); expect(component.toJSON()).toMatchSnapshot(); }); it('should apply values from theme', () => { const theme = { SearchBar: { placeholder: 'Enter search term', }, }; const component = renderWithWrapper( <SearchBar platform="android" />, '', theme ); expect(component.queryByTestId('RNE__SearchBar').props.placeholder).toBe( 'Enter search term' ); expect(component.toJSON()).toMatchSnapshot(); }); });
{ "content_hash": "d7892c017b84ba1c74cdc619d8b23a19", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 77, "avg_line_length": 30.475, "alnum_prop": 0.6341263330598852, "repo_name": "react-native-community/React-Native-Elements", "id": "297eac853da91cd8e9b1e1b435ec157b96869ebe", "size": "1219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SearchBar/__tests__/SearchBar.test.tsx", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "37088" } ], "symlink_target": "" }
static NSString *BLOCK_ASS_KEY = @"com.pixeltek.BLOCK"; @interface UIActionSheetBlockObj : NSObject @property (copy, nonatomic) void (^action)(UIActionSheet *actionSheet, int buttonIndex); @end @implementation UIActionSheetBlockObj @end @implementation UIActionSheet (Blocks) - (void)setBlock:(void (^)(UIActionSheet *actionSheet, int buttonIndex)) block { [self setDelegate:self]; UIActionSheetBlockObj *obj = objc_getAssociatedObject(self, (__bridge const void *)BLOCK_ASS_KEY); if (!obj) { obj = [UIActionSheetBlockObj new]; obj.action=block; objc_setAssociatedObject(self, (__bridge const void *)BLOCK_ASS_KEY, obj, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } obj.action=block; } - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { UIActionSheetBlockObj *obj = objc_getAssociatedObject(self, (__bridge const void *)BLOCK_ASS_KEY); if (obj.action) { obj.action(self, buttonIndex); } objc_setAssociatedObject(self, (__bridge const void *)BLOCK_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } @end
{ "content_hash": "dcfbe6e0f3b750ff33cf8cc9323414a7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 117, "avg_line_length": 31.97142857142857, "alnum_prop": 0.7176050044682752, "repo_name": "pixeltek/UIAlertView-UIActionSheet-blocks", "id": "6a1ad48da44de7050c3abd37f0d763614243e917", "size": "1318", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UIActionSheet+Blocks.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "274" } ], "symlink_target": "" }
#include <algorithm> #include <cctype> #include <cstdint> #include <memory> #include <string> #include <vector> #include "tests/utils/Gmock.h" #include "tests/utils/Gtest.h" #include <boost/algorithm/string/predicate.hpp> #include "joynr/BrokerUrl.h" #include "joynr/MessagingSettings.h" #include "joynr/MulticastSubscriptionQos.h" #include "joynr/OnChangeSubscriptionQos.h" #include "joynr/PrivateCopyAssign.h" #include "joynr/Settings.h" #include "joynr/tests/testAbstractProvider.h" #include "joynr/tests/testProxy.h" #include "tests/JoynrTest.h" #include "tests/mock/MockLocationUpdatedSelectiveFilter.h" #include "tests/mock/MockSubscriptionListener.h" #include "tests/mock/TestJoynrClusterControllerRuntime.h" #include "tests/utils/MyTestProvider.h" #include "tests/utils/PtrUtils.h" using namespace ::testing; using namespace joynr; static const std::string messagingPropertiesPersistenceFileName1( "End2EndBroadcastTest-runtime1-joynr.persist"); static const std::string messagingPropertiesPersistenceFileName2( "End2EndBroadcastTest-runtime2-joynr.persist"); namespace joynr { class End2EndBroadcastTestBase : public TestWithParam<std::tuple<std::string, std::string>> { public: std::shared_ptr<TestJoynrClusterControllerRuntime> runtime1; std::shared_ptr<TestJoynrClusterControllerRuntime> runtime2; std::string baseUuid; std::string uuid; std::string domainName; std::shared_ptr<Semaphore> semaphore; std::shared_ptr<Semaphore> altSemaphore; joynr::tests::TestLocationUpdateSelectiveBroadcastFilterParameters filterParameters; std::shared_ptr<MockLocationUpdatedSelectiveFilter> filter; std::uint16_t subscribeToAttributeWait; std::uint16_t subscribeToBroadcastWait; joynr::types::Localisation::GpsLocation gpsLocation; joynr::types::Localisation::GpsLocation gpsLocation2; joynr::types::Localisation::GpsLocation gpsLocation3; joynr::types::Localisation::GpsLocation gpsLocation4; End2EndBroadcastTestBase() : runtime1(), runtime2(), baseUuid(util::createUuid()), uuid("_" + baseUuid.substr(1, baseUuid.length() - 2)), domainName("cppEnd2EndBroadcastTest_Domain" + uuid), semaphore(std::make_shared<Semaphore>(0)), altSemaphore(std::make_shared<Semaphore>(0)), filter(std::make_shared<MockLocationUpdatedSelectiveFilter>()), subscribeToAttributeWait(2000), subscribeToBroadcastWait(2000), gpsLocation(types::Localisation::GpsLocation()), gpsLocation2(types::Localisation::GpsLocation(9.0, 51.0, 508.0, types::Localisation::GpsFixEnum::MODE2D, 0.0, 0.0, 0.0, 0.0, 444, 444, 2)), gpsLocation3(types::Localisation::GpsLocation(9.0, 51.0, 508.0, types::Localisation::GpsFixEnum::MODE2D, 0.0, 0.0, 0.0, 0.0, 444, 444, 3)), gpsLocation4(types::Localisation::GpsLocation(9.0, 51.0, 508.0, types::Localisation::GpsFixEnum::MODE2D, 0.0, 0.0, 0.0, 0.0, 444, 444, 4)), providerParticipantId(), integration1Settings("test-resources/libjoynrSystemIntegration1.settings"), integration2Settings("test-resources/libjoynrSystemIntegration2.settings") { auto settings1 = std::make_unique<Settings>(std::get<0>(GetParam())); auto settings2 = std::make_unique<Settings>(std::get<1>(GetParam())); MessagingSettings messagingSettings1(*settings1); MessagingSettings messagingSettings2(*settings2); messagingSettings1.setMessagingPropertiesPersistenceFilename( messagingPropertiesPersistenceFileName1); messagingSettings2.setMessagingPropertiesPersistenceFilename( messagingPropertiesPersistenceFileName2); Settings::merge(integration1Settings, *settings1, false); runtime1 = std::make_shared<TestJoynrClusterControllerRuntime>( std::move(settings1), failOnFatalRuntimeError); runtime1->init(); Settings::merge(integration2Settings, *settings2, false); runtime2 = std::make_shared<TestJoynrClusterControllerRuntime>( std::move(settings2), failOnFatalRuntimeError); runtime2->init(); filterParameters.setCountry("Germany"); filterParameters.setStartTime("4.00 pm"); runtime1->start(); runtime2->start(); } ~End2EndBroadcastTestBase() override { if (!providerParticipantId.empty()) { unregisterProvider(); } runtime1->shutdown(); runtime2->shutdown(); test::util::resetAndWaitUntilDestroyed(runtime1); test::util::resetAndWaitUntilDestroyed(runtime2); // Delete persisted files test::util::removeAllCreatedSettingsAndPersistencyFiles(); } private: std::string providerParticipantId; Settings integration1Settings; Settings integration2Settings; DISALLOW_COPY_AND_ASSIGN(End2EndBroadcastTestBase); protected: std::shared_ptr<MyTestProvider> registerProvider() { return registerProvider(runtime1); } void unregisterProvider() { return runtime1->unregisterProvider(providerParticipantId); } std::shared_ptr<MyTestProvider> registerProvider( std::shared_ptr<TestJoynrClusterControllerRuntime> runtime) { auto testProvider = std::make_shared<MyTestProvider>(); constexpr bool persist{true}; constexpr bool awaitGlobalRegistration{true}; types::ProviderQos providerQos; std::chrono::milliseconds millisSinceEpoch = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch()); providerQos.setPriority(millisSinceEpoch.count()); providerQos.setScope(joynr::types::ProviderScope::GLOBAL); providerQos.setSupportsOnChangeSubscriptions(true); providerParticipantId = runtime->registerProvider<tests::testProvider>( domainName, testProvider, providerQos, persist, awaitGlobalRegistration); return testProvider; } std::shared_ptr<tests::testProxy> buildProxy() { return buildProxy(runtime2); } std::shared_ptr<tests::testProxy> buildProxy( std::shared_ptr<TestJoynrClusterControllerRuntime> runtime) { std::shared_ptr<ProxyBuilder<tests::testProxy>> testProxyBuilder = runtime->createProxyBuilder<tests::testProxy>(domainName); DiscoveryQos discoveryQos; discoveryQos.setArbitrationStrategy(DiscoveryQos::ArbitrationStrategy::HIGHEST_PRIORITY); discoveryQos.setDiscoveryTimeoutMs(30000); discoveryQos.setRetryIntervalMs(500); std::uint64_t qosRoundTripTTL = 40000; std::shared_ptr<tests::testProxy> testProxy( testProxyBuilder->setMessagingQos(MessagingQos(qosRoundTripTTL)) ->setDiscoveryQos(discoveryQos) ->build()); return testProxy; } template <typename FireBroadcast, typename SubscribeTo, typename UnsubscribeFrom, typename T> void testOneShotBroadcastSubscription(const T& expectedValue, SubscribeTo subscribeTo, UnsubscribeFrom unsubscribeFrom, FireBroadcast fireBroadcast) { auto mockListener = std::make_shared<MockSubscriptionListenerOneType<T>>(); // Use a semaphore to count and wait on calls to the mock listener EXPECT_CALL(*mockListener, onReceive(Eq(expectedValue))) .WillOnce(ReleaseSemaphore(semaphore)); testOneShotBroadcastSubscription( mockListener, subscribeTo, unsubscribeFrom, fireBroadcast, expectedValue); } template <typename SubscriptionListener, typename FireBroadcast, typename SubscribeTo, typename UnsubscribeFrom, typename... T> void testOneShotBroadcastSubscription(SubscriptionListener subscriptionListener, SubscribeTo subscribeTo, UnsubscribeFrom unsubscribeFrom, FireBroadcast fireBroadcast, T... expectedValues) { std::vector<std::string> partitions({}); // TODO test with real partitions std::shared_ptr<MyTestProvider> testProvider = registerProvider(); std::shared_ptr<tests::testProxy> testProxy = buildProxy(); auto subscriptionQos = std::make_shared<MulticastSubscriptionQos>(); subscriptionQos->setValidityMs(500000); std::string subscriptionId; subscribeTo(testProxy.get(), subscriptionListener, subscriptionQos, subscriptionId); delayForMqttSubscribeOrUnsubscribe(); (*testProvider.*fireBroadcast)(expectedValues..., partitions); // Wait for a subscription message to arrive ASSERT_TRUE(semaphore->waitFor(std::chrono::seconds(3))); unsubscribeFrom(testProxy.get(), subscriptionId); delayForMqttSubscribeOrUnsubscribe(); } template <typename BroadcastFilter> void addFilterToTestProvider(std::shared_ptr<MyTestProvider> testProvider, std::shared_ptr<BroadcastFilter> filter) { if (filter) { testProvider->addBroadcastFilter(filter); } } void addFilterToTestProvider(std::shared_ptr<MyTestProvider> testProvider, std::nullptr_t filter) { std::ignore = testProvider; std::ignore = filter; } template <typename SubscriptionListener, typename FireBroadcast, typename SubscribeTo, typename UnsubscribeFrom, typename BroadcastFilterPtr, typename... T> void testOneShotBroadcastSubscriptionWithFiltering(SubscriptionListener subscriptionListener, SubscribeTo subscribeTo, UnsubscribeFrom unsubscribeFrom, FireBroadcast fireBroadcast, BroadcastFilterPtr filter, T... expectedValues) { std::shared_ptr<MyTestProvider> testProvider = registerProvider(); addFilterToTestProvider(testProvider, filter); std::shared_ptr<tests::testProxy> testProxy = buildProxy(); std::int64_t minInterval_ms = 50; std::string subscriptionId; auto subscriptionQos = std::make_shared<OnChangeSubscriptionQos>(500000, // validity_ms 1000, // publication ttl minInterval_ms); // minInterval_ms subscribeTo(testProxy.get(), subscriptionListener, subscriptionQos, subscriptionId); (*testProvider.*fireBroadcast)(expectedValues...); // Wait for a subscription message to arrive ASSERT_TRUE(semaphore->waitFor(std::chrono::seconds(3))); unsubscribeFrom(testProxy.get(), subscriptionId); } void delayForMqttSubscribeOrUnsubscribe() { // wait some time so that MQTT subscribe/unsubscribe can be // executed by MQTT client and MQTT broker std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } }; } // namespace joynr
{ "content_hash": "23ac8ddefaae38728f3b9cc16251c653", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 100, "avg_line_length": 42.44514106583072, "alnum_prop": 0.5617429837518464, "repo_name": "bmwcarit/joynr", "id": "6b81c5412a9f36c9bdd07a5fb0fb189b568f73d8", "size": "14166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cpp/tests/systemintegration-tests/End2EndBroadcastTestBase.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AIDL", "bytes": "110" }, { "name": "C", "bytes": "3087" }, { "name": "C++", "bytes": "4799115" }, { "name": "CMake", "bytes": "184499" }, { "name": "Dockerfile", "bytes": "51887" }, { "name": "Gnuplot", "bytes": "2344" }, { "name": "Handlebars", "bytes": "1549" }, { "name": "Java", "bytes": "5967524" }, { "name": "JavaScript", "bytes": "37186" }, { "name": "Kotlin", "bytes": "23721" }, { "name": "Python", "bytes": "36320" }, { "name": "Rust", "bytes": "10592" }, { "name": "Shell", "bytes": "268527" }, { "name": "TypeScript", "bytes": "1803452" }, { "name": "Xtend", "bytes": "539488" } ], "symlink_target": "" }
import Cartesian2 from "../Core/Cartesian2.js"; import Check from "../Core/Check.js"; import defined from "../Core/defined.js"; import defaultValue from "../Core/defaultValue.js"; import destroyObject from "../Core/destroyObject.js"; import DeveloperError from "../Core/DeveloperError.js"; import OctahedralProjectedCubeMap from "./OctahedralProjectedCubeMap.js"; /** * Properties for managing image-based lighting on tilesets and models. * Also manages the necessary resources and textures. * <p> * If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called * when the image-based lighting is no longer needed to clean up GPU resources properly. * If a model or tileset creates an instance of ImageBasedLighting, it will handle this. * Otherwise, the application is responsible for calling destroy(). *</p> * * @alias ImageBasedLighting * @constructor * * @param {Cartesian2} [options.imageBasedLightingFactor=Cartesian2(1.0, 1.0)] Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. * @param {Number} [options.luminanceAtZenith=0.2] The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. * @param {Cartesian3[]} [options.sphericalHarmonicCoefficients] The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. * @param {String} [options.specularEnvironmentMaps] A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. */ function ImageBasedLighting(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); const imageBasedLightingFactor = defined(options.imageBasedLightingFactor) ? Cartesian2.clone(options.imageBasedLightingFactor) : new Cartesian2(1.0, 1.0); //>>includeStart('debug', pragmas.debug); Check.typeOf.object( "options.imageBasedLightingFactor", imageBasedLightingFactor ); Check.typeOf.number.greaterThanOrEquals( "options.imageBasedLightingFactor.x", imageBasedLightingFactor.x, 0.0 ); Check.typeOf.number.lessThanOrEquals( "options.imageBasedLightingFactor.x", imageBasedLightingFactor.x, 1.0 ); Check.typeOf.number.greaterThanOrEquals( "options.imageBasedLightingFactor.y", imageBasedLightingFactor.y, 0.0 ); Check.typeOf.number.lessThanOrEquals( "options.imageBasedLightingFactor.y", imageBasedLightingFactor.y, 1.0 ); //>>includeEnd('debug'); this._imageBasedLightingFactor = imageBasedLightingFactor; const luminanceAtZenith = defaultValue(options.luminanceAtZenith, 0.2); //>>includeStart('debug', pragmas.debug); Check.typeOf.number("options.luminanceAtZenith", luminanceAtZenith); //>>includeEnd('debug'); this._luminanceAtZenith = luminanceAtZenith; const sphericalHarmonicCoefficients = options.sphericalHarmonicCoefficients; //>>includeStart('debug', pragmas.debug); if ( defined(sphericalHarmonicCoefficients) && (!Array.isArray(sphericalHarmonicCoefficients) || sphericalHarmonicCoefficients.length !== 9) ) { throw new DeveloperError( "options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values." ); } //>>includeEnd('debug'); this._sphericalHarmonicCoefficients = sphericalHarmonicCoefficients; // The specular environment map texture is created in update(); this._specularEnvironmentMaps = options.specularEnvironmentMaps; this._specularEnvironmentMapAtlas = undefined; this._specularEnvironmentMapAtlasDirty = true; this._specularEnvironmentMapLoaded = false; this._previousSpecularEnvironmentMapLoaded = false; this._useDefaultSpecularMaps = false; this._useDefaultSphericalHarmonics = false; this._shouldRegenerateShaders = false; // Store the previous frame number to prevent redundant update calls this._previousFrameNumber = undefined; // Keeps track of the last values for use during update logic this._previousImageBasedLightingFactor = Cartesian2.clone( imageBasedLightingFactor ); this._previousLuminanceAtZenith = luminanceAtZenith; this._previousSphericalHarmonicCoefficients = sphericalHarmonicCoefficients; } Object.defineProperties(ImageBasedLighting.prototype, { /** * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. * This cartesian is used to scale the final diffuse and specular lighting * contribution from those sources to the final color. A value of 0.0 will * disable those light sources. * * @memberof ImageBasedLighting.prototype * * @type {Cartesian2} * @default Cartesian2(1.0, 1.0) */ imageBasedLightingFactor: { get: function () { return this._imageBasedLightingFactor; }, set: function (value) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("imageBasedLightingFactor", value); Check.typeOf.number.greaterThanOrEquals( "imageBasedLightingFactor.x", value.x, 0.0 ); Check.typeOf.number.lessThanOrEquals( "imageBasedLightingFactor.x", value.x, 1.0 ); Check.typeOf.number.greaterThanOrEquals( "imageBasedLightingFactor.y", value.y, 0.0 ); Check.typeOf.number.lessThanOrEquals( "imageBasedLightingFactor.y", value.y, 1.0 ); //>>includeEnd('debug'); this._previousImageBasedLightingFactor = Cartesian2.clone( this._imageBasedLightingFactor, this._previousImageBasedLightingFactor ); this._imageBasedLightingFactor = Cartesian2.clone( value, this._imageBasedLightingFactor ); }, }, /** * The sun's luminance at the zenith in kilo candela per meter squared * to use for this model's procedural environment map. This is used when * {@link ImageBasedLighting#specularEnvironmentMaps} and {@link ImageBasedLighting#sphericalHarmonicCoefficients} * are not defined. * * @memberof ImageBasedLighting.prototype * * @type {Number} * @default 0.2 */ luminanceAtZenith: { get: function () { return this._luminanceAtZenith; }, set: function (value) { this._previousLuminanceAtZenith = this._luminanceAtZenith; this._luminanceAtZenith = value; }, }, /** * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance * computed from the atmosphere color is used. * <p> * There are nine <code>Cartesian3</code> coefficients. * The order of the coefficients is: L<sub>0,0</sub>, L<sub>1,-1</sub>, L<sub>1,0</sub>, L<sub>1,1</sub>, L<sub>2,-2</sub>, L<sub>2,-1</sub>, L<sub>2,0</sub>, L<sub>2,1</sub>, L<sub>2,2</sub> * </p> * * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be * supplied to {@link Model#specularEnvironmentMaps}. * * @memberof ImageBasedLighting.prototype * * @type {Cartesian3[]} * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo} * @see {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf|An Efficient Representation for Irradiance Environment Maps} */ sphericalHarmonicCoefficients: { get: function () { return this._sphericalHarmonicCoefficients; }, set: function (value) { //>>includeStart('debug', pragmas.debug); if (defined(value) && (!Array.isArray(value) || value.length !== 9)) { throw new DeveloperError( "sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values." ); } //>>includeEnd('debug'); this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients; this._sphericalHarmonicCoefficients = value; }, }, /** * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. * * @memberof ImageBasedLighting.prototype * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo} * @type {String} * @see ImageBasedLighting#sphericalHarmonicCoefficients */ specularEnvironmentMaps: { get: function () { return this._specularEnvironmentMaps; }, set: function (value) { if (value !== this._specularEnvironmentMaps) { this._specularEnvironmentMapAtlasDirty = this._specularEnvironmentMapAtlasDirty || value !== this._specularEnvironmentMaps; this._specularEnvironmentMapLoaded = false; } this._specularEnvironmentMaps = value; }, }, /** * Whether or not image-based lighting is enabled. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ enabled: { get: function () { return ( this._imageBasedLightingFactor.x > 0.0 || this._imageBasedLightingFactor.y > 0.0 ); }, }, /** * Whether or not the models that use this lighting should regenerate their shaders, * based on the properties and resources have changed. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ shouldRegenerateShaders: { get: function () { return this._shouldRegenerateShaders; }, }, /** * Whether or not to use the default spherical harmonic coefficients. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ useDefaultSphericalHarmonics: { get: function () { return this._useDefaultSphericalHarmonics; }, }, /** * Whether or not the image-based lighting settings use spherical harmonic coefficients. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ useSphericalHarmonicCoefficients: { get: function () { return ( defined(this._sphericalHarmonicCoefficients) || this._useDefaultSphericalHarmonics ); }, }, /** * The texture atlas for the specular environment maps. * * @memberof ImageBasedLighting.prototype * @type {OctahedralProjectedCubeMap} * * @private */ specularEnvironmentMapAtlas: { get: function () { return this._specularEnvironmentMapAtlas; }, }, /** * Whether or not to use the default specular environment maps. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ useDefaultSpecularMaps: { get: function () { return this._useDefaultSpecularMaps; }, }, /** * Whether or not the image-based lighting settings use specular environment maps. * * @memberof ImageBasedLighting.prototype * @type {Boolean} * * @private */ useSpecularEnvironmentMaps: { get: function () { return ( (defined(this._specularEnvironmentMapAtlas) && this._specularEnvironmentMapAtlas.ready) || this._useDefaultSpecularMaps ); }, }, }); function createSpecularEnvironmentMapAtlas(imageBasedLighting, context) { if (!OctahedralProjectedCubeMap.isSupported(context)) { return; } imageBasedLighting._specularEnvironmentMapAtlas = imageBasedLighting._specularEnvironmentMapAtlas && imageBasedLighting._specularEnvironmentMapAtlas.destroy(); if (defined(imageBasedLighting._specularEnvironmentMaps)) { const atlas = new OctahedralProjectedCubeMap( imageBasedLighting._specularEnvironmentMaps ); imageBasedLighting._specularEnvironmentMapAtlas = atlas; atlas.readyPromise .then(function () { imageBasedLighting._specularEnvironmentMapLoaded = true; }) .catch(function (error) { console.error(`Error loading specularEnvironmentMaps: ${error}`); }); } // Regenerate shaders so they do not use an environment map. // Will be set to true again if there was a new environment map and it is ready. imageBasedLighting._shouldRegenerateShaders = true; } ImageBasedLighting.prototype.update = function (frameState) { if (frameState.frameNumber === this._previousFrameNumber) { return; } this._previousFrameNumber = frameState.frameNumber; const context = frameState.context; frameState.brdfLutGenerator.update(frameState); this._shouldRegenerateShaders = false; const iblFactor = this._imageBasedLightingFactor; const previousIBLFactor = this._previousImageBasedLightingFactor; if (!Cartesian2.equals(iblFactor, previousIBLFactor)) { this._shouldRegenerateShaders = (iblFactor.x > 0.0 && previousIBLFactor.x === 0.0) || (iblFactor.x === 0.0 && previousIBLFactor.x > 0.0); this._shouldRegenerateShaders = this._shouldRegenerateShaders || (iblFactor.y > 0.0 && previousIBLFactor.y === 0.0) || (iblFactor.y === 0.0 && previousIBLFactor.y > 0.0); this._previousImageBasedLightingFactor = Cartesian2.clone( this._imageBasedLightingFactor, this._previousImageBasedLightingFactor ); } if (this._luminanceAtZenith !== this._previousLuminanceAtZenith) { this._shouldRegenerateShaders = this._shouldRegenerateShaders || defined(this._luminanceAtZenith) !== defined(this._previousLuminanceAtZenith); this._previousLuminanceAtZenith = this._luminanceAtZenith; } if ( this._previousSphericalHarmonicCoefficients !== this._sphericalHarmonicCoefficients ) { this._shouldRegenerateShaders = this._shouldRegenerateShaders || defined(this._previousSphericalHarmonicCoefficients) !== defined(this._sphericalHarmonicCoefficients); this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients; } this._shouldRegenerateShaders = this._shouldRegenerateShaders || this._previousSpecularEnvironmentMapLoaded !== this._specularEnvironmentMapLoaded; this._previousSpecularEnvironmentMapLoaded = this._specularEnvironmentMapLoaded; if (this._specularEnvironmentMapAtlasDirty) { createSpecularEnvironmentMapAtlas(this, context); this._specularEnvironmentMapAtlasDirty = false; } if (defined(this._specularEnvironmentMapAtlas)) { this._specularEnvironmentMapAtlas.update(frameState); } const recompileWithDefaultAtlas = !defined(this._specularEnvironmentMapAtlas) && defined(frameState.specularEnvironmentMaps) && !this._useDefaultSpecularMaps; const recompileWithoutDefaultAtlas = !defined(frameState.specularEnvironmentMaps) && this._useDefaultSpecularMaps; const recompileWithDefaultSHCoeffs = !defined(this._sphericalHarmonicCoefficients) && defined(frameState.sphericalHarmonicCoefficients) && !this._useDefaultSphericalHarmonics; const recompileWithoutDefaultSHCoeffs = !defined(frameState.sphericalHarmonicCoefficients) && this._useDefaultSphericalHarmonics; this._shouldRegenerateShaders = this._shouldRegenerateShaders || recompileWithDefaultAtlas || recompileWithoutDefaultAtlas || recompileWithDefaultSHCoeffs || recompileWithoutDefaultSHCoeffs; this._useDefaultSpecularMaps = !defined(this._specularEnvironmentMapAtlas) && defined(frameState.specularEnvironmentMaps); this._useDefaultSphericalHarmonics = !defined(this._sphericalHarmonicCoefficients) && defined(frameState.sphericalHarmonicCoefficients); }; /** * Returns true if this object was destroyed; otherwise, false. * <br /><br /> * If this object was destroyed, it should not be used; calling any function other than * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. * * @returns {Boolean} True if this object was destroyed; otherwise, false. * * @see ImageBasedLighting#destroy * @private */ ImageBasedLighting.prototype.isDestroyed = function () { return false; }; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic * release of WebGL resources, instead of relying on the garbage collector to destroy this object. * <br /><br /> * Once an object is destroyed, it should not be used; calling any function other than * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, * assign the return value (<code>undefined</code>) to the object as done in the example. * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example * imageBasedLighting = imageBasedLighting && imageBasedLighting.destroy(); * * @see ImageBasedLighting#isDestroyed * @private */ ImageBasedLighting.prototype.destroy = function () { this._specularEnvironmentMapAtlas = this._specularEnvironmentMapAtlas && this._specularEnvironmentMapAtlas.destroy(); return destroyObject(this); }; export default ImageBasedLighting;
{ "content_hash": "1ab6248f0ead5858f416b401d79fac9e", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 193, "avg_line_length": 33.449019607843134, "alnum_prop": 0.7122340113722961, "repo_name": "CesiumGS/cesium", "id": "efbd2e00cd819d7a655078f0b4a33a3ce6d178c6", "size": "17059", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/engine/Source/Scene/ImageBasedLighting.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "54077" }, { "name": "GLSL", "bytes": "396894" }, { "name": "HTML", "bytes": "1763626" }, { "name": "Handlebars", "bytes": "2480" }, { "name": "JavaScript", "bytes": "20974134" }, { "name": "Python", "bytes": "4899" }, { "name": "Shell", "bytes": "1570" }, { "name": "TypeScript", "bytes": "11035" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <PreferenceCategory android:title="Custom" android:key="category"> <SwitchPreference android:title="Consistant Notification" android:summary="Notification will always be on the Notification center for easy and fast action." /> <SwitchPreference android:title="Custom Message" android:key="Custom Message" android:summary="Edit the unique message of your notification? " android:defaultValue="false"/> <EditTextPreference android:title="Tap to Edit Message." android:key="customMessage" android:dependency="Custom Message" android:defaultValue="Record your experiences, update your journal." android:persistent="true" android:dialogTitle="Costomize your notification."/> </PreferenceCategory> </PreferenceScreen>
{ "content_hash": "5ad8f40558678fd1101896f4a955f544", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 110, "avg_line_length": 44.625, "alnum_prop": 0.6209150326797386, "repo_name": "rtomyj/Animus", "id": "1a7ba5d348146ac03b29c0634226855c73d3b058", "size": "1071", "binary": false, "copies": "1", "ref": "refs/heads/v2.3", "path": "Diary/res/xml/notifications_settings.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "384027" } ], "symlink_target": "" }
const { Client } = require('@elastic/elasticsearch') const client = new Client(config.elasticSearch) let bulkUpdates = {} module.exports = { ensureIndexes: async function (updateSettings) { // await client.indices.delete({index: 'import'}) // imports index let exists = await client.indices.exists({index: 'import'}) if (!exists || !exists.body) { await client.indices.create({index: 'import'}) } if (updateSettings) { await client.indices.close({index: 'import'}) await client.indices.putSettings({index: 'import', body: { analysis: { analyzer: { default_search: { tokenizer: 'standard', filter: [ 'lowercase', 'word_delimiter' ] } } }}}) await client.indices.open({index: 'import'}) } await client.indices.putMapping({index: 'import', body: { properties: { id: {type: 'text', index: false}, name: {type: 'text'}, slug: {type: 'text'}, domain: {type: 'short'}, description: {type: 'text'}, categories: {type: 'keyword'}, categoriesRoot: {type: 'short'}, categoriesTotal: {type: 'short'}, expansion: {type: 'byte'}, installs: {type: 'integer'}, stars: {type: 'integer'}, views: {type: 'integer'}, viewsThisWeek: {type: 'integer'}, comments: {type: 'integer'}, installScore: {type: 'half_float'}, starScore: {type: 'half_float'}, viewsScore: {type: 'half_float'}, thumbnail: {type: 'text', index: false}, thumbnailStatic: {type: 'text', index: false}, timestamp: {type: 'integer'}, hidden: {type: 'boolean'}, type: {type: 'keyword'}, restrictions: {type: 'keyword'}, userId: {type: 'keyword'}, userName: {type: 'text', index: false}, userAvatar: {type: 'text', index: false}, userClass: {type: 'text', index: false}, userLinked: {type: 'boolean', index: false} } }}) // code index exists = await client.indices.exists({index: 'code'}) if (!exists || !exists.body) { await client.indices.create({index: 'code'}) } await client.indices.putMapping({index: 'code', body: { properties: { id: {type: 'text', index: false}, name: {type: 'text', index: false}, domain: {type: 'short'}, versionString: {type: 'text', index: false}, code: {type: 'text'}, expansion: {type: 'byte'}, timestamp: {type: 'integer'}, hidden: {type: 'boolean'}, type: {type: 'keyword'}, restrictions: {type: 'keyword'}, userId: {type: 'keyword'}, userName: {type: 'text', index: false}, userAvatar: {type: 'text', index: false}, userClass: {type: 'text', index: false}, userLinked: {type: 'boolean', index: false} } }}) // await client.indices.delete({index: 'comment'}) exists = await client.indices.exists({index: 'comment'}) if (!exists || !exists.body) { await client.indices.create({index: 'comment'}) } await client.indices.putMapping({index: 'comment', body: { properties: { id: {type: 'keyword'}, text: {type: 'text'}, timestamp: {type: 'integer'}, hidden: {type: 'boolean'}, taggedIDs: {type: 'keyword'}, importName: {type: 'text', index: false}, importID: {type: 'keyword'}, userId: {type: 'keyword'}, userName: {type: 'text', index: false}, userAvatar: {type: 'text', index: false}, userClass: {type: 'text', index: false}, userLinked: {type: 'boolean', index: false} } }}) // console.log(JSON.stringify((await client.indices.getMapping({index: 'import'})).body, null, 2)) // console.log(JSON.stringify((await client.indices.getSettings({index: 'import'})).body, null, 2)) // console.log(JSON.stringify((await client.indices.stats({index: 'import'})).body, null, 2)) }, addDoc: async function (index, doc, syncing) { if (!bulkUpdates[index]) { bulkUpdates[index] = {docs: [], timeout: null} } if (!syncing) { for (let i = 0; i < bulkUpdates[index].docs.length; i++) { if (bulkUpdates[index].docs[i].id === doc.id) { bulkUpdates[index].docs[i] = doc return this.checkBulk(index) } } } bulkUpdates[index].docs.push({index: {_index: index, _id: doc.id}}) bulkUpdates[index].docs.push(doc) this.checkBulk(index) }, removeDoc: async function (index, id) { if (!bulkUpdates[index]) { bulkUpdates[index] = {docs: [], timeout: null} } bulkUpdates[index].docs.push({delete: {_index: index, _id: id}}) this.checkBulk(index) }, checkBulk: async function (index) { if (bulkUpdates[index].docs.length >= 1000) { clearTimeout(bulkUpdates[index].timeout) bulkUpdates[index].timeout = null this.bulkProcessing(index) } else if (!bulkUpdates[index].timeout && bulkUpdates[index].docs.length) { bulkUpdates[index].timeout = setTimeout(() => { this.bulkProcessing(index) bulkUpdates[index].timeout = null }, 30000) } }, bulkProcessing: async function (index) { try { const bulkResponse = (await client.bulk({ refresh: true, body: bulkUpdates[index].docs })).body if (bulkResponse.errors) { const erroredDocuments = [] bulkResponse.items.forEach((action, i) => { const operation = Object.keys(action)[0] if (action[operation].error) { erroredDocuments.push(action) } }) console.log('ELASTIC ERRORS', JSON.stringify(erroredDocuments, null, 2)) } else { bulkUpdates[index].docs = [] } } catch (e) { console.log(e) } this.checkBulk(index) }, search: async function (o) { const resultsPerPage = 25 let results = [] if (o.algorithm === 'popular') { results = await client.search({ index: o.index, body: { query: { function_score: { query: { bool: o.query, }, functions: [ {gauss: { timestamp: { origin: Date.now() / 1000, scale: 86400 * 120, offset: 86400 * 75, decay : 0.25 } }}, // {field_value_factor: {field: "installScore", missing: 0, factor: 8}}, {field_value_factor: {field: "starScore", missing: 0, factor: 6}}, {field_value_factor: {field: "viewsScore", missing: 0, modifier: "ln1p", factor: 1}}, {field_value_factor: {field: "ageScore", missing: 0, modifier: "ln1p", factor: .01}}, {field_value_factor: {field: "installs", missing: 0, modifier: "ln1p", factor: .05}}, {field_value_factor: {field: "stars", missing: 0, modifier: "ln1p", factor: .05}}, {field_value_factor: {field: "viewsThisWeek", missing: 0, modifier: "ln1p", factor: .01}}, ], score_mode: "sum" } }, sort: o.sort || ['_score'], size: resultsPerPage, from: resultsPerPage * (o.page || 0) } }) } else { results = await client.search({ index: o.index, body: { query: { bool: o.query, }, sort: o.sort || ['_score'], size: resultsPerPage, from: resultsPerPage * (o.page || 0) } }) } try { return {hits: results.body.hits.hits.map(d => Object.assign(d._source, {_score: d._score})), total: results.body.hits.total.value, query: o.textQuery, index: o.index} } catch (e) { console.log(e) return {hits: [], total: 0, query: o.query} } } }
{ "content_hash": "d130a9238682f1a27172775a3cce8fda", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 172, "avg_line_length": 33.55833333333333, "alnum_prop": 0.533772038738515, "repo_name": "oratory/wago.io", "id": "0a03fdedfb091ea985b7b68ad6cbb20ba70b5017", "size": "8054", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/api/helpers/elasticsearch.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19410" }, { "name": "HTML", "bytes": "2173" }, { "name": "JavaScript", "bytes": "922841" }, { "name": "Lua", "bytes": "10713584" }, { "name": "SCSS", "bytes": "8150" }, { "name": "Vue", "bytes": "979954" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>plouffe: 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.10.2 / plouffe - 1.0.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> plouffe <small> 1.0.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-03-01 03:55:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-03-01 03:55:52 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.10.2 Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Laurent.Thery@inria.fr&quot; homepage: &quot;https://github.com/thery/Plouffe&quot; bug-reports: &quot;https://github.com/thery/Plouffe/issues&quot; license: &quot;MIT&quot; build: [ [&quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot;] ] install: [make &quot;install&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.4pl4&quot;} &quot;coq-ssreflect&quot; &quot;coq-coquelicot&quot; {= &quot;2.0.1&quot;} ] tags: [ &quot;logpath:Plouffe&quot; ] synopsis: &quot;A Coq formalization of Plouffe formula&quot; authors: &quot;Laurent Thery&quot; url { src: &quot;https://github.com/thery/Plouffe/archive/v1.0.0.tar.gz&quot; checksum: &quot;md5=b877d0f05c0264b4684664d6cc090829&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-plouffe.1.0.0 coq.8.10.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.2). The following dependencies couldn&#39;t be met: - coq-plouffe -&gt; coq-ssreflect -&gt; coq &lt; 8.5~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-plouffe.1.0.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"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </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": "759af85c666ed66dfb4fdd7204affe1d", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 157, "avg_line_length": 38.8780487804878, "alnum_prop": 0.5233688833124216, "repo_name": "coq-bench/coq-bench.github.io", "id": "91f8711c2e763ab50fd4f476f638bbac2a3a2246", "size": "6378", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.0-2.0.5/released/8.10.2/plouffe/1.0.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> <glossary id="Glossary"> <glossdiv> <title>A</title> <glossentry> <glossterm>ACPI</glossterm> <glossdef> <para>Advanced Configuration and Power Interface, une spécification de l'industrie pour BIOS et extensions matérielles pour configurer le matériel PC et gérer l'alimentation. Windows 2000 et ultérieur ainsi que Linux 2.4 et ultérieur supportent ACPI. Windows ne peut activer/désactiver le support ACPI qu'à l'installation.</para> </glossdef> </glossentry> <glossentry> <glossterm>AHCI</glossterm> <glossdef> <para>Advanced Host Controller Interface, l'interface qui supporte les périphériques SATA tel que les disques durs. Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>AMD-V</glossterm> <glossdef> <para>La capacité de virtualisation matérielle implémentée dans les processeurs AMD récents. Voir <xref linkend="hwvirt" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>API</glossterm> <glossdef> <para>Application Programming Interface.</para> </glossdef> </glossentry> <glossentry> <glossterm>APIC</glossterm> <glossdef> <para>Advanced Programmable Interrupt Controller, une version plus récente de l'ancienne PIC (programmable interrupt controller). La plupart des CPUs récents incorporent un APIC ("local APIC"). Beaucoup de systèmes intègrent aussi un I/O APIC (input output APIC) dans une puce à part qui fournit plus de 16 IRQs. Windows 2000 et ultérieur utilise un noyau différent si il est détecté un I/O APIC à l'installation. De ce fait un I/O APIC ne doit pas être supprimé après l'installation.</para> </glossdef> </glossentry> <glossentry> <glossterm>ATA</glossterm> <glossdef> <para>Advanced Technology Attachment, un standard de l'industrie pour les interfaces de disques durs (synonyme de IDE). Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>B</title> <glossentry> <glossterm>BIOS</glossterm> <glossdef> <para>Basic Input/Output System, le firmware intégré à la plupart des ordinateurs personnels qui est chargé d'initialiser le matériel après que la machine ait été allumée et qui alors démarre le système d'exploitation. VirtualBox est livré avec son propre BIOS virtuel qui se lance quand une machine est démarrée.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>C</title> <glossentry> <glossterm>COM</glossterm> <glossdef> <para>Microsoft Component Object Model, une infrastructure de programmation pour logiciels modulaires. COM permet aux applications de fournir une interface de programmation qui peut être accédée depuis divers autres langages de programmation et applications. VirtualBox utilise COM en interne et en externe pour fournir une API complète aux développeurs externes .</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>D</title> <glossentry> <glossterm>DHCP</glossterm> <glossdef> <para>Dynamic Host Configuration Protocol. Ceci donne la faculté à un périphérique de réseau d'obtenir automatiquement son adresse IP (et autres informations du réseau) , afin d'éviter d'avoir à configurer tous les périphériques d'un réseau avec des adresses IP fixes. VirtualBox a un serveur DHCP incorporé qui octroie une adresse IP à une machine virtuelle quand le réseau est configuré en mode NAT&#xA0;; voir <xref linkend="networkingdetails" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>DKMS</glossterm> <glossdef> <para>Dynamic Kernel Module Support. Un environnement qui simplifie l'installation et la mise à jour des modules externes de noyau sur les machines Linux&#xA0;; voir <xref linkend="externalkernelmodules" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>E</title> <glossentry> <glossterm>EFI</glossterm> <glossdef> <para>Extensible Firmware Interface, un firmware intégré aux ordinateurs qui a pour but de remplacer le BIOS dépassé. À l'origine conçu par Intel, la plupart des systèmes peuvent maintenant démarrer une machine qui a EFI au lieu de BIOS&#xA0;; voir <xref linkend="efi" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>EHCI</glossterm> <glossdef> <para>Enhanced Host Controller Interface, l'interface qui implémente l'USB 2.0 standard.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>G</title> <glossentry> <glossterm>GUI</glossterm> <glossdef> <para>Graphical User Interface. Communément employé en opposition à "interface en ligne de commande", dans le contexte VirtualBox, nous nous référons au programme graphique principal de <computeroutput>VirtualBox</computeroutput> en tant que "GUI", pour le différencier de l'interface <computeroutput>VBoxManage</computeroutput> .</para> </glossdef> </glossentry> <glossentry> <glossterm>GUID</glossterm> <glossdef> <para>Voir UUID.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>I</title> <glossentry> <glossterm>IDE</glossterm> <glossdef> <para>Integrated Drive Electronics, un standard de l'industrie pour une interface de disque dur. Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>I/O APIC</glossterm> <glossdef> <para>Voir APIC.</para> </glossdef> </glossentry> <glossentry> <glossterm>iSCSI</glossterm> <glossdef> <para>Internet SCSI; voir <xref linkend="storage-iscsi" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>M</title> <glossentry> <glossterm>MAC</glossterm> <glossdef> <para>Media Access Control, un élément d'une carte Ethernet. Une adresse MAC est un nombre de 6 octets qui identifie une carte réseau. C'est typiquement écrit en héxadecimal où les octets sont séparés par ":", tel que <computeroutput>00:17:3A:5E:CB:08</computeroutput>.</para> </glossdef> </glossentry> <glossentry> <glossterm>MSI</glossterm> <glossdef> <para>Message Signaled Interrupts, supporté par les circuits récents tel que le ICH9; voir <xref linkend="settings-motherboard" />. Contrairement aux traditionnelles interruptions pin-based, avec MSI, une petite quantité de données peut accompagner le véritable message d'interruption. Ceci réduit la quantité requise de broches sur le matériel, permet plus d'interruptions avec de meilleures performances.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>N</title> <glossentry> <glossterm>NAT</glossterm> <glossdef> <para>Network Address Translation. Une technique pour partager les interfaces réseau par laquelle une interface modifie l'adresse IP source et/ou cible des paquets réseau selon des règles spécifiques. Couramment employé par routeurs et pare-feux pour séparer un réseau interne de l'Internet, VirtualBox peut utiliser NAT pour facilement partager un équipement réseau physique de l'hôte avec ses machines virtuelles. Voir <xref linkend="network_nat" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>O</title> <glossentry> <glossterm>OVF</glossterm> <glossdef> <para>Open Virtualization Format, un standard de l'industrie inter-platforme pour échanger des briques logicielles virtuelles entre produits de virtualisation; voir <xref linkend="ovf" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>P</title> <glossentry> <glossterm>PAE</glossterm> <glossdef> <para>Physical Address Extension. Ceci permet l'accès à plus de 4 GB de RAM même en environnement 32-bit&#xA0;; voir <xref linkend="settings-general-advanced" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>PIC</glossterm> <glossdef> <para>Voir APIC.</para> </glossdef> </glossentry> <glossentry> <glossterm>PXE</glossterm> <glossdef> <para>Preboot Execution Environment, un standard de l'industrie pour démarrer des systèmes PC à distance. Cela inclue DHCP pour la configuration IP et TFTP pour le transfert de fichier. Avec UNDI, est disponible une pile de pilote de matériel indépendant pour accéder la carte réseau par le code d'amorce .</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>R</title> <glossentry> <glossterm>RDP</glossterm> <glossdef> <para>Remote Desktop Protocol, un protocole développé par Microsoft en extension des protocoles ITU T.128 et T.124 de vidéo conference. Avec RDP, un système PC peut être contrôllé à distance en utilisant une connection réseau à travers laquelle les données sont transférées dans les 2 directions. Typiquement les événements graphiques et audio sont envoyés depuis la machine à distance et les événements clavier et souris sont envoyés depuis le client. Un paquet d'extension VirtualBox d'Oracle fournit VRDP, une implementation améliorée du standard approprié qui est largement compatible avec le RDP Microsoft. Voir <xref linkend="vrde" /> pour le detail.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>S</title> <glossentry> <glossterm>SAS</glossterm> <glossdef> <para>Serial Attached SCSI, un standard de l'industrie pour les interfaces de disques durs. Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>SATA</glossterm> <glossdef> <para>Serial ATA, un standard de l'industrie pour les interfaces de disques durs. Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>SCSI</glossterm> <glossdef> <para>Small Computer System Interface. Un standard de l'industrie pour le transfer de données entre périphériques, de stockage particulièrement. Voir <xref linkend="harddiskcontrollers" />.</para> </glossdef> </glossentry> <glossentry> <glossterm>SMP</glossterm> <glossdef> <para>Symmetrical Multiprocessing, indique que les ressources d'une machine sont partagées entre différents processeurs. Ceci peut être soit plusieurs puces processeur ou, le plus courant dans le matériel récent, plusieurs coeurs CPU dans le processeur.</para> </glossdef> </glossentry> <glossentry> <glossterm>SSD</glossterm> <glossdef> <para>Solid-state drive, utilise des micropuces pour stocker les données système d'une machine. Comparé aux classiquex disques durs ils n'ont pas de composants mécaniques comme les plateaux tournants. </para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>T</title> <glossentry> <glossterm>TAR</glossterm> <glossdef> <para>Un format de fichier largement répandu pour l'archivage. À l'origine pour "Tape ARchive", était déjà supporté par les premières versions d'Unix pour sauvegarder les données sur bande. Le format de fichier est toujours largement utilisé, par exemple, avec les archives OVF (avec l'extension de fichier <computeroutput>.ova</computeroutput>)&#xA0;; voir <xref linkend="ovf" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>U</title> <glossentry> <glossterm>UUID</glossterm> <glossdef> <para>Un identifiant unique universel (Universally Unique Identifier) -- souvent aussi appelé GUID (Globally Unique Identifier) -- est une chaîne de nombres et lettres qui peut être calculée dynamiquement et qui garantie son unicité. En général, c'est utilisé comme un identifiant global d'un composant. VirtualBox emploie les UUIDs pour identifier les VMs, les images de disque virtuel (fichiers VDI) et autres composants.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>V</title> <glossentry> <glossterm>VM</glossterm> <glossdef> <para>Machine virtuelle -- un ordinateur virtuel que VirtualBox fait tourner dans la véritable machine. Voir <xref linkend="virtintro" /> pour le detail.</para> </glossdef> </glossentry> <glossentry> <glossterm>VMM</glossterm> <glossdef> <para>Virtual Machine Manager -- le composant de VirtualBox qui contrôle l'exécution des VMs. Voir <xref linkend="technical-components" /> pour une liste de composants VirtualBox.</para> </glossdef> </glossentry> <glossentry> <glossterm>VRDE</glossterm> <glossdef> <para>VirtualBox Remote Desktop Extension. Cette interface est intégrée à VirtualBox pour permettre aux paquets d'extension VirtualBox de fournir aux machines virtuelles un accès à distance. Un paquet d'extension de VirtualBox d'Oracle implémente VRDP; voir <xref linkend="vrde" /> pour le detail.</para> </glossdef> </glossentry> <glossentry> <glossterm>VRDP</glossterm> <glossdef> <para>Voir RDP.</para> </glossdef> </glossentry> <glossentry> <glossterm>VT-x</glossterm> <glossdef> <para>La capacité de virtualisation matérielle implémentée dans les processeurs Intel récents. Voir <xref linkend="hwvirt" />.</para> </glossdef> </glossentry> </glossdiv> <glossdiv> <title>X</title> <glossentry> <glossterm>XML</glossterm> <glossdef> <para>eXtensible Markup Language, un métastandard pour toute sorte d'information textuelle. XML spécifie seulement comment les données dans un document sont organisées en général et ne préscrit pas la manière d'organiser le contenu sémantiquement.</para> </glossdef> </glossentry> <glossentry> <glossterm>XPCOM</glossterm> <glossdef> <para>Mozilla Cross Platform Component Object Model, un environnement de programmation développé par le projet de navigateur Mozilla qui est similaire au COM de Microsoft et permet aux applications de fournir une interface de programmation modulaire. VirtualBox emploie XPCOM sur Linux à la fois en interne et en externe pour fournir une API complète aux développeurs externes.</para> </glossdef> </glossentry> </glossdiv> </glossary>
{ "content_hash": "d8ef6a7db46da5f90b5c32408e4ce6d5", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 106, "avg_line_length": 31.90688259109312, "alnum_prop": 0.6601954066742799, "repo_name": "egraba/vbox_openbsd", "id": "570f24e0f31ba4205408de473c17a4ab91c75cbe", "size": "15958", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "VirtualBox-5.0.0/doc/manual/fr_FR/user_Glossary.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Ada", "bytes": "88714" }, { "name": "Assembly", "bytes": "4303680" }, { "name": "AutoIt", "bytes": "2187" }, { "name": "Batchfile", "bytes": "95534" }, { "name": "C", "bytes": "192632221" }, { "name": "C#", "bytes": "64255" }, { "name": "C++", "bytes": "83842667" }, { "name": "CLIPS", "bytes": "5291" }, { "name": "CMake", "bytes": "6041" }, { "name": "CSS", "bytes": "26756" }, { "name": "D", "bytes": "41844" }, { "name": "DIGITAL Command Language", "bytes": "56579" }, { "name": "DTrace", "bytes": "1466646" }, { "name": "GAP", "bytes": "350327" }, { "name": "Groff", "bytes": "298540" }, { "name": "HTML", "bytes": "467691" }, { "name": "IDL", "bytes": "106734" }, { "name": "Java", "bytes": "261605" }, { "name": "JavaScript", "bytes": "80927" }, { "name": "Lex", "bytes": "25122" }, { "name": "Logos", "bytes": "4941" }, { "name": "Makefile", "bytes": "426902" }, { "name": "Module Management System", "bytes": "2707" }, { "name": "NSIS", "bytes": "177212" }, { "name": "Objective-C", "bytes": "5619792" }, { "name": "Objective-C++", "bytes": "81554" }, { "name": "PHP", "bytes": "58585" }, { "name": "Pascal", "bytes": "69941" }, { "name": "Perl", "bytes": "240063" }, { "name": "PowerShell", "bytes": "10664" }, { "name": "Python", "bytes": "9094160" }, { "name": "QMake", "bytes": "3055" }, { "name": "R", "bytes": "21094" }, { "name": "SAS", "bytes": "1847" }, { "name": "Shell", "bytes": "1460572" }, { "name": "SourcePawn", "bytes": "4139" }, { "name": "TypeScript", "bytes": "142342" }, { "name": "Visual Basic", "bytes": "7161" }, { "name": "XSLT", "bytes": "1034475" }, { "name": "Yacc", "bytes": "22312" } ], "symlink_target": "" }
package ac.simons.biking2.statistics.highcharts; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; /** * @author Michael J. Simons * * @since 2014-02-11 */ class SeriesOptionsTest { @Test void testBuilder() { SeriesOptions seriesOptions = new SeriesOptions.Builder<>(object -> object).build(); assertThat(seriesOptions.isAnimation()).isNull(); seriesOptions = new SeriesOptions.Builder<>(object -> object) .enableAnimation() .build(); assertThat(seriesOptions.isAnimation()).isTrue(); seriesOptions = new SeriesOptions.Builder<>(object -> object) .disableAnimation() .build(); assertThat(seriesOptions.isAnimation()).isFalse(); } }
{ "content_hash": "ba315370c793d1ac0ac7149ece4a71b1", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 92, "avg_line_length": 26.419354838709676, "alnum_prop": 0.6312576312576312, "repo_name": "michael-simons/biking2", "id": "06c2f61e01a1baa3ca433f46d9dcadffde0bc6d6", "size": "1426", "binary": false, "copies": "2", "ref": "refs/heads/public", "path": "src/test/java/ac/simons/biking2/statistics/highcharts/SeriesOptionsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "52088" }, { "name": "HTML", "bytes": "32131" }, { "name": "Java", "bytes": "479936" }, { "name": "JavaScript", "bytes": "246220" }, { "name": "Ruby", "bytes": "41870" } ], "symlink_target": "" }
package com.game_machine.entity_system.generated; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.ArrayList; import java.util.List; import com.dyuproject.protostuff.ByteString; import com.dyuproject.protostuff.GraphIOUtil; import com.dyuproject.protostuff.Input; import com.dyuproject.protostuff.Message; import com.dyuproject.protostuff.Output; import java.io.ByteArrayOutputStream; import com.dyuproject.protostuff.JsonIOUtil; import com.dyuproject.protostuff.LinkedBuffer; import com.dyuproject.protostuff.ProtobufIOUtil; import com.dyuproject.protostuff.ProtostuffIOUtil; import com.dyuproject.protostuff.runtime.RuntimeSchema; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.game_machine.entity_system.generated.Entity; import com.dyuproject.protostuff.Pipe; import com.dyuproject.protostuff.Schema; import com.dyuproject.protostuff.UninitializedMessageException; public final class Subscribe implements Externalizable, Message<Subscribe>, Schema<Subscribe> { public static Schema<Subscribe> getSchema() { return DEFAULT_INSTANCE; } public static Subscribe getDefaultInstance() { return DEFAULT_INSTANCE; } static final Subscribe DEFAULT_INSTANCE = new Subscribe(); public String topic; public Subscribe() { } public String getTopic() { return topic; } public Subscribe setTopic(String topic) { this.topic = topic; return this; } public Boolean hasTopic() { return topic == null ? false : true; } // java serialization public void readExternal(ObjectInput in) throws IOException { GraphIOUtil.mergeDelimitedFrom(in, this, this); } public void writeExternal(ObjectOutput out) throws IOException { GraphIOUtil.writeDelimitedTo(out, this, this); } // message method public Schema<Subscribe> cachedSchema() { return DEFAULT_INSTANCE; } // schema methods public Subscribe newMessage() { return new Subscribe(); } public Class<Subscribe> typeClass() { return Subscribe.class; } public String messageName() { return Subscribe.class.getSimpleName(); } public String messageFullName() { return Subscribe.class.getName(); } public boolean isInitialized(Subscribe message) { return true; } public void mergeFrom(Input input, Subscribe message) throws IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: message.topic = input.readString(); break; default: input.handleUnknownField(number, this); } } } public void writeTo(Output output, Subscribe message) throws IOException { if(message.topic != null) output.writeString(1, message.topic, false); } public String getFieldName(int number) { switch(number) { case 1: return "topic"; default: return null; } } public int getFieldNumber(String name) { final Integer number = __fieldMap.get(name); return number == null ? 0 : number.intValue(); } private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>(); static { __fieldMap.put("topic", 1); } public static List<String> getFields() { ArrayList<String> fieldNames = new ArrayList<String>(); String fieldName = null; Integer i = 1; while(true) { fieldName = Subscribe.getSchema().getFieldName(i); if (fieldName == null) { break; } fieldNames.add(fieldName); i++; } return fieldNames; } public static Subscribe parseFrom(byte[] bytes) { Subscribe message = new Subscribe(); ProtobufIOUtil.mergeFrom(bytes, message, RuntimeSchema.getSchema(Subscribe.class)); return message; } public Subscribe clone() { byte[] bytes = this.toByteArray(); Subscribe subscribe = Subscribe.parseFrom(bytes); return subscribe; } public byte[] toByteArray() { return toProtobuf(); //return toJson(); } public byte[] toJson() { boolean numeric = false; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { JsonIOUtil.writeTo(out, this, Subscribe.getSchema(), numeric); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Json encoding failed"); } return out.toByteArray(); } public byte[] toProtobuf() { LinkedBuffer buffer = LinkedBuffer.allocate(8024); byte[] bytes = null; try { bytes = ProtobufIOUtil.toByteArray(this, RuntimeSchema.getSchema(Subscribe.class), buffer); buffer.clear(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Protobuf encoding failed"); } return bytes; } }
{ "content_hash": "6b3fb56aa1e5ab590dc46558fd800283", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 112, "avg_line_length": 20.907692307692308, "alnum_prop": 0.6269315673289183, "repo_name": "cnsoft/game_machine", "id": "69be0b189a28bae8676f323486af9d21497f3fa5", "size": "5436", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "java/src/main/java/com/game_machine/entity_system/generated/Subscribe.java", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>JobCanceledException (xenon 3.0.0 API for Xenon developers)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JobCanceledException (xenon 3.0.0 API for Xenon developers)"; } } catch(err) { } //--> var pathtoroot = "../../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">nl.esciencecenter.xenon.adaptors.schedulers</a></div> <h2 title="Class JobCanceledException" class="title">Class JobCanceledException</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Throwable</li> <li> <ul class="inheritance"> <li>java.lang.Exception</li> <li> <ul class="inheritance"> <li><a href="../../XenonException.html" title="class in nl.esciencecenter.xenon">nl.esciencecenter.xenon.XenonException</a></li> <li> <ul class="inheritance"> <li>nl.esciencecenter.xenon.adaptors.schedulers.JobCanceledException</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><code>java.io.Serializable</code></dd> </dl> <hr> <pre>public class <span class="typeNameLabel">JobCanceledException</span> extends <a href="../../XenonException.html" title="class in nl.esciencecenter.xenon">XenonException</a></pre> <div class="block">Signals that a jobs has been canceled by the user.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.0</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../serialized-form.html#nl.esciencecenter.xenon.adaptors.schedulers.JobCanceledException">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <div class="memberSummary"> <table> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Field</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>private static long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#serialVersionUID">serialVersionUID</a></span></code></th> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </div> </li> </ul> </section> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <div class="memberSummary"> <table> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Constructor</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.lang.String,java.lang.String)">JobCanceledException</a></span>&#8203;(java.lang.String&nbsp;adaptorName, java.lang.String&nbsp;message)</code></th> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.lang.String,java.lang.String,java.lang.Throwable)">JobCanceledException</a></span>&#8203;(java.lang.String&nbsp;adaptorName, java.lang.String&nbsp;message, java.lang.Throwable&nbsp;t)</code></th> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </div> </li> </ul> </section> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.nl.esciencecenter.xenon.XenonException"> <!-- --> </a> <h3>Methods inherited from class&nbsp;nl.esciencecenter.xenon.<a href="../../XenonException.html" title="class in nl.esciencecenter.xenon">XenonException</a></h3> <code><a href="../../XenonException.html#getMessage()">getMessage</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.java.lang.Throwable"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Throwable</h3> <code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a id="serialVersionUID"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>serialVersionUID</h4> <pre>private static final&nbsp;long serialVersionUID</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#nl.esciencecenter.xenon.adaptors.schedulers.JobCanceledException.serialVersionUID">Constant Field Values</a></dd> </dl> </li> </ul> </li> </ul> </section> <!-- ========= CONSTRUCTOR DETAIL ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a id="&lt;init&gt;(java.lang.String,java.lang.String,java.lang.Throwable)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JobCanceledException</h4> <pre>public&nbsp;JobCanceledException&#8203;(java.lang.String&nbsp;adaptorName, java.lang.String&nbsp;message, java.lang.Throwable&nbsp;t)</pre> </li> </ul> <a id="&lt;init&gt;(java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>JobCanceledException</h4> <pre>public&nbsp;JobCanceledException&#8203;(java.lang.String&nbsp;adaptorName, java.lang.String&nbsp;message)</pre> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> </div> <a id="skip.navbar.bottom"> <!-- --> </a> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
{ "content_hash": "2b137855d1724a3f86f52fa68851bc98", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 228, "avg_line_length": 32.321739130434786, "alnum_prop": 0.6345619226975159, "repo_name": "NLeSC/Xenon", "id": "cacf585f92f575274f2de02b40b9c52cc123a132", "size": "11151", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/versions/3.0.0/javadoc-devel/nl/esciencecenter/xenon/adaptors/schedulers/JobCanceledException.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "762" }, { "name": "Java", "bytes": "1547681" }, { "name": "Shell", "bytes": "4009" } ], "symlink_target": "" }
package com.amazonaws.services.chimesdkmessaging.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.chimesdkmessaging.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * BatchCreateChannelMembershipRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class BatchCreateChannelMembershipRequestProtocolMarshaller implements Marshaller<Request<BatchCreateChannelMembershipRequest>, BatchCreateChannelMembershipRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON) .requestUri("/channels/{channelArn}/memberships?operation=batch-create").httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false) .hasPayloadMembers(true).serviceName("AmazonChimeSDKMessaging").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public BatchCreateChannelMembershipRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<BatchCreateChannelMembershipRequest> marshall(BatchCreateChannelMembershipRequest batchCreateChannelMembershipRequest) { if (batchCreateChannelMembershipRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<BatchCreateChannelMembershipRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller( SDK_OPERATION_BINDING, batchCreateChannelMembershipRequest); protocolMarshaller.startMarshalling(); BatchCreateChannelMembershipRequestMarshaller.getInstance().marshall(batchCreateChannelMembershipRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "a2622898dafea30942fe16c164e3f574", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 152, "avg_line_length": 43.867924528301884, "alnum_prop": 0.7802150537634409, "repo_name": "aws/aws-sdk-java", "id": "dfb7b9994798b45b304c7862ee10646ea932b418", "size": "2905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-chimesdkmessaging/src/main/java/com/amazonaws/services/chimesdkmessaging/model/transform/BatchCreateChannelMembershipRequestProtocolMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd"> <!-- 启用spring注解支持 --> <context:annotation-config /> <!-- 配置sessionFactory --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://127.0.0.1/newssystem" /> <property name="username" value="root" /> <property name="password" value="$ryougi_0207" /> </bean> --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://127.0.0.1/newssystem" /> <property name="user" value="root" /> <property name="password" value="$ryougi_0207" /> <!-- 其他配置 --> <!-- 初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 --> <property name="initialPoolSize" value="3"></property> <!-- 连接池中保留的最小连接数。Default: 3 --> <property name="minPoolSize" value="3"></property> <!-- 连接池中保留的最大连接数。Default: 15 --> <property name="maxPoolSize" value="5"></property> <!-- 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --> <property name="acquireIncrement" value="3"></property> <!-- 控制数据源内加载的PreparedStatements数量。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 --> <property name="maxStatements" value="8"></property> <!-- maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0 --> <property name="maxStatementsPerConnection" value="5"></property> <!-- 最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 --> <property name="maxIdleTime" value="1800"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.jdbc.batch_size">20</prop> <!-- <prop key="hibernate.current_session_context_class"> thread </prop> --> </props> </property> <property name="mappingLocations"> <list> <value>classpath:com/news/entity/Topic.hbm.xml</value> <value>classpath:com/news/entity/Admin.hbm.xml</value> <value>classpath:com/news/entity/NewsInfo.hbm.xml</value> </list> </property> </bean> <!-- 配置事务 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- 定义事务通知 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED"/> </tx:attributes> </tx:advice> <!-- 定义切面并和事务组合 --> <aop:config> <aop:pointcut expression="execution(* com.news.biz.*.*(..))" id="bizMethods"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethods"/> </aop:config> <!-- Spring Bean --> <bean id="newsInfoDAO" class="com.news.dao.impl.NewsInfoDAOImpl" autowire="byName"></bean> <bean id="topicDAO" class="com.news.dao.impl.TopicDAOImpl" autowire="byName"></bean> <bean id="newsInfoBiz" class="com.news.biz.impl.NewsInfoBizImpl" autowire="byName"></bean> <bean id="topicBiz" class="com.news.biz.impl.TopicBizImpl" autowire="byName"></bean> <bean id="adminDAO" class="com.news.dao.impl.AdminDAOImpl" autowire="byName"></bean> <bean id="adminBiz" class="com.news.biz.impl.AdminBizImpl" autowire="byName"></bean> <bean id="adminUtil" class="com.news.util.AdminUtil" autowire="byName"></bean> <!-- spring管理的自定义filter --> <!-- spring管理struts2的Action --> <bean id="newsInfoAction" class="com.news.action.NewsInfoAction" scope="prototype" autowire="byName"></bean> <bean id="adminAction" class="com.news.action.AdminAction" scope="prototype" autowire="byName"></bean> <bean id="topicAction" class="com.news.action.TopicAction" scope="prototype" autowire="byName"></bean> </beans>
{ "content_hash": "445f7ec055cda5f8189db5632409ca2c", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 125, "avg_line_length": 45.90654205607477, "alnum_prop": 0.7041938110749185, "repo_name": "RyougiChan/NewsSystem", "id": "1afd6e225a11288281364481ea495ab4f1c941c9", "size": "5276", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "build/classes/applicationContext.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "16296" }, { "name": "HTML", "bytes": "881" }, { "name": "Java", "bytes": "56320" }, { "name": "JavaScript", "bytes": "11461" } ], "symlink_target": "" }
package in.twizmwaz.cardinal.module.modules.team; import com.google.common.base.Optional; import in.twizmwaz.cardinal.GameHandler; import in.twizmwaz.cardinal.chat.ChatConstant; import in.twizmwaz.cardinal.chat.LocalizedChatMessage; import in.twizmwaz.cardinal.chat.UnlocalizedChatMessage; import in.twizmwaz.cardinal.event.PlayerChangeTeamEvent; import in.twizmwaz.cardinal.match.Match; import in.twizmwaz.cardinal.module.Module; import in.twizmwaz.cardinal.module.modules.blitz.Blitz; import in.twizmwaz.cardinal.tabList.TabList; import in.twizmwaz.cardinal.util.Teams; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import java.util.ArrayList; public class TeamModule extends ArrayList<Player> implements Module { private final Match match; private final String id; private final boolean observer; private String name; private int min; private int max; private int maxOverfill; private int respawnLimit; private ChatColor color; private boolean plural; private boolean ready; protected TeamModule(Match match, String name, String id, int min, int max, int maxOverfill, int respawnLimit, ChatColor color, boolean plural, boolean observer) { this.match = match; this.name = name; this.id = id; this.min = min; this.max = max; this.maxOverfill = maxOverfill; this.respawnLimit = respawnLimit; this.color = color; this.plural = plural; this.observer = observer; this.ready = false; } public boolean add(Player player, boolean force, boolean message) { if (Blitz.matchIsBlitz() && GameHandler.getGameHandler().getMatch().isRunning() && !this.isObserver() && !force) { String title = GameHandler.getGameHandler().getMatch().getModules().getModule(Blitz.class).getTitle(); player.sendMessage(new UnlocalizedChatMessage(ChatColor.RED + "{0}", new LocalizedChatMessage(ChatConstant.ERROR_MAY_NOT_JOIN, ChatColor.ITALIC + "" + ChatColor.AQUA + title + ChatColor.RESET + ChatColor.RED)).getMessage(player.getLocale())); return false; } if (!force && size() >= max) { player.sendMessage(new UnlocalizedChatMessage(ChatColor.RED + "{0}", new LocalizedChatMessage(ChatConstant.ERROR_TEAM_FULL, getCompleteName() + ChatColor.RED)).getMessage(player.getLocale())); return false; } PlayerChangeTeamEvent event = new PlayerChangeTeamEvent(player, force, Optional.of(this), Teams.getTeamByPlayer(player)); Bukkit.getServer().getPluginManager().callEvent(event); if (message && event.getNewTeam().isPresent()) { event.getPlayer().sendMessage(ChatColor.WHITE + new LocalizedChatMessage(ChatConstant.GENERIC_JOINED, event.getNewTeam().get().getCompleteName()).getMessage(event.getPlayer().getLocale())); } else if (message) { event.getPlayer().sendMessage(ChatColor.WHITE + new LocalizedChatMessage(ChatConstant.GENERIC_JOINED, ChatConstant.MISC_MATCH.asMessage()).getMessage(event.getPlayer().getLocale())); } return !event.isCancelled() || force; } public boolean add(Player player, boolean force) { return this.add(player, force, true); } public boolean add(Player player) { return this.add(player, false); } @EventHandler(priority = EventPriority.LOW) public void onTeamSwitch(PlayerChangeTeamEvent event) { if (!event.isCancelled()) { this.remove(event.getPlayer()); } if (event.getNewTeam().orNull() == this) { super.add(event.getPlayer()); } } @Override public void unload() { HandlerList.unregisterAll(this); } public String getCompleteName() { return this.color + this.name; } public Match getMatch() { return match; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId() { return id; } public int getMin() { return min; } public int getMax() { return max; } public void setMax(int max) { this.max = max; TabList.renderTeamTitle(this); } public int getMaxOverfill() { return maxOverfill; } public void setMaxOverfill(int maxOverfill) { this.maxOverfill = maxOverfill; } public int getRespawnLimit() { return respawnLimit; } public void setRespawnLimit(int respawnLimit) { this.respawnLimit = respawnLimit; } public ChatColor getColor() { return color; } public void setColor(ChatColor color) { this.color = color; } public boolean isPlural() { return plural; } public boolean isObserver() { return observer; } public boolean isReady() { return ready; } public void setReady(boolean ready) { this.ready = ready; } @Override public boolean equals(Object obj){ return super.equals(obj) && obj instanceof TeamModule && ((TeamModule) obj).getId().equals(this.id); } }
{ "content_hash": "a9c88074ac5802222e212685107c464d", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 254, "avg_line_length": 31.11046511627907, "alnum_prop": 0.6623061110072883, "repo_name": "Pablete1234/CardinalPGM", "id": "6c4a8c98236ed1956fff2b057b35c4b7c6ee9066", "size": "5351", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/in/twizmwaz/cardinal/module/modules/team/TeamModule.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1311651" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>nl.vorhauer.oia.tomcat</groupId> <artifactId>metrics-valve</artifactId> <version>1.3-SNAPSHOT</version> <licenses> <license> <name>Apache License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> <developers> <developer> <email>jvorhauer@me.com</email> <id>jvorhauer</id> <name>Jurjen Vorhauer</name> <timezone>UTC+1:00</timezone> </developer> </developers> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>11</java.version> <metrics.version>4.1.18</metrics.version> <tomcat.version>10.0.4</tomcat.version> </properties> <scm> <connection>scm:git:git@github.com:jvorhauer/metrics-valve.git</connection> <developerConnection>scm:git:git@github.com:jvorhauer/metrics-valve.git</developerConnection> <url>https://github.com/jvorhauer/metrics-valve</url> <tag>HEAD</tag> </scm> <distributionManagement> <repository> <id>mine</id> <url>file:///Users/juvor/.m2/repository</url> </repository> </distributionManagement> <dependencies> <!-- Provided Tomcat libraries: --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-catalina</artifactId> <version>${tomcat.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-coyote</artifactId> <version>${tomcat.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> <!-- Coda Hale's metrics: --> <dependency> <groupId>io.dropwizard.metrics</groupId> <artifactId>metrics-core</artifactId> <version>${metrics.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.dropwizard.metrics</groupId> <artifactId>metrics-graphite</artifactId> <version>${metrics.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.dropwizard.metrics</groupId> <artifactId>metrics-jvm</artifactId> <version>${metrics.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>net.alchim31</groupId> <artifactId>metrics-influxdb</artifactId> <version>0.7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.ning</groupId> <artifactId>async-http-client</artifactId> <version>1.9.40</version> </dependency> <!-- Tests: --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.1</version> <scope>test</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core-java8</artifactId> <version>1.0.0m1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>${project.build.sourceEncoding}</encoding> <compilerArgument>-Xlint:unchecked</compilerArgument> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "2ab2ae51159814c1ed10cbb64c832c12", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 108, "avg_line_length": 29.68794326241135, "alnum_prop": 0.6409460105112279, "repo_name": "jvorhauer/monitoring-valves", "id": "5fef790c8ad9e46bfbb841f7e098903d0e53caa6", "size": "4186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "12833" } ], "symlink_target": "" }
package library; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; /** * Created by Joed on 12/5/14. */ public class EndlessListViewManager extends LinearLayoutManager { private static final int LAST_ITEM_VISIBLE_TRIGGER_COUNT = 5; private int HEADER_COUNT = 0; private int FOOTER_COUNT = 0; private boolean mIsLoadingMore; private OnLastItemVisible onLastItemVisible; private int SCROLL_STATE = 0; private Handler handler; public interface OnLastItemVisible{ public void onLastItemVisible(); } public void isLoadingMore(boolean loading){ mIsLoadingMore = loading; } public void setHeaderCount(int count){ HEADER_COUNT = count; } public void setFooterCount(int count){ FOOTER_COUNT = count; } public void setOnLastItemVisible(OnLastItemVisible onLastItemVisible) { this.onLastItemVisible = onLastItemVisible; } public EndlessListViewManager(Context context) { super(context); handler = new Handler(Looper.getMainLooper()); } public EndlessListViewManager(Context context, int orientation, boolean reverseLayout) { super(context, orientation, reverseLayout); } @Override public int getItemCount() { return super.getItemCount() - (HEADER_COUNT + FOOTER_COUNT); } @Override public void onScrollStateChanged(int state) { super.onScrollStateChanged(state); } @Override public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) { int scroll = super.scrollVerticallyBy(dy, recycler, state); if(getItemCount() >= 10 ){ checkIfLastItemVisible(); } return scroll; } private void checkIfLastItemVisible(){ if(findFirstVisibleItemPosition() <= getItemCount() && findFirstVisibleItemPosition() >= getItemCount()-LAST_ITEM_VISIBLE_TRIGGER_COUNT){ if(onLastItemVisible != null && !mIsLoadingMore){ Log.d("Joed", "Firing onLastItemVisible"); mIsLoadingMore = true; handler.postDelayed(lastItemNotifier,10); } } } private Runnable lastItemNotifier = new Runnable() { @Override public void run() { onLastItemVisible.onLastItemVisible(); } }; }
{ "content_hash": "c8b2329e09e57da5b40145b0b91ca109", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 145, "avg_line_length": 26.9468085106383, "alnum_prop": 0.6671930517173312, "repo_name": "Dyoed/MenuPeekaboo", "id": "4dace566c44e6b8ef3b0345c48c20dc0b1684bbf", "size": "2533", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/library/EndlessListViewManager.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "53199" } ], "symlink_target": "" }
package com.kubotaku.android.code4kyoto5374; import android.app.Application; import io.realm.Realm; import io.realm.RealmConfiguration; /** * Custom Application class. */ public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Realm.init(this); RealmConfiguration realmConfiguration = new RealmConfiguration.Builder().build(); Realm.setDefaultConfiguration(realmConfiguration); } }
{ "content_hash": "b6367b6ec051839a25dce9c8139b3aa0", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 89, "avg_line_length": 23.9, "alnum_prop": 0.7238493723849372, "repo_name": "kubotaku1119/5374Kyoto_Android", "id": "524b7ab5bb1084f44b27ef688ac1946f32364d7b", "size": "1110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/kubotaku/android/code4kyoto5374/MyApplication.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "3077" }, { "name": "Java", "bytes": "169471" } ], "symlink_target": "" }
import { test, moduleForModel } from 'ember-qunit'; moduleForModel('plan', 'Plan', { // Specify the other units that are required for this test. needs: [] }); test('it exists', function() { var model = this.subject(); // var store = this.store(); ok(model); });
{ "content_hash": "9ef9385be2ce247b124210136defdaa0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 61, "avg_line_length": 22.833333333333332, "alnum_prop": 0.635036496350365, "repo_name": "visualjeff/paypal_ember_models", "id": "8360a4687d5f1347bf752c7c0d402ca8bf6eb3a4", "size": "274", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/unit/models/plan-test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "622" }, { "name": "JavaScript", "bytes": "107421" }, { "name": "Shell", "bytes": "1090" } ], "symlink_target": "" }
package com.spotify.heroic.shell.task; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.spotify.heroic.QueryOptions; import com.spotify.heroic.async.AsyncObservable; import com.spotify.heroic.async.AsyncObserver; import com.spotify.heroic.dagger.CoreComponent; import com.spotify.heroic.filter.Filter; import com.spotify.heroic.grammar.QueryParser; import com.spotify.heroic.metric.BackendKey; import com.spotify.heroic.metric.BackendKeyFilter; import com.spotify.heroic.metric.BackendKeySet; import com.spotify.heroic.metric.MetricBackend; import com.spotify.heroic.metric.MetricCollection; import com.spotify.heroic.metric.MetricManager; import com.spotify.heroic.metric.WriteMetric; import com.spotify.heroic.shell.ShellIO; import com.spotify.heroic.shell.ShellTask; import com.spotify.heroic.shell.TaskName; import com.spotify.heroic.shell.TaskParameters; import com.spotify.heroic.shell.TaskUsage; import com.spotify.heroic.shell.Tasks; import dagger.Component; import eu.toolchain.async.AsyncFramework; import eu.toolchain.async.AsyncFuture; import eu.toolchain.async.ResolvableFuture; import lombok.Data; import lombok.Getter; import lombok.ToString; import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; import javax.inject.Inject; import javax.inject.Named; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; import java.util.function.Supplier; @TaskUsage("Migrate data from one backend to another") @TaskName("data-migrate") public class DataMigrate implements ShellTask { public static final long DOTS = 100; public static final long LINES = DOTS * 20; public static final long ALLOWED_ERRORS = 5; public static final long ALLOWED_FAILED_KEYS = 100; private final QueryParser parser; private final MetricManager metric; private final AsyncFramework async; private final ObjectMapper mapper; @Inject public DataMigrate( QueryParser parser, MetricManager metric, AsyncFramework async, @Named("application/json") ObjectMapper mapper ) { this.parser = parser; this.metric = metric; this.async = async; this.mapper = mapper; } @Override public TaskParameters params() { return new Parameters(); } @Override public AsyncFuture<Void> run(final ShellIO io, final TaskParameters p) throws Exception { final Parameters params = (Parameters) p; final QueryOptions.Builder options = QueryOptions.builder().tracing(params.tracing); params.fetchSize.ifPresent(options::fetchSize); final Filter filter = Tasks.setupFilter(parser, params); final MetricBackend from = metric.useOptionalGroup(params.from); final MetricBackend to = metric.useOptionalGroup(params.to); final BackendKeyFilter keyFilter = Tasks.setupKeyFilter(params, mapper); final ResolvableFuture<Void> future = async.future(); /* all errors seen */ final ConcurrentLinkedQueue<Throwable> errors = new ConcurrentLinkedQueue<>(); final AsyncObservable<BackendKeySet> observable; if (params.keysPaged) { observable = from.streamKeysPaged(keyFilter, options.build(), params.keysPageSize); } else { observable = from.streamKeys(keyFilter, options.build()); } observable.observe(new KeyObserver(io, params, filter, from, to, future, errors)); return future.directTransform(v -> { io.out().println(); if (!errors.isEmpty()) { io.out().println("ERRORS: "); for (final Throwable t : errors) { io.out().println(t.getMessage()); t.printStackTrace(io.out()); } } io.out().flush(); return null; }); } @Data class KeyObserver implements AsyncObserver<BackendKeySet> { final ShellIO io; final Parameters params; final Filter filter; final MetricBackend from; final MetricBackend to; final ResolvableFuture<Void> future; final ConcurrentLinkedQueue<Throwable> errors; final Object lock = new Object(); /** * must synchronize access with {@link #lock} */ volatile boolean done = false; int pending = 0; ResolvableFuture<Void> next = null; /* a queue of the next keys to migrate */ final ConcurrentLinkedQueue<BackendKey> current = new ConcurrentLinkedQueue<>(); /* the total number of keys migrated */ final AtomicLong total = new AtomicLong(); /* the total number of failed keys */ final AtomicLong failedKeys = new AtomicLong(); /* the total number of keys */ final AtomicLong totalKeys = new AtomicLong(); @Override public AsyncFuture<Void> observe(final BackendKeySet set) { if (next != null) { return async.failed(new RuntimeException("next future is still set")); } failedKeys.addAndGet(set.getFailedKeys()); totalKeys.addAndGet(set.getFailedKeys() + set.getKeys().size()); if (errors.size() > ALLOWED_ERRORS) { return async.failed(new RuntimeException("too many failed migrations")); } if (failedKeys.get() > ALLOWED_FAILED_KEYS) { return async.failed(new RuntimeException("too many failed keys")); } if (future.isDone()) { return async.cancelled(); } if (set.getKeys().isEmpty()) { return async.resolved(); } current.addAll(set.getKeys()); synchronized (lock) { next = async.future(); while (true) { if (pending >= params.parallelism) { break; } final BackendKey k = current.poll(); if (k == null) { break; } pending++; streamOne(k); } if (pending < params.parallelism) { return async.resolved(); } return next; } } void streamOne(final BackendKey key) { if (!filter.apply(key.getSeries())) { endOne(key); return; } from .streamRow(key) .observe(new RowObserver(errors, to, future, key, () -> done, this::endOneRuntime)); } void endOneRuntime(final BackendKey key) { try { endOne(key); } catch (final Exception e) { throw new RuntimeException(e); } } void endOne(final BackendKey key) { streamDot(io, key, total.incrementAndGet()); // opportunistically pick up the next available task without locking (if available). final BackendKey k = current.poll(); if (k != null) { streamOne(k); return; } synchronized (lock) { pending--; if (next != null) { final ResolvableFuture<Void> tmp = next; next = null; tmp.resolve(null); } checkFinished(); } } @Override public void cancel() { synchronized (io) { io.out().println("Cancelled when reading keys"); } end(); } @Override public void fail(final Throwable cause) { synchronized (io) { io.out().println("Error when reading keys: " + cause.getMessage()); cause.printStackTrace(io.out()); io.out().flush(); } end(); } @Override public void end() { synchronized (lock) { done = true; checkFinished(); } } void checkFinished() { if (done && pending == 0) { future.resolve(null); } } void streamDot(final ShellIO io, final BackendKey key, final long n) { if (n % LINES == 0) { synchronized (io) { try { io.out().println(" failedKeys: " + failedKeys.get() + ", last: " + mapper.writeValueAsString(key)); } catch (JsonProcessingException e) { throw new RuntimeException(e); } io.out().flush(); } } else if (n % DOTS == 0) { synchronized (io) { io.out().print("."); io.out().flush(); } } } } @Data class RowObserver implements AsyncObserver<MetricCollection> { final ConcurrentLinkedQueue<Throwable> errors; final MetricBackend to; final ResolvableFuture<Void> future; final BackendKey key; final Supplier<Boolean> done; final Consumer<BackendKey> end; @Override public AsyncFuture<Void> observe(MetricCollection value) { if (future.isDone() || done.get()) { return async.cancelled(); } final AsyncFuture<Void> write = to .write(new WriteMetric.Request(key.getSeries(), value)) .directTransform(v -> null); future.bind(write); return write; } @Override public void cancel() { end(); } @Override public void fail(Throwable cause) { errors.add(cause); end(); } @Override public void end() { end.accept(key); } } @ToString private static class Parameters extends Tasks.KeyspaceBase { @Option(name = "-f", aliases = {"--from"}, usage = "Backend group to load data from", metaVar = "<group>") private Optional<String> from = Optional.empty(); @Option(name = "-t", aliases = {"--to"}, usage = "Backend group to load data to", metaVar = "<group>") private Optional<String> to = Optional.empty(); @Option(name = "--page-limit", usage = "Limit the number metadata entries to fetch per page (default: 100)") @Getter private int pageLimit = 100; @Option(name = "--keys-paged", usage = "Use the high-level paging mechanism when streaming keys") private boolean keysPaged = false; @Option(name = "--keys-page-size", usage = "Use the given page-size when paging keys") private int keysPageSize = 10; @Option(name = "--fetch-size", usage = "Use the given fetch size") private Optional<Integer> fetchSize = Optional.empty(); @Option(name = "--tracing", usage = "Trace the queries for more debugging when things go wrong") private boolean tracing = false; @Option(name = "--parallelism", usage = "The number of migration requests to send in parallel (default: 100)", metaVar = "<number>") private int parallelism = Runtime.getRuntime().availableProcessors() * 4; @Argument @Getter private List<String> query = new ArrayList<String>(); } public static DataMigrate setup(final CoreComponent core) { return DaggerDataMigrate_C.builder().coreComponent(core).build().task(); } @Component(dependencies = CoreComponent.class) interface C { DataMigrate task(); } }
{ "content_hash": "03ef80d8d48ec0a16e97f93d8b307d87", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 100, "avg_line_length": 31.104859335038363, "alnum_prop": 0.5692320342049005, "repo_name": "dbrounst/heroic", "id": "060903fcc9c07ed87ec0d8461ddf2b90a25899a4", "size": "13006", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "heroic-core/src/main/java/com/spotify/heroic/shell/task/DataMigrate.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "4583" }, { "name": "Java", "bytes": "2662251" } ], "symlink_target": "" }
package elastic import ( "context" "encoding/json" "testing" ) func TestHighlighterField(t *testing.T) { field := NewHighlighterField("grade") src, err := field.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlighterFieldWithOptions(t *testing.T) { field := NewHighlighterField("grade").FragmentSize(2).NumOfFragments(1) src, err := field.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"fragment_size":2,"number_of_fragments":1}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlightWithStringField(t *testing.T) { builder := NewHighlight().Field("grade") src, err := builder.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"fields":{"grade":{}}}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlightWithFields(t *testing.T) { gradeField := NewHighlighterField("grade") builder := NewHighlight().Fields(gradeField) src, err := builder.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"fields":{"grade":{}}}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlightWithMultipleFields(t *testing.T) { gradeField := NewHighlighterField("grade") colorField := NewHighlighterField("color") builder := NewHighlight().Fields(gradeField, colorField) src, err := builder.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"fields":{"color":{},"grade":{}}}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlighterWithExplicitFieldOrder(t *testing.T) { gradeField := NewHighlighterField("grade").FragmentSize(2) colorField := NewHighlighterField("color").FragmentSize(2).NumOfFragments(1) builder := NewHighlight().Fields(gradeField, colorField).UseExplicitFieldOrder(true) src, err := builder.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"fields":[{"grade":{"fragment_size":2}},{"color":{"fragment_size":2,"number_of_fragments":1}}]}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlightWithBoundarySettings(t *testing.T) { builder := NewHighlight(). BoundaryChars(" \t\r"). BoundaryScannerType("word") src, err := builder.Source() if err != nil { t.Fatal(err) } data, err := json.Marshal(src) if err != nil { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) expected := `{"boundary_chars":" \t\r","boundary_scanner":"word"}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } func TestHighlightWithTermQuery(t *testing.T) { client := setupTestClientAndCreateIndex(t) tweet1 := tweet{User: "olivere", Message: "Welcome to Golang and Elasticsearch."} tweet2 := tweet{User: "olivere", Message: "Another unrelated topic."} tweet3 := tweet{User: "sandrae", Message: "Cycling is fun to do."} // Add all documents _, err := client.Index().Index(testIndexName).Type("tweet").Id("1").BodyJson(&tweet1).Do(context.TODO()) if err != nil { t.Fatal(err) } _, err = client.Index().Index(testIndexName).Type("tweet").Id("2").BodyJson(&tweet2).Do(context.TODO()) if err != nil { t.Fatal(err) } _, err = client.Index().Index(testIndexName).Type("tweet").Id("3").BodyJson(&tweet3).Do(context.TODO()) if err != nil { t.Fatal(err) } _, err = client.Flush().Index(testIndexName).Do(context.TODO()) if err != nil { t.Fatal(err) } // Specify highlighter hl := NewHighlight() hl = hl.Fields(NewHighlighterField("message")) hl = hl.PreTags("<em>").PostTags("</em>") // Match all should return all documents query := NewPrefixQuery("message", "golang") searchResult, err := client.Search(). Index(testIndexName). Highlight(hl). Query(query). Do(context.TODO()) if err != nil { t.Fatal(err) } if searchResult.Hits == nil { t.Fatalf("expected SearchResult.Hits != nil; got nil") } if searchResult.Hits.TotalHits != 1 { t.Fatalf("expected SearchResult.Hits.TotalHits = %d; got %d", 1, searchResult.Hits.TotalHits) } if len(searchResult.Hits.Hits) != 1 { t.Fatalf("expected len(SearchResult.Hits.Hits) = %d; got %d", 1, len(searchResult.Hits.Hits)) } hit := searchResult.Hits.Hits[0] var tw tweet if err := json.Unmarshal(*hit.Source, &tw); err != nil { t.Fatal(err) } if hit.Highlight == nil || len(hit.Highlight) == 0 { t.Fatal("expected hit to have a highlight; got nil") } if hl, found := hit.Highlight["message"]; found { if len(hl) != 1 { t.Fatalf("expected to have one highlight for field \"message\"; got %d", len(hl)) } expected := "Welcome to <em>Golang</em> and Elasticsearch." if hl[0] != expected { t.Errorf("expected to have highlight \"%s\"; got \"%s\"", expected, hl[0]) } } else { t.Fatal("expected to have a highlight on field \"message\"; got none") } }
{ "content_hash": "39fba9b188d210d063f48caac67edfb9", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 111, "avg_line_length": 27.256038647342994, "alnum_prop": 0.6511875221552641, "repo_name": "atomiqio/atomiq", "id": "6f077f719810f8d4ac5517075b8983edf86b8860", "size": "5826", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "vendor/gopkg.in/olivere/elastic.v5/highlight_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "489260" }, { "name": "HCL", "bytes": "11250" }, { "name": "Makefile", "bytes": "13514" }, { "name": "Protocol Buffer", "bytes": "12519" }, { "name": "Shell", "bytes": "85625" }, { "name": "Smarty", "bytes": "24497" } ], "symlink_target": "" }
import pytest from pip._internal.exceptions import InstallationError from pip._internal.req import InstallRequirement @pytest.mark.parametrize(('source', 'expected'), [ ("pep517_setup_and_pyproject", True), ("pep517_setup_only", False), ("pep517_pyproject_only", True), ]) def test_use_pep517(data, source, expected): """ Test that we choose correctly between PEP 517 and legacy code paths """ src = data.src.join(source) req = InstallRequirement(None, None, source_dir=src) req.load_pyproject_toml() assert req.use_pep517 is expected @pytest.mark.parametrize(('source', 'msg'), [ ("pep517_setup_and_pyproject", "specifies a build backend"), ("pep517_pyproject_only", "does not have a setup.py"), ]) def test_disabling_pep517_invalid(data, source, msg): """ Test that we fail if we try to disable PEP 517 when it's not acceptable """ src = data.src.join(source) req = InstallRequirement(None, None, source_dir=src) # Simulate --no-use-pep517 req.use_pep517 = False with pytest.raises(InstallationError) as e: req.load_pyproject_toml() err_msg = e.value.args[0] assert "Disabling PEP 517 processing is invalid" in err_msg assert msg in err_msg
{ "content_hash": "e962b1be09153299e1197f606006cdbf", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 30.51219512195122, "alnum_prop": 0.6810551558752997, "repo_name": "techtonik/pip", "id": "e531639c086bf667d23a1c9c34bda20de4ada37d", "size": "1251", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/unit/test_pep517.py", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "510" }, { "name": "HTML", "bytes": "2342" }, { "name": "Python", "bytes": "1122737" }, { "name": "Shell", "bytes": "2054" } ], "symlink_target": "" }
module CultomePlayer::Command module Processor # Parse a user input into a command # # @param user_input [String] The user input to be parsed. # @return [Command] The parsed command. def parse(user_input) return user_input.split("&&").collect do |usr_in| tokens = identify_tokens(get_tokens(usr_in.strip)) validate_command(:command, tokens) CultomePlayer::Objects::Command.new(tokens.shift, tokens) end end # Split the user input into tokens. # # @param user_input [String] The user input. # @return [List<String>] The detected tokens. def get_tokens(user_input) tokens = [] token = "" capturing_string = false user_input.each_char do |char| case char when /[\d\w\/:@]/ token << char when /["']/ capturing_string = !capturing_string when /[\s]/ if capturing_string token << char else tokens << token token = "" end else token << char end # case end # each tokens << token unless token.empty? raise "invalid command:unclosed string" if capturing_string return tokens end # Identify detected tokens. # # @param tokens [List<String>] The detected tokens. # @return [List<Hash>] The hash contains keys :type and :value. def identify_tokens(tokens) tokens.map do |token| id = guess_token_id(token) id.nil? ? {type: :unknown, value: token} : get_token_value(token, id) end end # Check that a the tokens identifed correspond to a player command. # # @param type [Symbol] The language structure you try to match. # @param tokens [List<Hash>] The list of tokens identified. # @return [Boolean] True if the user command match with a player command format. def validate_command(type, tokens) current_format = get_command_format(type, tokens) # extraemos el primer token, que debe ser el comando cmd = tokens.first[:value] valid_format = semantics[cmd] if valid_format.nil? if plugins_respond_to?(cmd) valid_format = plugin_command_sintax(cmd) else raise 'invalid command:invalid action' end end return current_format =~ valid_format end # Creates a string representation of the command prototype. # # @param type [Symbol] The Language structure you try to match. # @param tokens [List<Hash>] The Language structure you try to match. # @return [String] The string representation of the command prototype. def get_command_format(type, tokens) format = guess_command_format(type, tokens) return format if format.class == Symbol langs = format.split # partimos el formato y validamos cada pedazo tks = tokens.clone cmd_format = "" while !langs.empty? do # extraemos el primer elemento del formato lang = langs.shift if langs.empty? # volvemos a validar con el nuevo elemento del lenguaje cmd_format << " " << get_command_format(lang.to_sym, tks).to_s else tk = tks.shift cmd_format << " " << get_command_format(lang.to_sym, tk).to_s end end # limpiamos el formato final return cmd_format.strip.gsub(" ", " ") end private def guess_token_id(token) token_identities.find do |tok_id| token =~ tok_id[:identity] end end def get_token_value(token, id) captures = id[:captures] || 1 labels = id[:labels] || [:value] token_info = {type: id[:type]} token =~ id[:identity] (1..captures).to_a.zip(labels).each do |idx, label| token_info[label] = eval("$#{idx}") end return token_info end def guess_command_format(type, tokens) # buscamos el formato que tenga mas matches con los parametros format = sintax[type].find do |stxs_elem| # ["action", "action parameters"] if stxs_elem.is_a?(String) # checamos si el numero de token en el comando corresponde # con el numer de tokens en la sintax stxs_elem.split.size >= tokens.size # ej. "play 1 2" === "action paramters" elsif stxs_elem.is_a?(Symbol) if tokens.is_a?(Hash) tokens[:type] == stxs_elem elsif tokens.is_a?(Array) && tokens.size == 1 tokens.first[:type] == stxs_elem else false end else raise 'invalid command:invalid command format' end end if format.nil? max = sintax[type].max{|tk| tk.class == String ? tk.split.size: 0} if max.respond_to?(:split) && tokens.size > max.split.size format = max else raise 'invalid command:invalid command' end end return format end end end
{ "content_hash": "109fc2119d0a8ed1c3b76d85f4bc7a1a", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 86, "avg_line_length": 29.87425149700599, "alnum_prop": 0.5884946883142914, "repo_name": "cultome/cultome_player", "id": "f5b27355613bef0cae80e7144f23cf142d208ece", "size": "4989", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/cultome_player/command/processor.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "176150" } ], "symlink_target": "" }
package com.predic8.membrane.starter; import org.springframework.context.annotation.Import; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Import(MembraneMarkerConfiguration.class) public @interface EnableMembrane { }
{ "content_hash": "8c54cbd806412e699816a310245ac48c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 53, "avg_line_length": 28.357142857142858, "alnum_prop": 0.8438287153652393, "repo_name": "membrane/membrane-spring-boot-starter", "id": "68dbd953f87ec6d7ee21e38593cbe2d28b509e46", "size": "397", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/predic8/membrane/starter/EnableMembrane.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5006" }, { "name": "Java", "bytes": "33016" }, { "name": "Shell", "bytes": "7058" } ], "symlink_target": "" }
package org.elasticsearch.indices; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.elasticsearch.cluster.metadata.ComponentTemplate; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.metadata.Metadata; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; import static org.elasticsearch.indices.AssociatedIndexDescriptor.buildAutomaton; /** * Describes a {@link DataStream} that is reserved for use by a system component. The data stream will be managed by the system and also * protected by the system against user modification so that system features are not broken by inadvertent user operations. */ public class SystemDataStreamDescriptor { private final String dataStreamName; private final String description; private final Type type; private final ComposableIndexTemplate composableIndexTemplate; private final Map<String, ComponentTemplate> componentTemplates; private final List<String> allowedElasticProductOrigins; private final ExecutorNames executorNames; private final CharacterRunAutomaton characterRunAutomaton; /** * Creates a new descriptor for a system data descriptor * @param dataStreamName the name of the data stream. Must not be {@code null} * @param description a brief description of what the data stream is used for. Must not be {@code null} * @param type the {@link Type} of the data stream which determines how the data stream can be accessed. Must not be {@code null} * @param composableIndexTemplate the {@link ComposableIndexTemplate} that contains the mappings and settings for the data stream. * Must not be {@code null} * @param componentTemplates a map that contains {@link ComponentTemplate} instances corresponding to those references in the * {@link ComposableIndexTemplate} * @param allowedElasticProductOrigins a list of product origin values that are allowed to access this data stream if the * type is {@link Type#EXTERNAL}. Must not be {@code null} * @param executorNames thread pools that should be used for operations on the system data stream */ public SystemDataStreamDescriptor( String dataStreamName, String description, Type type, ComposableIndexTemplate composableIndexTemplate, Map<String, ComponentTemplate> componentTemplates, List<String> allowedElasticProductOrigins, ExecutorNames executorNames ) { this.dataStreamName = Objects.requireNonNull(dataStreamName, "dataStreamName must be specified"); if (dataStreamName.length() < 2) { throw new IllegalArgumentException("system data stream name [" + dataStreamName + "] but must at least 2 characters in length"); } if (dataStreamName.charAt(0) != '.') { throw new IllegalArgumentException("system data stream name [" + dataStreamName + "] but must start with the character [.]"); } this.description = Objects.requireNonNull(description, "description must be specified"); this.type = Objects.requireNonNull(type, "type must be specified"); this.composableIndexTemplate = Objects.requireNonNull(composableIndexTemplate, "composableIndexTemplate must be provided"); this.componentTemplates = componentTemplates == null ? Map.of() : Map.copyOf(componentTemplates); this.allowedElasticProductOrigins = Objects.requireNonNull( allowedElasticProductOrigins, "allowedElasticProductOrigins must not be null" ); if (type == Type.EXTERNAL && allowedElasticProductOrigins.isEmpty()) { throw new IllegalArgumentException("External system data stream without allowed products is not a valid combination"); } this.executorNames = Objects.nonNull(executorNames) ? executorNames : ExecutorNames.DEFAULT_SYSTEM_DATA_STREAM_THREAD_POOLS; this.characterRunAutomaton = new CharacterRunAutomaton(buildAutomaton(backingIndexPatternForDataStream(this.dataStreamName))); } public String getDataStreamName() { return dataStreamName; } /** * Retrieve backing indices for this system data stream * @param metadata Metadata in which to look for indices * @return List of names of backing indices */ public List<String> getBackingIndexNames(Metadata metadata) { return metadata.indices().keySet().stream().filter(this.characterRunAutomaton::run).collect(Collectors.toUnmodifiableList()); } public String getDescription() { return description; } public ComposableIndexTemplate getComposableIndexTemplate() { return composableIndexTemplate; } public boolean isExternal() { return type == Type.EXTERNAL; } public String getBackingIndexPattern() { return backingIndexPatternForDataStream(getDataStreamName()); } private static String backingIndexPatternForDataStream(String dataStream) { return DataStream.BACKING_INDEX_PREFIX + dataStream + "-*"; } public List<String> getAllowedElasticProductOrigins() { return allowedElasticProductOrigins; } public Map<String, ComponentTemplate> getComponentTemplates() { return componentTemplates; } /** * Get the names of the thread pools that should be used for operations on this data stream. * @return Names for get, search, and write executors. */ public ExecutorNames getThreadPoolNames() { return this.executorNames; } public enum Type { INTERNAL, EXTERNAL } }
{ "content_hash": "dba49a7398961bc7e7357a7a113c7894", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 140, "avg_line_length": 44.64885496183206, "alnum_prop": 0.7170456488288597, "repo_name": "GlenRSmith/elasticsearch", "id": "54072b6280b043e71bea5e466068fcb00d7774c6", "size": "6202", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "server/src/main/java/org/elasticsearch/indices/SystemDataStreamDescriptor.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11082" }, { "name": "Batchfile", "bytes": "11057" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "337461" }, { "name": "HTML", "bytes": "2186" }, { "name": "Java", "bytes": "43224931" }, { "name": "Perl", "bytes": "11756" }, { "name": "Python", "bytes": "19852" }, { "name": "Shell", "bytes": "99571" } ], "symlink_target": "" }
namespace Data { using System; using System.Collections.Generic; public partial class Entity_FrameworkItem { public int Id { get; set; } public int EntityId { get; set; } public int CategoryId { get; set; } public Nullable<int> CodeId { get; set; } public Nullable<System.DateTime> Created { get; set; } public Nullable<int> CreatedById { get; set; } public string OtherValue { get; set; } public string CodedNotation { get; set; } public virtual Codes_PropertyCategory Codes_PropertyCategory { get; set; } public virtual Entity Entity { get; set; } } }
{ "content_hash": "f1005a6b926afe286ce83220daac4f84", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 33.2, "alnum_prop": 0.6174698795180723, "repo_name": "CredentialTransparencyInitiative/CredentialFinderSearch", "id": "8e8a54af8e00aeda82afba572cce3ab7650412b5", "size": "1088", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Data/Entity_FrameworkItem.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "104" }, { "name": "C#", "bytes": "3800151" }, { "name": "CSS", "bytes": "151860" }, { "name": "HTML", "bytes": "277" }, { "name": "JavaScript", "bytes": "993409" } ], "symlink_target": "" }
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use app\components\MenuWidget; /* @var $this yii\web\View */ /* @var $model app\modules\admin\models\Category */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="category-form"> <?php $form = ActiveForm::begin(); ?> <div class="form-group field-category-parent_id"> <label class="control-label" for="category-parent_id">Родительская категория</label> <select id="category-parent_id" class="form-control" name="Category[parent_id]"> <option value="0">Самостаятельная категория</option> <?= MenuWidget::widget(['tpl' => 'select', 'model' => $model])?> </select> </div> <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?> <div class="form-group"> <?= Html::submitButton($model->isNewRecord ? 'Добавить' : 'Редактировать', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-success']) ?> </div> <?php ActiveForm::end(); ?> </div>
{ "content_hash": "e39d3c6f8955ba8825f55599c7aaaa9d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 159, "avg_line_length": 32.55555555555556, "alnum_prop": 0.6083617747440273, "repo_name": "Sothik/yii2.site", "id": "35a001e15fc2d64c0f1e4b4ad3ce8d753322bbf7", "size": "1238", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/admin/views/category/_form.php", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1030" }, { "name": "CSS", "bytes": "53318" }, { "name": "JavaScript", "bytes": "82246" }, { "name": "PHP", "bytes": "166915" } ], "symlink_target": "" }
class Functional { public: Functional(); ~Functional(); void set_functional(const char *line); int set_order(const int order, xcfun_t * fun) const; bool is_gga; // FIXME make private bool is_tau_mgga; // FIXME make private std::vector<std::string> keys; // FIXME make private std::vector<double> weights; // FIXME make private private: Functional(const Functional &rhs); // not implemented Functional &operator=(const Functional &rhs); // not implemented char *functional_line; void parse(const char *line); void nullify(); bool is_synced; };
{ "content_hash": "546d4d7c950020bd60d9b8f03df38ddf", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 68, "avg_line_length": 26.12, "alnum_prop": 0.6140888208269525, "repo_name": "bast/xcint", "id": "99bd3534fb59345cacb1ed8e9b3ca21662c05284", "size": "730", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Functional.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "6007" }, { "name": "C++", "bytes": "121504" }, { "name": "CMake", "bytes": "33844" }, { "name": "FORTRAN", "bytes": "21808" }, { "name": "Python", "bytes": "76333" } ], "symlink_target": "" }
package org.apache.geode.cache.wan; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.internal.AvailablePort; import org.apache.geode.management.internal.i18n.CliStrings; import org.apache.geode.test.dunit.DistributedTestUtils; import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.NetworkUtils; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.version.VersionManager; public class WANRollingUpgradeCreateGatewaySenderMixedSiteOneCurrentSiteTwo extends WANRollingUpgradeDUnitTest { @Test public void CreateGatewaySenderMixedSiteOneCurrentSiteTwo() throws Exception { final Host host = Host.getHost(0); // Get mixed site members VM site1Locator = host.getVM(oldVersion, 0); VM site1Server1 = host.getVM(oldVersion, 1); VM site1Server2 = host.getVM(oldVersion, 2); // Get current site members VM site2Locator = host.getVM(VersionManager.CURRENT_VERSION, 4); VM site2Server1 = host.getVM(VersionManager.CURRENT_VERSION, 5); VM site2Server2 = host.getVM(VersionManager.CURRENT_VERSION, 6); // Get mixed site locator properties String hostName = NetworkUtils.getServerHostName(host); final int site1LocatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); site1Locator.invoke(() -> DistributedTestUtils.deleteLocatorStateFile(site1LocatorPort)); final String site1Locators = hostName + "[" + site1LocatorPort + "]"; final int site1DistributedSystemId = 0; // Get current site locator properties final int site2LocatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); site2Locator.invoke(() -> DistributedTestUtils.deleteLocatorStateFile(site2LocatorPort)); final String site2Locators = hostName + "[" + site2LocatorPort + "]"; final int site2DistributedSystemId = 1; // Start mixed site locator site1Locator.invoke(() -> startLocator(site1LocatorPort, site1DistributedSystemId, site1Locators, site2Locators)); // Locators before 1.4 handled configuration asynchronously. // We must wait for configuration configuration to be ready, or confirm that it is disabled. site1Locator.invoke( () -> await() .untilAsserted(() -> assertTrue( !InternalLocator.getLocator().getConfig().getEnableClusterConfiguration() || InternalLocator.getLocator().isSharedConfigurationRunning()))); // Start current site locator site2Locator.invoke(() -> startLocator(site2LocatorPort, site2DistributedSystemId, site2Locators, site1Locators)); // Start current site servers with receivers site2Server1.invoke(() -> createCache(site2Locators)); site2Server1.invoke(() -> createGatewayReceiver()); site2Server2.invoke(() -> createCache(site2Locators)); site2Server2.invoke(() -> createGatewayReceiver()); // Start mixed site servers site1Server1.invoke(() -> createCache(site1Locators)); site1Server2.invoke(() -> createCache(site1Locators)); // Roll mixed site locator to current with jmx manager site1Locator.invoke(() -> stopLocator()); VM site1RolledLocator = host.getVM(VersionManager.CURRENT_VERSION, site1Locator.getId()); int jmxManagerPort = site1RolledLocator.invoke(() -> startLocatorWithJmxManager(site1LocatorPort, site1DistributedSystemId, site1Locators, site2Locators)); // Roll one mixed site server to current site1Server2.invoke(() -> closeCache()); VM site1Server2RolledServer = host.getVM(VersionManager.CURRENT_VERSION, site1Server2.getId()); site1Server2RolledServer.invoke(() -> createCache(site1Locators)); // Use gfsh to attempt to create a gateway sender in the mixed site servers this.gfsh.connectAndVerify(jmxManagerPort, GfshCommandRule.PortType.jmxManager); this.gfsh .executeAndAssertThat(getCreateGatewaySenderCommand("toSite2", site2DistributedSystemId)) .statusIsError() .containsOutput(CliStrings.CREATE_GATEWAYSENDER__MSG__CAN_NOT_CREATE_DIFFERENT_VERSIONS); } }
{ "content_hash": "961fdf16b09b9f4023a92a5d0c44e3f6", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 99, "avg_line_length": 45.734042553191486, "alnum_prop": 0.7490113979995348, "repo_name": "davebarnes97/geode", "id": "465c1a3f9f73c39956d9f0731f8bc684d8e5f6eb", "size": "5088", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "geode-wan/src/upgradeTest/java/org/apache/geode/cache/wan/WANRollingUpgradeCreateGatewaySenderMixedSiteOneCurrentSiteTwo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "106708" }, { "name": "Dockerfile", "bytes": "17835" }, { "name": "Go", "bytes": "1205" }, { "name": "Groovy", "bytes": "38590" }, { "name": "HTML", "bytes": "3855237" }, { "name": "Java", "bytes": "31895961" }, { "name": "JavaScript", "bytes": "1781602" }, { "name": "Python", "bytes": "30033" }, { "name": "Ruby", "bytes": "6698" }, { "name": "Shell", "bytes": "190751" } ], "symlink_target": "" }
package com.maxiee.heartbeatsdk; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.maxiee.hbsdk.api.EventAPI; import com.maxiee.hbsdk.api.ThoughtAPI; import com.maxiee.hbsdk.model.Event; import com.maxiee.hbsdk.model.Thought; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; public class MainActivity extends AppCompatActivity { @Bind(R.id.random_event) Button mRandomEventButton; @Bind(R.id.get_event) Button mGetEventButton; @Bind(R.id.input_id) EditText mIdInput; @Bind(R.id.get_thoughts) Button mGetThoughtButton; @Bind(R.id.input_id_thought)EditText mIdThoughtInput; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); } @OnClick(R.id.random_event) public void randomEvent() { Event e = EventAPI.random(this); Toast.makeText(MainActivity.this, e.getEvent(), Toast.LENGTH_SHORT).show(); } @OnClick(R.id.get_event) public void getEvent() { String input = mIdInput.getText().toString(); if (input.isEmpty()) { Toast.makeText(MainActivity.this, "Please input id.", Toast.LENGTH_SHORT).show(); return; } Event e = EventAPI.getEvent(this, Long.parseLong(input)); if (e == null) { Toast.makeText(MainActivity.this, "This id has no event.", Toast.LENGTH_SHORT).show(); return; } Toast.makeText(MainActivity.this, e.getEvent(), Toast.LENGTH_SHORT).show(); } @OnClick(R.id.get_thoughts) public void getThoughts() { String input = mIdThoughtInput.getText().toString(); if (input.isEmpty()) { Toast.makeText(MainActivity.this, "Please input id.", Toast.LENGTH_SHORT).show(); return; } List<Thought> thoughtList = ThoughtAPI.getThought(this, Long.parseLong(input)); if (thoughtList == null) { Toast.makeText(MainActivity.this, "This id has no thoughts.", Toast.LENGTH_SHORT).show(); return; } Toast.makeText(MainActivity.this, thoughtListToString(thoughtList), Toast.LENGTH_SHORT).show(); } private static String thoughtListToString(List<Thought> thoughtList) { String ret = ""; for (Thought t: thoughtList) { ret += "[" + t.getKey() + "][" + t.getThought() + "][" + t.getResType() + "]\n"; } return ret; } }
{ "content_hash": "a9c46cad74d0ba496e1425364c935c2f", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 103, "avg_line_length": 34.833333333333336, "alnum_prop": 0.6433566433566433, "repo_name": "maxiee/HeartBeatSDK", "id": "fc039354044ed7739a79cafef74f73f6686fbba4", "size": "2717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/maxiee/heartbeatsdk/MainActivity.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "34045" } ], "symlink_target": "" }
package exec import ( "bytes" "errors" "io" "os" "path/filepath" "strconv" "sync" "syscall" ) // Error records the name of a binary that failed to be executed // and the reason it failed. type Error struct { Name string Err error } func (e *Error) Error() string { return "exec: " + strconv.Quote(e.Name) + ": " + e.Err.Error() } // Cmd represents an external command being prepared or run. type Cmd struct { // Path is the path of the command to run. // // This is the only field that must be set to a non-zero // value. If Path is relative, it is evaluated relative // to Dir. Path string // Args holds command line arguments, including the command as Args[0]. // If the Args field is empty or nil, Run uses {Path}. // // In typical use, both Path and Args are set by calling Command. Args []string // Env specifies the environment of the process. // If Env is nil, Run uses the current process's environment. Env []string // Dir specifies the working directory of the command. // If Dir is the empty string, Run runs the command in the // calling process's current directory. Dir string // Stdin specifies the process's standard input. If Stdin is // nil, the process reads from the null device (os.DevNull). Stdin io.Reader // Stdout and Stderr specify the process's standard output and error. // // If either is nil, Run connects the corresponding file descriptor // to the null device (os.DevNull). // // If Stdout and Stderr are the same writer, at most one // goroutine at a time will call Write. Stdout io.Writer Stderr io.Writer // ExtraFiles specifies additional open files to be inherited by the // new process. It does not include standard input, standard output, or // standard error. If non-nil, entry i becomes file descriptor 3+i. // // BUG: on OS X 10.6, child processes may sometimes inherit unwanted fds. // http://golang.org/issue/2603 ExtraFiles []*os.File // SysProcAttr holds optional, operating system-specific attributes. // Run passes it to os.StartProcess as the os.ProcAttr's Sys field. SysProcAttr *syscall.SysProcAttr // Process is the underlying process, once started. Process *os.Process // ProcessState contains information about an exited process, // available after a call to Wait or Run. ProcessState *os.ProcessState lookPathErr error // LookPath error, if any. finished bool // when Wait was called childFiles []*os.File closeAfterStart []io.Closer closeAfterWait []io.Closer goroutine []func() error errch chan error // one send per goroutine } // Command returns the Cmd struct to execute the named program with // the given arguments. // // It sets only the Path and Args in the returned structure. // // If name contains no path separators, Command uses LookPath to // resolve the path to a complete name if possible. Otherwise it uses // name directly. // // The returned Cmd's Args field is constructed from the command name // followed by the elements of arg, so arg should not include the // command name itself. For example, Command("echo", "hello") func Command(name string, arg ...string) *Cmd { cmd := &Cmd{ Path: name, Args: append([]string{name}, arg...), } if filepath.Base(name) == name { if lp, err := LookPath(name); err != nil { cmd.lookPathErr = err } else { cmd.Path = lp } } return cmd } // interfaceEqual protects against panics from doing equality tests on // two interfaces with non-comparable underlying types. func interfaceEqual(a, b interface{}) bool { defer func() { recover() }() return a == b } func (c *Cmd) envv() []string { if c.Env != nil { return c.Env } return os.Environ() } func (c *Cmd) argv() []string { if len(c.Args) > 0 { return c.Args } return []string{c.Path} } func (c *Cmd) stdin() (f *os.File, err error) { if c.Stdin == nil { f, err = os.Open(os.DevNull) if err != nil { return } c.closeAfterStart = append(c.closeAfterStart, f) return } if f, ok := c.Stdin.(*os.File); ok { return f, nil } pr, pw, err := os.Pipe() if err != nil { return } c.closeAfterStart = append(c.closeAfterStart, pr) c.closeAfterWait = append(c.closeAfterWait, pw) c.goroutine = append(c.goroutine, func() error { _, err := io.Copy(pw, c.Stdin) if err1 := pw.Close(); err == nil { err = err1 } return err }) return pr, nil } func (c *Cmd) stdout() (f *os.File, err error) { return c.writerDescriptor(c.Stdout) } func (c *Cmd) stderr() (f *os.File, err error) { if c.Stderr != nil && interfaceEqual(c.Stderr, c.Stdout) { return c.childFiles[1], nil } return c.writerDescriptor(c.Stderr) } func (c *Cmd) writerDescriptor(w io.Writer) (f *os.File, err error) { if w == nil { f, err = os.OpenFile(os.DevNull, os.O_WRONLY, 0) if err != nil { return } c.closeAfterStart = append(c.closeAfterStart, f) return } if f, ok := w.(*os.File); ok { return f, nil } pr, pw, err := os.Pipe() if err != nil { return } c.closeAfterStart = append(c.closeAfterStart, pw) c.closeAfterWait = append(c.closeAfterWait, pr) c.goroutine = append(c.goroutine, func() error { _, err := io.Copy(w, pr) return err }) return pw, nil } func (c *Cmd) closeDescriptors(closers []io.Closer) { for _, fd := range closers { fd.Close() } } // Run starts the specified command and waits for it to complete. // // The returned error is nil if the command runs, has no problems // copying stdin, stdout, and stderr, and exits with a zero exit // status. // // If the command fails to run or doesn't complete successfully, the // error is of type *ExitError. Other error types may be // returned for I/O problems. func (c *Cmd) Run() error { if err := c.Start(); err != nil { return err } return c.Wait() } // Start starts the specified command but does not wait for it to complete. // // The Wait method will return the exit code and release associated resources // once the command exits. func (c *Cmd) Start() error { if c.lookPathErr != nil { c.closeDescriptors(c.closeAfterStart) c.closeDescriptors(c.closeAfterWait) return c.lookPathErr } if c.Process != nil { return errors.New("exec: already started") } type F func(*Cmd) (*os.File, error) for _, setupFd := range []F{(*Cmd).stdin, (*Cmd).stdout, (*Cmd).stderr} { fd, err := setupFd(c) if err != nil { c.closeDescriptors(c.closeAfterStart) c.closeDescriptors(c.closeAfterWait) return err } c.childFiles = append(c.childFiles, fd) } c.childFiles = append(c.childFiles, c.ExtraFiles...) var err error c.Process, err = os.StartProcess(c.Path, c.argv(), &os.ProcAttr{ Dir: c.Dir, Files: c.childFiles, Env: c.envv(), Sys: c.SysProcAttr, }) if err != nil { c.closeDescriptors(c.closeAfterStart) c.closeDescriptors(c.closeAfterWait) return err } c.closeDescriptors(c.closeAfterStart) c.errch = make(chan error, len(c.goroutine)) for _, fn := range c.goroutine { go func(fn func() error) { c.errch <- fn() }(fn) } return nil } // An ExitError reports an unsuccessful exit by a command. type ExitError struct { *os.ProcessState } func (e *ExitError) Error() string { return e.ProcessState.String() } // Wait waits for the command to exit. // It must have been started by Start. // // The returned error is nil if the command runs, has no problems // copying stdin, stdout, and stderr, and exits with a zero exit // status. // // If the command fails to run or doesn't complete successfully, the // error is of type *ExitError. Other error types may be // returned for I/O problems. // // Wait releases any resources associated with the Cmd. func (c *Cmd) Wait() error { if c.Process == nil { return errors.New("exec: not started") } if c.finished { return errors.New("exec: Wait was already called") } c.finished = true state, err := c.Process.Wait() c.ProcessState = state var copyError error for _ = range c.goroutine { if err := <-c.errch; err != nil && copyError == nil { copyError = err } } c.closeDescriptors(c.closeAfterWait) if err != nil { return err } else if !state.Success() { return &ExitError{state} } return copyError } // Output runs the command and returns its standard output. func (c *Cmd) Output() ([]byte, error) { if c.Stdout != nil { return nil, errors.New("exec: Stdout already set") } var b bytes.Buffer c.Stdout = &b err := c.Run() return b.Bytes(), err } // CombinedOutput runs the command and returns its combined standard // output and standard error. func (c *Cmd) CombinedOutput() ([]byte, error) { if c.Stdout != nil { return nil, errors.New("exec: Stdout already set") } if c.Stderr != nil { return nil, errors.New("exec: Stderr already set") } var b bytes.Buffer c.Stdout = &b c.Stderr = &b err := c.Run() return b.Bytes(), err } // StdinPipe returns a pipe that will be connected to the command's // standard input when the command starts. // The pipe will be closed automatically after Wait sees the command exit. // A caller need only call Close to force the pipe to close sooner. // For example, if the command being run will not exit until standard input // is closed, the caller must close the pipe. func (c *Cmd) StdinPipe() (io.WriteCloser, error) { if c.Stdin != nil { return nil, errors.New("exec: Stdin already set") } if c.Process != nil { return nil, errors.New("exec: StdinPipe after process started") } pr, pw, err := os.Pipe() if err != nil { return nil, err } c.Stdin = pr c.closeAfterStart = append(c.closeAfterStart, pr) wc := &closeOnce{File: pw} c.closeAfterWait = append(c.closeAfterWait, wc) return wc, nil } type closeOnce struct { *os.File close sync.Once closeErr error } func (c *closeOnce) Close() error { c.close.Do(func() { c.closeErr = c.File.Close() }) return c.closeErr } // StdoutPipe returns a pipe that will be connected to the command's // standard output when the command starts. // // Wait will close the pipe after seeing the command exit, so most callers // need not close the pipe themselves; however, an implication is that // it is incorrect to call Wait before all reads from the pipe have completed. // For the same reason, it is incorrect to call Run when using StdoutPipe. // See the example for idiomatic usage. func (c *Cmd) StdoutPipe() (io.ReadCloser, error) { if c.Stdout != nil { return nil, errors.New("exec: Stdout already set") } if c.Process != nil { return nil, errors.New("exec: StdoutPipe after process started") } pr, pw, err := os.Pipe() if err != nil { return nil, err } c.Stdout = pw c.closeAfterStart = append(c.closeAfterStart, pw) c.closeAfterWait = append(c.closeAfterWait, pr) return pr, nil } // StderrPipe returns a pipe that will be connected to the command's // standard error when the command starts. // // Wait will close the pipe after seeing the command exit, so most callers // need not close the pipe themselves; however, an implication is that // it is incorrect to call Wait before all reads from the pipe have completed. // For the same reason, it is incorrect to use Run when using StderrPipe. // See the StdoutPipe example for idiomatic usage. func (c *Cmd) StderrPipe() (io.ReadCloser, error) { if c.Stderr != nil { return nil, errors.New("exec: Stderr already set") } if c.Process != nil { return nil, errors.New("exec: StderrPipe after process started") } pr, pw, err := os.Pipe() if err != nil { return nil, err } c.Stderr = pw c.closeAfterStart = append(c.closeAfterStart, pw) c.closeAfterWait = append(c.closeAfterWait, pr) return pr, nil }
{ "content_hash": "94480bc474701930643fbf48e7d7c515", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 78, "avg_line_length": 25.941834451901567, "alnum_prop": 0.684115212142118, "repo_name": "glycerine/jeaten-go-arrayof-structof", "id": "d2cee03fcd0277861c5903a27a8f8fc84b35b66c", "size": "11922", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/pkg/os/exec/exec.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "100" }, { "name": "Assembly", "bytes": "618427" }, { "name": "Awk", "bytes": "3851" }, { "name": "Bison", "bytes": "90140" }, { "name": "C", "bytes": "4972454" }, { "name": "C++", "bytes": "117212" }, { "name": "CSS", "bytes": "8" }, { "name": "Emacs Lisp", "bytes": "49391" }, { "name": "Go", "bytes": "16359785" }, { "name": "HTML", "bytes": "1094" }, { "name": "JavaScript", "bytes": "2308" }, { "name": "Logos", "bytes": "1248" }, { "name": "Makefile", "bytes": "7156" }, { "name": "Objective-C", "bytes": "18417" }, { "name": "Perl", "bytes": "200123" }, { "name": "Python", "bytes": "121132" }, { "name": "Shell", "bytes": "96350" }, { "name": "VimL", "bytes": "28149" } ], "symlink_target": "" }
<?php /** * Created by PhpStorm. * User: reglobbe * Date: 28/8/15 * Time: 4:31 PM */ namespace auction\widgets\grid; use auction\components\Auction; use yii\grid\Column; use dosamigos\datepicker\DatePicker; class DatePickerColumn extends Column{ /** * @var string [ 'header' => 'Create Date', 'value' => function($model){ return Auction::$app->formatter->asDate($model->create_date); }, 'filter' => DatePicker::widget([ 'model' => $searchModel, 'attribute' => 'create_date', 'template' => '{addon}{input}', 'clientOptions' => [ 'autoclose' => true, 'format' => 'yyyy-mm-dd', 'disableEntry'=>true, ], 'options' => [ 'data-pjax' => false ] ]) ], */ public $header = 'Create date'; public $dateColumn = 'create_date'; protected function renderDataCellContent($model, $key, $index) { $dateColumn = $this->dateColumn; return Auction::$app->formatter->asDate($model->$dateColumn); } protected function renderFilterCellContent() { return DatePicker::widget([ 'model' => $this->grid->filterModel, 'attribute' => $this->dateColumn, 'template' => '{addon}{input}', 'clientOptions' => [ 'autoclose' => true, 'format' => 'yyyy-mm-dd', 'disableEntry'=>true, ], 'options' => [ 'data-pjax' => '0', ] ]); } }
{ "content_hash": "29ebcc97dc8e0337f64fc7fabc820afe", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 69, "avg_line_length": 21.855072463768117, "alnum_prop": 0.5265251989389921, "repo_name": "harish-reglobbe/Auction", "id": "d5a2ae3559925497213022a578fb0660f2ef3ba0", "size": "1508", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "auction/widgets/grid/DatePickerColumn.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "420" }, { "name": "Batchfile", "bytes": "1541" }, { "name": "CSS", "bytes": "13000" }, { "name": "JavaScript", "bytes": "7516" }, { "name": "PHP", "bytes": "581737" } ], "symlink_target": "" }
<?php namespace ChrisHalbert\PhpBCC\Input; /** * Interface InputInterface * @package ChrisHalbert\PhpBCC\Input */ interface InputInterface { /** * InputInterface constructor. * @param string $path The path to the input file. */ public function __construct(string $path); }
{ "content_hash": "4e390621739fdecbeab9a813ddb49ca0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 54, "avg_line_length": 18.8125, "alnum_prop": 0.6810631229235881, "repo_name": "chrishalbert/phpbcc", "id": "fc35293cfa7f064238901c83ec6c7894fedf2c07", "size": "301", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Input/InputInterface.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "37267" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SqliteMergeModule")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("SqliteMergeModule")] [assembly: AssemblyCopyright("Copyright © Public Domain 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9c0dd96a-551e-4c74-9090-540bbffb2dbc")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.60.0")] [assembly: AssemblyFileVersion("1.0.60.0")]
{ "content_hash": "de66bec5c9be155a6aa7bb3be7f6594b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.75, "alnum_prop": 0.750524109014675, "repo_name": "SamSaffron/simplestorageengine", "id": "c0fbce8de7eda53b728edc56052703de217b76a2", "size": "1434", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SqliteMergeModule/Properties/AssemblyInfo.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "62403" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_27) on Wed Mar 06 23:03:08 EET 2013 --> <TITLE> Uses of Class org.smslib.USSDResultPresentation (SMSLib 3.5.3) </TITLE> <META NAME="date" CONTENT="2013-03-06"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.smslib.USSDResultPresentation (SMSLib 3.5.3)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>SMSLib 3.5.3</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/smslib/\class-useUSSDResultPresentation.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="USSDResultPresentation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.smslib.USSDResultPresentation</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.smslib"><B>org.smslib</B></A></TD> <TD>Main SMSLib classes.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.smslib"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A> in <A HREF="../../../org/smslib/package-summary.html">org.smslib</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../org/smslib/package-summary.html">org.smslib</A> that return <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></CODE></FONT></TD> <TD><CODE><B>USSDRequest.</B><B><A HREF="../../../org/smslib/USSDRequest.html#getResultPresentation()">getResultPresentation</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></CODE></FONT></TD> <TD><CODE><B>USSDResultPresentation.</B><B><A HREF="../../../org/smslib/USSDResultPresentation.html#valueOf(java.lang.String)">valueOf</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the enum constant of this type with the specified name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A>[]</CODE></FONT></TD> <TD><CODE><B>USSDResultPresentation.</B><B><A HREF="../../../org/smslib/USSDResultPresentation.html#values()">values</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the constants of this enum type, in the order they are declared.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../org/smslib/package-summary.html">org.smslib</A> with parameters of type <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>USSDRequest.</B><B><A HREF="../../../org/smslib/USSDRequest.html#setUSSDResultPresentation(org.smslib.USSDResultPresentation)">setUSSDResultPresentation</A></B>(<A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A>&nbsp;aResultPresentation)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../org/smslib/package-summary.html">org.smslib</A> with parameters of type <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../org/smslib/USSDRequest.html#USSDRequest(org.smslib.USSDResultPresentation, java.lang.String, org.smslib.USSDDcs, java.lang.String)">USSDRequest</A></B>(<A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib">USSDResultPresentation</A>&nbsp;aPresentation, java.lang.String&nbsp;aContent, <A HREF="../../../org/smslib/USSDDcs.html" title="enum in org.smslib">USSDDcs</A>&nbsp;aDcs, java.lang.String&nbsp;aGatewayId)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Full constructor</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/smslib/USSDResultPresentation.html" title="enum in org.smslib"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>SMSLib 3.5.3</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/smslib/\class-useUSSDResultPresentation.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="USSDResultPresentation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> (c) 2002-2011, http://smslib.org </BODY> </HTML>
{ "content_hash": "ad7f855062a499a4686d096540383693", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 318, "avg_line_length": 47.595652173913045, "alnum_prop": 0.6385311044121678, "repo_name": "markodudic/boatguard-sms-server", "id": "02945383cd98bf48c6818f9523884da8686bbfa4", "size": "10947", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javadoc/org/smslib/class-use/USSDResultPresentation.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "11133" }, { "name": "Java", "bytes": "896137" }, { "name": "PLSQL", "bytes": "2542" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>dpdgraph: 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 / extra-dev</a></li> <li class="active"><a href="">8.10.0 / dpdgraph - 0.6</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> dpdgraph <small> 0.6 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2020-08-03 21:31:15 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-03 21:31:15 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.10.0 Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;yves.bertot@inria.fr&quot; license: &quot;LGPL 2.1&quot; homepage: &quot;https://github.com/karmaki/coq-dpdgraph&quot; build: [ [&quot;./configure&quot;] [&quot;echo&quot; &quot;%{jobs}%&quot; &quot;jobs for the linter&quot;] [make] ] bug-reports: &quot;https://github.com/karmaki/coq-dpdgraph/issues&quot; dev-repo: &quot;git+https://github.com/karmaki/coq-dpdgraph.git&quot; install: [ [make &quot;install&quot; &quot;BINDIR=%{bin}%&quot;] ] remove: [ [&quot;rm&quot; &quot;%{bin}%/dpd2dot&quot; &quot;%{bin}%/dpdusage&quot;] [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/dpdgraph&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.6~&quot;} &quot;ocamlgraph&quot; ] authors: [ &quot;Anne Pacalet&quot; &quot;Yves Bertot&quot;] synopsis: &quot;Compute dependencies between Coq objects (definitions, theorems)&quot; description: &quot;and produce graphs&quot; flags: light-uninstall url { src: &quot;https://github.com/ybertot/coq-dpdgraph/archive/coq-dpdgraph-0.6.rc1.zip&quot; checksum: &quot;md5=959e3fbe425fc8c4189635db736fbc9e&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-dpdgraph.0.6 coq.8.10.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.10.0). The following dependencies couldn&#39;t be met: - coq-dpdgraph -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) 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-dpdgraph.0.6</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": "19c6e76dfd0c6d79580b3f00d6bd1de8", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 159, "avg_line_length": 39.63583815028902, "alnum_prop": 0.5353653201108356, "repo_name": "coq-bench/coq-bench.github.io", "id": "ac4db8d37d1b9544a25c8661c004d3624219bb53", "size": "6882", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.1-2.0.6/extra-dev/8.10.0/dpdgraph/0.6.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
name: UI feedback about: Give feedback on the UI experience. title: 'UI feedback: ' labels: 'UI/UX, Feedback' --- **Describe the solution you'd like** A clear and concise description of your feedback. **Screenshots** If you have screenshots that clarifies your feedback, please add it here.
{ "content_hash": "8a99fd2dd0b2180610650d4e9074e1d8", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 24.5, "alnum_prop": 0.7482993197278912, "repo_name": "google/timesketch", "id": "5ac26f9ed8b7c57fb2a3f139fac1e8fdb748727e", "size": "298", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".github/ISSUE_TEMPLATE/ui_feedback.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "245" }, { "name": "Dockerfile", "bytes": "3735" }, { "name": "HTML", "bytes": "8718" }, { "name": "JavaScript", "bytes": "97456" }, { "name": "Jupyter Notebook", "bytes": "340247" }, { "name": "Makefile", "bytes": "593" }, { "name": "Mako", "bytes": "412" }, { "name": "PowerShell", "bytes": "7120" }, { "name": "Python", "bytes": "1859758" }, { "name": "SCSS", "bytes": "17377" }, { "name": "Shell", "bytes": "22830" }, { "name": "Vue", "bytes": "584825" } ], "symlink_target": "" }
A Isomorphic Router for meteor ## Documentation The docs are split into two documents. First the guide, It's located below this section. It's still a work in progress. Then the [API documentation](https://github.com/Kriegslustig/meteor-iso-router/blob/master/DOCS.md). It documents _every_ object and function available. ## Guide I wrote this package because I didn't like the currently existing options. Iron-Router is to big and Flow-Router isn't isomorphic. I thought I'd build something even simpler than Flow-Router. It uses Page which is a npm package for client-side routing. The package isn't too big, but it does have some features which aren't strictly necessary. Those bloat Flow-Router. Iso-Router is isomorphic, so I didn't have to reimplement anything for the server-side and was able to scrape off a lot of complexity. Iso-Router is event-driven and isomorphic. When using it you simply instantiate the `Route` object and add event-listener using the `addListener` function on it. `Route` objects emit two different events; `enter` and `exit`. They pretty much speak for them self. `enter` fires when a user enters a router and `exit` fires when a user exits one. The events pass an event object to their callbacks. It's structured as follows: ```js e = { // A node.js reuqest object. Only availible on the server-side request: http.clientRequest, // A node.js response object. Only availible on the server-side response: http.serverResponse, // A function calling the next middleware on the connect stack. Other event-listeners will be called all the same. This is mainly for internal use. next: connectHandle, // The parsed parameters defined in the route using the ':name' syntax parameters: { name: value }, // The path that was requested path: '/something' } ``` This guide is a work in progress. ## Usage ```js if(Meteor.isClient) { IsoRouter.route('/start') .addListener('enter', function renderStart (e) { Blaze.renderWithData( Template.start, {header: 'hi!'}, document.body ) }) .addListener('enter', function enterStart (e) { Meteor.subscribe('someSub', e.next) }) .addListener('exit', function clearBody () { document.body = '' }) } else { IsoRouter.route('/somthing.txt') .addListener('enter', function serveSomething (e) { e.response.end('hi') }) } ``` ## TODO
{ "content_hash": "a5964e5b04a36d525becb6c3b0880184", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 503, "avg_line_length": 41.58620689655172, "alnum_prop": 0.7180762852404643, "repo_name": "Kriegslustig/meteor-iso-router", "id": "43ab7cac67c39689224c56e17214338b3295cc45", "size": "2433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "20918" }, { "name": "Shell", "bytes": "59" } ], "symlink_target": "" }
package edu.nju.data.repository.crud; import edu.nju.data.entity.MemberEntity; import edu.nju.util.enums.MemberState; import org.springframework.data.repository.CrudRepository; import java.util.List; /** * member repository * @author cuihao */ public interface MemberRepository extends CrudRepository<MemberEntity,Integer>{ List<MemberEntity> findByState(MemberState state); List<MemberEntity> findByLevelBetween(int level1, int level2); List<MemberEntity> findByLevelGreaterThan(int level); List<MemberEntity> findByScoreBetween(int score1, int score2); List<MemberEntity> findByScoreGreaterThan(int score); List<MemberEntity> findByRemainBetween(int remain1, int remain2); List<MemberEntity> findByRemainGreaterThan(int remain); MemberEntity findByName(String name); }
{ "content_hash": "10cabccbf7881a6e93805333168fbf6a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 26.387096774193548, "alnum_prop": 0.78239608801956, "repo_name": "cuiods/HostelWorld", "id": "3f40ea28ea41c1a6f4dab267bba586748772c9fe", "size": "818", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/edu/nju/data/repository/crud/MemberRepository.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "123" }, { "name": "Java", "bytes": "229706" } ], "symlink_target": "" }
"""Tests for supervisor.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import os import shutil import time import uuid from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf from tensorflow.core.protobuf import meta_graph_pb2 from tensorflow.python.framework import meta_graph def _summary_iterator(test_dir): """Reads events from test_dir/events. Args: test_dir: Name of the test directory. Returns: A summary_iterator """ event_paths = sorted(glob.glob(os.path.join(test_dir, "event*"))) return tf.train.summary_iterator(event_paths[-1]) def _test_dir(test_name): test_dir = os.path.join(tf.test.get_temp_dir(), test_name) if os.path.exists(test_dir): shutil.rmtree(test_dir) return test_dir class SupervisorTest(tf.test.TestCase): def _wait_for_glob(self, pattern, timeout_secs, for_checkpoint=True): """Wait for a checkpoint file to appear. Args: pattern: A string. timeout_secs: How long to wait for in seconds. for_checkpoint: whether we're globbing for checkpoints. """ end_time = time.time() + timeout_secs while time.time() < end_time: if for_checkpoint: if tf.train.checkpoint_exists(pattern): return else: if len(tf.gfile.Glob(pattern)) >= 1: return time.sleep(0.05) self.assertFalse(True, "Glob never matched any file: %s" % pattern) # This test does not test much. def testBasics(self): logdir = _test_dir("basics") with tf.Graph().as_default(): my_op = tf.constant(1.0) sv = tf.train.Supervisor(logdir=logdir) sess = sv.prepare_or_wait_for_session("") for _ in xrange(10): sess.run(my_op) sess.close() sv.stop() def testManagedSession(self): logdir = _test_dir("managed_session") with tf.Graph().as_default(): my_op = tf.constant(1.0) sv = tf.train.Supervisor(logdir=logdir) with sv.managed_session("") as sess: for _ in xrange(10): sess.run(my_op) # Supervisor has been stopped. self.assertTrue(sv.should_stop()) def testManagedSessionUserError(self): logdir = _test_dir("managed_user_error") with tf.Graph().as_default(): my_op = tf.constant(1.0) sv = tf.train.Supervisor(logdir=logdir) last_step = None with self.assertRaisesRegexp(RuntimeError, "failing here"): with sv.managed_session("") as sess: for step in xrange(10): last_step = step if step == 1: raise RuntimeError("failing here") else: sess.run(my_op) # Supervisor has been stopped. self.assertTrue(sv.should_stop()) self.assertEqual(1, last_step) def testManagedSessionIgnoreOutOfRangeError(self): logdir = _test_dir("managed_out_of_range") with tf.Graph().as_default(): my_op = tf.constant(1.0) sv = tf.train.Supervisor(logdir=logdir) last_step = None with sv.managed_session("") as sess: for step in xrange(10): last_step = step if step == 3: raise tf.errors.OutOfRangeError(my_op.op.node_def, my_op.op, "all done") else: sess.run(my_op) # Supervisor has been stopped. OutOfRangeError was not thrown. self.assertTrue(sv.should_stop()) self.assertEqual(3, last_step) def testManagedSessionDoNotKeepSummaryWriter(self): logdir = _test_dir("managed_not_keep_summary_writer") with tf.Graph().as_default(): tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sv = tf.train.Supervisor(logdir=logdir, summary_op=None) with sv.managed_session("", close_summary_writer=True, start_standard_services=False) as sess: sv.summary_computed(sess, sess.run(summ)) # Sleep 1.2s to make sure that the next event file has a different name # than the current one. time.sleep(1.2) with sv.managed_session("", close_summary_writer=True, start_standard_services=False) as sess: sv.summary_computed(sess, sess.run(summ)) event_paths = sorted(glob.glob(os.path.join(logdir, "event*"))) self.assertEquals(2, len(event_paths)) # The two event files should have the same contents. for path in event_paths: # The summary iterator should report the summary once as we closed the # summary writer across the 2 sessions. rr = tf.train.summary_iterator(path) # The first event should list the file_version. ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) # The next one has the graph and metagraph. ev = next(rr) self.assertTrue(ev.graph_def) ev = next(rr) self.assertTrue(ev.meta_graph_def) # The next one should have the values from the summary. # But only once. ev = next(rr) self.assertProtoEquals(""" value { tag: 'c1' simple_value: 1.0 } value { tag: 'c2' simple_value: 2.0 } value { tag: 'c3' simple_value: 3.0 } """, ev.summary) # The next one should be a stop message if we closed cleanly. ev = next(rr) self.assertEquals(tf.SessionLog.STOP, ev.session_log.status) # We should be done. with self.assertRaises(StopIteration): next(rr) def testManagedSessionKeepSummaryWriter(self): logdir = _test_dir("managed_keep_summary_writer") with tf.Graph().as_default(): tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sv = tf.train.Supervisor(logdir=logdir) with sv.managed_session("", close_summary_writer=False, start_standard_services=False) as sess: sv.summary_computed(sess, sess.run(summ)) with sv.managed_session("", close_summary_writer=False, start_standard_services=False) as sess: sv.summary_computed(sess, sess.run(summ)) # Now close the summary writer to flush the events. sv.summary_writer.close() # The summary iterator should report the summary twice as we reused # the same summary writer across the 2 sessions. rr = _summary_iterator(logdir) # The first event should list the file_version. ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) # The next one has the graph. ev = next(rr) self.assertTrue(ev.graph_def) ev = next(rr) self.assertTrue(ev.meta_graph_def) # The next one should have the values from the summary. ev = next(rr) self.assertProtoEquals(""" value { tag: 'c1' simple_value: 1.0 } value { tag: 'c2' simple_value: 2.0 } value { tag: 'c3' simple_value: 3.0 } """, ev.summary) # The next one should also have the values from the summary. ev = next(rr) self.assertProtoEquals(""" value { tag: 'c1' simple_value: 1.0 } value { tag: 'c2' simple_value: 2.0 } value { tag: 'c3' simple_value: 3.0 } """, ev.summary) # We should be done. self.assertRaises(StopIteration, lambda: next(rr)) def _csv_data(self, logdir): # Create a small data file with 3 CSV records. data_path = os.path.join(logdir, "data.csv") with open(data_path, "w") as f: f.write("1,2,3\n") f.write("4,5,6\n") f.write("7,8,9\n") return data_path def testManagedEndOfInputOneQueue(self): # Tests that the supervisor finishes without an error when using # a fixed number of epochs, reading from a single queue. logdir = _test_dir("managed_end_of_input_one_queue") os.makedirs(logdir) data_path = self._csv_data(logdir) with tf.Graph().as_default(): # Create an input pipeline that reads the file 3 times. filename_queue = tf.train.string_input_producer([data_path], num_epochs=3) reader = tf.TextLineReader() _, csv = reader.read(filename_queue) rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]]) sv = tf.train.Supervisor(logdir=logdir) with sv.managed_session("") as sess: while not sv.should_stop(): sess.run(rec) def testManagedEndOfInputTwoQueues(self): # Tests that the supervisor finishes without an error when using # a fixed number of epochs, reading from two queues, the second # one producing a batch from the first one. logdir = _test_dir("managed_end_of_input_two_queues") os.makedirs(logdir) data_path = self._csv_data(logdir) with tf.Graph().as_default(): # Create an input pipeline that reads the file 3 times. filename_queue = tf.train.string_input_producer([data_path], num_epochs=3) reader = tf.TextLineReader() _, csv = reader.read(filename_queue) rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]]) shuff_rec = tf.train.shuffle_batch(rec, 1, 6, 4) sv = tf.train.Supervisor(logdir=logdir) with sv.managed_session("") as sess: while not sv.should_stop(): sess.run(shuff_rec) def testManagedMainErrorTwoQueues(self): # Tests that the supervisor correctly raises a main loop # error even when using multiple queues for input. logdir = _test_dir("managed_main_error_two_queues") os.makedirs(logdir) data_path = self._csv_data(logdir) with self.assertRaisesRegexp(RuntimeError, "fail at step 3"): with tf.Graph().as_default(): # Create an input pipeline that reads the file 3 times. filename_queue = tf.train.string_input_producer([data_path], num_epochs=3) reader = tf.TextLineReader() _, csv = reader.read(filename_queue) rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]]) shuff_rec = tf.train.shuffle_batch(rec, 1, 6, 4) sv = tf.train.Supervisor(logdir=logdir) with sv.managed_session("") as sess: for step in range(9): if sv.should_stop(): break elif step == 3: raise RuntimeError("fail at step 3") else: sess.run(shuff_rec) def testSessionConfig(self): logdir = _test_dir("session_config") with tf.Graph().as_default(): with tf.device("/cpu:1"): my_op = tf.constant([1.0]) sv = tf.train.Supervisor(logdir=logdir) sess = sv.prepare_or_wait_for_session( "", config=tf.ConfigProto(device_count={"CPU": 2})) for _ in xrange(10): sess.run(my_op) sess.close() sv.stop() def testChiefCanWriteEvents(self): logdir = _test_dir("can_write") with tf.Graph().as_default(): tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sv = tf.train.Supervisor(is_chief=True, logdir=logdir, summary_op=None) meta_graph_def = meta_graph.create_meta_graph_def() sess = sv.prepare_or_wait_for_session("") sv.summary_computed(sess, sess.run(summ)) sess.close() # Wait to make sure everything is written to file before stopping. time.sleep(1) sv.stop() rr = _summary_iterator(logdir) # The first event should list the file_version. ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) # The next one has the graph. ev = next(rr) ev_graph = tf.GraphDef() ev_graph.ParseFromString(ev.graph_def) self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph) # Stored MetaGraphDef ev = next(rr) ev_meta_graph = meta_graph_pb2.MetaGraphDef() ev_meta_graph.ParseFromString(ev.meta_graph_def) self.assertProtoEquals(meta_graph_def, ev_meta_graph) self.assertProtoEquals( sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def) # The next one should have the values from the summary. ev = next(rr) self.assertProtoEquals(""" value { tag: 'c1' simple_value: 1.0 } value { tag: 'c2' simple_value: 2.0 } value { tag: 'c3' simple_value: 3.0 } """, ev.summary) # The next one should be a stop message if we closed cleanly. ev = next(rr) self.assertEquals(tf.SessionLog.STOP, ev.session_log.status) # We should be done. self.assertRaises(StopIteration, lambda: next(rr)) def testNonChiefCannotWriteEvents(self): def _summary_computed(): with tf.Graph().as_default(): sv = tf.train.Supervisor(is_chief=False) sess = sv.prepare_or_wait_for_session("") tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) summ = tf.summary.merge_all() sv.summary_computed(sess, sess.run(summ)) def _start_standard_services(): with tf.Graph().as_default(): sv = tf.train.Supervisor(is_chief=False) sess = sv.prepare_or_wait_for_session("") sv.start_standard_services(sess) self.assertRaises(RuntimeError, _summary_computed) self.assertRaises(RuntimeError, _start_standard_services) def testNoLogdirButWantSummary(self): with tf.Graph().as_default(): tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sv = tf.train.Supervisor(logdir="", summary_op=None) sess = sv.prepare_or_wait_for_session("") with self.assertRaisesRegexp(RuntimeError, "requires a summary writer"): sv.summary_computed(sess, sess.run(summ)) def testLogdirButExplicitlyNoSummaryWriter(self): logdir = _test_dir("explicit_no_summary_writer") with tf.Graph().as_default(): tf.Variable([1.0], name="foo") tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sv = tf.train.Supervisor(logdir=logdir, summary_writer=None) sess = sv.prepare_or_wait_for_session("") # Check that a checkpoint is still be generated. self._wait_for_glob(sv.save_path, 3.0) # Check that we cannot write a summary with self.assertRaisesRegexp(RuntimeError, "requires a summary writer"): sv.summary_computed(sess, sess.run(summ)) def testNoLogdirButExplicitSummaryWriter(self): logdir = _test_dir("explicit_summary_writer") with tf.Graph().as_default(): tf.summary.scalar("c1", tf.constant(1)) tf.summary.scalar("c2", tf.constant(2)) tf.summary.scalar("c3", tf.constant(3)) summ = tf.summary.merge_all() sw = tf.summary.FileWriter(logdir) sv = tf.train.Supervisor(logdir="", summary_op=None, summary_writer=sw) meta_graph_def = meta_graph.create_meta_graph_def() sess = sv.prepare_or_wait_for_session("") sv.summary_computed(sess, sess.run(summ)) sess.close() # Wait to make sure everything is written to file before stopping. time.sleep(1) sv.stop() # Check the summary was written to 'logdir' rr = _summary_iterator(logdir) # The first event should list the file_version. ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) # The next one has the graph. ev = next(rr) ev_graph = tf.GraphDef() ev_graph.ParseFromString(ev.graph_def) self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph) # Stored MetaGraphDef ev = next(rr) ev_meta_graph = meta_graph_pb2.MetaGraphDef() ev_meta_graph.ParseFromString(ev.meta_graph_def) self.assertProtoEquals(meta_graph_def, ev_meta_graph) self.assertProtoEquals( sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def) # The next one should have the values from the summary. ev = next(rr) self.assertProtoEquals(""" value { tag: 'c1' simple_value: 1.0 } value { tag: 'c2' simple_value: 2.0 } value { tag: 'c3' simple_value: 3.0 } """, ev.summary) # The next one should be a stop message if we closed cleanly. ev = next(rr) self.assertEquals(tf.SessionLog.STOP, ev.session_log.status) # We should be done. self.assertRaises(StopIteration, lambda: next(rr)) def testNoLogdirSucceeds(self): with tf.Graph().as_default(): tf.Variable([1.0, 2.0, 3.0]) sv = tf.train.Supervisor(logdir="", summary_op=None) sess = sv.prepare_or_wait_for_session("") sess.close() sv.stop() def testUseSessionManager(self): with tf.Graph().as_default(): tf.Variable([1.0, 2.0, 3.0]) sm = tf.train.SessionManager() # Pass in session_manager. The additional init_op is ignored. sv = tf.train.Supervisor(logdir="", session_manager=sm) sv.prepare_or_wait_for_session("") def testInitOp(self): logdir = _test_dir("default_init_op") with tf.Graph().as_default(): v = tf.Variable([1.0, 2.0, 3.0]) sv = tf.train.Supervisor(logdir=logdir) sess = sv.prepare_or_wait_for_session("") self.assertAllClose([1.0, 2.0, 3.0], sess.run(v)) sv.stop() def testInitFn(self): logdir = _test_dir("default_init_op") with tf.Graph().as_default(): v = tf.Variable([1.0, 2.0, 3.0]) def _init_fn(sess): sess.run(v.initializer) sv = tf.train.Supervisor(logdir=logdir, init_op=None, init_fn=_init_fn) sess = sv.prepare_or_wait_for_session("") self.assertAllClose([1.0, 2.0, 3.0], sess.run(v)) sv.stop() def testInitOpWithFeedDict(self): logdir = _test_dir("feed_dict_init_op") with tf.Graph().as_default(): p = tf.placeholder(tf.float32, shape=(3,)) v = tf.Variable(p, name="v") sv = tf.train.Supervisor(logdir=logdir, init_op=tf.global_variables_initializer(), init_feed_dict={p: [1.0, 2.0, 3.0]}) sess = sv.prepare_or_wait_for_session("") self.assertAllClose([1.0, 2.0, 3.0], sess.run(v)) sv.stop() def testReadyForLocalInitOp(self): server = tf.train.Server.create_local_server() logdir = _test_dir("default_ready_for_local_init_op") uid = uuid.uuid4().hex def get_session(is_chief): g = tf.Graph() with g.as_default(): with tf.device("/job:local"): v = tf.Variable( 1, name="default_ready_for_local_init_op_v_" + str(uid)) vadd = v.assign_add(1) w = tf.Variable( v, trainable=False, collections=[tf.GraphKeys.LOCAL_VARIABLES], name="default_ready_for_local_init_op_w_" + str(uid)) ready_for_local_init_op = tf.report_uninitialized_variables( tf.all_variables()) sv = tf.train.Supervisor( logdir=logdir, is_chief=is_chief, graph=g, recovery_wait_secs=1, init_op=v.initializer, ready_for_local_init_op=ready_for_local_init_op) sess = sv.prepare_or_wait_for_session(server.target) return sv, sess, v, vadd, w sv0, sess0, v0, _, w0 = get_session(True) sv1, sess1, _, vadd1, w1 = get_session(False) self.assertEqual(1, sess0.run(w0)) self.assertEqual(2, sess1.run(vadd1)) self.assertEqual(1, sess1.run(w1)) self.assertEqual(2, sess0.run(v0)) sv0.stop() sv1.stop() def testReadyForLocalInitOpRestoreFromCheckpoint(self): server = tf.train.Server.create_local_server() logdir = _test_dir("ready_for_local_init_op_restore") uid = uuid.uuid4().hex # Create a checkpoint. with tf.Graph().as_default(): v = tf.Variable( 10.0, name="ready_for_local_init_op_restore_v_" + str(uid)) tf.summary.scalar("ready_for_local_init_op_restore_v_" + str(uid), v) sv = tf.train.Supervisor(logdir=logdir) sv.prepare_or_wait_for_session(server.target) save_path = sv.save_path self._wait_for_glob(save_path, 3.0) self._wait_for_glob( os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False) # Wait to make sure everything is written to file before stopping. time.sleep(1) sv.stop() def get_session(is_chief): g = tf.Graph() with g.as_default(): with tf.device("/job:local"): v = tf.Variable( 1.0, name="ready_for_local_init_op_restore_v_" + str(uid)) vadd = v.assign_add(1) w = tf.Variable( v, trainable=False, collections=[tf.GraphKeys.LOCAL_VARIABLES], name="ready_for_local_init_op_restore_w_" + str(uid)) ready_for_local_init_op = tf.report_uninitialized_variables( tf.all_variables()) sv = tf.train.Supervisor( logdir=logdir, is_chief=is_chief, graph=g, recovery_wait_secs=1, ready_for_local_init_op=ready_for_local_init_op) sess = sv.prepare_or_wait_for_session(server.target) return sv, sess, v, vadd, w sv0, sess0, v0, _, w0 = get_session(True) sv1, sess1, _, vadd1, w1 = get_session(False) self.assertEqual(10, sess0.run(w0)) self.assertEqual(11, sess1.run(vadd1)) self.assertEqual(10, sess1.run(w1)) self.assertEqual(11, sess0.run(v0)) sv0.stop() sv1.stop() def testLocalInitOp(self): logdir = _test_dir("default_local_init_op") with tf.Graph().as_default(): # A local variable. v = tf.Variable([1.0, 2.0, 3.0], trainable=False, collections=[tf.GraphKeys.LOCAL_VARIABLES]) # An entity which is initialized through a TABLE_INITIALIZER. w = tf.Variable([4, 5, 6], trainable=False, collections=[]) tf.add_to_collection(tf.GraphKeys.TABLE_INITIALIZERS, w.initializer) # This shouldn't add a variable to the VARIABLES collection responsible # for variables that are saved/restored from checkpoints. self.assertEquals(len(tf.all_variables()), 0) # Suppress normal variable inits to make sure the local one is # initialized via local_init_op. sv = tf.train.Supervisor(logdir=logdir, init_op=None) sess = sv.prepare_or_wait_for_session("") self.assertAllClose([1.0, 2.0, 3.0], sess.run(v)) self.assertAllClose([4, 5, 6], sess.run(w)) sv.stop() def testLocalInitOpForNonChief(self): logdir = _test_dir("default_local_init_op_non_chief") with tf.Graph().as_default(): with tf.device("/job:localhost"): # A local variable. v = tf.Variable([1.0, 2.0, 3.0], trainable=False, collections=[tf.GraphKeys.LOCAL_VARIABLES]) # This shouldn't add a variable to the VARIABLES collection responsible # for variables that are saved/restored from checkpoints. self.assertEquals(len(tf.all_variables()), 0) # Suppress normal variable inits to make sure the local one is # initialized via local_init_op. sv = tf.train.Supervisor(logdir=logdir, init_op=None, is_chief=False) sess = sv.prepare_or_wait_for_session("") self.assertAllClose([1.0, 2.0, 3.0], sess.run(v)) sv.stop() def testInitOpFails(self): server = tf.train.Server.create_local_server() logdir = _test_dir("default_init_op_fails") with tf.Graph().as_default(): v = tf.Variable([1.0, 2.0, 3.0], name="v") tf.Variable([4.0, 5.0, 6.0], name="w") # w will not be initialized. sv = tf.train.Supervisor(logdir=logdir, init_op=v.initializer) with self.assertRaisesRegexp(RuntimeError, "Variables not initialized: w"): sv.prepare_or_wait_for_session(server.target) def testInitOpFailsForTransientVariable(self): server = tf.train.Server.create_local_server() logdir = _test_dir("default_init_op_fails_for_local_variable") with tf.Graph().as_default(): v = tf.Variable([1.0, 2.0, 3.0], name="v", collections=[tf.GraphKeys.LOCAL_VARIABLES]) tf.Variable([1.0, 2.0, 3.0], name="w", collections=[tf.GraphKeys.LOCAL_VARIABLES]) # w will not be initialized. sv = tf.train.Supervisor(logdir=logdir, local_init_op=v.initializer) with self.assertRaisesRegexp( RuntimeError, "Variables not initialized: w"): sv.prepare_or_wait_for_session(server.target) def testSetupFail(self): logdir = _test_dir("setup_fail") with tf.Graph().as_default(): tf.Variable([1.0, 2.0, 3.0], name="v") with self.assertRaisesRegexp(ValueError, "must have their device set"): tf.train.Supervisor(logdir=logdir, is_chief=False) with tf.Graph().as_default(), tf.device("/job:ps"): tf.Variable([1.0, 2.0, 3.0], name="v") tf.train.Supervisor(logdir=logdir, is_chief=False) def testDefaultGlobalStep(self): logdir = _test_dir("default_global_step") with tf.Graph().as_default(): tf.Variable(287, name="global_step") sv = tf.train.Supervisor(logdir=logdir) sess = sv.prepare_or_wait_for_session("") self.assertEquals(287, sess.run(sv.global_step)) sv.stop() def testRestoreFromMetaGraph(self): logdir = _test_dir("restore_from_meta_graph") with tf.Graph().as_default(): tf.Variable(1, name="v0") sv = tf.train.Supervisor(logdir=logdir) sess = sv.prepare_or_wait_for_session("") filename = sv.saver.save(sess, sv.save_path) sv.stop() # Create a new Graph and Supervisor and recover. with tf.Graph().as_default(): new_saver = tf.train.import_meta_graph(".".join([filename, "meta"])) self.assertIsNotNone(new_saver) sv2 = tf.train.Supervisor(logdir=logdir, saver=new_saver) sess = sv2.prepare_or_wait_for_session("") self.assertEquals(1, sess.run("v0:0")) sv2.saver.save(sess, sv2.save_path) sv2.stop() # This test is based on the fact that the standard services start # right away and get to run once before sv.stop() returns. # We still sleep a bit to make the test robust. def testStandardServicesWithoutGlobalStep(self): logdir = _test_dir("standard_services_without_global_step") # Create a checkpoint. with tf.Graph().as_default(): v = tf.Variable([1.0], name="foo") tf.summary.scalar("v", v[0]) sv = tf.train.Supervisor(logdir=logdir) meta_graph_def = meta_graph.create_meta_graph_def( saver_def=sv.saver.saver_def) sess = sv.prepare_or_wait_for_session("") save_path = sv.save_path self._wait_for_glob(save_path, 3.0) self._wait_for_glob( os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False) # Wait to make sure everything is written to file before stopping. time.sleep(1) sv.stop() # There should be an event file with a version number. rr = _summary_iterator(logdir) ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) ev = next(rr) ev_graph = tf.GraphDef() ev_graph.ParseFromString(ev.graph_def) self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph) # Stored MetaGraphDef ev = next(rr) ev_meta_graph = meta_graph_pb2.MetaGraphDef() ev_meta_graph.ParseFromString(ev.meta_graph_def) self.assertProtoEquals(meta_graph_def, ev_meta_graph) self.assertProtoEquals( sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def) ev = next(rr) self.assertProtoEquals("value { tag: 'v' simple_value: 1.0 }", ev.summary) ev = next(rr) self.assertEquals(tf.SessionLog.STOP, ev.session_log.status) self.assertRaises(StopIteration, lambda: next(rr)) # There should be a checkpoint file with the variable "foo" with tf.Graph().as_default(), self.test_session() as sess: v = tf.Variable([10.10], name="foo") sav = tf.train.Saver([v]) sav.restore(sess, save_path) self.assertEqual(1.0, v.eval()[0]) # Same as testStandardServicesNoGlobalStep but with a global step. # We should get a summary about the step time. def testStandardServicesWithGlobalStep(self): logdir = _test_dir("standard_services_with_global_step") # Create a checkpoint. with tf.Graph().as_default(): v = tf.Variable([123], name="global_step") sv = tf.train.Supervisor(logdir=logdir) meta_graph_def = meta_graph.create_meta_graph_def( saver_def=sv.saver.saver_def) sess = sv.prepare_or_wait_for_session("") # This is where the checkpoint will appear, with step number 123. save_path = "%s-123" % sv.save_path self._wait_for_glob(save_path, 3.0) self._wait_for_glob( os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False) # Wait to make sure everything is written to file before stopping. time.sleep(1) sv.stop() # There should be an event file with a version number. rr = _summary_iterator(logdir) ev = next(rr) self.assertEquals("brain.Event:2", ev.file_version) ev = next(rr) ev_graph = tf.GraphDef() ev_graph.ParseFromString(ev.graph_def) self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph) ev = next(rr) ev_meta_graph = meta_graph_pb2.MetaGraphDef() ev_meta_graph.ParseFromString(ev.meta_graph_def) self.assertProtoEquals(meta_graph_def, ev_meta_graph) self.assertProtoEquals( sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def) ev = next(rr) # It is actually undeterministic whether SessionLog.START gets written # before the summary or the checkpoint, but this works when run 10000 times. self.assertEquals(123, ev.step) self.assertEquals(tf.SessionLog.START, ev.session_log.status) first = next(rr) second = next(rr) # It is undeterministic whether the value gets written before the checkpoint # since they are on separate threads, so we check for both conditions. if first.HasField("summary"): self.assertProtoEquals("""value { tag: 'global_step/sec' simple_value: 0.0 }""", first.summary) self.assertEquals(123, second.step) self.assertEquals(tf.SessionLog.CHECKPOINT, second.session_log.status) else: self.assertEquals(123, first.step) self.assertEquals(tf.SessionLog.CHECKPOINT, first.session_log.status) self.assertProtoEquals("""value { tag: 'global_step/sec' simple_value: 0.0 }""", second.summary) ev = next(rr) self.assertEquals(tf.SessionLog.STOP, ev.session_log.status) self.assertRaises(StopIteration, lambda: next(rr)) # There should be a checkpoint file with the variable "foo" with tf.Graph().as_default(), self.test_session() as sess: v = tf.Variable([-12], name="global_step") sav = tf.train.Saver([v]) sav.restore(sess, save_path) self.assertEqual(123, v.eval()[0]) def testNoQueueRunners(self): with tf.Graph().as_default(), self.test_session() as sess: sv = tf.train.Supervisor(logdir=_test_dir("no_queue_runners")) self.assertEqual(0, len(sv.start_queue_runners(sess))) sv.stop() def testPrepareSessionAfterStopForChief(self): logdir = _test_dir("prepare_after_stop_chief") with tf.Graph().as_default(): sv = tf.train.Supervisor(logdir=logdir, is_chief=True) # Create a first session and then stop. sess = sv.prepare_or_wait_for_session("") sv.stop() sess.close() self.assertTrue(sv.should_stop()) # Now create a second session and test that we don't stay stopped, until # we ask to stop again. sess2 = sv.prepare_or_wait_for_session("") self.assertFalse(sv.should_stop()) sv.stop() sess2.close() self.assertTrue(sv.should_stop()) def testPrepareSessionAfterStopForNonChief(self): logdir = _test_dir("prepare_after_stop_nonchief") with tf.Graph().as_default(): sv = tf.train.Supervisor(logdir=logdir, is_chief=False) # Create a first session and then stop. sess = sv.prepare_or_wait_for_session("") sv.stop() sess.close() self.assertTrue(sv.should_stop()) # Now create a second session and test that we don't stay stopped, until # we ask to stop again. sess2 = sv.prepare_or_wait_for_session("") self.assertFalse(sv.should_stop()) sv.stop() sess2.close() self.assertTrue(sv.should_stop()) if __name__ == "__main__": tf.test.main()
{ "content_hash": "81a891dc6243eeaa25e2e2e93b8e0fd1", "timestamp": "", "source": "github", "line_count": 866, "max_line_length": 80, "avg_line_length": 37.97344110854503, "alnum_prop": 0.6282803709898129, "repo_name": "rdipietro/tensorflow", "id": "dda0166aa630f5fb2841629c9971f0350dbee352", "size": "33574", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tensorflow/python/training/supervisor_test.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6748" }, { "name": "C", "bytes": "99597" }, { "name": "C++", "bytes": "14397954" }, { "name": "CMake", "bytes": "110108" }, { "name": "CSS", "bytes": "774" }, { "name": "Go", "bytes": "91226" }, { "name": "HTML", "bytes": "533841" }, { "name": "Java", "bytes": "113683" }, { "name": "JavaScript", "bytes": "13406" }, { "name": "Jupyter Notebook", "bytes": "1833484" }, { "name": "Makefile", "bytes": "23563" }, { "name": "Objective-C", "bytes": "7056" }, { "name": "Objective-C++", "bytes": "64592" }, { "name": "Protocol Buffer", "bytes": "151136" }, { "name": "Python", "bytes": "14031954" }, { "name": "Shell", "bytes": "294183" }, { "name": "TypeScript", "bytes": "757218" } ], "symlink_target": "" }
import React, { Component } from 'react'; import Cart from './Cart'; import { checkout, clearCart } from '../../../actions/products' import { connect } from 'react-redux'; import { getTotal, getCartProducts } from '../../../reducers'; class CartContainer extends Component { render() { return ( <Cart products={this.props.products} total={this.props.total} onCheckoutClick={() => this.props.checkout(this.products)} onClearCartClick={() => this.props.clearCart()} /> ); } } const mapStateToProps = (state) => ({ products: getCartProducts(state), total: getTotal(state) }) export default connect(mapStateToProps, { checkout, clearCart })(CartContainer);
{ "content_hash": "94ba9daf4df053dea5b19c5ac41bf7f5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 80, "avg_line_length": 29.625, "alnum_prop": 0.6540084388185654, "repo_name": "fredmarques/petshop", "id": "6252c9bcf8250e8a5c33415999d0ee95bb7a62c7", "size": "711", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/routes/cart/CartContainer.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17265" }, { "name": "HTML", "bytes": "1590" }, { "name": "JavaScript", "bytes": "69941" } ], "symlink_target": "" }
package ch.qos.logback.core.rolling; import java.util.concurrent.TimeUnit; /** Appender that will roll the logs every 5 minutes */ public class FiveMinuteRollingFileAppender<E> extends RollingFileAppender<E> { private long start = System.currentTimeMillis(); @Override public void rollover() { long currentTime = System.currentTimeMillis(); long maxIntervalSinceLastLoggingInMillis = TimeUnit.MINUTES.toMillis(1); if ((currentTime - start) >= maxIntervalSinceLastLoggingInMillis) { super.rollover(); start = System.currentTimeMillis(); } } }
{ "content_hash": "b838d4ea0bf7e3ca8859cd0f227affab", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 78, "avg_line_length": 27.80952380952381, "alnum_prop": 0.7363013698630136, "repo_name": "Nike-Inc/cerberus-management-service", "id": "4601d579a3522b0cce35784648f8fab76b61d35e", "size": "1177", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cerberus-audit-logger-athena/src/main/java/ch/qos/logback/core/rolling/FiveMinuteRollingFileAppender.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "53298" }, { "name": "Groovy", "bytes": "17220" }, { "name": "HTML", "bytes": "1513" }, { "name": "Java", "bytes": "1337444" }, { "name": "JavaScript", "bytes": "233158" }, { "name": "Shell", "bytes": "837" }, { "name": "TSQL", "bytes": "6563" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "ac2b38479ca416491eccc97fa0196684", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "3c1d2ca59541b14aacddcb5c0871befa80597314", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Distephanus cloiselii/ Syn. Vernonia cloiselii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package askari.types; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import askari.codec.ReusableByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.EOFException; import java.io.IOException; import org.junit.Before; import org.junit.Test; public class BooleanTypeTest { private BooleanType it; private boolean [] decoded; private byte [] encoded; private int offset; private ByteArrayOutputStream bytesOut; private DataOutputStream out; private ReusableByteArrayInputStream bytesIn; private DataInputStream in; @Before public void setUp() { it = new BooleanType(); decoded = new boolean [] { false, true, false, // garbage skipped by offset true, false, true, false, false, true, true, true }; // 1010 0111 reversed is 1110 0101, or 0xe5 encoded = new byte [] { (byte) 0xe5 }; offset = 3; bytesOut = new ByteArrayOutputStream(); out = new DataOutputStream(bytesOut); bytesIn = new ReusableByteArrayInputStream(); in = new DataInputStream(bytesIn); } @Test public void isNameable() { assertThat(it.isNameable(), is(true)); } @Test public void isPackable() { assertThat(it.isPackable(), is(true)); } @Test public void isFixedWidth() { assertThat(it.isFixedWidth(), is(true)); assertThat(it.isStreamDecodeable(), is(true)); assertThat(it.isDecodeable(), is(true)); } @Test public void isOneBitWide() { assertThat(it.getBitWidth(), is(1)); assertThat(it.isWholeByteSized(), is(false)); } @Test public void isNotByteAligned() { assertThat(it.isByteAligned(), is(false)); assertThat(it.isInternallyByteAligned(), is(true)); } @Test public void isNotWellFormed() { // It doesn't fill a whole number of bytes. assertThat(it.isWellFormed(), is(false)); } @Test public void isBoolean() { assertThat(it.isBoolean(), is(true)); } @Test public void encodesEightBooleansAsAByte() throws IOException { it.encodeBooleans(decoded, offset, out); assertThat(bytesOut.toByteArray(), is(encoded)); } @Test(expected=IllegalArgumentException.class) public void refusesToEncodeBooleanGroupsShorterThanEight() throws IOException { offset = decoded.length - 7; it.encodeBooleans(decoded, offset, out); } @Test public void decodesAByteAsEightBooleans() throws IOException { bytesIn.setBuffer(encoded); boolean [] destination = new boolean [decoded.length]; it.decodeBooleans(destination, offset, in); // Only compare those 8 elements starting at the offset. boolean [] actual = new boolean [8]; boolean [] expected = new boolean [8]; System.arraycopy(destination, offset, actual, 0, 8); System.arraycopy(decoded, offset, expected, 0, 8); assertThat(actual, is(expected)); } @Test public void doesNotMoveInputStreamOnShortReads() throws IOException { byte [] shortEncoded = new byte [] {}; bytesIn.setBuffer(shortEncoded); boolean [] actual = new boolean [decoded.length]; int initialPosition = bytesIn.getPosition(); boolean raised = false; try { it.decodeBooleans(actual, offset, in); } catch (EOFException ioe) { raised = true; } assertTrue(raised); assertThat(bytesIn.getPosition(), is(initialPosition)); } @Test public void doesNotMoveInputStreamOnShortDestinationBuffers() throws IOException { offset = decoded.length - 7; bytesIn.setBuffer(encoded); boolean [] actual = new boolean [decoded.length]; int initialPosition = bytesIn.getPosition(); boolean raised = false; try { it.decodeBooleans(actual, offset, in); } catch (IllegalArgumentException iae) { raised = true; } assertTrue(raised); assertThat(bytesIn.getPosition(), is(initialPosition)); } }
{ "content_hash": "975a02f54b4932f9fcac8365220eee0f", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 84, "avg_line_length": 25.92207792207792, "alnum_prop": 0.6918837675350702, "repo_name": "pombredanne/askari", "id": "4ac979a25d5716fdf6c844860a6db66e9b8542cb", "size": "3992", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/askari/types/BooleanTypeTest.java", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import re from typing import List import requests from feedsearch.lib import get_site_root from flask import current_app as app from marshmallow import ValidationError from sqlalchemy import or_ from feedrsub.database import db from feedrsub.models.feed import Feed from feedrsub.models.feedinfo_schema import FeedInfo, feedinfo_schema_many from feedrsub.utils.strings import stringify_list from feedrsub.utils.urls import strip_url_scheme, strip_url_end comment_pattern = r"\/comment(?:s)?(?:\/)?" comment_regex = re.compile(comment_pattern) www_pattern = "^www." www_regex = re.compile(www_pattern) class FeedSearchManager: def __init__(self, excluded_domains: List[str] = None) -> None: self.excluded_domains = excluded_domains if excluded_domains else [] self.last_update = None self.feed_info_list: List[FeedInfo] = [] self.not_found: List[str] = [] self.excluded: List[str] = [] self.urls: List[str] = [] self.excluded_domains.append("auctorial.com") @staticmethod def is_comment_feed(url: str) -> bool: """ Check if feed url contains comments """ return bool(comment_regex.search(url)) @staticmethod def get_naked_domain(url: str) -> str: """ Strip www from domain """ return www_regex.sub("", url) @staticmethod def get_existing_feeds(urls: List[str]) -> List[Feed]: """ Get all feeds with topics that match urls """ return Feed.query.filter( or_(*[Feed.topic.ilike(f"%{url}%") for url in urls]) ).all() # noqa @staticmethod def get_feed_from_feeds(url: str, feeds: List[Feed]) -> Feed: """ Get feed that matches url from list of feeds """ for f in feeds: if strip_url_end(f.topic) == strip_url_end(url): return f def get_excluded_domains(self) -> List[str]: """ Returns a list of domains excluded from feed search. :return: List<Str> """ return self.excluded def is_excluded(self, url: str) -> bool: """ Check if the domain is in the list of domains excluded from subscription. """ root = get_site_root(url) naked_domain = self.get_naked_domain(root) if naked_domain in self.get_excluded_domains(): app.logger.info("Skipping Url: %s, excluded domain", url) self.excluded.append(url) return True return False def find_feeds(self, url: str) -> List[FeedInfo]: """ Find all RSS feeds at a url. """ found = [] payload = {"url": url, "favicon": True} with requests.get( "https://feedsearch.dev/api/v1/search", params=payload ) as response: if response.status_code == 200: try: found = feedinfo_schema_many.loads(json_data=response.text) except ValidationError: pass if not found: app.logger.info("No feeds found at url: %s", url) self.not_found.append(url) return [] app.logger.info("Found feeds at url %s: %s", url, list(f.url for f in found)) return found def is_valid_feed_info(self, feed_info: FeedInfo) -> bool: """ Check if StatusFeedInfo is valid """ if self.is_comment_feed(str(feed_info.url)): app.logger.info("Discarding URL %s as Comment Feed", feed_info.url) return False if feed_info.url in self.urls: app.logger.info("Discarding URL %s as already found", feed_info.url) return False return True def process_feed_info(self, feed_info: FeedInfo, feed: Feed) -> None: """ Get and update feed with feed_info details. """ if feed: app.logger.info("Updating %s with info: %s", feed, feed_info) feed.update_from_feed_info(feed_info) db.session.add(feed) if feed.excluded: self.excluded.append(str(feed_info.url)) return None if feed.active: feed_info.subscribed = True self.feed_info_list.append(feed_info) self.urls.append(str(feed_info.url)) def process_url(self, url: str) -> None: """ Search for RSS Feeds at URL and process results """ if not url: return None # Exclude feed if in list of excluded URLs if self.is_excluded(url): return None # Find all possible feeds from URL found = self.find_feeds(url) if not found: return None # Check if feed_info is valid valid = [] for feed_info in found: if self.is_valid_feed_info(feed_info): valid.append(feed_info) urls = [strip_url_scheme(str(f.url)) for f in valid] # Find existing feeds that have the same topic as StatusFeedInfo URLs feeds = self.get_existing_feeds(urls) app.logger.info("Found existing Feeds %s", stringify_list(feeds)) # Update feed details from StatusFeedInfo for feed_info in valid: feed = self.get_feed_from_feeds(str(feed_info.url), feeds) self.process_feed_info(feed_info, feed) def search_urls(self, urls: List[str]) -> None: """ Search URLs for Feeds Each URL should be processed in separate Task in future """ for url in urls: self.process_url(url)
{ "content_hash": "c0a3aca5d7c53e4ad8237e98349b881e", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 85, "avg_line_length": 31.209944751381215, "alnum_prop": 0.5778013807753585, "repo_name": "DBeath/flask-feedrsub", "id": "ecee972f27c41787116f2a32294053735121e77e", "size": "5649", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "feedrsub/feeds/search_manager.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4337" }, { "name": "Dockerfile", "bytes": "1105" }, { "name": "HTML", "bytes": "60608" }, { "name": "JavaScript", "bytes": "24058" }, { "name": "Mako", "bytes": "412" }, { "name": "Python", "bytes": "815501" }, { "name": "Shell", "bytes": "6364" } ], "symlink_target": "" }