text
stringlengths
2
1.04M
meta
dict
Locauto ======= Sistema para Locadora de automóveis
{ "content_hash": "74309801d3ce3f1c67855b93eb270f19", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 35, "avg_line_length": 13.25, "alnum_prop": 0.7169811320754716, "repo_name": "hipertrix/Locauto", "id": "17c91eb7f5d3e226127429ed9563a0d98d3ef0c1", "size": "54", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "776" }, { "name": "Java", "bytes": "12775" }, { "name": "JavaScript", "bytes": "90815" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <feed><tipo>Rua</tipo><logradouro>Gerânio</logradouro><bairro>Bom Jardim</bairro><cidade>Ipatinga</cidade><uf>MG</uf><cep>35162268</cep></feed>
{ "content_hash": "ce2bbd75291494a969a921b4040c01c8", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 143, "avg_line_length": 100, "alnum_prop": 0.72, "repo_name": "chesarex/webservice-cep", "id": "04deb7ea3095e8b619fa61733332ced93076fc09", "size": "201", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/ceps/35/162/268/cep.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. defined('MOODLE_INTERNAL') || die(); $string['modulename'] = 'redprofile'; $string['modulenameplural'] = 'redprofiles'; $string['modulename_help'] = 'Use the redprofile module for... | The redprofile module allows...'; $string['redprofilefieldset'] = 'Custom example fieldset'; $string['redprofilename'] = 'redprofile name'; $string['redprofilename_help'] = 'This is the content of the help tooltip associated with the redprofilename field. Markdown syntax is supported.'; $string['redprofile'] = 'redprofile'; $string['pluginadministration'] = 'redprofile administration'; $string['pluginname'] = 'redprofile';
{ "content_hash": "09855c554fcec1130e6d2dbf668e175b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 147, "avg_line_length": 42.16129032258065, "alnum_prop": 0.7345065034429993, "repo_name": "loqman/moodle_redprofile", "id": "d5207f53f766b1622b04e86736fcb0ed0477c4ca", "size": "1597", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lang/fa/newmodule.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "43181" } ], "symlink_target": "" }
import pytest from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike @pytest.mark.parametrize("datum1", [1, 2., "3", (4, 5), [6, 7], None]) @pytest.mark.parametrize("datum2", [8, 9., "10", (11, 12), [13, 14], None]) def test_cast_1d_array(datum1, datum2): data = [datum1, datum2] result = construct_1d_object_array_from_listlike(data) # Direct comparison fails: https://github.com/numpy/numpy/issues/10218 assert result.dtype == "object" assert list(result) == data @pytest.mark.parametrize("val", [1, 2., None]) def test_cast_1d_array_invalid_scalar(val): with pytest.raises(TypeError, match="has no len()"): construct_1d_object_array_from_listlike(val)
{ "content_hash": "b634cd45926ff422c3d9847e8d02c2c4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 35.7, "alnum_prop": 0.6792717086834734, "repo_name": "MJuddBooth/pandas", "id": "61fc17880ed65a1878449adc305d9b1640bb0e3b", "size": "739", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pandas/tests/dtypes/cast/test_construct_object_arr.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "4879" }, { "name": "C", "bytes": "406766" }, { "name": "C++", "bytes": "17248" }, { "name": "HTML", "bytes": "606963" }, { "name": "Makefile", "bytes": "529" }, { "name": "Python", "bytes": "14858932" }, { "name": "Shell", "bytes": "29575" }, { "name": "Smarty", "bytes": "2040" } ], "symlink_target": "" }
(function() { 'use strict'; angular.module('hansei.ui') .directive('cardPile', ['board', function(board) { return { restrict: 'E', templateUrl: '/templates/_cardPile.html', scope: { pile: '=', column: '=', index: '=' }, controller: ['$rootScope', '$scope', 'api', 'view', function($rootScope, $scope, api, view) { var _ = { findIndex: $rootScope.findIndex }; var flip = function(idx) { api.boardCardFlip(board.id, { cardId: $scope.pile[idx].id, columnId: $scope.column.id, position: $scope.index + 1 }); }; $scope.board = board; $scope.view = view; // Get the card model for the top-most card. If getIndexOnly is true, // then return only the index of the $scope.pile array. $scope.getTopCard = function(getIndexOnly) { var cardOrIdx = board.getTopCard($scope.pile, getIndexOnly), curCard = getIndexOnly ? cardOrIdx : _.findIndex($scope.pile, function(c) { return c.id === cardOrIdx.id; }) + 1; $scope.curCard = curCard; return cardOrIdx; }; // Calculate the total number of votes for the pile $scope.votes = 0; $scope.pile.forEach(function(c) { $scope.votes += c.votes.length; }); $scope.forward = function() { var idx = board.getTopCard($scope.pile, true) + 1; if (idx >= $scope.pile.length) idx = 0; flip(idx); }; $scope.back = function() { var idx = board.getTopCard($scope.pile, true) - 1; if (idx < 0) idx = $scope.pile.length - 1; flip(idx); }; }] }; }]) })();
{ "content_hash": "5fb3215945108f405b5da1c6908bc92d", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 101, "avg_line_length": 30.306451612903224, "alnum_prop": 0.48589675359233636, "repo_name": "afebbraro/lucidboard", "id": "735c7044e7f5a6629e92b23a757ff8503c9aef13", "size": "1879", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "assets/js/ui/cardPile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35043" }, { "name": "HTML", "bytes": "41455" }, { "name": "JavaScript", "bytes": "269064" }, { "name": "Ruby", "bytes": "224" } ], "symlink_target": "" }
// Copyright (c) 2012 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. #include "chrome/browser/extensions/api/record/record_api.h" #include <string> #include "base/file_path.h" #include "base/file_util.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/string_split.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/threading/sequenced_worker_pool.h" #include "base/values.h" #include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/api/experimental_record.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" namespace utils = extension_function_test_utils; namespace extensions { namespace { // Dummy content for mock stats file. const std::string kTestStatistics = "Sample Stat 1\nSample Stat 2\n"; // Standard capture parameters, with a mix of good and bad URLs, and // a hole for filling in the user data dir. // Restore these on the next CL of the new page cycler, when the C++ // side's implementation is de-hacked. //const char kCaptureArgs1[] = // "[\"%s\", [\"URL 1\", \"URL 2(bad)\", \"URL 3\", \"URL 4(bad)\"]]"; const char kCaptureArgs1[] = "[\"%s\", [\"http://www.google.com\", \"http://www.amazon.com\"]]"; // Standard playback parameters, with the same mix of good and bad URLs // as the capture parameters, a hole for filling in the user data dir, and // a mocked-up extension path and repeat count (which are used only to // verify that they made it into the CommandLine, since extension loading // and repeat-counting are hard to emulate in the test ProcessStrategy. const char kPlaybackArgs1[] = "[\"%s\", 2, {\"extensionPath\": \"MockExtension\"}]"; // Use this as the value of FilePath switches (e.g. user-data-dir) that // should be replaced by the record methods. const FilePath::CharType kDummyDirName[] = FILE_PATH_LITERAL("ReplaceMe"); // Use this as the filename for a mock "cache" file in the user-data-dir. const FilePath::CharType kMockCacheFile[] = FILE_PATH_LITERAL("MockCache"); } class TestProcessStrategy : public ProcessStrategy { public: explicit TestProcessStrategy(std::vector<FilePath>* temp_files) : command_line_(CommandLine::NO_PROGRAM), temp_files_(temp_files) {} ~TestProcessStrategy() {} // Pump the blocking pool queue, since this is needed during test. void PumpBlockingPool() OVERRIDE { content::BrowserThread::GetBlockingPool()->FlushForTesting(); } // Act somewhat like a real test browser instance. In particular: // 1. If visit-urls, then // a. If record-mode, then put a copy of the URL list into the user data // directory in a mocked up cache file // b. If playback-mode, then check for existence of that URL list copy // in the cache // c. Scan list of URLS, noting in |urls_visited_| all those // visited. If there are any "bad" URLS, don't visit these, but // create a ".errors" file listing them. // 2. If record-stats, then create a mock stats file. void RunProcess(const CommandLine& command_line, std::vector<std::string>* errors) OVERRIDE { command_line_ = command_line; visited_urls_.clear(); if (command_line.HasSwitch(switches::kVisitURLs)) { FilePath url_path = command_line.GetSwitchValuePath(switches::kVisitURLs); temp_files_->push_back(url_path); if (command_line.HasSwitch(switches::kRecordMode) || command_line.HasSwitch(switches::kPlaybackMode)) { FilePath url_path_copy = command_line.GetSwitchValuePath( switches::kUserDataDir).Append( FilePath(FilePath::StringType(kMockCacheFile))); if (command_line.HasSwitch(switches::kRecordMode)) { file_util::CopyFile(url_path, url_path_copy); } else { if (!file_util::ContentsEqual(url_path, url_path_copy)) { std::string contents1, contents2; file_util::ReadFileToString(url_path, &contents1); file_util::ReadFileToString(url_path_copy, &contents2); LOG(ERROR) << "FILE MISMATCH" << contents1 << " VS " << contents2; } EXPECT_TRUE(file_util::ContentsEqual(url_path, url_path_copy)); } } std::string urls; file_util::ReadFileToString(url_path, &urls); std::vector<std::string> url_vector, bad_urls; base::SplitString(urls, '\n', &url_vector); for (std::vector<std::string>::iterator itr = url_vector.begin(); itr != url_vector.end(); ++itr) { if (itr->find_first_of("bad") != std::string::npos) bad_urls.push_back(*itr); else visited_urls_.push_back(*itr); } if (!bad_urls.empty()) { FilePath url_errors_path = url_path.DirName() .Append(url_path.BaseName().value() + FilePath::StringType(kURLErrorsSuffix)); std::string error_content = JoinString(bad_urls, '\n'); temp_files_->push_back(url_errors_path); file_util::WriteFile(url_errors_path, error_content.c_str(), error_content.size()); } } if (command_line.HasSwitch(switches::kRecordStats)) { FilePath record_stats_path(command_line.GetSwitchValuePath( switches::kRecordStats)); temp_files_->push_back(record_stats_path); file_util::WriteFile(record_stats_path, kTestStatistics.c_str(), kTestStatistics.size()); } } const CommandLine& GetCommandLine() const { return command_line_; } const std::vector<std::string>& GetVisitedURLs() const { return visited_urls_; } private: CommandLine command_line_; std::vector<std::string> visited_urls_; std::vector<FilePath>* temp_files_; }; class RecordApiTest : public InProcessBrowserTest { public: RecordApiTest() {} virtual ~RecordApiTest() {} // Override to scope known temp directories outside the scope of the running // browser test. virtual void SetUp() OVERRIDE { InProcessBrowserTest::SetUp(); if (!scoped_temp_user_data_dir_.Set(FilePath(kDummyDirName))) NOTREACHED(); } // Override to delete temp directories. virtual void TearDown() OVERRIDE { if (!scoped_temp_user_data_dir_.Delete()) NOTREACHED(); InProcessBrowserTest::TearDown(); } // Override to delete temporary files created during execution. virtual void CleanUpOnMainThread() OVERRIDE { InProcessBrowserTest::CleanUpOnMainThread(); for (std::vector<FilePath>::const_iterator it = temp_files_.begin(); it != temp_files_.end(); ++it) { if (!file_util::Delete(*it, false)) NOTREACHED(); } } // Override SetUpCommandline to specify a dummy user_data_dir, which // should be replaced. Clear record-mode, playback-mode, visit-urls, // record-stats, and load-extension. void SetUpCommandLine(CommandLine* command_line) OVERRIDE { std::vector<std::string> remove_switches; remove_switches.push_back(switches::kUserDataDir); remove_switches.push_back(switches::kVisitURLs); remove_switches.push_back(switches::kPlaybackMode); remove_switches.push_back(switches::kRecordStats); remove_switches.push_back(switches::kLoadExtension); *command_line = RunPageCyclerFunction::RemoveSwitches(*command_line, remove_switches); command_line->AppendSwitchPath(switches::kUserDataDir, FilePath(kDummyDirName)); // Adding a dummy load-extension switch is rather complex since the // preent design of InProcessBrowserTest requires a *real* extension // for the flag, even if we're just testing its replacement. Opted // to omit this for the sake of simplicity. } // Run a capture, using standard URL test list and the specified // user data dir. Return via |out_list| the list of error URLs, // if any, resulting from the capture. And return directly the // CaptureURLsFunction that was used, so that its state may be // queried. scoped_refptr<CaptureURLsFunction> RunCapture(const FilePath& user_data_dir, scoped_ptr<base::ListValue>* out_list) { scoped_refptr<CaptureURLsFunction> capture_function( new CaptureURLsFunction(new TestProcessStrategy(&temp_files_))); std::string escaped_user_data_dir; ReplaceChars(user_data_dir.AsUTF8Unsafe(), "\\", "\\\\", &escaped_user_data_dir); out_list->reset(utils::ToList( utils::RunFunctionAndReturnSingleResult(capture_function.get(), base::StringPrintf(kCaptureArgs1, escaped_user_data_dir.c_str()), browser()))); return capture_function; } // Verify that the URL list of good and bad URLs was properly handled. // Needed by several tests. bool VerifyURLHandling(const ListValue* result, const TestProcessStrategy& strategy) { // Check that the two bad URLs are returned. StringValue badURL2("URL 2(bad)"), badURL4("URL 4(bad)"); /* TODO(CAS) Need to rework this once the new record API is implemented. const base::Value* string_value = NULL; EXPECT_TRUE(result->GetSize() == 2); result->Get(0, &string_value); EXPECT_TRUE(base::Value::Equals(string_value, &badURL2)); result->Get(1, &string_value); EXPECT_TRUE(base::Value::Equals(string_value, &badURL4)); // Check that both good URLs were visited. std::string goodURL1("URL 1"), goodURL3("URL 3"); EXPECT_TRUE(strategy.GetVisitedURLs()[0].compare(goodURL1) == 0 && strategy.GetVisitedURLs()[1].compare(goodURL3) == 0); */ return true; } protected: std::vector<FilePath> temp_files_; private: base::ScopedTempDir scoped_temp_user_data_dir_; DISALLOW_COPY_AND_ASSIGN(RecordApiTest); }; IN_PROC_BROWSER_TEST_F(RecordApiTest, CheckCapture) { base::ScopedTempDir user_data_dir; scoped_ptr<base::ListValue> result; EXPECT_TRUE(user_data_dir.CreateUniqueTempDir()); scoped_refptr<CaptureURLsFunction> capture_URLs_function = RunCapture(user_data_dir.path(), &result); // Check that user-data-dir switch has been properly overridden. const TestProcessStrategy &strategy = static_cast<const TestProcessStrategy &>( capture_URLs_function->GetProcessStrategy()); const CommandLine& command_line = strategy.GetCommandLine(); EXPECT_TRUE(command_line.HasSwitch(switches::kUserDataDir)); EXPECT_TRUE(command_line.GetSwitchValuePath(switches::kUserDataDir) != FilePath(kDummyDirName)); EXPECT_TRUE(VerifyURLHandling(result.get(), strategy)); } #if defined(ADDRESS_SANITIZER) // Times out under ASan, see http://crbug.com/130267. #define MAYBE_CheckPlayback DISABLED_CheckPlayback #else #define MAYBE_CheckPlayback CheckPlayback #endif IN_PROC_BROWSER_TEST_F(RecordApiTest, MAYBE_CheckPlayback) { base::ScopedTempDir user_data_dir; EXPECT_TRUE(user_data_dir.CreateUniqueTempDir()); // Assume this RunCapture operates w/o error, since it's tested // elsewhere. scoped_ptr<base::ListValue> capture_result; RunCapture(user_data_dir.path(), &capture_result); std::string escaped_user_data_dir; ReplaceChars(user_data_dir.path().AsUTF8Unsafe(), "\\", "\\\\", &escaped_user_data_dir); scoped_refptr<ReplayURLsFunction> playback_function(new ReplayURLsFunction( new TestProcessStrategy(&temp_files_))); scoped_ptr<base::DictionaryValue> result(utils::ToDictionary( utils::RunFunctionAndReturnSingleResult(playback_function, base::StringPrintf(kPlaybackArgs1, escaped_user_data_dir.c_str()), browser()))); // Check that command line user-data-dir was overridden. (That // it was *consistently* overridden in both capture and replay // is verified elsewhere. const TestProcessStrategy &strategy = static_cast<const TestProcessStrategy &>( playback_function->GetProcessStrategy()); const CommandLine& command_line = strategy.GetCommandLine(); EXPECT_TRUE(command_line.HasSwitch(switches::kUserDataDir)); EXPECT_TRUE(command_line.GetSwitchValuePath(switches::kUserDataDir) != FilePath(kDummyDirName)); // Check that command line load-extension was overridden. EXPECT_TRUE(command_line.HasSwitch(switches::kLoadExtension) && command_line.GetSwitchValuePath(switches::kLoadExtension) != FilePath(kDummyDirName)); // Check for return value with proper stats. EXPECT_EQ(kTestStatistics, utils::GetString(result.get(), kStatsKey)); ListValue* errors = NULL; EXPECT_TRUE(result->GetList(kErrorsKey, &errors)); EXPECT_TRUE(VerifyURLHandling(errors, strategy)); } } // namespace extensions
{ "content_hash": "95e0ed0f4feabc1eb67c1282bc7a80a9", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 78, "avg_line_length": 37.26149425287356, "alnum_prop": 0.6938382046734017, "repo_name": "leiferikb/bitpop-private", "id": "df0679d7a444ff0419ce653c4ca49eb33217f11a", "size": "12967", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "chrome/browser/extensions/api/record/record_api_test.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1871" }, { "name": "C", "bytes": "1800028" }, { "name": "C++", "bytes": "76499582" }, { "name": "CSS", "bytes": "803682" }, { "name": "Java", "bytes": "1234788" }, { "name": "JavaScript", "bytes": "21793252" }, { "name": "Objective-C", "bytes": "5358744" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "64410" }, { "name": "Python", "bytes": "3017857" }, { "name": "Ruby", "bytes": "650" }, { "name": "Shell", "bytes": "322362" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "12138" } ], "symlink_target": "" }
/* $NetBSD: stdarg.h,v 1.7 2003/08/07 16:26:53 agc Exp $ */ /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: @(#)stdarg.h 8.1 (Berkeley) 6/10/93 */ #ifndef _ARM32_STDARG_H_ #define _ARM32_STDARG_H_ #include <machine/ansi.h> typedef _BSD_VA_LIST_ va_list; #ifdef __lint__ #define __builtin_next_arg(t) ((t) ? 0 : 0) #define __builtin_stdarg_start(a, l) ((a) = ((l) ? 0 : 0)) #define __builtin_va_arg(a, t) ((a) ? 0 : 0) #define __builtin_va_end /* nothing */ #define __builtin_va_copy(d, s) ((d) = (s)) #endif #if __GNUC_PREREQ__(2, 96) #define va_start(ap, last) __builtin_stdarg_start((ap), (last)) #define va_arg __builtin_va_arg #define va_end __builtin_va_end #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) #else #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) #define va_start(ap, last) \ ((ap) = (va_list)__builtin_next_arg(last)) #define va_arg(ap, type) \ ((type *)(ap += sizeof(type)))[-1] #define va_end(ap) #define __va_copy(dest, src) ((dest) = (src)) #endif /* __GNUC_PREREQ__(2, 96) */ #if !defined(_ANSI_SOURCE) && \ (defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \ defined(_NETBSD_SOURCE)) #define va_copy(dest, src) __va_copy((dest), (src)) #endif #endif /* !_ARM32_STDARG_H_ */
{ "content_hash": "8fc2c3ab8d69a3ff5c971071265af8ac", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 38.21333333333333, "alnum_prop": 0.6866713189113748, "repo_name": "MarginC/kame", "id": "9aa9c09e96dfecf4e397584e4b27debe5876973a", "size": "2866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "openbsd/sys/arch/arm/include/stdarg.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Arc", "bytes": "7491" }, { "name": "Assembly", "bytes": "14375563" }, { "name": "Awk", "bytes": "313712" }, { "name": "Batchfile", "bytes": "6819" }, { "name": "C", "bytes": "356715789" }, { "name": "C++", "bytes": "4231647" }, { "name": "DIGITAL Command Language", "bytes": "11155" }, { "name": "Emacs Lisp", "bytes": "790" }, { "name": "Forth", "bytes": "253695" }, { "name": "GAP", "bytes": "9964" }, { "name": "Groff", "bytes": "2220485" }, { "name": "Lex", "bytes": "168376" }, { "name": "Logos", "bytes": "570213" }, { "name": "Makefile", "bytes": "1778847" }, { "name": "Mathematica", "bytes": "16549" }, { "name": "Objective-C", "bytes": "529629" }, { "name": "PHP", "bytes": "11283" }, { "name": "Perl", "bytes": "151251" }, { "name": "Perl6", "bytes": "2572" }, { "name": "Ruby", "bytes": "7283" }, { "name": "Scheme", "bytes": "76872" }, { "name": "Shell", "bytes": "583253" }, { "name": "Stata", "bytes": "408" }, { "name": "Yacc", "bytes": "606054" } ], "symlink_target": "" }
<?php namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** * Auto-generated Migration: Please modify to your needs! */ class Version20150320142311 extends AbstractMigration { public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE INDEX first_name ON users (first_name)'); $this->addSql('CREATE INDEX last_name ON users (last_name)'); $this->addSql('ALTER TABLE user_photos DROP FOREIGN KEY FK_6D24FBE47E3C61F9'); $this->addSql('ALTER TABLE user_photos ADD CONSTRAINT FK_6D24FBE47E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id) ON DELETE CASCADE'); } public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE user_photos DROP FOREIGN KEY FK_6D24FBE47E3C61F9'); $this->addSql('ALTER TABLE user_photos ADD CONSTRAINT FK_6D24FBE47E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)'); $this->addSql('DROP INDEX first_name ON users'); $this->addSql('DROP INDEX last_name ON users'); } }
{ "content_hash": "212a74ffe2dcc5ba52567cc079b1d8f4", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 147, "avg_line_length": 44.470588235294116, "alnum_prop": 0.6911375661375662, "repo_name": "nchervyakov/chat", "id": "a7bf84c5e345e9a7ff4c50ff45f7c6a877933d24", "size": "1512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/DoctrineMigrations/Version20150320142311.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3820" }, { "name": "CSS", "bytes": "18697" }, { "name": "HTML", "bytes": "89180" }, { "name": "JavaScript", "bytes": "35094" }, { "name": "PHP", "bytes": "603037" }, { "name": "Shell", "bytes": "1853" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context="net.danmercer.ponderizer.AddScriptureReferenceActivity"> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/scriptureEntry" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:singleLine="true" android:layout_toLeftOf="@+id/button" android:layout_toStartOf="@+id/button" android:hint="Type scripture reference" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:text="Small Text" android:id="@+id/outTextView" android:layout_below="@+id/scriptureEntry" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentBottom="true" android:padding="8dp" android:layout_alignRight="@+id/button" android:layout_alignEnd="@+id/button" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Go" android:id="@+id/button" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_above="@+id/outTextView" /> </RelativeLayout>
{ "content_hash": "fa0ad7938cdd33b740986077041584e6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 96, "avg_line_length": 43.15555555555556, "alnum_prop": 0.6869207003089598, "repo_name": "drmercer/Ponderizer", "id": "3568fc7f9c600dbdd129102f6afe5f2b449c216d", "size": "1942", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/activity_add_scripture_reference.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "149407" } ], "symlink_target": "" }
h1. Boilerplate project installation instructions You should insert all prequisites for your project along with installation instructions in here. Do not forget to add description of project to @README.md@ document!
{ "content_hash": "2ae191e1967bbb90586b0daa6fd6a068", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 68, "avg_line_length": 43.2, "alnum_prop": 0.8333333333333334, "repo_name": "illibejiep/YiiBoilerplate", "id": "d541f00816c91374cc532f550290a9955bc951de", "size": "216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "INSTALL.md", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "49212" }, { "name": "Batchfile", "bytes": "1263" }, { "name": "CSS", "bytes": "111863" }, { "name": "Gherkin", "bytes": "514" }, { "name": "HTML", "bytes": "4160678" }, { "name": "JavaScript", "bytes": "1744248" }, { "name": "PHP", "bytes": "33269841" }, { "name": "Shell", "bytes": "273" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="3" failures="0" disabled="0" errors="0" timestamp="2015-12-11T14:58:43" time="0.007" name="AllTests"> <testsuite name="TmpTest/0" tests="1" failures="0" disabled="0" errors="0" time="0.003"> <testcase name="All" type_param="double" status="run" time="0.003" classname="TmpTest/0" /> </testsuite> <testsuite name="TmpTest/1" tests="1" failures="0" disabled="0" errors="0" time="0.002"> <testcase name="All" type_param="int" status="run" time="0.002" classname="TmpTest/1" /> </testsuite> <testsuite name="TmpTest/2" tests="1" failures="0" disabled="0" errors="0" time="0.002"> <testcase name="All" type_param="std::complex&lt;double&gt;" status="run" time="0.002" classname="TmpTest/2" /> </testsuite> </testsuites>
{ "content_hash": "17c88406dc42553deb9000239b606e6f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 120, "avg_line_length": 66.41666666666667, "alnum_prop": 0.6637390213299874, "repo_name": "wwu-numerik/dune-stuff-testlogs", "id": "1b735ae0d2b34a78c3b51a2f38cf1c931d0eb71a", "size": "797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clang++-3.7/test_common_tmp-storage.xml", "mode": "33188", "license": "bsd-2-clause", "language": [], "symlink_target": "" }
/****************************************************************************** * main.cpp * * Main entrypoint for the camera control software * Currently only GigE cameras from AVT are supported (see camCtrlVmbAPI.h) * * Sami Varjo 2013 *----------------------------------------------------------------------------- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, * NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #include <iostream> #include <signal.h> #include "camCtrlVmbAPI.h" #include "iniReader.h" #include "settings.h" #include "fileIO.h" #include "experiments.h" //Contain also the global variables for experiments (like settings) using namespace VisMe; using namespace VisMe::Settings; //#define DEBUG 1 /******************************************************** * Signal handler for ctrl+c to quit cleanly ********************************************************/ void signal_SIGINT_callback_handler(int signum) { // Cleanup and close up stuff here cleanExit("\nCaught CTRL+C - exiting...\n"); exit(signum); } /********************************************************* * The program main entry point */ int main(int argc, char** argv) { bool forceAllCameras = false; char buf[1024]; /////////////////////////////////////////////////// // Register signal handler for ctrl+c (clean exit) /////////////////////////////////////////////////// signal(SIGINT, signal_SIGINT_callback_handler); /////////////////////////////////////////////////// // Handle the command line parameters /////////////////////////////////////////////////// if (argc >1){ for (int i=1; i<argc;i++){ std::string argStr = std::string(argv[i]); //Help requested if ( argStr == "-h" ){ std::cout << "Usage: " << argv[0] << " setupFile.ini" << " [-findAllCameras] [-h]" << std::endl << std::endl << " setupFile.ini is a required parameter file (default: " << DEFAULT_SETUP_FILE_NAME << ")." << std::endl << " -findAllCameras forces to enumerate all possible cameras overriding the" <<".ini file settings.\n" <<std::endl << " -h show the command line help." << std::endl; exit(0); } //An .INI setup file is found else if ( ( argStr.length() >= SETUP_FILE_SUFFIX.length() ) && ( argStr.compare( argStr.length()-SETUP_FILE_SUFFIX.length(), SETUP_FILE_SUFFIX.length(), SETUP_FILE_SUFFIX) == 0) ){ setupFileName = argStr; if( ! FileIO::fileExist( argv[i] ) ){ std::cout << "Setup file '" << setupFileName << "' do not exist!" << std::endl; exit(0); } } //Selector for camera enumeration mode (by pass the camera ids in INI) else if (argStr == "-findAllCameras"){ forceAllCameras = true; } else{ std::cout << "Unknown commandline parameter : " << argStr << std::endl; } }//end for : command line parameters } if (setupFileName == "undefined" ){ setupFileName = DEFAULT_SETUP_FILE_NAME; } ////////////////////////////////////// //Get the settings from the ini file getSaveSettings( &saveSettings, setupFileName ); std::cout <<"Saving settings:\n\t"<< saveSettings.outPath << "\n\t" << saveSettings.cameraDirectoryPrefix << "\n\t" << saveSettings.filenamePrefix << "\n\t" << saveSettings.filenameSuffix << std::endl; getCameraIds(cameraIds, setupFileName); std::cout << "\nSetting up " << cameraIds.size() << " camera(s):" << std::endl; for (int i=0;i<cameraIds.size();i++){ std::cout << "\t" << cameraIds[i] << std::endl; } getExperimentSettings( &experimentSettings, setupFileName); /////////////////////////////////////////////////// //Initialize the Vimba camera controller and // open cameras (default by ID ) camCtrl = new CamCtrlVmbAPI(); int init_rval; if (forceAllCameras) init_rval = camCtrl->InitAll(); else init_rval = camCtrl->InitByIds( cameraIds ); ////////////////////////////////////////////////// // Run experiments if everything in init was OK #ifdef DEBUG //Force running experiments even if init was not OK init_rval = 0; #endif if (init_rval < 0){ std::cout << "Error while initializing cameras.\nExiting..." << std::endl; } else{ ////////////////////////////////////////////////// //make a data directory for each camera for (int i = 0; i < cameraIds.size(); i++) generateCamDir(i + 1, buf); switch (experimentSettings.mode) { case IMAGE_STACK_EXPTIME: { std::cout << "Capturing image stacks for HDR" << std::endl; run_image_stack_capture(); break; } case SINGLE: { std::cout << "Capturing single image from the first camera (first image stack settings)" << std::endl; int cameraId = 0; int exptime = experimentSettings.imageStack[0].exposureTime; //µs run_single_capture(cameraId, exptime); break; } case ADAPTIVE: { getAdaptiveSettings(&adaptiveSettings, setupFileName); std::cout << "Capturing HDR image using adaptive exposure" << std::endl; run_adaptive_hdr_capture(); break; } case STREAMING_VIEW: { std::cout << "Streaming view started" << std::endl; run_streaming_view(); break; } case EXTERNAL_SIGNAL:{ std::cout << "External signal capture mode" <<std::endl; run_external_signal_capture(); break; } case DEBUG_TESTING: { std::cout << "Debug test:" << experimentSettings.id << std::endl; switch (experimentSettings.id) { case 0: { run_debug_filenames(); //OK break; } case 1: { run_test_tiff_load(argv[2]); break; } case 2: { run_test_tiff_saving(); break; } default: { std::cout << "Running [test] but id=" << experimentSettings.id << " not implemented" << std::endl; break; } } break; } } } cleanExit("Done"); }
{ "content_hash": "5a3ca0497d3c9baa910c94090c8de1b5", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 110, "avg_line_length": 32.372549019607845, "alnum_prop": 0.5617807389460933, "repo_name": "svarjo/VisMe", "id": "d9a7b361f65b348c373a9317da1eda809247a0da", "size": "6605", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "camCtrl/src/main.cpp", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "32073" }, { "name": "C++", "bytes": "481102" }, { "name": "Makefile", "bytes": "5500" }, { "name": "Matlab", "bytes": "37560" }, { "name": "Shell", "bytes": "1700" } ], "symlink_target": "" }
using namespace std; class Graph { int V; // No. of vertices list<int> *adj; // adjacency lists // A recursive function to print DFS starting from v void DFSUtil(int v, vector<bool> &visited); public: Graph(int V); void addEdge(int v, int w); int findMother(); }; Graph::Graph(int V) { this->V = V; adj = new list<int>[V]; } // A recursive function to print DFS starting from v void Graph::DFSUtil(int v, vector<bool> &visited) { // Mark the current node as visited and print it visited[v] = true; // Recur for all the vertices adjacent to this vertex list<int>::iterator i; for (i = adj[v].begin(); i != adj[v].end(); ++i) if (!visited[*i]) DFSUtil(*i, visited); } void Graph::addEdge(int v, int w) { adj[v].push_back(w); // Add w to v’s list. } // Returns a mother vertex if exists. Otherwise returns -1 int Graph::findMother() { // visited[] is used for DFS. Initially all are // initialized as not visited vector <bool> visited(V, false); // To store last finished vertex (or mother vertex) int v = 0; // Do a DFS traversal and find the last finished // vertex for (int i = 0; i < V; i++) { if (visited[i] == false) { DFSUtil(i, visited); v = i; } } // If there exist mother vertex (or vetices) in given // graph, then v must be one (or one of them) // Now check if v is actually a mother vertex (or graph // has a mother vertex). We basically check if every vertex // is reachable from v or not. // Reset all values in visited[] as false and do // DFS beginning from v to check if all vertices are // reachable from it or not. fill(visited.begin(), visited.end(), false); DFSUtil(v, visited); for (int i=0; i<V; i++) if (visited[i] == false) return -1; return v; } // Driver program to test above functions int main() { // Create a graph given in the above diagram Graph g(7); g.addEdge(0, 1); g.addEdge(0, 2); g.addEdge(1, 3); g.addEdge(4, 1); g.addEdge(6, 4); g.addEdge(5, 6); g.addEdge(5, 2); g.addEdge(6, 0); cout << "A mother vertex is " << g.findMother(); return 0; }
{ "content_hash": "944a423386b6ed4103dee05e54f11789", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 64, "avg_line_length": 24.77319587628866, "alnum_prop": 0.5538909696213067, "repo_name": "gbelwariar/Self-Made-Projects", "id": "98b282412447bd91e3c42a861929a8f9002f00e7", "size": "2484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Mother-Vertex-of-a-graph/Mother_Vertex.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "231375" } ], "symlink_target": "" }
import json import uuid from datetime import datetime from ._compat import iteritems, binary_type, cached_property __all__ = ('Alert', 'Message', 'HIGH_PRIORITY', 'LOW_PRIORITY', 'EXPIRE_IMMEDIATELY') _EPOCH = datetime(1970, 1, 1) #: Send the push message immediately. Notifications with this priority must #: trigger an alert, sound, or badge on the target device. It is an error #: to use this priority for a push notification that contains only the #: ``content-available`` key. HIGH_PRIORITY = 10 #: Send the push message at a time that takes into account power #: considerations for the device. Notifications with this priority might be #: grouped and delivered in bursts. They are throttled, and in some cases #: are not delivered. LOW_PRIORITY = 5 #: If the message expiration is ``0``, APNs treats the notification as if #: it expires immediately and does not store the notification or attempt to #: redeliver it. EXPIRE_IMMEDIATELY = 0 class Message(object): """ An APNs message. :param id: A canonical :class:`~uuid.UUID` that identifies the notification. If there is an error sending the notification, APNs uses this value to identify the notification to your server. You may pass a :class:`~uuid.UUID` object, or any value which can be used to create one. If you omit this value, a new :class:`~uuid.UUID` is created by APNs and returned by :meth:`Client.push`. :param priority: The priority of the notification. Can be either :data:`.HIGH_PRIORITY` or :data:`.LOW_PRIORITY`. :param expiration: A UNIX epoch date expressed in seconds (UTC), or a :class:`~datetime.datetime`. This identifies the date when the notification is no longer valid and can be discarded. If this value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed if it is unable to deliver the notification the first time. If the value is 0 or ``None``, APNs treats the notification as if it expires immediately and does not store the notification or attempt to redeliver it. :param alert: If this property is included, the system displays a standard alert or a banner, based on the user’s OS settings. You can specify a string or an :class:`.Alert` as the value of ``alert``. If you specify a string, it becomes the message text of an alert with two buttons: Close and View. If the user taps View, the app launches. If you specify an :class:`.Alert`, more complex behavior is supported. See the documentation for :class:`.Alert` for details. :param badge: The number to display as the badge of the app icon. If this property is absent, the badge is not changed. To remove the badge, set the value of this property to ``0``. :param topic: The topic of the remote notification, which is typically the bundle ID for your app. The certificate you create in Member Center must include the capability for this topic. If your certificate includes multiple topics, you must specify a value for this attribute. If you omit this value and your APNs certificate does not specify multiple topics, the APNs server uses the certificate’s Subject as the default topic. :param category: Provide this key with a string value that represents the identifier property of the ``UIMutableUserNotificationCategory`` object you created to define custom actions. To learn more about using custom actions, see `Registering Your Actionable Notification Types`_. :param sound: The name of a sound file in the app bundle or in the ``Library/Sounds`` folder of the app’s data container. The sound in this file is played as an alert. If the sound file doesn’t exist or default is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds; see `Preparing Custom Alert Sounds`_ for details. :param content_available: Provide this key with a value of ``True`` to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, ``application:didReceiveRemoteNotification:fetchCompletionHandler:`` is called. :param extra: Extra information to bundle with the notification payload. .. _Registering Your Actionable Notification Types: https://developer.apple .com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNoti ficationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008 194-CH103-SW26 .. _Preparing Custom Alert Sounds: https://developer.apple.com/library/ios/ documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapt ers/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6 """ def __init__(self, id=None, topic=None, alert=None, badge=None, sound=None, category=None, content_available=None, expiration=EXPIRE_IMMEDIATELY, priority=HIGH_PRIORITY, **extra): #: A canonical :class:`~uuid.UUID` that identifies the notification. self.id = id #: The priority of the notification. self.priority = priority #: A :class:`~datetime.datetime` representing when the notification is #: no longer valid and can be discarded. self.expiration = expiration #: The Alert to show in the app. self.alert = alert #: The number to display as the badge of the app icon. self.badge = badge #: The topic of the remote notification self.topic = topic #: The notification category self.category = category #: The notification sound to play when the message is received. self.sound = sound #: Indicates that new content is available. self.content_available = content_available #: Extra information to bundle with the notification payload. self.extra = extra @property def aps(self): """The content of the ``aps`` dictionary.""" if isinstance(self.alert, Alert): alert = self.alert.payload else: alert = self.alert aps = { 'alert': alert, 'badge': self.badge, 'sound': self.sound, 'content-available': self.content_available, 'category': self.category, } aps = {k: v for k, v in iteritems(aps) if v is not None} return aps @property def content_available(self): return self._content_available @content_available.setter def content_available(self, value): # This key should be 1 if "true" and omitted if "false" self._content_available = None if value: self._content_available = 1 @cached_property def headers(self): _id = None if self.id: _id = str(self.id) _exp = EXPIRE_IMMEDIATELY if self.expiration: _exp = self.expiration - _EPOCH hdrs = { 'apns-id': _id, 'apns-topic': self.topic, 'apns-priority': self.priority, 'apns-expiration': _exp, } return {k: v for k, v in iteritems(hdrs) if v is not None} @property def id(self): return self._id @id.setter def id(self, value): if value is not None and not isinstance(value, uuid.UUID): # Raises ValueError if UUID string is invalid value = uuid.UUID(value) self._id = value @property def priority(self): return self._priority @priority.setter def priority(self, value): assert value in (LOW_PRIORITY, HIGH_PRIORITY), 'Invalid priority' self._priority = value @property def expiration(self): if not self._expiration: return None return datetime.utcfromtimestamp(self._expiration) @expiration.setter def expiration(self, value): if isinstance(value, datetime): diff = value - _EPOCH value = diff.total_seconds() if value: assert value >= 0, 'Invalid expiration' self._expiration = value @cached_property def payload(self): """The payload data of the message. See `the Remote Notification Payload <https://developer.apple.com/library/ios/documentation/Networki ngInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPay load.html>`_ for details. This property is cached once computed, so it is best to not reuse message objects. """ payload = { 'aps': self.aps, } if self.extra: payload.update(self.extra) return payload @cached_property def encoded(self): """The message payload encoded as a JSON string. This property is cached once computed. """ jsondata = json.dumps( self.payload, # Apple does not support \U notation ensure_ascii=False, # More compact than the default separators separators=(',', ':') ) if not isinstance(jsondata, binary_type): # pragma: no cover jsondata = jsondata.encode('utf-8') return jsondata class Alert(object): """Object representing the APNs ``alert`` data of the ``aps`` payload. Use this to construct an alert if you need to support the Apple Watch, have localized notification messages, or change the launch image used when opening your app from a notification. If your notifications do not need to support these things, and you just want a simple text notification, you may use a regular string for :attr:`.Message.alert`. See the `APNs Remote Notification Payload`_ documentation for more details. :param title: A short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. :param body: The text of the alert message. :param title_loc_key: The key to a title string in the ``Localizable.strings`` file for the current localization. The key string can be formatted with ``%@`` and ``%n$@`` specifiers to take the variables specified in the title-loc-args array. :param title_loc_args: Variable string values to appear in place of the format specifiers in title-loc-key. :param action_loc_key: If a string is specified, the system displays an alert that includes the Close and View buttons. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. :param loc_key: A key to an alert-message string in a ``Localizable.strings`` file for the current localization (which is set by the user’s language preference). The key string can be formatted with ``%@`` and ``%n$@`` specifiers to take the variables specified in the ``loc-args`` array. :param loc_args: Variable string values to appear in place of the format specifiers in loc-key. :param launch_image: The filename of an image file in the app bundle; it may include the extension or omit it. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot,uses the image identified by the ``UILaunchImageFile`` key in the app’s ``Info.plist`` file, or falls back to ``Default.png``. .. _APNs Remote Notification Payload: https://developer.apple.com/library/i os/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Ch apters/TheNotificationPayload.html """ def __init__(self, title, body, title_loc_key=None, title_loc_args=None, action_loc_key=None, loc_key=None, loc_args=None, launch_image=None): self.body = body self.title = title self.title_loc_key = title_loc_key self.title_loc_args = title_loc_args self.action_loc_key = action_loc_key self.loc_key = loc_key self.loc_args = loc_args self.launch_image = launch_image @cached_property def payload(self): """The payload data that will be used for the ``alert`` section of the ``aps`` payload. """ p = { 'title': self.title, 'body': self.body, 'title-loc-key': self.title_loc_key, 'title-loc-args': self.title_loc_args, 'action-loc-key': self.action_loc_key, 'loc-key': self.loc_key, 'loc-args': self.loc_args, 'launch-image': self.launch_image, } return {k: v for k, v in iteritems(p) if v is not None}
{ "content_hash": "9df6e4441daad9dd8e95e93355d38768", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 79, "avg_line_length": 41.64576802507837, "alnum_prop": 0.651411366202484, "repo_name": "joshfriend/apns3", "id": "8aae9f8fd9d1854d80895db746f912f6851a9949", "size": "13350", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "apns/message.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "4890" }, { "name": "Python", "bytes": "47311" }, { "name": "Shell", "bytes": "3993" } ], "symlink_target": "" }
#include "tensorflow/compiler/xla/python/py_buffer.h" #include <functional> #include <type_traits> #include "absl/base/casts.h" #include "pybind11/pybind11.h" #include "pybind11/pytypes.h" #include "tensorflow/compiler/xla/pjrt/pjrt_client.h" #include "tensorflow/compiler/xla/python/py_client.h" #include "tensorflow/compiler/xla/python/python_ref_manager.h" #include "tensorflow/compiler/xla/python/types.h" #include "tensorflow/compiler/xla/util.h" namespace xla { namespace py = pybind11; namespace { // Representation of a DeviceArrayBase as a Python object. Since // a DeviceArrayBase has no fields, this is just a PyObject. struct PyBufferBasePyObject { PyObject_HEAD; }; static_assert(std::is_standard_layout<PyBufferBasePyObject>::value, "PyBufferBasePyObject must be standard layout"); // Representation of a DeviceArray as a Python object. struct PyBufferPyObject { PyBufferBasePyObject base; PyBuffer buffer; // Used by the Python interpreter to maintain a list of weak references to // this object. PyObject* weakrefs; }; static_assert(std::is_standard_layout<PyBufferPyObject>::value, "PyBufferPyObject must be standard layout"); PyObject* PyBuffer_tp_new(PyTypeObject* subtype, PyObject* args, PyObject* kwds) { PyBufferPyObject* self = reinterpret_cast<PyBufferPyObject*>(subtype->tp_alloc(subtype, 0)); if (!self) return nullptr; self->weakrefs = nullptr; return reinterpret_cast<PyObject*>(self); } void PyBuffer_tp_dealloc(PyObject* self) { PyTypeObject* tp = Py_TYPE(self); PyBufferPyObject* o = reinterpret_cast<PyBufferPyObject*>(self); if (o->weakrefs) { PyObject_ClearWeakRefs(self); } o->buffer.~PyBuffer(); tp->tp_free(self); Py_DECREF(tp); } } // namespace /*static*/ PyBuffer::object PyBuffer::Make( std::shared_ptr<PyClient> client, std::shared_ptr<PjRtBuffer> buffer, std::shared_ptr<Traceback> traceback) { py::object obj = py::reinterpret_steal<py::object>(PyBuffer_tp_new( reinterpret_cast<PyTypeObject*>(type_), nullptr, nullptr)); PyBufferPyObject* buf = reinterpret_cast<PyBufferPyObject*>(obj.ptr()); new (&buf->buffer) PyBuffer(std::move(client), std::move(buffer), std::move(traceback)); return py::reinterpret_borrow<PyBuffer::object>(obj); } bool PyBuffer::IsPyBuffer(py::handle handle) { return handle.get_type() == PyBuffer::type(); } /*static*/ PyBuffer* PyBuffer::AsPyBufferUnchecked(pybind11::handle handle) { return &(reinterpret_cast<PyBufferPyObject*>(handle.ptr())->buffer); } /*static*/ StatusOr<PyBuffer*> PyBuffer::AsPyBuffer(pybind11::handle handle) { if (!IsPyBuffer(handle)) { return InvalidArgument("Expected a DeviceArray"); } return AsPyBufferUnchecked(handle); } py::handle PyBuffer::AsHandle() { return reinterpret_cast<PyObject*>(reinterpret_cast<char*>(this) - offsetof(PyBufferPyObject, buffer)); } PyBuffer::PyBuffer(std::shared_ptr<PyClient> client, std::shared_ptr<PjRtBuffer> buffer, std::shared_ptr<Traceback> traceback) : client_(std::move(client)), buffer_(std::move(buffer)), traceback_(std::move(traceback)) { CHECK(PyGILState_Check()); next_ = client_->buffers_[buffer_->device()->id()]; client_->buffers_[buffer_->device()->id()] = this; prev_ = nullptr; if (next_) { next_->prev_ = this; } } PyBuffer::~PyBuffer() { CHECK(PyGILState_Check()); if (client_->buffers_[device()->id()] == this) { client_->buffers_[device()->id()] = next_; } if (prev_) { prev_->next_ = next_; } if (next_) { next_->prev_ = prev_; } } StatusOr<int64_t> PyBuffer::size() { Shape max_buffer_shape = buffer()->on_device_shape(); if (max_buffer_shape.is_dynamic()) { TF_ASSIGN_OR_RETURN(const auto* dynamic_shape, xla_dynamic_shape()); return ShapeUtil::ElementsIn(*dynamic_shape); } return ShapeUtil::ElementsIn(max_buffer_shape); } StatusOr<const Shape*> PyBuffer::xla_dynamic_shape() { CHECK(PyGILState_Check()); if (buffer_->on_device_shape().is_static()) { return &buffer_->on_device_shape(); } // Python buffer protocol references shape data by pointer, therefore we must // store a valid copy of the shape. if (!dynamic_shape_) { Shape dynamic_shape; { py::gil_scoped_release gil_release; TF_ASSIGN_OR_RETURN(dynamic_shape, buffer_->logical_on_device_shape()); } dynamic_shape_ = dynamic_shape; } return &dynamic_shape_.value(); } pybind11::tuple PyBuffer::python_shape() const { return SpanToTuple(buffer()->on_device_shape().dimensions()); } pybind11::dtype PyBuffer::python_dtype() const { PrimitiveType primitive = buffer()->on_device_shape().element_type(); return PrimitiveTypeToDtype(primitive).ValueOrDie(); } ClientAndPtr<PjRtDevice> PyBuffer::device() const { return WrapWithClient(client_, buffer_->device()); } PyBuffer::object PyBuffer::Clone() const { auto buffer = Make(client_, buffer_, traceback_); buffer.buf()->sticky_device_ = sticky_device_; buffer.buf()->aval_ = aval_; return buffer; } StatusOr<py::object> PyBuffer::CopyToDevice( const ClientAndPtr<PjRtDevice>& dst_device) const { CHECK(dst_device.get() != nullptr); GlobalPyRefManager()->CollectGarbage(); std::unique_ptr<PjRtBuffer> out; { py::gil_scoped_release gil_release; TF_ASSIGN_OR_RETURN(out, buffer_->CopyToDevice(dst_device.get())); } auto traceback = Traceback::Get(); return Make(dst_device.client, std::move(out), std::move(traceback)); } Status PyBuffer::BlockHostUntilReady() { GlobalPyRefManager()->CollectGarbage(); py::gil_scoped_release gil_release; return buffer_->BlockHostUntilReady(); } Status PyBuffer::CopyToHostAsync() { if (!buffer_->IsOnCpu() && !host_value_) { std::shared_ptr<HostValue> host_value = std::make_shared<HostValue>(); host_value_ = host_value; // TODO(b/182461453): This is a blocking call. If we further implemented // populating dynamic shape metadata while fetching the literal, we wouldn't // need this static approach. TF_ASSIGN_OR_RETURN(const auto* dynamic_shape, xla_dynamic_shape()); py::gil_scoped_release gil; host_value->value = std::make_shared<Literal>( ShapeUtil::DeviceShapeToHostShape(*dynamic_shape)); Literal* literal = host_value->value.get(); buffer_->ToLiteral(literal, [host_value{std::move(host_value)}](Status status) { host_value->status = std::move(status); host_value->ready.Notify(); }); } return Status::OK(); } StatusOr<pybind11::object> PyBuffer::AsNumPyArray(py::handle this_obj) { if (buffer_->IsDeleted()) { return InvalidArgument("DeviceArray has been deleted."); } TF_RET_CHECK(buffer_->on_device_shape().IsArray()); // On CPU, we can return the value in a zero-copy way. if (buffer_->IsOnCpu()) { TF_ASSIGN_OR_RETURN(const auto* shape, xla_dynamic_shape()); TF_ASSIGN_OR_RETURN(py::dtype dtype, PrimitiveTypeToDtype(shape->element_type())); // Objects that must be kept alive while the array is alive. struct Hold { py::object buffer; std::unique_ptr<PjRtBuffer::ExternalReference> external_reference_hold; }; auto hold = std::make_unique<Hold>(); TF_ASSIGN_OR_RETURN(hold->external_reference_hold, buffer_->AcquireExternalReference()); hold->buffer = py::reinterpret_borrow<py::object>(this_obj); void* data = hold->external_reference_hold->OpaqueDeviceMemoryDataPointer(); py::capsule hold_capsule(hold.release(), [](void* h) { delete static_cast<Hold*>(h); }); py::array array(dtype, shape->dimensions(), ByteStridesForShape(*shape), data, hold_capsule); array.attr("flags").attr("writeable") = Py_False; { py::gil_scoped_release gil; TF_RETURN_IF_ERROR(buffer_->BlockHostUntilReady()); } return array; } TF_RETURN_IF_ERROR(CopyToHostAsync()); if (!host_value_->ready.HasBeenNotified()) { py::gil_scoped_release gil; host_value_->ready.WaitForNotification(); } TF_RETURN_IF_ERROR(host_value_->status); TF_ASSIGN_OR_RETURN(py::object array, LiteralToPython(host_value_->value)); array.attr("flags").attr("writeable") = Py_False; return array; } StatusOr<std::uintptr_t> PyBuffer::UnsafeBufferPointer() const { return client_->pjrt_client()->UnsafeBufferPointer(buffer_.get()); } StatusOr<py::dict> PyBuffer::CudaArrayInterface() { // TODO(zhangqiaorjc): Differentiate between NVidia and other GPUs. if (buffer_->client()->platform_id() != kGpuId) { return InvalidArgument( "__cuda_array_interface__ is only defined for NVidia GPU buffers."); } if (!buffer_->on_device_shape().IsArray()) { return InvalidArgument( "__cuda_array_interface__ is only defined for array buffers."); } if (buffer_->on_device_shape().element_type() == BF16) { return InvalidArgument( "__cuda_array_interface__ is not supported for bfloat16 buffers."); } TF_RET_CHECK(LayoutUtil::IsMonotonicWithDim0Major( buffer_->on_device_shape().layout())); py::dict result; TF_ASSIGN_OR_RETURN(const auto* dynamic_shape, xla_dynamic_shape()); result["shape"] = SpanToTuple(dynamic_shape->dimensions()); TF_ASSIGN_OR_RETURN(py::str typestr, TypeDescriptorForPrimitiveType( buffer_->on_device_shape().element_type())); result["typestr"] = std::move(typestr); TF_ASSIGN_OR_RETURN( std::unique_ptr<PjRtBuffer::ExternalReference> external_reference_hold, buffer_->AcquireExternalReference()); const void* root_ptr = external_reference_hold->OpaqueDeviceMemoryDataPointer(); py::tuple data(2); data[0] = py::int_(absl::bit_cast<std::uintptr_t>(root_ptr)); data[1] = py::bool_(true); // read-only result["data"] = std::move(data); result["version"] = py::int_(2); return result; } // PEP 3118 buffer protocol implementation. namespace { // Extra data to be kept alive by the consumer of the buffer protocol. struct ExtraBufferInfo { explicit ExtraBufferInfo( std::unique_ptr<PjRtBuffer::ExternalReference> external_reference_hold) : external_reference_hold(std::move(external_reference_hold)) {} std::string format; std::vector<Py_ssize_t> strides; // We keep an external reference hold to the PjRtBuffer. This prevents a // use-after-free in the event that Delete() is called on a buffer with an // live buffer protocol view. It does however mean that Delete() sometimes // won't actually delete immediately. std::unique_ptr<PjRtBuffer::ExternalReference> external_reference_hold; }; int PyBuffer_bf_getbuffer(PyObject* exporter, Py_buffer* view, int flags) { Status status = [&]() { TF_ASSIGN_OR_RETURN(PyBuffer * py_buffer, PyBuffer::AsPyBuffer(exporter)); PjRtBuffer& buffer = *py_buffer->buffer(); TF_ASSIGN_OR_RETURN(const auto* shape, py_buffer->xla_dynamic_shape()); // Py_buffer objects are POD C structures, so we don't need to hold the GIL. // Additionally we call BlockHostUntilReady() below, which may block. py::gil_scoped_release gil_release; if (!buffer.IsOnCpu()) { return InvalidArgument( "Python buffer protocol is only defined for CPU buffers."); } if (!buffer.on_device_shape().IsArray()) { return InvalidArgument( "Python buffer protocol is only defined for array buffers."); } // If we allowed exports of formatted BF16 buffers, consumers would get // confused about the type because there is no way to describe BF16 to // Python. if (buffer.on_device_shape().element_type() == BF16 && ((flags & PyBUF_FORMAT) == PyBUF_FORMAT)) { return InvalidArgument( "bfloat16 buffer format not supported by Python buffer protocol."); } if ((flags & PyBUF_WRITEABLE) == PyBUF_WRITEABLE) { return InvalidArgument("XLA buffers are read-only."); } TF_ASSIGN_OR_RETURN( std::unique_ptr<PjRtBuffer::ExternalReference> external_reference_hold, buffer.AcquireExternalReference()); if (buffer.IsDeleted()) { return InvalidArgument("Deleted buffer used in buffer protocol."); } if (((flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS || (flags & PyBUF_STRIDES) == PyBUF_ND) && !LayoutUtil::IsMonotonicWithDim0Major(shape->layout())) { return InvalidArgument("Buffer is not in C-contiguous layout."); } else if ((flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS && !LayoutUtil::IsMonotonicWithDim0Minor(shape->layout())) { return InvalidArgument("Buffer is not in F-contiguous layout."); } else if ((flags & PyBUF_ANY_CONTIGUOUS) == PyBUF_ANY_CONTIGUOUS && !LayoutUtil::IsMonotonicWithDim0Major(shape->layout()) && !LayoutUtil::IsMonotonicWithDim0Minor(shape->layout())) { return InvalidArgument("Buffer is not in contiguous layout."); } std::memset(view, 0, sizeof(Py_buffer)); const void* root_ptr = external_reference_hold->OpaqueDeviceMemoryDataPointer(); view->buf = const_cast<void*>(root_ptr); auto extra = absl::make_unique<ExtraBufferInfo>(std::move(external_reference_hold)); view->itemsize = ShapeUtil::ByteSizeOfPrimitiveType(shape->element_type()); view->len = ShapeUtil::ByteSizeOf(*shape); view->readonly = 1; if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) { TF_ASSIGN_OR_RETURN(extra->format, FormatDescriptorForPrimitiveType( shape->element_type())); view->format = const_cast<char*>(extra->format.c_str()); } if ((flags & PyBUF_ND) == PyBUF_ND) { view->ndim = shape->dimensions_size(); static_assert(sizeof(int64_t) == sizeof(Py_ssize_t), "Py_ssize_t must be 64 bits"); if (view->ndim != 0) { view->shape = reinterpret_cast<Py_ssize_t*>( const_cast<int64_t*>(shape->dimensions().data())); if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) { extra->strides = ByteStridesForShape(*shape); view->strides = extra->strides.data(); } } } TF_RETURN_IF_ERROR(buffer.BlockHostUntilReady()); view->internal = extra.release(); return Status::OK(); }(); if (!status.ok()) { // numpy.asarray(...) silents the PyExc_BufferError. Adding a log here helps // debugging when the error really occurs. VLOG(1) << "Buffer Protocol Error: " << status; PyErr_SetString(PyExc_BufferError, status.ToString().c_str()); return -1; } view->obj = exporter; Py_INCREF(view->obj); return 0; } void PyBuffer_bf_releasebuffer(PyObject*, Py_buffer* buffer) { auto extra = static_cast<ExtraBufferInfo*>(buffer->internal); delete extra; } PyBufferProcs PyBuffer_tp_as_buffer = []() { PyBufferProcs procs; procs.bf_getbuffer = &PyBuffer_bf_getbuffer; procs.bf_releasebuffer = &PyBuffer_bf_releasebuffer; return procs; }(); // Helpers for building Python properties template <typename Func> py::object property_readonly(Func&& get) { py::handle property(reinterpret_cast<PyObject*>(&PyProperty_Type)); return property(py::cpp_function(std::forward<Func>(get)), py::none(), py::none(), ""); } template <typename GetFunc, typename SetFunc> py::object property(GetFunc&& get, SetFunc&& set) { py::handle property(reinterpret_cast<PyObject*>(&PyProperty_Type)); return property(py::cpp_function(std::forward<GetFunc>(get)), py::cpp_function(std::forward<SetFunc>(set)), py::none(), ""); } } // namespace PyObject* PyBuffer::base_type_ = nullptr; PyObject* PyBuffer::type_ = nullptr; Status PyBuffer::RegisterTypes(py::module& m) { // We do not use pybind11::class_ to build Python wrapper objects because // creation, destruction, and casting of buffer objects is performance // critical. By using hand-written Python classes, we can avoid extra C heap // allocations, and we can avoid pybind11's slow cast<>() implementation // during jit dispatch. // We need to use heap-allocated type objects because we want to add // additional methods dynamically. { py::str name = py::str("DeviceArrayBase"); py::str qualname = py::str("DeviceArrayBase"); PyHeapTypeObject* heap_type = reinterpret_cast<PyHeapTypeObject*>( PyType_Type.tp_alloc(&PyType_Type, 0)); // Caution: we must not call any functions that might invoke the GC until // PyType_Ready() is called. Otherwise the GC might see a half-constructed // type object. if (!heap_type) { return Internal("Unable to create heap type object"); } heap_type->ht_name = name.release().ptr(); heap_type->ht_qualname = qualname.release().ptr(); PyTypeObject* type = &heap_type->ht_type; type->tp_name = "DeviceArrayBase"; type->tp_basicsize = sizeof(PyBufferBasePyObject); type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE | Py_TPFLAGS_BASETYPE; TF_RET_CHECK(PyType_Ready(type) == 0); base_type_ = reinterpret_cast<PyObject*>(type); } py::object base_type = py::reinterpret_borrow<py::object>(base_type_); base_type.attr("__module__") = m.attr("__name__"); m.attr("DeviceArrayBase") = base_type; { py::tuple bases = py::make_tuple(base_type); py::str name = py::str("DeviceArray"); py::str qualname = py::str("DeviceArray"); PyHeapTypeObject* heap_type = reinterpret_cast<PyHeapTypeObject*>( PyType_Type.tp_alloc(&PyType_Type, 0)); // Caution: we must not call any functions that might invoke the GC until // PyType_Ready() is called below. Otherwise the GC might see a // half-constructed type object. if (!heap_type) { return Internal("Unable to create heap type object"); } heap_type->ht_name = name.release().ptr(); heap_type->ht_qualname = qualname.release().ptr(); PyTypeObject* type = &heap_type->ht_type; type->tp_name = "DeviceArray"; type->tp_basicsize = sizeof(PyBufferPyObject); type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE; type->tp_bases = bases.release().ptr(); type->tp_dealloc = PyBuffer_tp_dealloc; type->tp_new = PyBuffer_tp_new; // Supported protocols type->tp_as_number = &heap_type->as_number; type->tp_as_sequence = &heap_type->as_sequence; type->tp_as_mapping = &heap_type->as_mapping; type->tp_as_buffer = &PyBuffer_tp_as_buffer; // Allow weak references to DeviceArray objects. type->tp_weaklistoffset = offsetof(PyBufferPyObject, weakrefs); TF_RET_CHECK(PyType_Ready(type) == 0); type_ = reinterpret_cast<PyObject*>(type); } py::object type = py::reinterpret_borrow<py::object>(type_); m.attr("DeviceArray") = type; m.attr("PyLocalBuffer") = type; m.attr("Buffer") = type; // Add methods and properties to the class. We use pybind11 and add methods // dynamically mostly because this is easy to write and allows us to use // pybind11's casting logic. This is most likely slightly slower than // hand-writing bindings, but most of these methods are not performance // critical. type.attr("__array_priority__") = property_readonly([](py::object self) -> int { return 100; }); type.attr("_device") = property( [](PyBuffer::object self) -> ClientAndPtr<PjRtDevice> { return WrapWithClient(self.buf()->client(), self.buf()->sticky_device()); }, [](PyBuffer::object self, PjRtDevice* sticky_device) { return self.buf()->set_sticky_device(sticky_device); }); type.attr("aval") = property( [](PyBuffer::object self) -> py::object { return self.buf()->GetAval(); }, [](PyBuffer::object self, py::object aval) { return self.buf()->SetAval(std::move(aval)); }); type.attr("weak_type") = property( [](PyBuffer::object self) -> absl::optional<bool> { return self.buf()->weak_type(); }, [](PyBuffer::object self, absl::optional<bool> weak_type) { return self.buf()->set_weak_type(weak_type); }); type.attr("_lazy_expr") = property_readonly([](py::handle self) { return py::none(); }); type.attr("device_buffer") = property_readonly([](py::object self) { return self; }); type.attr( "shape") = property_readonly([](PyBuffer::object self) -> py::tuple { return SpanToTuple(self.buf()->buffer()->on_device_shape().dimensions()); }); type.attr("dtype") = property_readonly([](PyBuffer::object self) { PrimitiveType primitive = self.buf()->buffer()->on_device_shape().element_type(); return PrimitiveTypeToDtype(primitive).ValueOrDie(); }); type.attr("size") = property_readonly([](PyBuffer::object self) -> StatusOr<int64_t> { return self.buf()->size(); }); type.attr("ndim") = property_readonly( [](PyBuffer::object self) -> int { return self.buf()->ndim(); }); type.attr("_value") = property_readonly( [](PyBuffer::object self) -> StatusOr<pybind11::object> { GlobalPyRefManager()->CollectGarbage(); return self.buf()->AsNumPyArray(self); }); type.attr("copy_to_device") = py::cpp_function( [](PyBuffer::object self, const ClientAndPtr<PjRtDevice>& dst_device) { return self.buf()->CopyToDevice(dst_device); }, py::is_method(type)); type.attr("on_device_size_in_bytes") = py::cpp_function( [](PyBuffer::object self) -> StatusOr<size_t> { return self.buf()->OnDeviceSizeInBytes(); }, py::is_method(type)); type.attr("delete") = py::cpp_function( [](PyBuffer::object self) { self.buf()->Delete(); }, py::is_method(type)); type.attr("block_host_until_ready") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->BlockHostUntilReady(); }, py::is_method(type)); type.attr("block_until_ready") = py::cpp_function( [](PyBuffer::object self) -> StatusOr<PyBuffer::object> { TF_RETURN_IF_ERROR(self.buf()->BlockHostUntilReady()); return std::move(self); }, py::is_method(type)); type.attr("copy_to_host_async") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->CopyToHostAsync(); }, py::is_method(type)); type.attr("to_py") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->AsNumPyArray(self); }, py::is_method(type)); type.attr("xla_shape") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->shape(); }, py::is_method(type)); type.attr("xla_dynamic_shape") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->xla_dynamic_shape(); }, py::is_method(type)); type.attr("client") = property_readonly( [](PyBuffer::object self) { return self.buf()->client(); }); type.attr("device") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->device(); }, py::is_method(type)); type.attr("platform") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->platform_name(); }, py::is_method(type)); type.attr("is_deleted") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->is_deleted(); }, py::is_method(type)); type.attr("unsafe_buffer_pointer") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->UnsafeBufferPointer(); }, py::is_method(type)); type.attr("__cuda_array_interface__") = property_readonly( [](PyBuffer::object self) { return self.buf()->CudaArrayInterface(); }); type.attr("traceback") = property_readonly( [](PyBuffer::object self) { return self.buf()->traceback(); }); type.attr("clone") = py::cpp_function( [](PyBuffer::object self) { return self.buf()->Clone(); }, py::is_method(type)); type.attr("__module__") = m.attr("__name__"); return Status::OK(); } } // namespace xla
{ "content_hash": "ed92038a6547661c739b9dc485d7f9bf", "timestamp": "", "source": "github", "line_count": 617, "max_line_length": 80, "avg_line_length": 39.027552674230144, "alnum_prop": 0.6511212624584718, "repo_name": "frreiss/tensorflow-fred", "id": "0079d1a5f5e370616939b181fb98c1dd2d273682", "size": "24748", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tensorflow/compiler/xla/python/py_buffer.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "6729" }, { "name": "Batchfile", "bytes": "49527" }, { "name": "C", "bytes": "871761" }, { "name": "C#", "bytes": "8562" }, { "name": "C++", "bytes": "79093233" }, { "name": "CMake", "bytes": "6500" }, { "name": "Dockerfile", "bytes": "110545" }, { "name": "Go", "bytes": "1852128" }, { "name": "HTML", "bytes": "4686483" }, { "name": "Java", "bytes": "961600" }, { "name": "Jupyter Notebook", "bytes": "549457" }, { "name": "LLVM", "bytes": "6536" }, { "name": "MLIR", "bytes": "1644156" }, { "name": "Makefile", "bytes": "62398" }, { "name": "Objective-C", "bytes": "116558" }, { "name": "Objective-C++", "bytes": "303063" }, { "name": "PHP", "bytes": "20523" }, { "name": "Pascal", "bytes": "3982" }, { "name": "Pawn", "bytes": "18876" }, { "name": "Perl", "bytes": "7536" }, { "name": "Python", "bytes": "40003007" }, { "name": "RobotFramework", "bytes": "891" }, { "name": "Roff", "bytes": "2472" }, { "name": "Ruby", "bytes": "7464" }, { "name": "Shell", "bytes": "681596" }, { "name": "Smarty", "bytes": "34740" }, { "name": "Swift", "bytes": "62814" }, { "name": "Vim Snippet", "bytes": "58" } ], "symlink_target": "" }
layout: post date: 2017-10-30 title: "Blush Prom Style 19 Sleeveless Sweep/Brush Train Aline/Princess" category: Blush tags: [Blush,Aline/Princess ,Sweetheart,Sweep/Brush Train,Sleeveless] --- ### Blush Prom Style 19 Just **$289.99** ### Sleeveless Sweep/Brush Train Aline/Princess <table><tr><td>BRANDS</td><td>Blush</td></tr><tr><td>Silhouette</td><td>Aline/Princess </td></tr><tr><td>Neckline</td><td>Sweetheart</td></tr><tr><td>Hemline/Train</td><td>Sweep/Brush Train</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table> <a href="https://www.readybrides.com/en/blush/49071-blush-prom-style-19.html"><img src="//img.readybrides.com/109001/blush-prom-style-19.jpg" alt="Blush Prom Style 19" style="width:100%;" /></a> <!-- break --><a href="https://www.readybrides.com/en/blush/49071-blush-prom-style-19.html"><img src="//img.readybrides.com/109002/blush-prom-style-19.jpg" alt="Blush Prom Style 19" style="width:100%;" /></a> Buy it: [https://www.readybrides.com/en/blush/49071-blush-prom-style-19.html](https://www.readybrides.com/en/blush/49071-blush-prom-style-19.html)
{ "content_hash": "45a27f8ab389c0d173fd5df380e14026", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 250, "avg_line_length": 77.78571428571429, "alnum_prop": 0.7134986225895317, "repo_name": "nicedaymore/nicedaymore.github.io", "id": "947bd7a5bf2ca665b33c34fb14750b6a92f3269c", "size": "1093", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2017-10-30-Blush-Prom-Style-19-Sleeveless-SweepBrush-Train-AlinePrincess.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "83876" }, { "name": "HTML", "bytes": "14755" }, { "name": "Ruby", "bytes": "897" } ], "symlink_target": "" }
namespace Wex { class WindowDeviceContext : public DeviceContext { public: WindowDeviceContext(HWND window); WindowDeviceContext(const WindowDeviceContext& rhs) = delete; ~WindowDeviceContext(); WindowDeviceContext& operator=(const WindowDeviceContext& rhs) = delete; private: friend class WindowDeviceContextTest; HWND window = nullptr; }; }
{ "content_hash": "8b6035bb33751fdee99c837175e9d964", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 74, "avg_line_length": 21.352941176470587, "alnum_prop": 0.768595041322314, "repo_name": "jmfb/wex", "id": "5a1b832a43bca6c7099355c7ba8ec6fed1d71af1", "size": "404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WindowDeviceContext.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "829" }, { "name": "C++", "bytes": "171175" } ], "symlink_target": "" }
module.exports = function (mongoose) { var Schema = mongoose.Schema; var ClientSchema = new Schema({ razaoSocial: {type: String, default: ''}, cpf: {type: String, default: ''}, cnpj: {type: String, default: ''}, telefone: {type: String, default: ''}, data: { type: Date, default: Date.now } }); return mongoose.model('Client', ClientSchema); }
{ "content_hash": "052b575bf051ac357fdd914d00ff9ad1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 48, "avg_line_length": 28.76923076923077, "alnum_prop": 0.6229946524064172, "repo_name": "Ibanheiz/mean-seed", "id": "14316e77f0e68b4307c6150cb19ec5bc1cbd077b", "size": "374", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "back/modules/client/model.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "15525" }, { "name": "HTML", "bytes": "18121" }, { "name": "JavaScript", "bytes": "46398" } ], "symlink_target": "" }
package com.noticeditorteam.noticeditor.model; import com.carrotsearch.junitbenchmarks.BenchmarkOptions; import com.carrotsearch.junitbenchmarks.BenchmarkRule; import com.noticeditorteam.noticeditor.io.JsonFormat; import org.json.JSONException; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestRule; public class NoticeTreeItemBenchmarksTest { @Rule public TestRule benchmarkRun = new BenchmarkRule(); private static final int NESTING_LEVEL = 6000; private static NoticeTreeItem root; @BeforeClass public static void beforeClass() { root = new NoticeTreeItem("root"); NoticeTreeItem branch = root; for (int i = 0; i < NESTING_LEVEL; i++) { NoticeTreeItem node = new NoticeTreeItem("branch " + i); branch.addChild(node); branch = node; } } @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 1) @Ignore @Test public void testJsonExport() throws JSONException { JsonFormat.with(null).export(root); } }
{ "content_hash": "a9772819b7210af7328ebe202ff45f30", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 68, "avg_line_length": 29.236842105263158, "alnum_prop": 0.7029702970297029, "repo_name": "NoticEditorTeam/NoticEditor", "id": "5c5c33f55543db3a68ee83ad5ae96aa7005155bc", "size": "1111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/com/noticeditorteam/noticeditor/model/NoticeTreeItemBenchmarksTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "27429" }, { "name": "HTML", "bytes": "2328" }, { "name": "Java", "bytes": "143617" }, { "name": "Makefile", "bytes": "778" } ], "symlink_target": "" }
package org.pepstock.charba.client.options; import org.pepstock.charba.client.commons.Checker; import org.pepstock.charba.client.commons.Key; import org.pepstock.charba.client.commons.NativeObject; import org.pepstock.charba.client.defaults.IsDefaultLegend; /** * The chart legend displays data about the datasets that area appearing on the chart. * * @author Andrea "Stock" Stocchero * */ public final class Legend extends AbstractDefaultPluginElement<IsDefaultLegend> implements IsDefaultLegend, HasTextDirection, HasEvents { private final LegendLabels labels; private final LegendTitle title; private final TextDirectionHandler textDirectionHandler; // events handler private final EventsOptionHandler eventsHandler; /** * Name of properties of native object. */ private enum Property implements Key { LABELS("labels"), TITLE("title"), // simple properties MAX_WIDTH("maxWidth"), MAX_HEIGHT("maxWidth"), FULL_SIZE("fullSize"), REVERSE("reverse"), RTL("rtl"), TEXT_DIRECTION("textDirection"); // name value of property private final String value; /** * Creates with the property value to use in the native object. * * @param value value of property name */ private Property(String value) { this.value = value; } /* * (non-Javadoc) * * @see org.pepstock.charba.client.commons.Key#value() */ @Override public String value() { return value; } } /** * Creates the object with the parent, the key of this element, default values and native object to map java script properties. * * @param options plugins options of the chart. * @param childKey the property name of this element to use to add it to the parent. * @param defaultValues default provider * @param nativeObject native object to map java script properties */ Legend(Plugins options, Key childKey, IsDefaultLegend defaultValues, NativeObject nativeObject) { super(options, childKey, defaultValues, nativeObject); // gets sub element this.labels = new LegendLabels(this, Property.LABELS, getDefaultValues().getLabels(), getValue(Property.LABELS)); this.title = new LegendTitle(this, Property.TITLE, getDefaultValues().getTitle(), getValue(Property.TITLE)); // creates text direction handler this.textDirectionHandler = new TextDirectionHandler(this, getDefaultValues(), getNativeObject()); // creates events handler this.eventsHandler = new EventsOptionHandler(this, getDefaultValues(), getNativeObject()); } /* * (non-Javadoc) * * @see org.pepstock.charba.client.options.HasTextDirection#getTextDirectionHandler() */ @Override public TextDirectionHandler getTextDirectionHandler() { return textDirectionHandler; } /* * (non-Javadoc) * * @see org.pepstock.charba.client.options.HasEvents#getEventsOptionHandler() */ @Override public EventsOptionHandler getEventsOptionHandler() { return eventsHandler; } /** * Returns the legend labels element. * * @return the labels */ @Override public LegendLabels getLabels() { return labels; } /** * Returns the legend title element. * * @return the title */ @Override public LegendTitle getTitle() { return title; } /** * Sets the maximum width of the legend, in pixels. * * @param maxWidth the maximum width of the legend, in pixels */ public void setMaxWidth(int maxWidth) { setValueAndAddToParent(Property.MAX_WIDTH, Checker.positiveOrZero(maxWidth)); } /** * Returns the maximum width of the legend, in pixels. * * @return the maximum width of the legend, in pixels */ @Override public int getMaxWidth() { return getValue(Property.MAX_WIDTH, getDefaultValues().getMaxWidth()); } /** * Sets the maximum height of the legend, in pixels. * * @param maxHeight the maximum height of the legend, in pixels */ public void setMaxHeight(int maxHeight) { setValueAndAddToParent(Property.MAX_HEIGHT, Checker.positiveOrZero(maxHeight)); } /** * Returns the maximum width of the legend, in pixels. * * @return the maximum width of the legend, in pixels */ @Override public int getMaxHeight() { return getValue(Property.MAX_HEIGHT, getDefaultValues().getMaxWidth()); } /** * Marks that this box should take the full width/height of the canvas (moving other boxes). * * @param fullSize Marks that this box should take the full width/height of the canvas (moving other boxes) */ public void setFullSize(boolean fullSize) { setValueAndAddToParent(Property.FULL_SIZE, fullSize); } /** * Returns if that this box should take the full width/height of the canvas (moving other boxes). * * @return <code>true</code> if that this box should take the full width/height of the canvas (moving other boxes). */ @Override public boolean isFullSize() { return getValue(Property.FULL_SIZE, getDefaultValues().isFullSize()); } /** * Sets the legend will show datasets in reverse order. * * @param reverse legend will show datasets in reverse order. */ public void setReverse(boolean reverse) { setValueAndAddToParent(Property.REVERSE, reverse); } /** * Returns if the legend will show datasets in reverse order. * * @return <code>true</code> if legend will show datasets in reverse order. */ @Override public boolean isReverse() { return getValue(Property.REVERSE, getDefaultValues().isReverse()); } }
{ "content_hash": "6c8a0e3274b9d500970142b14d5bbc41", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 137, "avg_line_length": 27.09045226130653, "alnum_prop": 0.7223149693934335, "repo_name": "pepstock-org/Charba", "id": "f0b42aeac2793085884261a3084cb63f3aa0a636", "size": "5999", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/pepstock/charba/client/options/Legend.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4541" }, { "name": "Java", "bytes": "10392434" }, { "name": "JavaScript", "bytes": "95293" }, { "name": "Shell", "bytes": "137" } ], "symlink_target": "" }
exports.insertPersonalScore = ctx => { return Bloggify.services.mousetracker.saveMouseSet(ctx.data) }
{ "content_hash": "05e6869cd6b9e730d665f142683088fc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 64, "avg_line_length": 35.333333333333336, "alnum_prop": 0.7735849056603774, "repo_name": "HackPurdue/purdue-ironhacks", "id": "e61590decd7a960e546f1020916438c79e8ed576", "size": "125", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/actions/mousetracker.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "146082" }, { "name": "JavaScript", "bytes": "299621" }, { "name": "Shell", "bytes": "332" } ], "symlink_target": "" }
using STSdb4.General.Communication; using STSdb4.General.IO; using STSdb4.Remote; using STSdb4.Storage; using STSdb4.WaterfallTree; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Management; using System.Text; namespace STSdb4.Database { public static class STSdb { private static IStorageEngine FromStream(Stream system, Stream data, long initialFreeSize, bool useCompression = false) { IHeap heap = new Heap(system, data, initialFreeSize, useCompression); return new StorageEngine(heap); } public static IStorageEngine FromFile(string systemFileName, string dataFileName, bool useCompression = false) { var system = new OptimizedFileStream(systemFileName, FileMode.OpenOrCreate); var data = new OptimizedFileStream(dataFileName, FileMode.OpenOrCreate); long initialFreeSize = IOUtils.GetTotalSpace(Path.GetPathRoot(Path.GetFullPath(dataFileName))); return STSdb.FromStream(system, data, initialFreeSize, useCompression); } public static IStorageEngine FromMemory(bool useCompression = false) { var system = new MemoryStream(); var data = new MemoryStream(); long initialFreeSize = 0; ManagementObjectSearcher searcher = new ManagementObjectSearcher(new ObjectQuery("SELECT * From Win32_ComputerSystem")); foreach (var item in searcher.Get()) initialFreeSize = long.Parse(item["TotalPhysicalMemory"].ToString()); return STSdb.FromStream(system, data, initialFreeSize, useCompression); } public static IStorageEngine FromNetwork(string host, int port = 7182) { return new StorageEngineClient(host, port); } public static StorageEngineServer CreateServer(IStorageEngine engine, int port = 7182) { TcpServer server = new TcpServer(port); StorageEngineServer engineServer = new StorageEngineServer(engine, server); return engineServer; } } }
{ "content_hash": "1ba4762bb5689e274c02902ac19d6821", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 132, "avg_line_length": 35.68333333333333, "alnum_prop": 0.6791219056515647, "repo_name": "zhouweiaccp/code", "id": "3f8b969955b9bef4b7c5f37053a111dbdf75c3ef", "size": "2143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Cache/Plugin_Cache/supercache/Store/Database/STSdb.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "987944" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Sp. pl. 1:324. 1753 "<I>Lilio Asphodelus</I>" #### Original name null ### Remarks null
{ "content_hash": "ba4887c1f1404a733509a1b8cd86b218", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 13.461538461538462, "alnum_prop": 0.6742857142857143, "repo_name": "mdoering/backbone", "id": "20acb716750795a3e13ba55021376dfafc481fc7", "size": "230", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Xanthorrhoeaceae/Hemerocallis/Hemerocallis lilioasphodelus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class My404 extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); $this->load->library('email'); $this->load->library('form_validation'); } public function index(){ $page = 'Page Not Found'; $this->output->cache(60); $data = array( 'active_menu' => ucfirst($page), 'title' => ucfirst($page) ); $this->output->set_status_header('404'); $data['content'] = 'error_404'; $this->load->view('header', $data); $this->load->view('errors/not_found'); $this->load->view('footer'); } }
{ "content_hash": "2d1a75e3261c3417422a7a5f81a6e1d8", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 63, "avg_line_length": 25.5, "alnum_prop": 0.5281045751633987, "repo_name": "jayrex24/mainsite", "id": "b8326ab06f2ab787a0acd7e50cc6cbbb8b5e81a7", "size": "765", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/controllers/My404.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "36707" }, { "name": "HTML", "bytes": "5636" }, { "name": "Hack", "bytes": "23209" }, { "name": "JavaScript", "bytes": "5568" }, { "name": "PHP", "bytes": "1731599" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.siemens.ct.exi</groupId> <artifactId>exificient-for-javascript</artifactId> <version>1.0.5-SNAPSHOT</version> <name>EXIficient for JavaScript</name> <scm> <connection>scm:git:git://github.com/EXIficient/exificient-for-javascript.git</connection> <developerConnection>scm:git:https://github.com/EXIficient/exificient-for-javascript.git</developerConnection> <url>https://github.com/EXIficient/exificient-for-javascript</url> <tag>HEAD</tag> </scm> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <compilerVersion>1.8</compilerVersion> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <!-- Include test classes --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <executions> <execution> <id>attach-test</id> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> <!-- Include Java Source OR mvn source:jar --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version><!--2.3.2 --> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> <!-- Include Java Doc OR mvn javadoc:jar --> <!-- see http://maven.apache.org/plugins/maven-javadoc-plugin/examples/javadoc-resources.html --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version><!--2.3.2 --> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.5.3</version> <configuration> <tagNameFormat>v@{project.version}</tagNameFormat> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> <version>1.0.4</version> </dependency> <dependency> <groupId>com.siemens.ct.exi</groupId> <artifactId>exificient</artifactId> <version>1.0.4</version><!-- -SNAPSHOT --> </dependency> <!-- TEST dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.skyscreamer</groupId> <artifactId>jsonassert</artifactId> <version>1.2.3</version> <scope>test</scope> </dependency> <dependency> <groupId>net.javacrumbs.json-unit</groupId> <artifactId>json-unit</artifactId> <version>1.16.0</version> <scope>test</scope> </dependency> <dependency> <!-- for json-unit --> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.9</version> <scope>test</scope> </dependency> </dependencies> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>7</version> </parent> </project>
{ "content_hash": "9962685c714dbf59a407ea191042fd68", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 204, "avg_line_length": 28.83823529411765, "alnum_prop": 0.6557878633350331, "repo_name": "EXIficient/exificient-for-javascript", "id": "5bb6031ea9ba3f7358b864ed97f303c027ef91b4", "size": "3922", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pom.xml", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1057873" }, { "name": "Java", "bytes": "103324" }, { "name": "JavaScript", "bytes": "6365" }, { "name": "Makefile", "bytes": "9444" }, { "name": "Shell", "bytes": "128" } ], "symlink_target": "" }
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateTableLocationStatus extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('location_status', function($table) { $table->increments('id'); $table->string('location')->nullable(); $table->string('nicename')->nullable(); $table->boolean('is_open')->default(false); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('location_status'); } }
{ "content_hash": "1168402688a8a28c8836accffddaf61f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 54, "avg_line_length": 18.771428571428572, "alnum_prop": 0.6118721461187214, "repo_name": "shampine/bang-wendell", "id": "b49c8f8e5d82744c162495b15b88f131a7085f8e", "size": "657", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "database/migrations/2015_06_01_215050_create_table_location_status.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2066" }, { "name": "HTML", "bytes": "2023" }, { "name": "PHP", "bytes": "23181" } ], "symlink_target": "" }
@interface YCEaseMobUITests : XCTestCase @end @implementation YCEaseMobUITests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. self.continueAfterFailure = NO; // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. [[[XCUIApplication alloc] init] launch]; // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } @end
{ "content_hash": "3858615446d5c4ccc4eada44cda65f17", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 178, "avg_line_length": 34.63333333333333, "alnum_prop": 0.7179980750721848, "repo_name": "RobertHuoShan/YCEaseMob", "id": "a8aef031e30ce877438d86c25060fa5fd8fb79ca", "size": "1212", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "YCEaseMobUITests/YCEaseMobUITests.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1487" }, { "name": "Objective-C", "bytes": "620899" } ], "symlink_target": "" }
MusicBrainz Collection Plugin ============================= The ``mbcollection`` plugin lets you submit your catalog to MusicBrainz to maintain your `music collection`_ list there. .. _music collection: http://musicbrainz.org/show/collection/ To begin, just enable the ``mbcollection`` plugin (see :doc:`/plugins/index`). Then, add your MusicBrainz username and password to your :doc:`configuration file </reference/config>` under a ``musicbrainz`` section:: musicbrainz: user: you pass: seekrit Then, use the ``beet mbupdate`` command to send your albums to MusicBrainz. The command automatically adds all of your albums to the first collection it finds. If you don't have a MusicBrainz collection yet, you may need to add one to your profile first.
{ "content_hash": "261d49d14c301cb0751caa744c2ff278", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 38.8, "alnum_prop": 0.7242268041237113, "repo_name": "pdf/beets", "id": "f5a6df130ddcc55de597fc40bbc6c320f8033fd0", "size": "776", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/plugins/mbcollection.rst", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "85314" }, { "name": "Python", "bytes": "789535" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">LexDroidEjemploTabs</string> <string name="action_settings">Settings</string> <string name="hello_world">Hello world!</string> <string name="opc01">Opción 1</string> <string name="opc02">Opción 2</string> <string name="opc03">Opción 3</string> <string name="opc04">Opción 4</string> </resources>
{ "content_hash": "e72f9a07fc04830ed6388bb085907c1a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 33.25, "alnum_prop": 0.6766917293233082, "repo_name": "jorgeSV/LexDroidEjemploTabs", "id": "bca90cd2227f2dd82f486d6404dd21e355aa7581", "size": "403", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LexDroidEjemploTabs/res/values/strings.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "522" } ], "symlink_target": "" }
//============================================================================================================= //============================================================================================================= // INCLUDES //============================================================================================================= #include "connectivitysettings.h" #include <mne/mne_forwardsolution.h> #include <fs/surfaceset.h> #include <fiff/fiff_info.h> //============================================================================================================= // QT INCLUDES //============================================================================================================= #include <QCommandLineParser> #include <QElapsedTimer> #include <QDebug> //============================================================================================================= // EIGEN INCLUDES //============================================================================================================= //============================================================================================================= // USED NAMESPACES //============================================================================================================= using namespace CONNECTIVITYLIB; using namespace MNELIB; using namespace Eigen; using namespace FIFFLIB; using namespace FSLIB; //============================================================================================================= // DEFINE GLOBAL METHODS //============================================================================================================= //============================================================================================================= // DEFINE MEMBER METHODS //============================================================================================================= ConnectivitySettings::ConnectivitySettings() : m_fFreqResolution(1.0f) , m_fSFreq(1000.0f) , m_sWindowType("hanning") { m_iNfft = int(m_fSFreq/m_fFreqResolution); qRegisterMetaType<CONNECTIVITYLIB::ConnectivitySettings>("CONNECTIVITYLIB::ConnectivitySettings"); } //******************************************************************************************************* void ConnectivitySettings::clearAllData() { m_trialData.clear(); clearIntermediateData(); } //******************************************************************************************************* void ConnectivitySettings::clearIntermediateData() { for (int i = 0; i < m_trialData.size(); ++i) { m_trialData[i].matPsd.resize(0,0); m_trialData[i].vecPairCsd.clear(); m_trialData[i].vecTapSpectra.clear(); m_trialData[i].vecPairCsdNormalized.clear(); m_trialData[i].vecPairCsdImagSign.clear(); m_trialData[i].vecPairCsdImagAbs.clear(); m_trialData[i].vecPairCsdImagSqrd.clear(); } m_intermediateSumData.matPsdSum.resize(0,0); m_intermediateSumData.vecPairCsdSum.clear(); m_intermediateSumData.vecPairCsdNormalizedSum.clear(); m_intermediateSumData.vecPairCsdImagSignSum.clear(); m_intermediateSumData.vecPairCsdImagAbsSum.clear(); m_intermediateSumData.vecPairCsdImagSqrdSum.clear(); } //******************************************************************************************************* void ConnectivitySettings::append(const QList<MatrixXd>& matInputData) { for(int i = 0; i < matInputData.size(); ++i) { this->append(matInputData.at(i)); } } //******************************************************************************************************* void ConnectivitySettings::append(const MatrixXd& matInputData) { ConnectivitySettings::IntermediateTrialData tempData; tempData.matData = matInputData; m_trialData.append(tempData); } //******************************************************************************************************* void ConnectivitySettings::append(const ConnectivitySettings::IntermediateTrialData& inputData) { m_trialData.append(inputData); } //******************************************************************************************************* const ConnectivitySettings::IntermediateTrialData& ConnectivitySettings::at(int i) const { return m_trialData.at(i); } //******************************************************************************************************* int ConnectivitySettings::size() const { return m_trialData.size(); } //******************************************************************************************************* bool ConnectivitySettings::isEmpty() const { return m_trialData.isEmpty(); } //******************************************************************************************************* void ConnectivitySettings::removeFirst(int iAmount) { // QElapsedTimer timer; // qint64 iTime = 0; // timer.start(); if(m_trialData.isEmpty()) { qDebug() << "ConnectivitySettings::removeFirst - No elements to delete. Returning."; return; } if(m_trialData.size() < iAmount) { qDebug() << "ConnectivitySettings::removeFirst - Not enough elements stored in list in order to delete them. Returning."; return; } // Substract influence of trials from overall summed up intermediate data and remove from data list for (int j = 0; j < iAmount; ++j) { for (int i = 0; i < m_trialData.first().matData.rows(); ++i) { if(i < m_intermediateSumData.vecPairCsdSum.size() && (m_intermediateSumData.vecPairCsdSum.size() == m_trialData.first().vecPairCsd.size())) { m_intermediateSumData.vecPairCsdSum[i].second -= m_trialData.first().vecPairCsd.at(i).second; } if(i < m_intermediateSumData.vecPairCsdNormalizedSum.size() && (m_intermediateSumData.vecPairCsdNormalizedSum.size() == m_trialData.first().vecPairCsdNormalized.size())) { m_intermediateSumData.vecPairCsdNormalizedSum[i].second -= m_trialData.first().vecPairCsdNormalized.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagSignSum.size() && (m_intermediateSumData.vecPairCsdImagSignSum.size() == m_trialData.first().vecPairCsdImagSign.size())) { m_intermediateSumData.vecPairCsdImagSignSum[i].second -= m_trialData.first().vecPairCsdImagSign.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagAbsSum.size() && (m_intermediateSumData.vecPairCsdImagAbsSum.size() == m_trialData.first().vecPairCsdImagAbs.size())) { m_intermediateSumData.vecPairCsdImagAbsSum[i].second -= m_trialData.first().vecPairCsdImagAbs.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagSqrdSum.size() && (m_intermediateSumData.vecPairCsdImagSqrdSum.size() == m_trialData.first().vecPairCsdImagSqrd.size())) { m_intermediateSumData.vecPairCsdImagSqrdSum[i].second -= m_trialData.first().vecPairCsdImagSqrd.at(i).second; } } if(m_intermediateSumData.matPsdSum.rows() == m_trialData.first().matPsd.rows() && m_intermediateSumData.matPsdSum.cols() == m_trialData.first().matPsd.cols() ) { m_intermediateSumData.matPsdSum -= m_trialData.first().matPsd; } m_trialData.removeFirst(); } // iTime = timer.elapsed(); // qDebug() << "ConnectivitySettings::removeFirst" << iTime; // timer.restart(); } //******************************************************************************************************* void ConnectivitySettings::removeLast(int iAmount) { // QElapsedTimer timer; // qint64 iTime = 0; // timer.start(); if(m_trialData.isEmpty()) { qDebug() << "ConnectivitySettings::removeLast - No elements to delete. Returning."; return; } if(m_trialData.size() < iAmount) { qDebug() << "ConnectivitySettings::removeLast - Not enough elements stored in list in order to delete them. Returning."; return; } // Substract influence of trials from overall summed up intermediate data and remove from data list for (int j = 0; j < iAmount; ++j) { for (int i = 0; i < m_trialData.last().matData.rows(); ++i) { if(i < m_intermediateSumData.vecPairCsdSum.size() && (m_intermediateSumData.vecPairCsdSum.size() == m_trialData.last().vecPairCsd.size())) { m_intermediateSumData.vecPairCsdSum[i].second -= m_trialData.last().vecPairCsd.at(i).second; } if(i < m_intermediateSumData.vecPairCsdNormalizedSum.size() && (m_intermediateSumData.vecPairCsdNormalizedSum.size() == m_trialData.last().vecPairCsdNormalized.size())) { m_intermediateSumData.vecPairCsdNormalizedSum[i].second -= m_trialData.last().vecPairCsdNormalized.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagSignSum.size() && (m_intermediateSumData.vecPairCsdImagSignSum.size() == m_trialData.last().vecPairCsdImagSign.size())) { m_intermediateSumData.vecPairCsdImagSignSum[i].second -= m_trialData.last().vecPairCsdImagSign.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagAbsSum.size() && (m_intermediateSumData.vecPairCsdImagAbsSum.size() == m_trialData.last().vecPairCsdImagAbs.size())) { m_intermediateSumData.vecPairCsdImagAbsSum[i].second -= m_trialData.last().vecPairCsdImagAbs.at(i).second; } if(i < m_intermediateSumData.vecPairCsdImagSqrdSum.size() && (m_intermediateSumData.vecPairCsdImagSqrdSum.size() == m_trialData.last().vecPairCsdImagSqrd.size())) { m_intermediateSumData.vecPairCsdImagSqrdSum[i].second -= m_trialData.last().vecPairCsdImagSqrd.at(i).second; } } if(m_intermediateSumData.matPsdSum.rows() == m_trialData.last().matPsd.rows() && m_intermediateSumData.matPsdSum.cols() == m_trialData.last().matPsd.cols() ) { m_intermediateSumData.matPsdSum -= m_trialData.last().matPsd; } m_trialData.removeLast(); } // iTime = timer.elapsed(); // qDebug() << "ConnectivitySettings::removeLast" << iTime; // timer.restart(); } //******************************************************************************************************* void ConnectivitySettings::setConnectivityMethods(const QStringList& sConnectivityMethods) { m_sConnectivityMethods = sConnectivityMethods; } //******************************************************************************************************* const QStringList& ConnectivitySettings::getConnectivityMethods() const { return m_sConnectivityMethods; } //******************************************************************************************************* void ConnectivitySettings::setSamplingFrequency(int iSFreq) { if(m_fSFreq == iSFreq) { return; } clearIntermediateData(); m_fSFreq = iSFreq; if(m_fFreqResolution != 0.0f) { m_iNfft = int(m_fSFreq/m_fFreqResolution); } } //******************************************************************************************************* int ConnectivitySettings::getSamplingFrequency() const { return m_fSFreq; } //******************************************************************************************************* void ConnectivitySettings::setFFTSize(int iNfft) { if(iNfft == 0) { return; } clearIntermediateData(); m_iNfft = iNfft; m_fFreqResolution = m_fSFreq/m_iNfft; } //******************************************************************************************************* int ConnectivitySettings::getFFTSize() const { return m_iNfft; } //******************************************************************************************************* void ConnectivitySettings::setWindowType(const QString& sWindowType) { // Clear all intermediate data since this will have an effect on the frequency calculation clearIntermediateData(); m_sWindowType = sWindowType; } //******************************************************************************************************* const QString& ConnectivitySettings::getWindowType() const { return m_sWindowType; } //******************************************************************************************************* void ConnectivitySettings::setNodePositions(const FiffInfo& fiffInfo, const RowVectorXi& picks) { m_matNodePositions.resize(picks.cols(),3); qint32 kind; for(int i = 0; i < picks.cols(); ++i) { kind = fiffInfo.chs.at(i).kind; if(kind == FIFFV_EEG_CH || kind == FIFFV_MEG_CH) { m_matNodePositions(i,0) = fiffInfo.chs.at(picks(i)).chpos.r0(0); m_matNodePositions(i,1) = fiffInfo.chs.at(picks(i)).chpos.r0(1); m_matNodePositions(i,2) = fiffInfo.chs.at(picks(i)).chpos.r0(2); } } } //******************************************************************************************************* void ConnectivitySettings::setNodePositions(const MNEForwardSolution& forwardSolution, const SurfaceSet& surfSet) { //Generate node vertices MatrixX3f matNodeVertLeft, matNodeVertRight; if(forwardSolution.isClustered()) { matNodeVertLeft.resize(forwardSolution.src[0].cluster_info.centroidVertno.size(),3); for(int j = 0; j < matNodeVertLeft.rows(); ++j) { matNodeVertLeft.row(j) = surfSet[0].rr().row(forwardSolution.src[0].cluster_info.centroidVertno.at(j)) - surfSet[0].offset().transpose(); } matNodeVertRight.resize(forwardSolution.src[1].cluster_info.centroidVertno.size(),3); for(int j = 0; j < matNodeVertRight.rows(); ++j) { matNodeVertRight.row(j) = surfSet[1].rr().row(forwardSolution.src[1].cluster_info.centroidVertno.at(j)) - surfSet[1].offset().transpose(); } } else { matNodeVertLeft.resize(forwardSolution.src[0].vertno.rows(),3); for(int j = 0; j < matNodeVertLeft.rows(); ++j) { matNodeVertLeft.row(j) = surfSet[0].rr().row(forwardSolution.src[0].vertno(j)) - surfSet[0].offset().transpose(); } matNodeVertRight.resize(forwardSolution.src[1].vertno.rows(),3); for(int j = 0; j < matNodeVertRight.rows(); ++j) { matNodeVertRight.row(j) = surfSet[1].rr().row(forwardSolution.src[1].vertno(j)) - surfSet[1].offset().transpose(); } } m_matNodePositions.resize(matNodeVertLeft.rows()+matNodeVertRight.rows(),3); m_matNodePositions << matNodeVertLeft, matNodeVertRight; } //******************************************************************************************************* void ConnectivitySettings::setNodePositions(const MatrixX3f& matNodePositions) { m_matNodePositions = matNodePositions; } //******************************************************************************************************* const MatrixX3f& ConnectivitySettings::getNodePositions() const { return m_matNodePositions; } //******************************************************************************************************* QList<ConnectivitySettings::IntermediateTrialData>& ConnectivitySettings::getTrialData() { return m_trialData; } //******************************************************************************************************* ConnectivitySettings::IntermediateSumData& ConnectivitySettings::getIntermediateSumData() { return m_intermediateSumData; }
{ "content_hash": "c2e5c2c0255e5051e3e7ae701be3c3be", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 183, "avg_line_length": 40.291989664082685, "alnum_prop": 0.5033668954017828, "repo_name": "LorenzE/mne-cpp", "id": "821d27629677f7edc5c667c8589b65584136b025", "size": "17375", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "libraries/connectivity/connectivitysettings.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "254017" }, { "name": "C++", "bytes": "9075474" }, { "name": "GLSL", "bytes": "31865" }, { "name": "JavaScript", "bytes": "3883" }, { "name": "QMake", "bytes": "265513" }, { "name": "Shell", "bytes": "5452" } ], "symlink_target": "" }
package net.javagoodies.MicroService; /** * Any exception from a MicroService starts here */ public class MicroServiceException extends Exception { /** * Default constructor */ public MicroServiceException() { super(); } /** * Constructor with just a text message * * @param message String of readable text that describes the nature of the cause */ public MicroServiceException(String message) { super(message); } /** * Constructor with a text message and a cause * * @param message String of readable text that describes the nature of the cause * @param cause Throwable root cause for this exception */ public MicroServiceException(String message, Throwable cause) { super(message, cause); } /** * Constructor with just a cause * * @param cause Throwable root cause for this exception */ public MicroServiceException(Throwable cause) { super(cause); } }
{ "content_hash": "df27b64db4982e610eea71e505bf40d7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 81, "avg_line_length": 21.232558139534884, "alnum_prop": 0.7141292442497261, "repo_name": "kellydiversified/JavaGoodies", "id": "862e226c29f81579563b10c2a18c724929f1566a", "size": "913", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Goodies/MicroService/src/main/java/Exception/MicroServiceException.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "14773" } ], "symlink_target": "" }
"no use strict"; ;(function(window) { if (typeof window.window != "undefined" && window.document) { return; } window.console = function() { var msgs = Array.prototype.slice.call(arguments, 0); postMessage({type: "log", data: msgs}); }; window.console.error = window.console.warn = window.console.log = window.console.trace = window.console; window.window = window; window.ace = window; window.normalizeModule = function(parentId, moduleName) { if (moduleName.indexOf("!") !== -1) { var chunks = moduleName.split("!"); return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); } if (moduleName.charAt(0) == ".") { var base = parentId.split("/").slice(0, -1).join("/"); moduleName = base + "/" + moduleName; while(moduleName.indexOf(".") !== -1 && previous != moduleName) { var previous = moduleName; moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } return moduleName; }; window.require = function(parentId, id) { if (!id) { id = parentId parentId = null; } if (!id.charAt) throw new Error("worker.js require() accepts only (parentId, id) as arguments"); id = normalizeModule(parentId, id); var module = require.modules[id]; if (module) { if (!module.initialized) { module.initialized = true; module.exports = module.factory().exports; } return module.exports; } var chunks = id.split("/"); chunks[0] = require.tlns[chunks[0]] || chunks[0]; var path = chunks.join("/") + ".js"; require.id = id; importScripts(path); return require(parentId, id); }; require.modules = {}; require.tlns = {}; window.define = function(id, deps, factory) { if (arguments.length == 2) { factory = deps; if (typeof id != "string") { deps = id; id = require.id; } } else if (arguments.length == 1) { factory = id; id = require.id; } if (id.indexOf("text!") === 0) return; var req = function(deps, factory) { return require(id, deps, factory); }; require.modules[id] = { exports: {}, factory: function() { var module = this; var returnExports = factory(req, module.exports, module); if (returnExports) module.exports = returnExports; return module; } }; }; window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { require.tlns = topLevelNamespaces; } window.initSender = function initSender() { var EventEmitter = require("ace/lib/event_emitter").EventEmitter; var oop = require("ace/lib/oop"); var Sender = function() {}; (function() { oop.implement(this, EventEmitter); this.callback = function(data, callbackId) { postMessage({ type: "call", id: callbackId, data: data }); }; this.emit = function(name, data) { postMessage({ type: "event", name: name, data: data }); }; }).call(Sender.prototype); return new Sender(); } window.main = null; window.sender = null; window.onmessage = function(e) { var msg = e.data; if (msg.command) { if (main[msg.command]) main[msg.command].apply(main, msg.args); else throw new Error("Unknown command:" + msg.command); } else if (msg.init) { initBaseUrls(msg.tlns); require("ace/lib/es5-shim"); sender = initSender(); var clazz = require(msg.module)[msg.classname]; main = new clazz(sender); } else if (msg.event && sender) { sender._emit(msg.event, msg.data); } }; })(this); define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { var EventEmitter = {}; var stopPropagation = function() { this.propagationStopped = true; }; var preventDefault = function() { this.defaultPrevented = true; }; EventEmitter._emit = EventEmitter._dispatchEvent = function(eventName, e) { this._eventRegistry || (this._eventRegistry = {}); this._defaultHandlers || (this._defaultHandlers = {}); var listeners = this._eventRegistry[eventName] || []; var defaultHandler = this._defaultHandlers[eventName]; if (!listeners.length && !defaultHandler) return; if (typeof e != "object" || !e) e = {}; if (!e.type) e.type = eventName; if (!e.stopPropagation) e.stopPropagation = stopPropagation; if (!e.preventDefault) e.preventDefault = preventDefault; for (var i=0; i<listeners.length; i++) { listeners[i](e, this); if (e.propagationStopped) break; } if (defaultHandler && !e.defaultPrevented) return defaultHandler(e, this); }; EventEmitter._signal = function(eventName, e) { var listeners = (this._eventRegistry || {})[eventName]; if (!listeners) return; for (var i=0; i<listeners.length; i++) listeners[i](e, this); }; EventEmitter.once = function(eventName, callback) { var _self = this; callback && this.addEventListener(eventName, function newCallback() { _self.removeEventListener(eventName, newCallback); callback.apply(null, arguments); }); }; EventEmitter.setDefaultHandler = function(eventName, callback) { var handlers = this._defaultHandlers if (!handlers) handlers = this._defaultHandlers = {_disabled_: {}}; if (handlers[eventName]) { var old = handlers[eventName]; var disabled = handlers._disabled_[eventName]; if (!disabled) handlers._disabled_[eventName] = disabled = []; disabled.push(old); var i = disabled.indexOf(callback); if (i != -1) disabled.splice(i, 1); } handlers[eventName] = callback; }; EventEmitter.removeDefaultHandler = function(eventName, callback) { var handlers = this._defaultHandlers if (!handlers) return; var disabled = handlers._disabled_[eventName]; if (handlers[eventName] == callback) { var old = handlers[eventName]; if (disabled) this.setDefaultHandler(eventName, disabled.pop()); } else if (disabled) { var i = disabled.indexOf(callback); if (i != -1) disabled.splice(i, 1); } }; EventEmitter.on = EventEmitter.addEventListener = function(eventName, callback, capturing) { this._eventRegistry = this._eventRegistry || {}; var listeners = this._eventRegistry[eventName]; if (!listeners) listeners = this._eventRegistry[eventName] = []; if (listeners.indexOf(callback) == -1) listeners[capturing ? "unshift" : "push"](callback); return callback; }; EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function(eventName, callback) { this._eventRegistry = this._eventRegistry || {}; var listeners = this._eventRegistry[eventName]; if (!listeners) return; var index = listeners.indexOf(callback); if (index !== -1) listeners.splice(index, 1); }; EventEmitter.removeAllListeners = function(eventName) { if (this._eventRegistry) this._eventRegistry[eventName] = []; }; exports.EventEmitter = EventEmitter; }); define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { exports.inherits = (function() { var tempCtor = function() {}; return function(ctor, superCtor) { tempCtor.prototype = superCtor.prototype; ctor.super_ = superCtor.prototype; ctor.prototype = new tempCtor(); ctor.prototype.constructor = ctor; }; }()); exports.mixin = function(obj, mixin) { for (var key in mixin) { obj[key] = mixin[key]; } return obj; }; exports.implement = function(proto, mixin) { exports.mixin(proto, mixin); }; }); define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { function Empty() {} if (!Function.prototype.bind) { Function.prototype.bind = function bind(that) { // .length is 1 var target = this; if (typeof target != "function") { throw new TypeError("Function.prototype.bind called on incompatible " + target); } var args = slice.call(arguments, 1); // for normal call var bound = function () { if (this instanceof bound) { var result = target.apply( this, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return this; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; if(target.prototype) { Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; } var call = Function.prototype.call; var prototypeOfArray = Array.prototype; var prototypeOfObject = Object.prototype; var slice = prototypeOfArray.slice; var _toString = call.bind(prototypeOfObject.toString); var owns = call.bind(prototypeOfObject.hasOwnProperty); var defineGetter; var defineSetter; var lookupGetter; var lookupSetter; var supportsAccessors; if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { defineGetter = call.bind(prototypeOfObject.__defineGetter__); defineSetter = call.bind(prototypeOfObject.__defineSetter__); lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); } if ([1,2].splice(0).length != 2) { if(function() { // test IE < 9 to splice bug - see issue #138 function makeArray(l) { var a = new Array(l+2); a[0] = a[1] = 0; return a; } var array = [], lengthBefore; array.splice.apply(array, makeArray(20)); array.splice.apply(array, makeArray(26)); lengthBefore = array.length; //46 array.splice(5, 0, "XXX"); // add one element lengthBefore + 1 == array.length if (lengthBefore + 1 == array.length) { return true;// has right splice implementation without bugs } }()) {//IE 6/7 var array_splice = Array.prototype.splice; Array.prototype.splice = function(start, deleteCount) { if (!arguments.length) { return []; } else { return array_splice.apply(this, [ start === void 0 ? 0 : start, deleteCount === void 0 ? (this.length - start) : deleteCount ].concat(slice.call(arguments, 2))) } }; } else {//IE8 Array.prototype.splice = function(pos, removeCount){ var length = this.length; if (pos > 0) { if (pos > length) pos = length; } else if (pos == void 0) { pos = 0; } else if (pos < 0) { pos = Math.max(length + pos, 0); } if (!(pos+removeCount < length)) removeCount = length - pos; var removed = this.slice(pos, pos+removeCount); var insert = slice.call(arguments, 2); var add = insert.length; if (pos === length) { if (add) { this.push.apply(this, insert); } } else { var remove = Math.min(removeCount, length - pos); var tailOldPos = pos + remove; var tailNewPos = tailOldPos + add - remove; var tailCount = length - tailOldPos; var lengthAfterRemove = length - remove; if (tailNewPos < tailOldPos) { // case A for (var i = 0; i < tailCount; ++i) { this[tailNewPos+i] = this[tailOldPos+i]; } } else if (tailNewPos > tailOldPos) { // case B for (i = tailCount; i--; ) { this[tailNewPos+i] = this[tailOldPos+i]; } } // else, add == remove (nothing to do) if (add && pos === lengthAfterRemove) { this.length = lengthAfterRemove; // truncate array this.push.apply(this, insert); } else { this.length = lengthAfterRemove + add; // reserves space for (i = 0; i < add; ++i) { this[pos+i] = insert[i]; } } } return removed; }; } } if (!Array.isArray) { Array.isArray = function isArray(obj) { return _toString(obj) == "[object Array]"; }; } var boxedString = Object("a"), splitString = boxedString[0] != "a" || !(0 in boxedString); if (!Array.prototype.forEach) { Array.prototype.forEach = function forEach(fun /*, thisp*/) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, thisp = arguments[1], i = -1, length = self.length >>> 0; if (_toString(fun) != "[object Function]") { throw new TypeError(); // TODO message } while (++i < length) { if (i in self) { fun.call(thisp, self[i], i, object); } } }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, result = Array(length), thisp = arguments[1]; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self) result[i] = fun.call(thisp, self[i], i, object); } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function filter(fun /*, thisp */) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, result = [], value, thisp = arguments[1]; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self) { value = self[i]; if (fun.call(thisp, value, i, object)) { result.push(value); } } } return result; }; } if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, thisp = arguments[1]; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.some) { Array.prototype.some = function some(fun /*, thisp */) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, thisp = arguments[1]; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self && fun.call(thisp, self[i], i, object)) { return true; } } return false; }; } if (!Array.prototype.reduce) { Array.prototype.reduce = function reduce(fun /*, initial*/) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } if (!length && arguments.length == 1) { throw new TypeError("reduce of empty array with no initial value"); } var i = 0; var result; if (arguments.length >= 2) { result = arguments[1]; } else { do { if (i in self) { result = self[i++]; break; } if (++i >= length) { throw new TypeError("reduce of empty array with no initial value"); } } while (true); } for (; i < length; i++) { if (i in self) { result = fun.call(void 0, result, self[i], i, object); } } return result; }; } if (!Array.prototype.reduceRight) { Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0; if (_toString(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } if (!length && arguments.length == 1) { throw new TypeError("reduceRight of empty array with no initial value"); } var result, i = length - 1; if (arguments.length >= 2) { result = arguments[1]; } else { do { if (i in self) { result = self[i--]; break; } if (--i < 0) { throw new TypeError("reduceRight of empty array with no initial value"); } } while (true); } do { if (i in this) { result = fun.call(void 0, result, self[i], i, object); } } while (i--); return result; }; } if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { var self = splitString && _toString(this) == "[object String]" ? this.split("") : toObject(this), length = self.length >>> 0; if (!length) { return -1; } var i = 0; if (arguments.length > 1) { i = toInteger(arguments[1]); } i = i >= 0 ? i : Math.max(0, length + i); for (; i < length; i++) { if (i in self && self[i] === sought) { return i; } } return -1; }; } if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { var self = splitString && _toString(this) == "[object String]" ? this.split("") : toObject(this), length = self.length >>> 0; if (!length) { return -1; } var i = length - 1; if (arguments.length > 1) { i = Math.min(i, toInteger(arguments[1])); } i = i >= 0 ? i : length - Math.abs(i); for (; i >= 0; i--) { if (i in self && sought === self[i]) { return i; } } return -1; }; } if (!Object.getPrototypeOf) { Object.getPrototypeOf = function getPrototypeOf(object) { return object.__proto__ || ( object.constructor ? object.constructor.prototype : prototypeOfObject ); }; } if (!Object.getOwnPropertyDescriptor) { var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + "non-object: "; Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { if ((typeof object != "object" && typeof object != "function") || object === null) throw new TypeError(ERR_NON_OBJECT + object); if (!owns(object, property)) return; var descriptor, getter, setter; descriptor = { enumerable: true, configurable: true }; if (supportsAccessors) { var prototype = object.__proto__; object.__proto__ = prototypeOfObject; var getter = lookupGetter(object, property); var setter = lookupSetter(object, property); object.__proto__ = prototype; if (getter || setter) { if (getter) descriptor.get = getter; if (setter) descriptor.set = setter; return descriptor; } } descriptor.value = object[property]; return descriptor; }; } if (!Object.getOwnPropertyNames) { Object.getOwnPropertyNames = function getOwnPropertyNames(object) { return Object.keys(object); }; } if (!Object.create) { var createEmpty; if (Object.prototype.__proto__ === null) { createEmpty = function () { return { "__proto__": null }; }; } else { createEmpty = function () { var empty = {}; for (var i in empty) empty[i] = null; empty.constructor = empty.hasOwnProperty = empty.propertyIsEnumerable = empty.isPrototypeOf = empty.toLocaleString = empty.toString = empty.valueOf = empty.__proto__ = null; return empty; } } Object.create = function create(prototype, properties) { var object; if (prototype === null) { object = createEmpty(); } else { if (typeof prototype != "object") throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); var Type = function () {}; Type.prototype = prototype; object = new Type(); object.__proto__ = prototype; } if (properties !== void 0) Object.defineProperties(object, properties); return object; }; } function doesDefinePropertyWork(object) { try { Object.defineProperty(object, "sentinel", {}); return "sentinel" in object; } catch (exception) { } } if (Object.defineProperty) { var definePropertyWorksOnObject = doesDefinePropertyWork({}); var definePropertyWorksOnDom = typeof document == "undefined" || doesDefinePropertyWork(document.createElement("div")); if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { var definePropertyFallback = Object.defineProperty; } } if (!Object.defineProperty || definePropertyFallback) { var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + "on this javascript engine"; Object.defineProperty = function defineProperty(object, property, descriptor) { if ((typeof object != "object" && typeof object != "function") || object === null) throw new TypeError(ERR_NON_OBJECT_TARGET + object); if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); if (definePropertyFallback) { try { return definePropertyFallback.call(Object, object, property, descriptor); } catch (exception) { } } if (owns(descriptor, "value")) { if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { var prototype = object.__proto__; object.__proto__ = prototypeOfObject; delete object[property]; object[property] = descriptor.value; object.__proto__ = prototype; } else { object[property] = descriptor.value; } } else { if (!supportsAccessors) throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); if (owns(descriptor, "get")) defineGetter(object, property, descriptor.get); if (owns(descriptor, "set")) defineSetter(object, property, descriptor.set); } return object; }; } if (!Object.defineProperties) { Object.defineProperties = function defineProperties(object, properties) { for (var property in properties) { if (owns(properties, property)) Object.defineProperty(object, property, properties[property]); } return object; }; } if (!Object.seal) { Object.seal = function seal(object) { return object; }; } if (!Object.freeze) { Object.freeze = function freeze(object) { return object; }; } try { Object.freeze(function () {}); } catch (exception) { Object.freeze = (function freeze(freezeObject) { return function freeze(object) { if (typeof object == "function") { return object; } else { return freezeObject(object); } }; })(Object.freeze); } if (!Object.preventExtensions) { Object.preventExtensions = function preventExtensions(object) { return object; }; } if (!Object.isSealed) { Object.isSealed = function isSealed(object) { return false; }; } if (!Object.isFrozen) { Object.isFrozen = function isFrozen(object) { return false; }; } if (!Object.isExtensible) { Object.isExtensible = function isExtensible(object) { if (Object(object) === object) { throw new TypeError(); // TODO message } var name = ''; while (owns(object, name)) { name += '?'; } object[name] = true; var returnValue = owns(object, name); delete object[name]; return returnValue; }; } if (!Object.keys) { var hasDontEnumBug = true, dontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ], dontEnumsLength = dontEnums.length; for (var key in {"toString": null}) { hasDontEnumBug = false; } Object.keys = function keys(object) { if ( (typeof object != "object" && typeof object != "function") || object === null ) { throw new TypeError("Object.keys called on a non-object"); } var keys = []; for (var name in object) { if (owns(object, name)) { keys.push(name); } } if (hasDontEnumBug) { for (var i = 0, ii = dontEnumsLength; i < ii; i++) { var dontEnum = dontEnums[i]; if (owns(object, dontEnum)) { keys.push(dontEnum); } } } return keys; }; } if (!Date.now) { Date.now = function now() { return new Date().getTime(); }; } var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + "\u2029\uFEFF"; if (!String.prototype.trim || ws.trim()) { ws = "[" + ws + "]"; var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), trimEndRegexp = new RegExp(ws + ws + "*$"); String.prototype.trim = function trim() { return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); }; } function toInteger(n) { n = +n; if (n !== n) { // isNaN n = 0; } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } return n; } function isPrimitive(input) { var type = typeof input; return ( input === null || type === "undefined" || type === "boolean" || type === "number" || type === "string" ); } function toPrimitive(input) { var val, valueOf, toString; if (isPrimitive(input)) { return input; } valueOf = input.valueOf; if (typeof valueOf === "function") { val = valueOf.call(input); if (isPrimitive(val)) { return val; } } toString = input.toString; if (typeof toString === "function") { val = toString.call(input); if (isPrimitive(val)) { return val; } } throw new TypeError(); } var toObject = function (o) { if (o == null) { // this matches both null and undefined throw new TypeError("can't convert "+o+" to object"); } return Object(o); }; }); define('ace/mode/json_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/json/json_parse'], function(require, exports, module) { var oop = require("../lib/oop"); var Mirror = require("../worker/mirror").Mirror; var parse = require("./json/json_parse"); var JsonWorker = exports.JsonWorker = function(sender) { Mirror.call(this, sender); this.setTimeout(200); }; oop.inherits(JsonWorker, Mirror); (function() { this.onUpdate = function() { var value = this.doc.getValue(); try { var result = parse(value); } catch (e) { var pos = this.doc.indexToPosition(e.at-1); this.sender.emit("error", { row: pos.row, column: pos.column, text: e.message, type: "error" }); return; } this.sender.emit("ok"); }; }).call(JsonWorker.prototype); }); define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { var Document = require("../document").Document; var lang = require("../lib/lang"); var Mirror = exports.Mirror = function(sender) { this.sender = sender; var doc = this.doc = new Document(""); var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); var _self = this; sender.on("change", function(e) { doc.applyDeltas(e.data); deferredUpdate.schedule(_self.$timeout); }); }; (function() { this.$timeout = 500; this.setTimeout = function(timeout) { this.$timeout = timeout; }; this.setValue = function(value) { this.doc.setValue(value); this.deferredUpdate.schedule(this.$timeout); }; this.getValue = function(callbackId) { this.sender.callback(this.doc.getValue(), callbackId); }; this.onUpdate = function() { }; }).call(Mirror.prototype); }); define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { var oop = require("./lib/oop"); var EventEmitter = require("./lib/event_emitter").EventEmitter; var Range = require("./range").Range; var Anchor = require("./anchor").Anchor; var Document = function(text) { this.$lines = []; if (text.length == 0) { this.$lines = [""]; } else if (Array.isArray(text)) { this._insertLines(0, text); } else { this.insert({row: 0, column:0}, text); } }; (function() { oop.implement(this, EventEmitter); this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); this.insert({row: 0, column:0}, text); }; this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; if ("aaa".split(/a/).length == 0) this.$split = function(text) { return text.replace(/\r\n|\r/g, "\n").split("\n"); } else this.$split = function(text) { return text.split(/\r\n|\r|\n/); }; this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); this.$autoNewLine = match ? match[1] : "\n"; }; this.getNewLineCharacter = function() { switch (this.$newLineMode) { case "windows": return "\r\n"; case "unix": return "\n"; default: return this.$autoNewLine; } }; this.$autoNewLine = "\n"; this.$newLineMode = "auto"; this.setNewLineMode = function(newLineMode) { if (this.$newLineMode === newLineMode) return; this.$newLineMode = newLineMode; }; this.getNewLineMode = function() { return this.$newLineMode; }; this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; this.getLine = function(row) { return this.$lines[row] || ""; }; this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; this.getAllLines = function() { return this.getLines(0, this.getLength()); }; this.getLength = function() { return this.$lines.length; }; this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.getLine(range.start.row) .substring(range.start.column, range.end.column); } var lines = this.getLines(range.start.row, range.end.row); lines[0] = (lines[0] || "").substring(range.start.column); var l = lines.length - 1; if (range.end.row - range.start.row == l) lines[l] = lines[l].substring(0, range.end.column); return lines.join(this.getNewLineCharacter()); }; this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { position.row = Math.max(0, length - 1); position.column = this.getLine(length-1).length; } else if (position.row < 0) position.row = 0; return position; }; this.insert = function(position, text) { if (!text || text.length === 0) return position; position = this.$clipPosition(position); if (this.getLength() <= 1) this.$detectNewLine(text); var lines = this.$split(text); var firstLine = lines.splice(0, 1)[0]; var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; position = this.insertInLine(position, firstLine); if (lastLine !== null) { position = this.insertNewLine(position); // terminate first line position = this._insertLines(position.row, lines); position = this.insertInLine(position, lastLine || ""); } return position; }; this.insertLines = function(row, lines) { if (row >= this.getLength()) return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); return this._insertLines(Math.max(row, 0), lines); }; this._insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; if (lines.length > 0xFFFF) { var end = this._insertLines(row, lines.slice(0xFFFF)); lines = lines.slice(0, 0xFFFF); } var args = [row, 0]; args.push.apply(args, lines); this.$lines.splice.apply(this.$lines, args); var range = new Range(row, 0, row + lines.length, 0); var delta = { action: "insertLines", range: range, lines: lines }; this._emit("change", { data: delta }); return end || range.end; }; this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; this.$lines[position.row] = line.substring(0, position.column); this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); var end = { row : position.row + 1, column : 0 }; var delta = { action: "insertText", range: Range.fromPoints(position, end), text: this.getNewLineCharacter() }; this._emit("change", { data: delta }); return end; }; this.insertInLine = function(position, text) { if (text.length == 0) return position; var line = this.$lines[position.row] || ""; this.$lines[position.row] = line.substring(0, position.column) + text + line.substring(position.column); var end = { row : position.row, column : position.column + text.length }; var delta = { action: "insertText", range: Range.fromPoints(position, end), text: text }; this._emit("change", { data: delta }); return end; }; this.remove = function(range) { range.start = this.$clipPosition(range.start); range.end = this.$clipPosition(range.end); if (range.isEmpty()) return range.start; var firstRow = range.start.row; var lastRow = range.end.row; if (range.isMultiLine()) { var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; var lastFullRow = lastRow - 1; if (range.end.column > 0) this.removeInLine(lastRow, 0, range.end.column); if (lastFullRow >= firstFullRow) this._removeLines(firstFullRow, lastFullRow); if (firstFullRow != firstRow) { this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); this.removeNewLine(range.start.row); } } else { this.removeInLine(firstRow, range.start.column, range.end.column); } return range.start; }; this.removeInLine = function(row, startColumn, endColumn) { if (startColumn == endColumn) return; var range = new Range(row, startColumn, row, endColumn); var line = this.getLine(row); var removed = line.substring(startColumn, endColumn); var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); this.$lines.splice(row, 1, newLine); var delta = { action: "removeText", range: range, text: removed }; this._emit("change", { data: delta }); return range.start; }; this.removeLines = function(firstRow, lastRow) { if (firstRow < 0 || lastRow >= this.getLength()) return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); return this._removeLines(firstRow, lastRow); }; this._removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); var delta = { action: "removeLines", range: range, nl: this.getNewLineCharacter(), lines: removed }; this._emit("change", { data: delta }); return removed; }; this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); var range = new Range(row, firstLine.length, row+1, 0); var line = firstLine + secondLine; this.$lines.splice(row, 2, line); var delta = { action: "removeText", range: range, text: this.getNewLineCharacter() }; this._emit("change", { data: delta }); }; this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; if (text == this.getTextRange(range)) return range.end; this.remove(range); if (text) { var end = this.insert(range.start, text); } else { end = range.start; } return end; }; this.applyDeltas = function(deltas) { for (var i=0; i<deltas.length; i++) { var delta = deltas[i]; var range = Range.fromPoints(delta.range.start, delta.range.end); if (delta.action == "insertLines") this.insertLines(range.start.row, delta.lines); else if (delta.action == "insertText") this.insert(range.start, delta.text); else if (delta.action == "removeLines") this._removeLines(range.start.row, range.end.row - 1); else if (delta.action == "removeText") this.remove(range); } }; this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; var range = Range.fromPoints(delta.range.start, delta.range.end); if (delta.action == "insertLines") this._removeLines(range.start.row, range.end.row - 1); else if (delta.action == "insertText") this.remove(range); else if (delta.action == "removeLines") this._insertLines(range.start.row, delta.lines); else if (delta.action == "removeText") this.insert(range.start, delta.text); } }; this.indexToPosition = function(index, startRow) { var lines = this.$lines || this.getAllLines(); var newlineLength = this.getNewLineCharacter().length; for (var i = startRow || 0, l = lines.length; i < l; i++) { index -= lines[i].length + newlineLength; if (index < 0) return {row: i, column: index + lines[i].length + newlineLength}; } return {row: l-1, column: lines[l-1].length}; }; this.positionToIndex = function(pos, startRow) { var lines = this.$lines || this.getAllLines(); var newlineLength = this.getNewLineCharacter().length; var index = 0; var row = Math.min(pos.row, lines.length); for (var i = startRow || 0; i < row; ++i) index += lines[i].length + newlineLength; return index + pos.column; }; }).call(Document.prototype); exports.Document = Document; }); define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) { var comparePoints = function(p1, p2) { return p1.row - p2.row || p1.column - p2.column; }; var Range = function(startRow, startColumn, endRow, endColumn) { this.start = { row: startRow, column: startColumn }; this.end = { row: endRow, column: endColumn }; }; (function() { this.isEqual = function(range) { return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column; }; this.toString = function() { return ("Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"); }; this.contains = function(row, column) { return this.compare(row, column) == 0; }; this.compareRange = function(range) { var cmp, end = range.end, start = range.start; cmp = this.compare(end.row, end.column); if (cmp == 1) { cmp = this.compare(start.row, start.column); if (cmp == 1) { return 2; } else if (cmp == 0) { return 1; } else { return 0; } } else if (cmp == -1) { return -2; } else { cmp = this.compare(start.row, start.column); if (cmp == -1) { return -1; } else if (cmp == 1) { return 42; } else { return 0; } } }; this.comparePoint = function(p) { return this.compare(p.row, p.column); }; this.containsRange = function(range) { return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; }; this.intersects = function(range) { var cmp = this.compareRange(range); return (cmp == -1 || cmp == 0 || cmp == 1); }; this.isEnd = function(row, column) { return this.end.row == row && this.end.column == column; }; this.isStart = function(row, column) { return this.start.row == row && this.start.column == column; }; this.setStart = function(row, column) { if (typeof row == "object") { this.start.column = row.column; this.start.row = row.row; } else { this.start.row = row; this.start.column = column; } }; this.setEnd = function(row, column) { if (typeof row == "object") { this.end.column = row.column; this.end.row = row.row; } else { this.end.row = row; this.end.column = column; } }; this.inside = function(row, column) { if (this.compare(row, column) == 0) { if (this.isEnd(row, column) || this.isStart(row, column)) { return false; } else { return true; } } return false; }; this.insideStart = function(row, column) { if (this.compare(row, column) == 0) { if (this.isEnd(row, column)) { return false; } else { return true; } } return false; }; this.insideEnd = function(row, column) { if (this.compare(row, column) == 0) { if (this.isStart(row, column)) { return false; } else { return true; } } return false; }; this.compare = function(row, column) { if (!this.isMultiLine()) { if (row === this.start.row) { return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); }; } if (row < this.start.row) return -1; if (row > this.end.row) return 1; if (this.start.row === row) return column >= this.start.column ? 0 : -1; if (this.end.row === row) return column <= this.end.column ? 0 : 1; return 0; }; this.compareStart = function(row, column) { if (this.start.row == row && this.start.column == column) { return -1; } else { return this.compare(row, column); } }; this.compareEnd = function(row, column) { if (this.end.row == row && this.end.column == column) { return 1; } else { return this.compare(row, column); } }; this.compareInside = function(row, column) { if (this.end.row == row && this.end.column == column) { return 1; } else if (this.start.row == row && this.start.column == column) { return -1; } else { return this.compare(row, column); } }; this.clipRows = function(firstRow, lastRow) { if (this.end.row > lastRow) var end = {row: lastRow + 1, column: 0}; else if (this.end.row < firstRow) var end = {row: firstRow, column: 0}; if (this.start.row > lastRow) var start = {row: lastRow + 1, column: 0}; else if (this.start.row < firstRow) var start = {row: firstRow, column: 0}; return Range.fromPoints(start || this.start, end || this.end); }; this.extend = function(row, column) { var cmp = this.compare(row, column); if (cmp == 0) return this; else if (cmp == -1) var start = {row: row, column: column}; else var end = {row: row, column: column}; return Range.fromPoints(start || this.start, end || this.end); }; this.isEmpty = function() { return (this.start.row === this.end.row && this.start.column === this.end.column); }; this.isMultiLine = function() { return (this.start.row !== this.end.row); }; this.clone = function() { return Range.fromPoints(this.start, this.end); }; this.collapseRows = function() { if (this.end.column == 0) return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) else return new Range(this.start.row, 0, this.end.row, 0) }; this.toScreenRange = function(session) { var screenPosStart = session.documentToScreenPosition(this.start); var screenPosEnd = session.documentToScreenPosition(this.end); return new Range( screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column ); }; this.moveBy = function(row, column) { this.start.row += row; this.start.column += column; this.end.row += row; this.end.column += column; }; }).call(Range.prototype); Range.fromPoints = function(start, end) { return new Range(start.row, start.column, end.row, end.column); }; Range.comparePoints = comparePoints; Range.comparePoints = function(p1, p2) { return p1.row - p2.row || p1.column - p2.column; }; exports.Range = Range; }); define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { var oop = require("./lib/oop"); var EventEmitter = require("./lib/event_emitter").EventEmitter; var Anchor = exports.Anchor = function(doc, row, column) { this.$onChange = this.onChange.bind(this); this.attach(doc); if (typeof column == "undefined") this.setPosition(row.row, row.column); else this.setPosition(row, column); }; (function() { oop.implement(this, EventEmitter); this.getPosition = function() { return this.$clipPositionToDocument(this.row, this.column); }; this.getDocument = function() { return this.document; }; this.onChange = function(e) { var delta = e.data; var range = delta.range; if (range.start.row == range.end.row && range.start.row != this.row) return; if (range.start.row > this.row) return; if (range.start.row == this.row && range.start.column > this.column) return; var row = this.row; var column = this.column; var start = range.start; var end = range.end; if (delta.action === "insertText") { if (start.row === row && start.column <= column) { if (start.row === end.row) { column += end.column - start.column; } else { column -= start.column; row += end.row - start.row; } } else if (start.row !== end.row && start.row < row) { row += end.row - start.row; } } else if (delta.action === "insertLines") { if (start.row <= row) { row += end.row - start.row; } } else if (delta.action === "removeText") { if (start.row === row && start.column < column) { if (end.column >= column) column = start.column; else column = Math.max(0, column - (end.column - start.column)); } else if (start.row !== end.row && start.row < row) { if (end.row === row) column = Math.max(0, column - end.column) + start.column; row -= (end.row - start.row); } else if (end.row === row) { row -= end.row - start.row; column = Math.max(0, column - end.column) + start.column; } } else if (delta.action == "removeLines") { if (start.row <= row) { if (end.row <= row) row -= end.row - start.row; else { row = start.row; column = 0; } } } this.setPosition(row, column, true); }; this.setPosition = function(row, column, noClip) { var pos; if (noClip) { pos = { row: row, column: column }; } else { pos = this.$clipPositionToDocument(row, column); } if (this.row == pos.row && this.column == pos.column) return; var old = { row: this.row, column: this.column }; this.row = pos.row; this.column = pos.column; this._emit("change", { old: old, value: pos }); }; this.detach = function() { this.document.removeEventListener("change", this.$onChange); }; this.attach = function(doc) { this.document = doc || this.document; this.document.on("change", this.$onChange); }; this.$clipPositionToDocument = function(row, column) { var pos = {}; if (row >= this.document.getLength()) { pos.row = Math.max(0, this.document.getLength() - 1); pos.column = this.document.getLine(pos.row).length; } else if (row < 0) { pos.row = 0; pos.column = 0; } else { pos.row = row; pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); } if (column < 0) pos.column = 0; return pos; }; }).call(Anchor.prototype); }); define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { exports.stringReverse = function(string) { return string.split("").reverse().join(""); }; exports.stringRepeat = function (string, count) { var result = ''; while (count > 0) { if (count & 1) result += string; if (count >>= 1) string += string; } return result; }; var trimBeginRegexp = /^\s\s*/; var trimEndRegexp = /\s\s*$/; exports.stringTrimLeft = function (string) { return string.replace(trimBeginRegexp, ''); }; exports.stringTrimRight = function (string) { return string.replace(trimEndRegexp, ''); }; exports.copyObject = function(obj) { var copy = {}; for (var key in obj) { copy[key] = obj[key]; } return copy; }; exports.copyArray = function(array){ var copy = []; for (var i=0, l=array.length; i<l; i++) { if (array[i] && typeof array[i] == "object") copy[i] = this.copyObject( array[i] ); else copy[i] = array[i]; } return copy; }; exports.deepCopy = function (obj) { if (typeof obj != "object") { return obj; } var copy = obj.constructor(); for (var key in obj) { if (typeof obj[key] == "object") { copy[key] = this.deepCopy(obj[key]); } else { copy[key] = obj[key]; } } return copy; }; exports.arrayToMap = function(arr) { var map = {}; for (var i=0; i<arr.length; i++) { map[arr[i]] = 1; } return map; }; exports.createMap = function(props) { var map = Object.create(null); for (var i in props) { map[i] = props[i]; } return map; }; exports.arrayRemove = function(array, value) { for (var i = 0; i <= array.length; i++) { if (value === array[i]) { array.splice(i, 1); } } }; exports.escapeRegExp = function(str) { return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }; exports.escapeHTML = function(str) { return str.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;"); }; exports.getMatchOffsets = function(string, regExp) { var matches = []; string.replace(regExp, function(str) { matches.push({ offset: arguments[arguments.length-2], length: str.length }); }); return matches; }; exports.deferredCall = function(fcn) { var timer = null; var callback = function() { timer = null; fcn(); }; var deferred = function(timeout) { deferred.cancel(); timer = setTimeout(callback, timeout || 0); return deferred; }; deferred.schedule = deferred; deferred.call = function() { this.cancel(); fcn(); return deferred; }; deferred.cancel = function() { clearTimeout(timer); timer = null; return deferred; }; return deferred; }; exports.delayedCall = function(fcn, defaultTimeout) { var timer = null; var callback = function() { timer = null; fcn(); }; var _self = function(timeout) { timer && clearTimeout(timer); timer = setTimeout(callback, timeout || defaultTimeout); }; _self.delay = _self; _self.schedule = function(timeout) { if (timer == null) timer = setTimeout(callback, timeout || 0); }; _self.call = function() { this.cancel(); fcn(); }; _self.cancel = function() { timer && clearTimeout(timer); timer = null; }; _self.isPending = function() { return timer; }; return _self; }; }); define('ace/mode/json/json_parse', ['require', 'exports', 'module' ], function(require, exports, module) { var at, // The index of the current character ch, // The current character escapee = { '"': '"', '\\': '\\', '/': '/', b: '\b', f: '\f', n: '\n', r: '\r', t: '\t' }, text, error = function (m) { throw { name: 'SyntaxError', message: m, at: at, text: text }; }, next = function (c) { if (c && c !== ch) { error("Expected '" + c + "' instead of '" + ch + "'"); } ch = text.charAt(at); at += 1; return ch; }, number = function () { var number, string = ''; if (ch === '-') { string = '-'; next('-'); } while (ch >= '0' && ch <= '9') { string += ch; next(); } if (ch === '.') { string += '.'; while (next() && ch >= '0' && ch <= '9') { string += ch; } } if (ch === 'e' || ch === 'E') { string += ch; next(); if (ch === '-' || ch === '+') { string += ch; next(); } while (ch >= '0' && ch <= '9') { string += ch; next(); } } number = +string; if (isNaN(number)) { error("Bad number"); } else { return number; } }, string = function () { var hex, i, string = '', uffff; if (ch === '"') { while (next()) { if (ch === '"') { next(); return string; } else if (ch === '\\') { next(); if (ch === 'u') { uffff = 0; for (i = 0; i < 4; i += 1) { hex = parseInt(next(), 16); if (!isFinite(hex)) { break; } uffff = uffff * 16 + hex; } string += String.fromCharCode(uffff); } else if (typeof escapee[ch] === 'string') { string += escapee[ch]; } else { break; } } else { string += ch; } } } error("Bad string"); }, white = function () { while (ch && ch <= ' ') { next(); } }, word = function () { switch (ch) { case 't': next('t'); next('r'); next('u'); next('e'); return true; case 'f': next('f'); next('a'); next('l'); next('s'); next('e'); return false; case 'n': next('n'); next('u'); next('l'); next('l'); return null; } error("Unexpected '" + ch + "'"); }, value, // Place holder for the value function. array = function () { var array = []; if (ch === '[') { next('['); white(); if (ch === ']') { next(']'); return array; // empty array } while (ch) { array.push(value()); white(); if (ch === ']') { next(']'); return array; } next(','); white(); } } error("Bad array"); }, object = function () { var key, object = {}; if (ch === '{') { next('{'); white(); if (ch === '}') { next('}'); return object; // empty object } while (ch) { key = string(); white(); next(':'); if (Object.hasOwnProperty.call(object, key)) { error('Duplicate key "' + key + '"'); } object[key] = value(); white(); if (ch === '}') { next('}'); return object; } next(','); white(); } } error("Bad object"); }; value = function () { white(); switch (ch) { case '{': return object(); case '[': return array(); case '"': return string(); case '-': return number(); default: return ch >= '0' && ch <= '9' ? number() : word(); } }; return function (source, reviver) { var result; text = source; at = 0; ch = ' '; result = value(); white(); if (ch) { error("Syntax error"); } return typeof reviver === 'function' ? function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); }({'': result}, '') : result; }; });
{ "content_hash": "7bc600765cd2f9eada43d8f85040a89b", "timestamp": "", "source": "github", "line_count": 2251, "max_line_length": 166, "avg_line_length": 29.410484229231454, "alnum_prop": 0.4943582617101944, "repo_name": "jupe/restdoc", "id": "fd554c63d82518d6aa9c29f5c2e61f3cb45ce351", "size": "66203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/public/js/ace/worker-json.js", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "805923" } ], "symlink_target": "" }
package io.cdap.plugin.zuora.objects; import com.google.gson.annotations.SerializedName; import io.cdap.cdap.api.data.schema.Schema; import io.cdap.plugin.zuora.restobjects.annotations.ObjectDefinition; import io.cdap.plugin.zuora.restobjects.annotations.ObjectFieldDefinition; import io.cdap.plugin.zuora.restobjects.objects.BaseObject; import javax.annotation.Nullable; /** * Object name: DataAccessControlField (DataAccessControlField). * Related objects: **/ @SuppressWarnings("unused") @ObjectDefinition( Name = "DataAccessControlField", ObjectType = ObjectDefinition.ObjectDefinitionType.NESTED ) public class DataAccessControlField extends BaseObject { @Override public void addFields() { } }
{ "content_hash": "06c1a30e31fa6a2ddae870459fc83444", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 26.51851851851852, "alnum_prop": 0.8072625698324022, "repo_name": "data-integrations/zuora", "id": "72d3d222dbc10eb9d2a8b6809bca7f3e1527d0f6", "size": "1323", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/main/java/io/cdap/plugin/zuora/objects/DataAccessControlField.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "3747055" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "5114f428724147cf5274d011ed003151", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "89b48ca6214d3f1c3e321ca899b4d3e93c4314ec", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Hieracium/Hieracium mitophorum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
export interface IDevice { name: string, token: string, type: string, platform: string, status?: string, startedAt?: number, busySince?: number, procPid?: number, apiLevel?: string, info?: string, config?: string } export class Device implements IDevice { private _startedAt?: number; private _busySince?: number; private _info?: string; private _config?: string; constructor(private _name: string, private _apiLevel: string, private _type: "emulator" | "simulator" | "device", private _platform: "android" | "ios", private _token: string, private _status: "free" | "busy" | "shutdown" | "booted", private _procPid?) { this._startedAt = -1; this._busySince = -1; } get name() { return this._name; } set name(name) { this._name = name; } set apiLevel(api) { this._apiLevel = api; } get apiLevel() { return this._apiLevel; } set token(token) { this._token = token; } get token() { return this._token; } set type(type) { this._type = type; } get type() { return this._type; } get platform() { return this._platform; } set platform(platform) { this._platform = platform; } set procPid(proc) { this._procPid = proc; } get procPid() { return this._procPid; } get status() { return this._status; } set status(status: "booted" | "free" | "busy" | "shutdown") { this._status = status; } get startedAt() { return this._startedAt; } set startedAt(startedAt) { this._startedAt = startedAt; } get busySince() { return this._busySince; } set busySince(busySince) { this._busySince = busySince; } get info() { return this._info; } set info(info) { this._info = info; } get config() { return this._config; } set config(config) { this._config = config; } public toJson() { return { name: this.name, token: this.token, type: this.type, platform: this.platform, info: this.info, config: this.config, status: this.status, startedAt: this.startedAt, procPid: this.procPid, apiLevel: this.apiLevel } } }
{ "content_hash": "6929a9ff9fbe0c3f61069a639c754e1a", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 256, "avg_line_length": 17.15625, "alnum_prop": 0.5924408014571949, "repo_name": "SvetoslavTsenov/devices-controller", "id": "f7f278c21e3fa0d67aadc043d720571612345773", "size": "2196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/device.ts", "mode": "33188", "license": "mit", "language": [ { "name": "TypeScript", "bytes": "19301" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>statsmodels.regression.dimred.PrincipalHessianDirections.fit &#8212; statsmodels v0.10.2 documentation</title> <link rel="stylesheet" href="../_static/nature.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.regression.dimred.PrincipalHessianDirections.from_formula" href="statsmodels.regression.dimred.PrincipalHessianDirections.from_formula.html" /> <link rel="prev" title="statsmodels.regression.dimred.PrincipalHessianDirections" href="statsmodels.regression.dimred.PrincipalHessianDirections.html" /> <link rel="stylesheet" href="../_static/examples.css" type="text/css" /> <link rel="stylesheet" href="../_static/facebox.css" type="text/css" /> <script type="text/javascript" src="../_static/scripts.js"> </script> <script type="text/javascript" src="../_static/facebox.js"> </script> <script type="text/javascript"> $.facebox.settings.closeImage = "../_static/closelabel.png" $.facebox.settings.loadingImage = "../_static/loading.gif" </script> <script> $(document).ready(function() { $.getJSON("../../versions.json", function(versions) { var dropdown = document.createElement("div"); dropdown.className = "dropdown"; var button = document.createElement("button"); button.className = "dropbtn"; button.innerHTML = "Other Versions"; var content = document.createElement("div"); content.className = "dropdown-content"; dropdown.appendChild(button); dropdown.appendChild(content); $(".header").prepend(dropdown); for (var i = 0; i < versions.length; i++) { if (versions[i].substring(0, 1) == "v") { versions[i] = [versions[i], versions[i].substring(1)]; } else { versions[i] = [versions[i], versions[i]]; }; }; for (var i = 0; i < versions.length; i++) { var a = document.createElement("a"); a.innerHTML = versions[i][1]; a.href = "../../" + versions[i][0] + "/index.html"; a.title = versions[i][1]; $(".dropdown-content").append(a); }; }); }); </script> </head><body> <div class="headerwrap"> <div class = "header"> <a href = "../index.html"> <img src="../_static/statsmodels_hybi_banner.png" alt="Logo" style="padding-left: 15px"/></a> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="statsmodels.regression.dimred.PrincipalHessianDirections.from_formula.html" title="statsmodels.regression.dimred.PrincipalHessianDirections.from_formula" accesskey="N">next</a> |</li> <li class="right" > <a href="statsmodels.regression.dimred.PrincipalHessianDirections.html" title="statsmodels.regression.dimred.PrincipalHessianDirections" accesskey="P">previous</a> |</li> <li><a href ="../install.html">Install</a></li> &nbsp;|&nbsp; <li><a href="https://groups.google.com/forum/?hl=en#!forum/pystatsmodels">Support</a></li> &nbsp;|&nbsp; <li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> &nbsp;|&nbsp; <li><a href="../dev/index.html">Develop</a></li> &nbsp;|&nbsp; <li><a href="../examples/index.html">Examples</a></li> &nbsp;|&nbsp; <li><a href="../faq.html">FAQ</a></li> &nbsp;|&nbsp; <li class="nav-item nav-item-1"><a href="../regression.html" >Linear Regression</a> |</li> <li class="nav-item nav-item-2"><a href="statsmodels.regression.dimred.PrincipalHessianDirections.html" accesskey="U">statsmodels.regression.dimred.PrincipalHessianDirections</a> |</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="statsmodels-regression-dimred-principalhessiandirections-fit"> <h1>statsmodels.regression.dimred.PrincipalHessianDirections.fit<a class="headerlink" href="#statsmodels-regression-dimred-principalhessiandirections-fit" title="Permalink to this headline">¶</a></h1> <p>method</p> <dl class="method"> <dt id="statsmodels.regression.dimred.PrincipalHessianDirections.fit"> <code class="sig-prename descclassname">PrincipalHessianDirections.</code><code class="sig-name descname">fit</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/statsmodels/regression/dimred.html#PrincipalHessianDirections.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#statsmodels.regression.dimred.PrincipalHessianDirections.fit" title="Permalink to this definition">¶</a></dt> <dd><p>Estimate the EDR space using PHD.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><dl class="simple"> <dt><strong>resid</strong><span class="classifier">bool, optional</span></dt><dd><p>If True, use least squares regression to remove the linear relationship between each covariate and the response, before conducting PHD.</p> </dd> </dl> </dd> </dl> </dd></dl> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="statsmodels.regression.dimred.PrincipalHessianDirections.html" title="previous chapter">statsmodels.regression.dimred.PrincipalHessianDirections</a></p> <h4>Next topic</h4> <p class="topless"><a href="statsmodels.regression.dimred.PrincipalHessianDirections.from_formula.html" title="next chapter">statsmodels.regression.dimred.PrincipalHessianDirections.from_formula</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/generated/statsmodels.regression.dimred.PrincipalHessianDirections.fit.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="footer" role="contentinfo"> &#169; Copyright 2009-2018, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.1. </div> </body> </html>
{ "content_hash": "566b0d2c46a1c6cd98fe5bfe33de98ac", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 515, "avg_line_length": 46.94252873563219, "alnum_prop": 0.6601371204701273, "repo_name": "statsmodels/statsmodels.github.io", "id": "455420597632b196264dbdbffae26914c8c1c317", "size": "8172", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v0.10.2/generated/statsmodels.regression.dimred.PrincipalHessianDirections.fit.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
using passwords_helper::AddLogin; using passwords_helper::AllProfilesContainSamePasswordForms; using passwords_helper::AllProfilesContainSamePasswordFormsAsVerifier; using passwords_helper::CreateTestPasswordForm; using passwords_helper::GetPasswordCount; using passwords_helper::GetPasswordStore; using passwords_helper::GetVerifierPasswordCount; using passwords_helper::GetVerifierPasswordStore; using passwords_helper::ProfileContainsSamePasswordFormsAsVerifier; using passwords_helper::RemoveLogin; using passwords_helper::RemoveLogins; using passwords_helper::SetDecryptionPassphrase; using passwords_helper::SetEncryptionPassphrase; using passwords_helper::UpdateLogin; using autofill::PasswordForm; static const char* kValidPassphrase = "passphrase!"; static const char* kAnotherValidPassphrase = "another passphrase!"; class TwoClientPasswordsSyncTest : public SyncTest { public: TwoClientPasswordsSyncTest() : SyncTest(TWO_CLIENT) {} virtual ~TwoClientPasswordsSyncTest() {} private: DISALLOW_COPY_AND_ASSIGN(TwoClientPasswordsSyncTest); }; // TCM ID - 3732277 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Add) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form); ASSERT_EQ(1, GetVerifierPasswordCount()); AddLogin(GetPasswordStore(0), form); ASSERT_EQ(1, GetPasswordCount(0)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Race) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordForms()); PasswordForm form0 = CreateTestPasswordForm(0); AddLogin(GetPasswordStore(0), form0); PasswordForm form1 = form0; form1.password_value = base::ASCIIToUTF16("new_password"); AddLogin(GetPasswordStore(1), form1); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllProfilesContainSamePasswordForms()); } // TCM ID - 4577932. IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::PASSWORDS)); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form); ASSERT_EQ(1, GetVerifierPasswordCount()); AddLogin(GetPasswordStore(0), form); ASSERT_EQ(1, GetPasswordCount(0)); ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); ASSERT_FALSE(ProfileContainsSamePasswordFormsAsVerifier(1)); ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::PASSWORDS)); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); ASSERT_EQ(1, GetPasswordCount(1)); } // TCM ID - 4649281. IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisableSync) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form); ASSERT_EQ(1, GetVerifierPasswordCount()); AddLogin(GetPasswordStore(0), form); ASSERT_EQ(1, GetPasswordCount(0)); ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); ASSERT_FALSE(ProfileContainsSamePasswordFormsAsVerifier(1)); ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); ASSERT_EQ(1, GetPasswordCount(1)); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, SetPassphrase) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(1)->AwaitCommitActivityCompletion()); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, SetPassphraseAndAddPassword) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetPasswordStore(0), form); ASSERT_EQ(1, GetPasswordCount(0)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_EQ(1, GetPasswordCount(1)); } // TCM ID - 4603879 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form); AddLogin(GetPasswordStore(0), form); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); form.password_value = base::ASCIIToUTF16("new_password"); UpdateLogin(GetVerifierPasswordStore(), form); UpdateLogin(GetPasswordStore(1), form); ASSERT_TRUE(AwaitQuiescence()); ASSERT_EQ(1, GetVerifierPasswordCount()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); } // TCM ID - 3719309 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Delete) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); PasswordForm form0 = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form0); AddLogin(GetPasswordStore(0), form0); PasswordForm form1 = CreateTestPasswordForm(1); AddLogin(GetVerifierPasswordStore(), form1); AddLogin(GetPasswordStore(0), form1); ASSERT_TRUE(AwaitQuiescence()); RemoveLogin(GetPasswordStore(1), form0); RemoveLogin(GetVerifierPasswordStore(), form0); ASSERT_TRUE(AwaitQuiescence()); ASSERT_EQ(1, GetVerifierPasswordCount()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); } // TCM ID - 7573511 // Flaky on Mac and Windows: http://crbug.com/111399 #if defined(OS_WIN) || defined(OS_MACOSX) #define MAYBE_DeleteAll DISABLED_DeleteAll #else #define MAYBE_DeleteAll DeleteAll #endif IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, MAYBE_DeleteAll) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); PasswordForm form0 = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form0); AddLogin(GetPasswordStore(0), form0); PasswordForm form1 = CreateTestPasswordForm(1); AddLogin(GetVerifierPasswordStore(), form1); AddLogin(GetPasswordStore(0), form1); ASSERT_TRUE(AwaitQuiescence()); RemoveLogins(GetPasswordStore(1)); RemoveLogins(GetVerifierPasswordStore()); ASSERT_TRUE(AwaitQuiescence()); ASSERT_EQ(0, GetVerifierPasswordCount()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); } // TCM ID - 3694311 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Merge) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordForms()); PasswordForm form0 = CreateTestPasswordForm(0); AddLogin(GetPasswordStore(0), form0); PasswordForm form1 = CreateTestPasswordForm(1); AddLogin(GetPasswordStore(1), form1); PasswordForm form2 = CreateTestPasswordForm(2); AddLogin(GetPasswordStore(1), form2); ASSERT_TRUE(AwaitQuiescence()); ASSERT_EQ(3, GetPasswordCount(0)); ASSERT_TRUE(AllProfilesContainSamePasswordForms()); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, SetPassphraseAndThenSetupSync) { ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; ASSERT_TRUE(GetClient(0)->SetupSync()); SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); ASSERT_FALSE(GetClient(1)->SetupSync()); ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(1)->AwaitCommitActivityCompletion()); // Following ensures types are enabled and active (see bug 87572). syncer::ModelSafeRoutingInfo routes; GetClient(0)->service()->GetModelSafeRoutingInfo(&routes); ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]); routes.clear(); GetClient(1)->service()->GetModelSafeRoutingInfo(&routes); ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, SetDifferentPassphraseAndThenSetupSync) { ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; ASSERT_TRUE(GetClient(0)->SetupSync()); SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); // Setup 1 with a different passphrase, so that it fails to sync. ASSERT_FALSE(GetClient(1)->SetupSync()); ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); ASSERT_FALSE(SetDecryptionPassphrase(1, kAnotherValidPassphrase)); ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); // Add a password on 0 while clients have different passphrases. PasswordForm form0 = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form0); AddLogin(GetPasswordStore(0), form0); ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); // Password hasn't been synced to 1 yet. ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier()); // Update 1 with the correct passphrase, the password should now sync over. ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); }
{ "content_hash": "ec0a4b0f15c195f067b889f66663baf0", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 77, "avg_line_length": 38.707581227436826, "alnum_prop": 0.774482372691662, "repo_name": "ChromiumWebApps/chromium", "id": "da167bfb7cf896026a24a450a7e70ea88f6aefb4", "size": "11280", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "52960" }, { "name": "Awk", "bytes": "8660" }, { "name": "C", "bytes": "42286199" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "198616766" }, { "name": "CSS", "bytes": "937333" }, { "name": "DOT", "bytes": "2984" }, { "name": "Java", "bytes": "5695686" }, { "name": "JavaScript", "bytes": "21967126" }, { "name": "M", "bytes": "2190" }, { "name": "Matlab", "bytes": "2262" }, { "name": "Objective-C", "bytes": "7602057" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "1210885" }, { "name": "Python", "bytes": "10774996" }, { "name": "R", "bytes": "262" }, { "name": "Shell", "bytes": "1316721" }, { "name": "Tcl", "bytes": "277091" }, { "name": "TypeScript", "bytes": "1560024" }, { "name": "XSLT", "bytes": "13493" }, { "name": "nesC", "bytes": "15243" } ], "symlink_target": "" }
@import './caption'; @import './image'; @import './wrapper';
{ "content_hash": "80836fe9c663450cb72ce4ddb232b0ad", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 20, "avg_line_length": 20.333333333333332, "alnum_prop": 0.6065573770491803, "repo_name": "aptuitiv/cacao", "id": "f87f0c75acbf199ae32db23ef730b310112d0c4a", "size": "61", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/css/components/image/index.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "180235" }, { "name": "JavaScript", "bytes": "10176" } ], "symlink_target": "" }
import json import codecs import requests import itertools URL_MAIN = "http://api.nytimes.com/svc/" URL_POPULAR = URL_MAIN + "mostpopular/v2/" API_KEY = { "popular": "", "article": ""} def get_from_file(kind, period): filename = "popular-{0}-{1}.json".format(kind, period) with open(filename, "r") as f: return json.loads(f.read()) def article_overview(kind, period): data = get_from_file(kind, period) titles = [] urls =[] u = [] #titles = data[1] for each in data: d = {} d[each['section']] = each['title'].encode('utf-8') titles.append( d) urls.append([x['url'] for other in each['media'] for x in other['media-metadata'] if x['format'] == 'Standard Thumbnail']) #for other in each['media']: #for x in other['media-metadata']: #if x['format'] == 'Standard Thumbnail': #urls.append( x['url']) print(titles, list(itertools.chain(*urls))) return (titles, list(itertools.chain(*urls))) def query_site(url, target, offset): # This will set up the query with the API key and offset # Web services often use offset paramter to return data in small chunks # NYTimes returns 20 articles per request, if you want the next 20 # You have to provide the offset parameter if API_KEY["popular"] == "" or API_KEY["article"] == "": print "You need to register for NYTimes Developer account to run this program." print "See Intructor notes for information" return False params = {"api-key": API_KEY[target], "offset": offset} r = requests.get(url, params = params) if r.status_code == requests.codes.ok: return r.json() else: r.raise_for_status() def get_popular(url, kind, days, section="all-sections", offset=0): # This function will construct the query according to the requirements of the site # and return the data, or print an error message if called incorrectly if days not in [1,7,30]: print "Time period can be 1,7, 30 days only" return False if kind not in ["viewed", "shared", "emailed"]: print "kind can be only one of viewed/shared/emailed" return False url = URL_POPULAR + "most{0}/{1}/{2}.json".format(kind, section, days) data = query_site(url, "popular", offset) return data def save_file(kind, period): # This will process all results, by calling the API repeatedly with supplied offset value, # combine the data and then write all results in a file. data = get_popular(URL_POPULAR, "viewed", 1) num_results = data["num_results"] full_data = [] with codecs.open("popular-{0}-{1}-full.json".format(kind, period), encoding='utf-8', mode='w') as v: for offset in range(0, num_results, 20): data = get_popular(URL_POPULAR, kind, period, offset=offset) full_data += data["results"] v.write(json.dumps(full_data, indent=2)) def test(): titles, urls = article_overview("viewed", 1) #print titles[2] assert len(titles) == 20 assert len(urls) == 30 assert titles[2] == {'Opinion': 'Professors, We Need You!'} assert urls[20] == 'http://graphics8.nytimes.com/images/2014/02/17/sports/ICEDANCE/ICEDANCE-thumbStandard.jpg' if __name__ == "__main__": test()
{ "content_hash": "19fd80ebd1ef9573b5e3e0e4cc05ef70", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 131, "avg_line_length": 35.041666666666664, "alnum_prop": 0.6192033293697978, "repo_name": "eneskemalergin/MongoDB", "id": "ecf983e949a41fdacd1f22783cf9bd499dd087ba", "size": "3364", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Lesson1/Problem Set/problem3.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "13696" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=type.P550.html"> </head> <body> <p>Redirecting to <a href="type.P550.html">type.P550.html</a>...</p> <script>location.replace("type.P550.html" + location.search + location.hash);</script> </body> </html>
{ "content_hash": "74583338d24320233b3b40748c4d9735", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 90, "avg_line_length": 29.7, "alnum_prop": 0.6531986531986532, "repo_name": "nitro-devs/nitro-game-engine", "id": "e02eb7d09a88b7a0bc12ecc4be0ac7f6792e7a95", "size": "297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/typenum/consts/P550.t.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CMake", "bytes": "1032" }, { "name": "Rust", "bytes": "59380" } ], "symlink_target": "" }
SCRIPTDIR=`dirname $0` source $SCRIPTDIR/env.sh for host in $NIMBUS do ssh nisstorm@$host 'sudo supervisorctl stop qm-infra' ssh nisstorm@$host 'sudo supervisorctl start qm-infra' echo $host ok done
{ "content_hash": "62778513b92e7e56aa6e6c2e0c1be614", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 62, "avg_line_length": 24.88888888888889, "alnum_prop": 0.6919642857142857, "repo_name": "QualiMaster/Infrastructure", "id": "2ff22665d35581ce583c0e28e59e04a950fd193a", "size": "409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AdaptationLayer/scripts/admin/restart-infrastructure.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "575" }, { "name": "Java", "bytes": "4750737" }, { "name": "Shell", "bytes": "9223" } ], "symlink_target": "" }
using System; using System.ComponentModel; using Xamarin.Forms; using System.Collections.Generic; namespace Kalam.Portable { public class BaseViewModel : INotifyPropertyChanged { public bool IsInitialized { get; set; } private bool _canLoadMore; /// <summary> /// Gets or sets the "IsBusy" property /// </summary> /// <value>The isbusy property.</value> public const string CanLoadMorePropertyName = "CanLoadMore"; public bool CanLoadMore { get { return _canLoadMore; } set { SetProperty (ref _canLoadMore, value, CanLoadMorePropertyName); } } bool isBusy; /// <summary> /// Gets or sets the "IsBusy" property /// </summary> /// <value>The isbusy property.</value> public const string IsBusyPropertyName = "IsBusy"; public bool IsBusy { get { return isBusy; } set { SetProperty (ref isBusy, value, IsBusyPropertyName); } } bool isValid; /// <summary> /// Gets or sets the "IsValid" property /// </summary> /// <value>The isbusy property.</value> public const string IsValidPropertyName = "IsValid"; public bool IsValid { get { return isValid; } set { SetProperty (ref isValid, value, IsValidPropertyName); } } string subTitle = string.Empty; /// <summary> /// Gets or sets the "Subtitle" property /// </summary> public const string SubtitlePropertyName = "Subtitle"; public string Subtitle { get { return subTitle; } set { SetProperty (ref subTitle, value, SubtitlePropertyName); } } string icon = null; /// <summary> /// Gets or sets the "Icon" of the viewmodel /// </summary> public const string IconPropertyName = "Icon"; public string Icon { get { return icon; } set { SetProperty (ref icon, value, IconPropertyName); } } protected void SetProperty<U> ( ref U backingStore, U value, string propertyName, Action onChanged = null, Action<U> onChanging = null) { if (EqualityComparer<U>.Default.Equals (backingStore, value)) return; if (onChanging != null) onChanging (value); OnPropertyChanging (propertyName); backingStore = value; if (onChanged != null) onChanged (); OnPropertyChanged (propertyName); } #region INotifyPropertyChanging implementation public event PropertyChangingEventHandler PropertyChanging; #endregion public void OnPropertyChanging (string propertyName) { if (PropertyChanging == null) return; PropertyChanging (this, new PropertyChangingEventArgs (propertyName)); } #region INotifyPropertyChanged implementation public event PropertyChangedEventHandler PropertyChanged; #endregion public void OnPropertyChanged (string propertyName) { if (PropertyChanged == null) return; PropertyChanged (this, new PropertyChangedEventArgs (propertyName)); } } }
{ "content_hash": "8e6cf63abde6fefa898a52465c86498b", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 74, "avg_line_length": 23.1900826446281, "alnum_prop": 0.6949394155381325, "repo_name": "bilal-sou/Kalam", "id": "766f349417e374c68bc2b434f236a5523dccebdd", "size": "2808", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Kalam.Portable/ViewModels/BaseViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "96784" }, { "name": "CSS", "bytes": "513" }, { "name": "HTML", "bytes": "2200" }, { "name": "JavaScript", "bytes": "133106" } ], "symlink_target": "" }
namespace RegPetServer.WebAPI { using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using RegPetServer.Data; using RegPetServer.Models; // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. public class ApplicationUserManager : UserManager<User> { public ApplicationUserManager(IUserStore<User> store) : base(store) { } public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context) { var manager = new ApplicationUserManager(new UserStore<User>(context.Get<RegPetServerDbContext>())); // Configure validation logic for usernames manager.UserValidator = new UserValidator<User>(manager) { AllowOnlyAlphanumericUserNames = false, RequireUniqueEmail = true }; // Configure validation logic for passwords manager.PasswordValidator = new PasswordValidator { RequiredLength = 3, RequireNonLetterOrDigit = false, RequireDigit = false, RequireLowercase = false, RequireUppercase = false, }; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider<User>(dataProtectionProvider.Create("ASP.NET Identity")); } return manager; } } }
{ "content_hash": "12a8bee6ffee5d10f7b3a325d1517df5", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 146, "avg_line_length": 39.15555555555556, "alnum_prop": 0.6356413166855845, "repo_name": "TishoAngelov/RegPetServer", "id": "09178b16a4cc9387e7fbe23c2a7612a73e2c2d2f", "size": "1764", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "RegPetServer.WebAPI/App_Start/IdentityConfig.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "113" }, { "name": "C#", "bytes": "193585" }, { "name": "CSS", "bytes": "2626" }, { "name": "JavaScript", "bytes": "10918" } ], "symlink_target": "" }
package com.yngvark.gridwalls.netcom.publish; public class NetcomSucceeded implements NetcomResult { @Override public boolean succeeded() { return true; } @Override public String getFailedInfo() { return "No failure info available for succeeded publish."; } }
{ "content_hash": "d1dc870de604e8d3bd6a336fbfa28553", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 66, "avg_line_length": 23.23076923076923, "alnum_prop": 0.6854304635761589, "repo_name": "yngvark/gridwalls2", "id": "ee04b18ee8b5b3b06be0d203b2cc6799fc7a223b", "size": "302", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "old/gradle_projects/zombie/src/main/java/com/yngvark/gridwalls/netcom/publish/NetcomSucceeded.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2116" }, { "name": "Dockerfile", "bytes": "15603" }, { "name": "Groovy", "bytes": "10377" }, { "name": "HTML", "bytes": "4056" }, { "name": "Java", "bytes": "303215" }, { "name": "JavaScript", "bytes": "1741" }, { "name": "Makefile", "bytes": "3494" }, { "name": "Mustache", "bytes": "2756" }, { "name": "Shell", "bytes": "23083" }, { "name": "TypeScript", "bytes": "7291" } ], "symlink_target": "" }
from copy import deepcopy from flask import current_app, request from werkzeug.datastructures import MultiDict, FileStorage from werkzeug import exceptions import flask_restful import decimal import six class Namespace(dict): def __getattr__(self, name): try: return self[name] except KeyError: raise AttributeError(name) def __setattr__(self, name, value): self[name] = value _friendly_location = { u'json': u'the JSON body', u'form': u'the post body', u'args': u'the query string', u'values': u'the post body or the query string', u'headers': u'the HTTP headers', u'cookies': u'the request\'s cookies', u'files': u'an uploaded file', } text_type = lambda x: six.text_type(x) class Argument(object): """ :param name: Either a name or a list of option strings, e.g. foo or -f, --foo. :param default: The value produced if the argument is absent from the request. :param dest: The name of the attribute to be added to the object returned by :meth:`~reqparse.RequestParser.parse_args()`. :param bool required: Whether or not the argument may be omitted (optionals only). :param action: The basic type of action to be taken when this argument is encountered in the request. Valid options are "store" and "append". :param ignore: Whether to ignore cases where the argument fails type conversion :param type: The type to which the request argument should be converted. If a type raises an exception, the message in the error will be returned in the response. Defaults to :class:`unicode` in python2 and :class:`str` in python3. :param location: The attributes of the :class:`flask.Request` object to source the arguments from (ex: headers, args, etc.), can be an iterator. The last item listed takes precedence in the result set. :param choices: A container of the allowable values for the argument. :param help: A brief description of the argument, returned in the response when the argument is invalid. May optionally contain an "{error_msg}" interpolation token, which will be replaced with the text of the error raised by the type converter. :param bool case_sensitive: Whether argument values in the request are case sensitive or not (this will convert all values to lowercase) :param bool store_missing: Whether the arguments default value should be stored if the argument is missing from the request. :param bool trim: If enabled, trims whitespace around the argument. :param bool nullable: If enabled, allows null value in argument. """ def __init__(self, name, default=None, dest=None, required=False, ignore=False, type=text_type, location=('json', 'values',), choices=(), action='store', help=None, operators=('=',), case_sensitive=True, store_missing=True, trim=False, nullable=True): self.name = name self.default = default self.dest = dest self.required = required self.ignore = ignore self.location = location self.type = type self.choices = choices self.action = action self.help = help self.case_sensitive = case_sensitive self.operators = operators self.store_missing = store_missing self.trim = trim self.nullable = nullable def source(self, request): """Pulls values off the request in the provided location :param request: The flask request object to parse arguments from """ if isinstance(self.location, six.string_types): value = getattr(request, self.location, MultiDict()) if callable(value): value = value() if value is not None: return value else: values = MultiDict() for l in self.location: value = getattr(request, l, None) if callable(value): value = value() if value is not None: values.update(value) return values return MultiDict() def convert(self, value, op): # Don't cast None if value is None: if self.nullable: return None else: raise ValueError('Must not be null!') # and check if we're expecting a filestorage and haven't overridden `type` # (required because the below instantiation isn't valid for FileStorage) elif isinstance(value, FileStorage) and self.type == FileStorage: return value try: return self.type(value, self.name, op) except TypeError: try: if self.type is decimal.Decimal: return self.type(str(value), self.name) else: return self.type(value, self.name) except TypeError: return self.type(value) def handle_validation_error(self, error, bundle_errors): """Called when an error is raised while parsing. Aborts the request with a 400 status and an error message :param error: the error that was raised :param bundle_errors: do not abort when first error occurs, return a dict with the name of the argument and the error message to be bundled """ error_str = six.text_type(error) error_msg = self.help.format(error_msg=error_str) if self.help else error_str msg = {self.name: "{0}".format(error_msg)} if current_app.config.get("BUNDLE_ERRORS", False) or bundle_errors: return error, msg flask_restful.abort(400, message=msg) def parse(self, request, bundle_errors=False): """Parses argument value(s) from the request, converting according to the argument's type. :param request: The flask request object to parse arguments from :param do not abort when first error occurs, return a dict with the name of the argument and the error message to be bundled """ source = self.source(request) results = [] # Sentinels _not_found = False _found = True for operator in self.operators: name = self.name + operator.replace("=", "", 1) if name in source: # Account for MultiDict and regular dict if hasattr(source, "getlist"): values = source.getlist(name) else: values = [source.get(name)] for value in values: if hasattr(value, "strip") and self.trim: value = value.strip() if hasattr(value, "lower") and not self.case_sensitive: value = value.lower() if hasattr(self.choices, "__iter__"): self.choices = [choice.lower() for choice in self.choices] try: value = self.convert(value, operator) except Exception as error: if self.ignore: continue return self.handle_validation_error(error, bundle_errors) if self.choices and value not in self.choices: if current_app.config.get("BUNDLE_ERRORS", False) or bundle_errors: return self.handle_validation_error( ValueError(u"{0} is not a valid choice".format( value)), bundle_errors) self.handle_validation_error( ValueError(u"{0} is not a valid choice".format( value)), bundle_errors) if name in request.unparsed_arguments: request.unparsed_arguments.pop(name) results.append(value) if not results and self.required: if isinstance(self.location, six.string_types): error_msg = u"Missing required parameter in {0}".format( _friendly_location.get(self.location, self.location) ) else: friendly_locations = [_friendly_location.get(loc, loc) for loc in self.location] error_msg = u"Missing required parameter in {0}".format( ' or '.join(friendly_locations) ) if current_app.config.get("BUNDLE_ERRORS", False) or bundle_errors: return self.handle_validation_error(ValueError(error_msg), bundle_errors) self.handle_validation_error(ValueError(error_msg), bundle_errors) if not results: if callable(self.default): return self.default(), _not_found else: return self.default, _not_found if self.action == 'append': return results, _found if self.action == 'store' or len(results) == 1: return results[0], _found return results, _found class RequestParser(object): """Enables adding and parsing of multiple arguments in the context of a single request. Ex:: from flask import request parser = RequestParser() parser.add_argument('foo') parser.add_argument('int_bar', type=int) args = parser.parse_args() :param bool trim: If enabled, trims whitespace on all arguments in this parser :param bool bundle_errors: If enabled, do not abort when first error occurs, return a dict with the name of the argument and the error message to be bundled and return all validation errors """ def __init__(self, argument_class=Argument, namespace_class=Namespace, trim=False, bundle_errors=False): self.args = [] self.argument_class = argument_class self.namespace_class = namespace_class self.trim = trim self.bundle_errors = bundle_errors def add_argument(self, *args, **kwargs): """Adds an argument to be parsed. Accepts either a single instance of Argument or arguments to be passed into :class:`Argument`'s constructor. See :class:`Argument`'s constructor for documentation on the available options. """ if len(args) == 1 and isinstance(args[0], self.argument_class): self.args.append(args[0]) else: self.args.append(self.argument_class(*args, **kwargs)) #Do not know what other argument classes are out there if self.trim and self.argument_class is Argument: #enable trim for appended element self.args[-1].trim = kwargs.get('trim', self.trim) return self def parse_args(self, req=None, strict=False): """Parse all arguments from the provided request and return the results as a Namespace :param strict: if req includes args not in parser, throw 400 BadRequest exception """ if req is None: req = request namespace = self.namespace_class() # A record of arguments not yet parsed; as each is found # among self.args, it will be popped out req.unparsed_arguments = dict(self.argument_class('').source(req)) if strict else {} errors = {} for arg in self.args: value, found = arg.parse(req, self.bundle_errors) if isinstance(value, ValueError): errors.update(found) found = None if found or arg.store_missing: namespace[arg.dest or arg.name] = value if errors: flask_restful.abort(400, message=errors) if strict and req.unparsed_arguments: raise exceptions.BadRequest('Unknown arguments: %s' % ', '.join(req.unparsed_arguments.keys())) return namespace def copy(self): """ Creates a copy of this RequestParser with the same set of arguments """ parser_copy = self.__class__(self.argument_class, self.namespace_class) parser_copy.args = deepcopy(self.args) parser_copy.trim = self.trim parser_copy.bundle_errors = self.bundle_errors return parser_copy def replace_argument(self, name, *args, **kwargs): """ Replace the argument matching the given name with a new version. """ new_arg = self.argument_class(name, *args, **kwargs) for index, arg in enumerate(self.args[:]): if new_arg.name == arg.name: del self.args[index] self.args.append(new_arg) break return self def remove_argument(self, name): """ Remove the argument matching the given name. """ for index, arg in enumerate(self.args[:]): if name == arg.name: del self.args[index] break return self
{ "content_hash": "8fb5b7d3d0dfff867fa938e3a6b07242", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 92, "avg_line_length": 39.220588235294116, "alnum_prop": 0.5819272590926134, "repo_name": "sotdjin/glibglab", "id": "07e42d90a6f0de38d49b954e7ce3ff46071ec35a", "size": "13335", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "venv/lib/python2.7/site-packages/flask_restful/reqparse.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5939" }, { "name": "CSS", "bytes": "164971" }, { "name": "HTML", "bytes": "35613" }, { "name": "JavaScript", "bytes": "10310" }, { "name": "Mako", "bytes": "9463" }, { "name": "PowerShell", "bytes": "468" }, { "name": "Python", "bytes": "9281018" }, { "name": "Shell", "bytes": "3228" } ], "symlink_target": "" }
package commandParsing.mathCommandParsing; import java.util.List; import java.util.Queue; import workspaceState.WorkspaceState; import commandParsing.exceptions.RunTimeDivideByZeroException; import commandParsing.floatCommandParsing.OneInputFloatCommandParser; import drawableobject.DrawableObject; public class Cosine extends OneInputFloatCommandParser { public Cosine (WorkspaceState someWorkspace) { super(someWorkspace); } @Override protected double operateOnComponents (List<Double> components, Queue<DrawableObject> objectQueue) throws RunTimeDivideByZeroException { return Math.cos(components.get(0) / (180 / Math.PI)); } }
{ "content_hash": "10b46049c5afa2bd116e0d7d72d3b9b0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 101, "avg_line_length": 29.782608695652176, "alnum_prop": 0.7824817518248175, "repo_name": "akyker20/Slogo_IDE", "id": "42f1f167d0d965e8b9ca80d1ed34ce29299374a1", "size": "685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/commandParsing/mathCommandParsing/Cosine.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "406" }, { "name": "Java", "bytes": "429094" } ], "symlink_target": "" }
import { Universe } from '@ephox/boss'; import { Adt, Fun } from '@ephox/katamari'; import { Gather, Split } from '@ephox/phoenix'; interface EntryPoint<E> { fold: <T> ( leftEdge: (element: E) => T, between: (before: E, after: E) => T, rightEdge: (element: E) => T ) => T; match: <T> (branches: { leftEdge: (element: E) => T; between: (before: E, after: E) => T; rightEdge: (element: E) => T; }) => T; log: (label: string) => void; } const adt: { leftEdge: <E>(element: E) => EntryPoint<E>; between: <E>(before: E, after: E) => EntryPoint<E>; rightEdge: <E>(element: E) => EntryPoint<E>; } = Adt.generate([ { leftEdge: [ 'element' ] }, { between: [ 'before', 'after' ] }, { rightEdge: [ 'element' ] } ]); const onText = <E, D>(universe: Universe<E, D>, element: E, offset: number): EntryPoint<E> => { const raw = Split.split(universe, element, offset); const positions = Split.position(universe, raw); // Note, these cannot be curried because then more arguments are supplied than the adt expects. const l = () => adt.leftEdge(element); const r = () => adt.rightEdge(element); // None, Start, Middle, End return positions.fold(r, l, adt.between, r); }; const onElement = <E, D>(universe: Universe<E, D>, element: E, offset: number): EntryPoint<E> => { const children = universe.property().children(element); if (offset === 0) { return adt.leftEdge(element); } else if (offset === children.length) { return adt.rightEdge(element); } else if (offset > 0 && offset < children.length) { return adt.between(children[offset - 1], children[offset]); } else { // NOTE: This should not happen. return adt.rightEdge(element); } }; const analyse = <E, D>(universe: Universe<E, D>, element: E, offset: number, fallback: (element: E) => EntryPoint<E>): EntryPoint<E> => { if (universe.property().isText(element)) { return onText(universe, element, offset); } else if (universe.property().isEmptyTag(element)) { return fallback(element); } else { return onElement(universe, element, offset); } }; // When breaking to the left, we will want to include the 'right' section of the split. const toLeft = <E, D>(universe: Universe<E, D>, isRoot: (e: E) => boolean, element: E, offset: number): E => { return analyse(universe, element, offset, adt.leftEdge).fold( // We are at the left edge of the element, so take the whole element Fun.identity, // We are splitting an element, so take the right side (b, a) => a, // We are at the right edge of the starting element, so gather the next element to the right (e) => Gather.after(universe, e, isRoot).getOr(e) ); }; // When breaking to the right, we will want to include the 'left' section of the split. const toRight = <E, D>(universe: Universe<E, D>, isRoot: (e: E) => boolean, element: E, offset: number): E => { return analyse(universe, element, offset, adt.rightEdge).fold( // We are at the left edge of the finishing element, so gather the previous element. (e) => Gather.before(universe, e, isRoot).getOr(e), // We are splitting an element, so take the left side. (b, _a) => b, // We are the right edge of the element, so take the whole element Fun.identity ); }; export { toLeft, toRight };
{ "content_hash": "042f03184a9cd43cfe6e3cb84299d7f3", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 137, "avg_line_length": 36.74444444444445, "alnum_prop": 0.6362261868763229, "repo_name": "tinymce/tinymce", "id": "067987715a10e27e6ca04d44d5270b909e326b2c", "size": "3307", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "modules/robin/src/main/ts/ephox/robin/clumps/EntryPoints.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9733" }, { "name": "HTML", "bytes": "183264" }, { "name": "JavaScript", "bytes": "117530" }, { "name": "Less", "bytes": "182379" }, { "name": "TypeScript", "bytes": "11764279" } ], "symlink_target": "" }
Integrating IvoryCKEditorBundle to Create a WYSIWYG Editor ========================================================== EasyAdmin uses a ``<textarea>`` form field to render long text properties: .. image:: ../images/wysiwyg/default-textarea.png :alt: Default textarea for text elements However, sometimes you need to provide to your users a rich editor, commonly named *WYSIWYG editor*. Although EasyAdmin doesn't provide any built-in rich text editor, you can integrate one very easily. Installing the Rich Text Editor ------------------------------- The recommended WYSIWYG editor is called `CKEditor`_ and you can integrate it thanks to the `IvoryCKEditorBundle`_: 1) Install the bundle: .. code-block:: terminal $ composer require egeloen/ckeditor-bundle 2) Enable the bundle: .. code-block:: php // app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { return array( // ... new Ivory\CKEditorBundle\IvoryCKEditorBundle(), ); } } 3) Install the JavaScript/CSS files used by the bundle: .. code-block:: terminal # Symfony 2 $ php app/console assets:install --symlink # Symfony 3 $ php bin/console assets:install --symlink Using the Rich Text Editor -------------------------- IvoryCKEditorBundle provides a new form type called ``ckeditor``. Just set the ``type`` option of any property to this value to display its contents using a rich text editor: .. code-block:: yaml easy_admin: entities: Product: # ... form: fields: # ... - { property: 'description', type: 'ckeditor' } .. tip:: Even if your application uses Symfony 3 there is no need to use the FQCN of the ``CKEditorType`` (``type: 'Ivory\CKEditorBundle\Form\Type\CKEditorType'``) because EasyAdmin supports the short types for some popular third-party bundles. Now, the ``description`` property will be rendered as a rich text editor and not as a simple ``<textarea>``: .. image:: ../images/wysiwyg/default-wysiwyg.png :alt: Default WYSIWYG editor Customizing the Rich Text Editor -------------------------------- EasyAdmin tweaks some CKEditor settings to improve the user experience. In case you need further customization, configure the editor globally in your Symfony application under the ``ivory_ck_editor`` option. For example: .. code-block:: yaml # app/config/config.yml ivory_ck_editor: input_sync: true default_config: base_config configs: base_config: toolbar: - { name: "styles", items: ['Bold', 'Italic', 'BulletedList', 'Link'] } easy_admin: entities: Product: # ... form: fields: # ... - { property: 'description', type: 'ckeditor' } In this example, the toolbar is simplified to display just a few common options: .. image:: ../images/wysiwyg/simple-wysiwyg.png :alt: Simple WYSIWYG editor Alternatively, you can also define the editor options in the ``type_options`` setting of the property: .. code-block:: yaml easy_admin: entities: Product: # ... form: fields: # ... - { property: 'description', type: 'ckeditor', type_options: { 'config': { 'toolbar': [ { name: 'styles', items: ['Bold', 'Italic', 'BulletedList', 'Link'] } ] } } } This inline configuration is very hard to maintain, so it's recommended to use the global configuration instead. You can even combine both to define the toolbars globally and then select the toolbar to use in each property: .. code-block:: yaml # app/config/config.yml ivory_ck_editor: input_sync: true default_config: simple_config configs: simple_config: toolbar: # ... advanced_config: toolbar: # ... easy_admin: entities: Product: # ... form: fields: # ... - { property: 'excerpt', type: 'ckeditor', type_options: { config_name: 'simple_config' } } - { property: 'description', type: 'ckeditor', type_options: { config_name: 'advanced_config' } } Check out the original CKEditor documentation to get `its full list of configuration options`_. Integrating CKFinder -------------------- `CKFinder`_ is a file manager plugin developed for CKEditor. First, follow its documentation to download and install the "CKFinder Connector" somewhere in your Symfony application. After that, integrating CKFinder with CKEditor is a matter of adding a few lines of JavaScript code. First, create a JavaScript file (for example in ``web/js/setup-ckfinder.js``) and add the following code: .. code-block:: js // web/js/setup-ckfinder.js window.onload = function () { if (window.CKEDITOR) { // configure 'connectorPath' according to your own application var path = '/ckfinder/connector'; CKFinder.config({ connectorPath: (window.location.pathname.indexOf("app_dev.php") == -1 ) ? path : '/app_dev.php' + path }); for (var ckInstance in CKEDITOR.instances){ CKFinder.setupCKEditor(CKEDITOR.instances[ckInstance]); } } } Then, use the ``design.assets.js`` config option to include that file in every page loaded by EasyAdmin: .. code-block:: yaml easy_admin: design: assets: js: - '/bundles/cksourceckfinder/ckfinder/ckfinder.js' - '/js/setup-ckfinder.js' # ... .. _`CKEditor`: http://ckeditor.com/ .. _`IvoryCKEditorBundle`: https://github.com/egeloen/IvoryCKEditorBundle .. _`its full list of configuration options`: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html .. _`CKFinder`: https://cksource.com/ckfinder
{ "content_hash": "8ab8258f14a7480d22ec4e609a606d95", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 189, "avg_line_length": 31.53233830845771, "alnum_prop": 0.5861470495424425, "repo_name": "nsonnycole/TeamDEV", "id": "44a25b88790915088a50ef1f13c35184a61f98ec", "size": "6338", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/javiereguiluz/easyadmin-bundle/Resources/doc/integration/ivoryckeditorbundle.rst", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3605" }, { "name": "CSS", "bytes": "128622" }, { "name": "HTML", "bytes": "370748" }, { "name": "JavaScript", "bytes": "197037" }, { "name": "PHP", "bytes": "201619" } ], "symlink_target": "" }
<?php namespace Bpocallaghan\Titan; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Bpocallaghan\Titan\Commands\SetupCommand; use Bpocallaghan\Titan\Commands\MigrateCommand; use Bpocallaghan\Titan\Commands\InstallCommand; use Bpocallaghan\Titan\Commands\PublishCommand; use Bpocallaghan\Titan\Commands\DatabaseSeedCommand; class TitanServiceProvider extends ServiceProvider { /** * Register bindings in the container. * * @return void */ public function register() { // merge config on register (before routes file) $appPath = __DIR__ . DIRECTORY_SEPARATOR; $basePath = $appPath . ".." . DIRECTORY_SEPARATOR; // merge config $configPath = $basePath . '/config/config.php'; $this->mergeConfigFrom($configPath, 'titan'); // register RouteServiceProvider $this->app->register('Bpocallaghan\Titan\Providers\RouteServiceProvider'); } /** * Bootstrap the application events. * * @return void */ public function boot() { // mysql (Specified key was too long) Schema::defaultStringLength(191); $appPath = __DIR__ . DIRECTORY_SEPARATOR; $basePath = $appPath . ".." . DIRECTORY_SEPARATOR; $migrationsPath = $basePath . "database" . DIRECTORY_SEPARATOR . "migrations"; $viewsPath = $basePath . "resources" . DIRECTORY_SEPARATOR . "views"; // merge config //$configPath = $basePath . '/config/config.php'; //$this->mergeConfigFrom($configPath, 'titan'); // load migrations $this->loadMigrationsFrom($migrationsPath); $this->loadViewsFrom($viewsPath, "titan"); $this->registerCommand(SetupCommand::class, 'setup'); $this->registerCommand(MigrateCommand::class, 'migrate'); $this->registerCommand(InstallCommand::class, 'install'); $this->registerCommand(PublishCommand::class, 'publish'); $this->registerCommand(DatabaseSeedCommand::class, 'db:seed'); // register RouteServiceProvider //$this->app->register('Bpocallaghan\Titan\Providers\RouteServiceProvider'); // register EventServiceProvider $this->app->register('Bpocallaghan\Titan\Providers\EventServiceProvider'); // register HelperServiceProvider $this->app->register('Bpocallaghan\Titan\Providers\HelperServiceProvider'); } /** * Register a singleton command * * @param $class * @param $command */ private function registerCommand($class, $command) { $path = 'bpocallaghan.commands.'; $this->app->singleton($path . $command, function ($app) use ($class) { return $app[$class]; }); $this->commands($path . $command); } }
{ "content_hash": "80704737b1b1228c2e8e5a39569f823b", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 86, "avg_line_length": 31.766666666666666, "alnum_prop": 0.6453305351521511, "repo_name": "bpocallaghan/titan", "id": "5f41e315758672fd3d97403e3649978f93308667", "size": "2859", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/TitanServiceProvider.php", "mode": "33188", "license": "mit", "language": [ { "name": "Blade", "bytes": "539220" }, { "name": "CSS", "bytes": "209954" }, { "name": "JavaScript", "bytes": "87815" }, { "name": "PHP", "bytes": "509784" }, { "name": "SCSS", "bytes": "247" } ], "symlink_target": "" }
using System; using Castle.Facilities.WcfIntegration; using Common.Logging; using _S_ServiceContractsProjectName_S_; namespace _S_ServiceProjectName_S_.Module { public class _S_ShortProductName_S_WindowsService2 : I_S_ShortProductName_S_WindowsService2 { private readonly DefaultServiceHostFactory _defaultServiceHostFactory; private readonly ILog _logger; public DefaultServiceHost ServiceHost = null; public _S_ShortProductName_S_WindowsService2(DefaultServiceHostFactory defaultServiceHostFactory, ILog logger) { _defaultServiceHostFactory = defaultServiceHostFactory; _logger = logger; } public void Start() { try { _logger.Info("Starting _S_ShortProductName_S_ service..."); ServiceHost?.Close(); _logger.Info("Creating a ServiceHost for the _S_ShortProductName_S_Manager type and provide the base address."); ServiceHost = (DefaultServiceHost)(_defaultServiceHostFactory.CreateServiceHost(typeof(I_S_ShortProductName_S_Manager).AssemblyQualifiedName, new Uri[] { })); ServiceHost.Faulted += ServiceHostFaulted; ServiceHost.EndpointCreated += ServiceHostEndpointCreated; ServiceHost.Closing += ServiceHostClosing; ServiceHost.Closed += ServiceHostClosed; ServiceHost.Opened += ServiceHostOpened; ServiceHost.Opening += ServiceHostOpening; _logger.Info("Service host has been created"); _logger.Info("Opening the ServiceHost to create listeners and start listening for messages."); ServiceHost.Open(); _logger.Info("_S_ShortProductName_S_ service has been started."); } catch (Exception ex) { _logger.Error("Failed to start _S_ShortProductName_S_ service. " + ex); throw; } } public void Stop() { _logger.Info("Stopping _S_ShortProductName_S_ service..."); ServiceHost?.Close(); ServiceHost = null; _logger.Info("_S_ShortProductName_S_ service has been stopped."); } void ServiceHostOpening(object sender, EventArgs e) { _logger.InfoFormat("_S_ProductName_S_ Service host is starting..."); } void ServiceHostOpened(object sender, EventArgs e) { _logger.InfoFormat("_S_ProductName_S_ Service host has been started."); } void ServiceHostClosed(object sender, EventArgs e) { _logger.InfoFormat("_S_ProductName_S_ Service host has been closed."); } void ServiceHostClosing(object sender, EventArgs e) { _logger.InfoFormat("_S_ProductName_S_ Service host is closing."); } void ServiceHostEndpointCreated(object sender, EndpointCreatedArgs e) { _logger.Info("End point has been created: " + e.Endpoint); } void ServiceHostFaulted(object sender, EventArgs e) { _logger.ErrorFormat("_S_ProductName_S_ Service host faulted. Sender: {0}. EventArgs: {1}", sender, e); } } }
{ "content_hash": "3b8a0e85e4bdceea190f1ce8e98c53b0", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 174, "avg_line_length": 39.44047619047619, "alnum_prop": 0.606097192876547, "repo_name": "trondr/NCmdLiner.SolutionTemplates", "id": "569c7c1058410832bd4f870618cea0b49f2b231c", "size": "3315", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Client Service Application/src/_S_ServiceProjectName_S_/Module/_S_ShortProductName_S_WindowsService2.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "4680" }, { "name": "C#", "bytes": "383946" }, { "name": "HTML", "bytes": "18060" }, { "name": "PowerShell", "bytes": "100829" }, { "name": "Smalltalk", "bytes": "1820" } ], "symlink_target": "" }
package com.example.android_service; import android.os.Bundle; public class StaggeredGridViewTest extends BaseUIActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.acty_sgv); } @Override protected void initLayout() { } @Override protected void initData() { } }
{ "content_hash": "6bc674a58875b9e7b1db6de12747d65e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 59, "avg_line_length": 16.91304347826087, "alnum_prop": 0.712082262210797, "repo_name": "Jayin/AndroidExample", "id": "f85341cf2d5a191bc234cef55f37a031cf01774d", "size": "389", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/example/android_service/StaggeredGridViewTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2383" }, { "name": "Java", "bytes": "562770" }, { "name": "JavaScript", "bytes": "44716" } ], "symlink_target": "" }
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import * as actions from '../state/actions'; import fixtures from '../fixtures'; import StateReport from '../components/StateReport'; import { GlobalNav } from 'hig-react'; class App extends Component { render() { const globalNavProps = { sideNavOpenByDefault: true, modules: fixtures.modules, submodules: fixtures.submodules, onModuleChange: this.props.changeModule, activeModuleId: this.props.activeModuleId, showSubNav: true, sideNav: { superHeaderLabel: 'AutoDesk HIG', headerLabel: 'Redux Example App', } }; return ( <GlobalNav {...globalNavProps}> <StateReport activeModuleId={this.props.activeModuleId} onModuleChange={this.props.changeModule} /> </GlobalNav> ); } } App.propTypes = { activeModuleId: PropTypes.string.isRequired, changeModule: PropTypes.func.isRequired } const mapStateToProps = (state={}) => { return { activeModuleId: state.activeModuleId, }; }; const mapDispatchToProps = (dispatch) => ({ ...bindActionCreators(actions, dispatch) }); export default connect( mapStateToProps, mapDispatchToProps )(App);
{ "content_hash": "92b85638362c16a37c1336a892b4e196", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 52, "avg_line_length": 24.472727272727273, "alnum_prop": 0.6708766716196136, "repo_name": "hyoshizumi/hig", "id": "9351cb6204806d0b3c07c5449868c3ffa969156d", "size": "1346", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "packages/react/examples/redux/src/containers/App.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "101634" }, { "name": "HTML", "bytes": "329784" }, { "name": "JavaScript", "bytes": "623350" }, { "name": "Shell", "bytes": "524" } ], "symlink_target": "" }
<?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( 'PhpConsole' => array($vendorDir . '/php-console/php-console/src'), 'Monolog' => array($vendorDir . '/monolog/monolog/src'), 'Detection' => array($vendorDir . '/mobiledetect/mobiledetectlib/namespaced'), 'Carbon' => array($vendorDir . '/nesbot/carbon/src'), );
{ "content_hash": "a102b9a17c2032189e5f3d3dae59def3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 32.53846153846154, "alnum_prop": 0.6713947990543735, "repo_name": "xiaofang520/agency", "id": "83b3d3dc467bd0e321622d94f0fcd673f070a801", "size": "423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/library/vendor/composer/autoload_namespaces.php", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "83454" }, { "name": "HTML", "bytes": "46232" }, { "name": "JavaScript", "bytes": "213925" }, { "name": "PHP", "bytes": "104071" } ], "symlink_target": "" }
SC.MutableArrayTests.extend({ name: 'SC.ArrayProxy', newObject: function(ary) { var ret = ary ? ary.slice() : this.newFixture(3); return new SC.ArrayProxy(ret); }, mutate: function(obj) { obj.pushObject(SC.get(obj, 'length')+1); }, toArray: function(obj) { return obj.toArray ? obj.toArray() : obj.slice(); } }).run();
{ "content_hash": "3413433269ee66bbc7469e22fe4bb532", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 53, "avg_line_length": 17.38095238095238, "alnum_prop": 0.5945205479452055, "repo_name": "crofty/sensor_js_message_parsing", "id": "680029ee2e3efc7d4a680a084a98094aee7caadb", "size": "663", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/sproutcore-runtime/tests/system/array_proxy/suite_test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "39923" }, { "name": "Ruby", "bytes": "63" } ], "symlink_target": "" }
package main import ( "fmt" "os" "path" "path/filepath" "github.com/ghmeier/bloodlines/config" "github.com/ghmeier/bloodlines/router" ) func main() { dir, _ := filepath.Abs(filepath.Dir(os.Args[0])) config, err := config.Init(path.Join(dir, "config.json")) if err != nil { fmt.Printf("ERROR: config initialization error.\n%s\n", err.Error()) return } b, err := router.New(config) if err != nil { fmt.Printf("ERROR: %s\n", err.Error()) return } fmt.Printf("Bloodlines running on %s\n", config.Port) b.Start(":" + config.Port) }
{ "content_hash": "9e25120d59dedc6ad705480ae019abea", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 70, "avg_line_length": 19.785714285714285, "alnum_prop": 0.648014440433213, "repo_name": "ghmeier/bloodlines", "id": "c60e4e12f25f419b16c9269be963a840ba74bd55", "size": "554", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "187072" }, { "name": "Makefile", "bytes": "244" }, { "name": "Shell", "bytes": "98" } ], "symlink_target": "" }
package org.apache.polygene.library.sql.generator.implementation.grammar.query.joins; import java.util.Objects; import org.apache.polygene.library.sql.generator.grammar.booleans.BooleanExpression; import org.apache.polygene.library.sql.generator.grammar.query.joins.JoinCondition; import org.apache.polygene.library.sql.generator.implementation.transformation.spi.SQLProcessorAggregator; /** * @author Stanislav Muhametsin */ public class JoinConditionImpl extends JoinSpecificationImpl<JoinCondition> implements JoinCondition { private final BooleanExpression _searchCondition; public JoinConditionImpl( SQLProcessorAggregator processor, BooleanExpression searchCondition ) { this( processor, JoinCondition.class, searchCondition ); } protected JoinConditionImpl( SQLProcessorAggregator processor, Class<? extends JoinCondition> implClass, BooleanExpression searchCondition ) { super( processor, implClass ); Objects.requireNonNull( searchCondition, "search condition" ); this._searchCondition = searchCondition; } public BooleanExpression getSearchConidition() { return this._searchCondition; } @Override protected boolean doesEqual( JoinCondition another ) { return this._searchCondition.equals( another.getSearchConidition() ); } }
{ "content_hash": "8d8c0f8981812368f6d0ed284b818846", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 108, "avg_line_length": 33.829268292682926, "alnum_prop": 0.7476568132660418, "repo_name": "apache/zest-qi4j", "id": "78596956ecec353abf43275d662b610bd1c0a448", "size": "2212", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libraries/sql-generator/src/main/java/org/apache/polygene/library/sql/generator/implementation/grammar/query/joins/JoinConditionImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "46292" }, { "name": "Groovy", "bytes": "21752" }, { "name": "HTML", "bytes": "246264" }, { "name": "Java", "bytes": "6969784" }, { "name": "JavaScript", "bytes": "19790" }, { "name": "Python", "bytes": "6440" }, { "name": "Scala", "bytes": "8606" }, { "name": "Shell", "bytes": "1233" }, { "name": "XSLT", "bytes": "70993" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\ValidationVisitorInterface; use Symfony\Component\Validator\ClassBasedInterface; use Symfony\Component\Validator\PropertyMetadataInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; abstract class MemberMetadata extends ElementMetadata implements PropertyMetadataInterface, ClassBasedInterface { public $class; public $name; public $property; public $cascaded = false; public $collectionCascaded = false; public $collectionCascadedDeeply = false; private $reflMember = array(); /** * Constructor. * * @param string $class The name of the class this member is defined on * @param string $name The name of the member * @param string $property The property the member belongs to */ public function __construct($class, $name, $property) { $this->class = $class; $this->name = $name; $this->property = $property; } public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null) { $visitor->visit($this, $value, $group, $propertyPath); if ($this->isCascaded()) { $visitor->validate($value, $propagatedGroup ?: $group, $propertyPath, $this->isCollectionCascaded(), $this->isCollectionCascadedDeeply()); } } /** * {@inheritDoc} */ public function addConstraint(Constraint $constraint) { if (!in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets())) { throw new ConstraintDefinitionException(sprintf( 'The constraint %s cannot be put on properties or getters', get_class($constraint) )); } if ($constraint instanceof Valid) { $this->cascaded = true; /* @var Valid $constraint */ $this->collectionCascaded = $constraint->traverse; $this->collectionCascadedDeeply = $constraint->deep; } else { parent::addConstraint($constraint); } return $this; } /** * Returns the names of the properties that should be serialized * * @return array */ public function __sleep() { return array_merge(parent::__sleep(), array( 'class', 'name', 'property', 'cascaded', // TESTME )); } /** * Returns the name of the member * * @return string */ public function getName() { return $this->name; } /** * Returns the class this member is defined on * * @return string */ public function getClassName() { return $this->class; } /** * Returns the name of the property this member belongs to * * @return string The property name */ public function getPropertyName() { return $this->property; } /** * Returns whether this member is public * * @param object|string $objectOrClassName The object or the class name * * @return Boolean */ public function isPublic($objectOrClassName) { return $this->getReflectionMember($objectOrClassName)->isPublic(); } /** * Returns whether this member is protected * * @param object|string $objectOrClassName The object or the class name * * @return Boolean */ public function isProtected($objectOrClassName) { return $this->getReflectionMember($objectOrClassName)->isProtected(); } /** * Returns whether this member is private * * @param object|string $objectOrClassName The object or the class name * * @return Boolean */ public function isPrivate($objectOrClassName) { return $this->getReflectionMember($objectOrClassName)->isPrivate(); } /** * Returns whether objects stored in this member should be validated * * @return Boolean */ public function isCascaded() { return $this->cascaded; } /** * Returns whether arrays or traversable objects stored in this member * should be traversed and validated in each entry * * @return Boolean */ public function isCollectionCascaded() { return $this->collectionCascaded; } /** * Returns whether arrays or traversable objects stored in this member * should be traversed recursively for inner arrays/traversable objects * * @return Boolean */ public function isCollectionCascadedDeeply() { return $this->collectionCascadedDeeply; } /** * Returns the Reflection instance of the member * * @param object|string $objectOrClassName The object or the class name * * @return object */ public function getReflectionMember($objectOrClassName) { $className = is_string($objectOrClassName) ? $objectOrClassName : get_class($objectOrClassName); if (!isset($this->reflMember[$className])) { $this->reflMember[$className] = $this->newReflectionMember($objectOrClassName); } return $this->reflMember[$className]; } /** * Creates a new Reflection instance for the member * * @param object|string $objectOrClassName The object or the class name * * @return mixed Reflection class */ abstract protected function newReflectionMember($objectOrClassName); }
{ "content_hash": "f3d2be0acd897bebb8afb7d0f086a69c", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 150, "avg_line_length": 28.23444976076555, "alnum_prop": 0.6000677851211659, "repo_name": "CaoPhiHung/CRM", "id": "fcf16689467f8ac96943a4413a8c2beb81c1ef84", "size": "6137", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/MemberMetadata.php", "mode": "33261", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "15982" }, { "name": "ApacheConf", "bytes": "2773" }, { "name": "CSS", "bytes": "616791" }, { "name": "HTML", "bytes": "6404402" }, { "name": "JavaScript", "bytes": "4126887" }, { "name": "Makefile", "bytes": "3152" }, { "name": "PHP", "bytes": "3718978" }, { "name": "Perl", "bytes": "14937" }, { "name": "Python", "bytes": "44785" }, { "name": "Ruby", "bytes": "861" }, { "name": "Shell", "bytes": "9232" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f078533ac4b6164e63effdf80da32178", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "c208531dbda8e9b74da173cde4fa5c6eb9423170", "size": "169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Boraginales/Boraginaceae/Sclerocaryopsis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/* Upper level functions for communication with Odroid board. */ #include "Communication.h" #include "stdint.h" #include "robot.h" InPackStruct inCommand ={0xFA, 0xAF, 0x00, 0x00, &param[0]}; //структура входящего пакета void pushByte(char inByte) // поиск, формирование и проверка входящего пакета в потоке данных { char j; uint16_t checkSum; uint16_t * test; inData[dataIndex++] = inByte; if((inData[0] == SYNC_BYTE) && (inData[1] == ADR_BYTE)) //поиск заголовка { if( (dataIndex >= inData[2]) && (dataIndex > 3) ) //проверка длинны пакета { checkSum = packetCheck(&inData[0], inData[2] - CHECK_SIZE); test = ( uint16_t *) &inData[inData[2] - CHECK_SIZE]; if (*test == checkSum) // проверка CRC { inCommand.packLen = inData[2]; for (j=0; j < inCommand.packLen - CHECK_SIZE - HEADER_SIZE; j++) //Копирование параметров *(inCommand.param + j) = inData[4 + j]; inCommand.command = inData[3]; execCommand(&inCommand); //выполнение команды } dataIndex = 0; inData[0] = 0; inData[1] = 0; } } else { if (dataIndex > 1) { inData[0] = inData[1]; inData[1] = 0; dataIndex = 1; } } } extern uint8_t APP_Rx_Buffer []; /* Write CDC received data in this buffer. These data will be sent over USB IN endpoint in the CDC core functions. */ extern uint32_t APP_Rx_ptr_in; /* Increment this pointer or roll it back to start address when writing received data in the buffer APP_Rx_Buffer. */ char sendAnswer(char cmd, char * param, int paramSize) // отправить ответ по USB { __disable_irq(); outData[0] = 0xFA; outData[1] = 0xFA; outData[2] = paramSize + HEADER_SIZE + CHECK_SIZE; outData[3] = cmd; memcpy(&outData[4], param, paramSize); *((int16_t*)&outData[paramSize + HEADER_SIZE]) = (int16_t) packetCheck(&outData[0], paramSize + HEADER_SIZE); int _size = paramSize + HEADER_SIZE + CHECK_SIZE ; int i; for (i=0; i < _size; i++) putchar(outData[i]); if (APP_Rx_ptr_in + _size < APP_RX_DATA_SIZE) { memcpy(&APP_Rx_Buffer[APP_Rx_ptr_in], outData, _size); APP_Rx_ptr_in += _size; } else { int freeSpace = APP_RX_DATA_SIZE - APP_Rx_ptr_in; memcpy(&APP_Rx_Buffer[APP_Rx_ptr_in], outData, freeSpace); APP_Rx_ptr_in = 0; memcpy(&APP_Rx_Buffer[APP_Rx_ptr_in], &outData[freeSpace], _size - freeSpace); APP_Rx_ptr_in += _size - freeSpace; } // APP_FOPS.pIf_DataTx((uint8_t*)outData, // paramSize+HEADER_SIZE+CHECK_SIZE); __enable_irq(); return paramSize + HEADER_SIZE + CHECK_SIZE; }
{ "content_hash": "c209740ace300e2919f197518684e294", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 118, "avg_line_length": 32.714285714285715, "alnum_prop": 0.5438360765871683, "repo_name": "SkRobo/Eurobot-2017", "id": "56b9f496a0bebcf65be2341ea675740ed2446111", "size": "3151", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "LowLevel/Small robot/Robot/Communication.c", "mode": "33261", "license": "mit", "language": [ { "name": "Assembly", "bytes": "305019" }, { "name": "C", "bytes": "35799707" }, { "name": "C++", "bytes": "434472" }, { "name": "Makefile", "bytes": "649383" }, { "name": "Python", "bytes": "1315596" } ], "symlink_target": "" }
package panda.interpreter.lexer; import org.jetbrains.annotations.Nullable; import panda.interpreter.source.Location; import panda.interpreter.token.Snippetable; import panda.interpreter.InterpreterFailure; import panda.interpreter.source.PandaIndicatedSource; import panda.interpreter.token.PandaToken; import panda.interpreter.token.PandaTokenInfo; import panda.interpreter.resource.syntax.TokenTypes; public final class PandaLexerFailure extends InterpreterFailure { public PandaLexerFailure(Snippetable line, Snippetable indicated, String message, @Nullable String note) { super(new PandaIndicatedSource(line, indicated), message, note); } public PandaLexerFailure(CharSequence line, CharSequence indicated, Location location, String message, @Nullable String note) { this(of(line, location), of(indicated, location), message, note); } private static Snippetable of(CharSequence content, Location location) { return new PandaTokenInfo(new PandaToken(TokenTypes.UNKNOWN, content.toString()), location); } }
{ "content_hash": "ba4c6ff5219a90382efc35064e43a343", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 131, "avg_line_length": 38.07142857142857, "alnum_prop": 0.7898686679174484, "repo_name": "Panda-Programming-Language/Panda", "id": "36ded77d7ba3b1601111214a6ca6faa2bc32152d", "size": "1661", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "panda-framework/src/main/java/panda/interpreter/lexer/PandaLexerFailure.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1465524" } ], "symlink_target": "" }
/**********************************************************\ | | | hprose | | | | Official WebSite: http://www.hprose.com/ | | http://www.hprose.org/ | | | \**********************************************************/ /**********************************************************\ * * * CalendarArrayUnserializer.java * * * * Calendar array unserializer class for Java. * * * * LastModified: Jun 24, 2015 * * Author: Ma Bingyao <[email protected]> * * * \**********************************************************/ package hprose.io.unserialize; import static hprose.io.HproseTags.TagList; import static hprose.io.HproseTags.TagNull; import static hprose.io.HproseTags.TagOpenbrace; import static hprose.io.HproseTags.TagRef; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Array; import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.util.Calendar; final class CalendarArrayUnserializer implements HproseUnserializer { public final static CalendarArrayUnserializer instance = new CalendarArrayUnserializer(); final static Calendar[] read(HproseReader reader, ByteBuffer buffer) throws IOException { int tag = buffer.get(); switch (tag) { case TagNull: return null; case TagList: { int count = ValueReader.readInt(buffer, TagOpenbrace); Calendar[] a = new Calendar[count]; reader.refer.set(a); for (int i = 0; i < count; ++i) { a[i] = CalendarUnserializer.read(reader, buffer); } buffer.get(); return a; } case TagRef: return (Calendar[])reader.readRef(buffer); default: throw ValueReader.castError(reader.tagToString(tag), Array.class); } } final static Calendar[] read(HproseReader reader, InputStream stream) throws IOException { int tag = stream.read(); switch (tag) { case TagNull: return null; case TagList: { int count = ValueReader.readInt(stream, TagOpenbrace); Calendar[] a = new Calendar[count]; reader.refer.set(a); for (int i = 0; i < count; ++i) { a[i] = CalendarUnserializer.read(reader, stream); } stream.read(); return a; } case TagRef: return (Calendar[])reader.readRef(stream); default: throw ValueReader.castError(reader.tagToString(tag), Array.class); } } public final Object read(HproseReader reader, ByteBuffer buffer, Class<?> cls, Type type) throws IOException { return read(reader, buffer); } public final Object read(HproseReader reader, InputStream stream, Class<?> cls, Type type) throws IOException { return read(reader, stream); } }
{ "content_hash": "a10ebd3919daae2dc4484a83b9eb9402", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 115, "avg_line_length": 41.95180722891566, "alnum_prop": 0.4681217690982194, "repo_name": "zijan/hprose-java", "id": "57a6df089d0e449e6503bd0e1669030b460afbe9", "size": "3482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/hprose/io/unserialize/CalendarArrayUnserializer.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4650" }, { "name": "HTML", "bytes": "660" }, { "name": "Java", "bytes": "979823" }, { "name": "Shell", "bytes": "2676" } ], "symlink_target": "" }
from __future__ import print_function from collections import defaultdict from luigi import six import luigi from luigi.contrib.ssh import RemoteContext, RemoteTarget from luigi.mock import MockFile SSH_HOST = "some.accessible.host" class CreateRemoteData(luigi.Task): """ Dump info on running processes on remote host. Data is still stored on the remote host """ def output(self): """ Returns the target output for this task. In this case, a successful execution of this task will create a file on a remote server using SSH. :return: the target output for this task. :rtype: object (:py:class:`~luigi.target.Target`) """ return RemoteTarget( "/tmp/stuff", SSH_HOST ) def run(self): remote = RemoteContext(SSH_HOST) print(remote.check_output([ "ps aux > {0}".format(self.output().path) ])) class ProcessRemoteData(luigi.Task): """ Create a toplist of users based on how many running processes they have on a remote machine. In this example the processed data is stored in a MockFile. """ def requires(self): """ This task's dependencies: * :py:class:`~.CreateRemoteData` :return: object (:py:class:`luigi.task.Task`) """ return CreateRemoteData() def run(self): processes_per_user = defaultdict(int) with self.input().open('r') as infile: for line in infile: username = line.split()[0] processes_per_user[username] += 1 toplist = sorted( six.iteritems(processes_per_user), key=lambda x: x[1], reverse=True ) with self.output().open('w') as outfile: for user, n_processes in toplist: print(n_processes, user, file=outfile) def output(self): """ Returns the target output for this task. In this case, a successful execution of this task will simulate the creation of a file in a filesystem. :return: the target output for this task. :rtype: object (:py:class:`~luigi.target.Target`) """ return MockFile("output", mirror_on_stderr=True)
{ "content_hash": "715a7f056875d5d39ed278811282994d", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 111, "avg_line_length": 27.829268292682926, "alnum_prop": 0.6016652059596845, "repo_name": "Viktor-Evst/fixed-luigi", "id": "384d213af68b7f98cede54ebdbf9e4594c40c0e9", "size": "2886", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "examples/ssh_remote_execution.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2162" }, { "name": "HTML", "bytes": "36680" }, { "name": "JavaScript", "bytes": "84223" }, { "name": "Python", "bytes": "1625261" }, { "name": "Shell", "bytes": "2627" } ], "symlink_target": "" }
<?php namespace Propel\Generator\Schema\Dumper; use Propel\Generator\Model\Database; use Propel\Generator\Model\Schema; interface DumperInterface { /** * Dumps a Database model into a text formatted version. * * @param \Propel\Generator\Model\Database $database The database model * * @return string The dumped formatted output (XML, YAML, CSV...) */ public function dump(Database $database): string; /** * Dumps a single Schema model into an XML formatted version. * * @param \Propel\Generator\Model\Schema $schema The schema model * @param bool $doFinalInitialization Whether to validate the schema * * @return string The dumped formatted output (XML, YAML, CSV...) */ public function dumpSchema(Schema $schema, bool $doFinalInitialization = true): string; }
{ "content_hash": "3b00d887442ce0d6f0dfb5ac94a1abf0", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 91, "avg_line_length": 28.266666666666666, "alnum_prop": 0.6863207547169812, "repo_name": "cristianoc72/Propel2", "id": "b7a96182ee68bbdcf479273b10f9b6108fa94242", "size": "1039", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Propel/Generator/Schema/Dumper/DumperInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2984" }, { "name": "Hack", "bytes": "1134" }, { "name": "PHP", "bytes": "5235752" }, { "name": "Shell", "bytes": "3524" }, { "name": "XSLT", "bytes": "74531" } ], "symlink_target": "" }
<?xml version="1.0"?> <!-- 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. See accompanying LICENSE file. --> <configuration> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration>
{ "content_hash": "000b1ced505838f78fe6e5568f411a33", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 37.3, "alnum_prop": 0.7453083109919572, "repo_name": "qnib/docker-samza-mono", "id": "20f7f85a1a4033afd73fbc9d6fa245a645085fb6", "size": "746", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "opt/hadoop/etc/hadoop/yarn-site.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "1539" }, { "name": "Shell", "bytes": "12054" } ], "symlink_target": "" }
using System.Collections.Generic; namespace Excel.Core.BinaryFormat { /// <summary> /// Represents Globals section of workbook /// </summary> internal class XlsWorkbookGlobals { private readonly List<XlsBiffRecord> m_ExtendedFormats = new List<XlsBiffRecord>(); private readonly List<XlsBiffRecord> m_Fonts = new List<XlsBiffRecord>(); private readonly Dictionary<ushort, XlsBiffFormatString> m_Formats = new Dictionary<ushort, XlsBiffFormatString>(); private readonly List<XlsBiffBoundSheet> m_Sheets = new List<XlsBiffBoundSheet>(); private readonly List<XlsBiffRecord> m_Styles = new List<XlsBiffRecord>(); private XlsBiffSimpleValueRecord m_Backup; private XlsBiffSimpleValueRecord m_CodePage; private XlsBiffRecord m_Country; private XlsBiffRecord m_DSF; private XlsBiffRecord m_ExtSST; private XlsBiffInterfaceHdr m_InterfaceHdr; private XlsBiffRecord m_MMS; private XlsBiffSST m_SST; private XlsBiffRecord m_WriteAccess; public XlsBiffInterfaceHdr InterfaceHdr { get { return m_InterfaceHdr; } set { m_InterfaceHdr = value; } } public XlsBiffRecord MMS { get { return m_MMS; } set { m_MMS = value; } } public XlsBiffRecord WriteAccess { get { return m_WriteAccess; } set { m_WriteAccess = value; } } public XlsBiffSimpleValueRecord CodePage { get { return m_CodePage; } set { m_CodePage = value; } } public XlsBiffRecord DSF { get { return m_DSF; } set { m_DSF = value; } } public XlsBiffRecord Country { get { return m_Country; } set { m_Country = value; } } public XlsBiffSimpleValueRecord Backup { get { return m_Backup; } set { m_Backup = value; } } public List<XlsBiffRecord> Fonts { get { return m_Fonts; } } public Dictionary<ushort, XlsBiffFormatString> Formats { get { return m_Formats; } } public List<XlsBiffRecord> ExtendedFormats { get { return m_ExtendedFormats; } } public List<XlsBiffRecord> Styles { get { return m_Styles; } } public List<XlsBiffBoundSheet> Sheets { get { return m_Sheets; } } /// <summary> /// Shared String Table of workbook /// </summary> public XlsBiffSST SST { get { return m_SST; } set { m_SST = value; } } public XlsBiffRecord ExtSST { get { return m_ExtSST; } set { m_ExtSST = value; } } } }
{ "content_hash": "6e6d8723f0542deeb0fca390edddc28b", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 123, "avg_line_length": 22.36036036036036, "alnum_prop": 0.6482675261885577, "repo_name": "rishios/ExcelBatchReader", "id": "76f07b4e0eb88cfb73ef8b8066017b97156e01d0", "size": "2482", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Excel/Core/BinaryFormat/XlsWorkbookGlobals.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "2979" }, { "name": "Batchfile", "bytes": "1934" }, { "name": "C#", "bytes": "530174" }, { "name": "HTML", "bytes": "2914" } ], "symlink_target": "" }
/** * */ package com.dale.ms.utils; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; /** * @author Dale' * @date 2016-3-8 下午12:56:20 * @description */ public class AlgorithmUtil { public final static String ENCODING = "UTF-8"; /** * md5加密算法 * * @param plainText * 需要加密的字符串 * @return md5 加密后的字符串 */ public static String Md5(String plainText) { StringBuffer buf = new StringBuffer(""); try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(plainText.getBytes()); byte b[] = md.digest(); int i; for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } } catch (NoSuchAlgorithmException e) { MyLogUtil.error("MD5 算法包未找到异常"); e.printStackTrace(); } return buf.toString(); } }
{ "content_hash": "f9b70bb321b93ddd48e703f4e09202de", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 55, "avg_line_length": 19.229166666666668, "alnum_prop": 0.6164680390032503, "repo_name": "noob/HousingMarket-Server", "id": "201ffd916fa5fbb24341e25dbd6c522c4088b95d", "size": "981", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/dale/ms/utils/AlgorithmUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2449124" }, { "name": "HTML", "bytes": "3457026" }, { "name": "Java", "bytes": "770543" }, { "name": "JavaScript", "bytes": "5115486" }, { "name": "Makefile", "bytes": "285" }, { "name": "PHP", "bytes": "7937" }, { "name": "Ruby", "bytes": "3879" }, { "name": "Shell", "bytes": "680" } ], "symlink_target": "" }
var fs = require('fs'); var async = require('async'); var misc = require('./misc'); var sprintf = require('./sprintf'); function knife(args, options) { return function(callback) { var env = misc.copyEnv(); var knife_path = '/usr/bin/knife'; options = options || {}; // Support for these must be implemented in your knife.rb if (options.server) { env['CHEF_URL'] = options.server; } if (options.user) { env['CHEF_USER'] = options.user; } if (env['KNIFE_PATH']) { knife_path = env['KNIFE_PATH']; } else if (options.knife_path) { knife_path = options.knife_path; } if (options.knife_config) { args = args.concat(['-c', options.knife_config]); } args = [knife_path].concat(args); misc.spawn(args, {env: env}, function(err, stdout, stderr) { var payload; if (err) { callback(err); return; } if (args.indexOf('json') >= 0) { try { payload = JSON.parse(stdout); } catch (e) { callback(e); return; } } callback(null, payload); }); }; } function knifeSearch(index, query, options, callback) { if (!callback) { callback = options; options = null; } knife(['search', index, query, '-F', 'json'], options)(callback); } function dataBagGet(bagName, item, options, callback) { if (!callback) { callback = options; options = null; } knife(['data', 'bag', 'show', '-F', 'json', bagName, item], options)(callback); } function dataBagFromFile(bagName, fileName, options, callback) { if (!callback) { callback = options; options = null; } knife(['data', 'bag', 'from', 'file', bagName, fileName], options)(callback); } function dataBagSet(bagName, obj, options, callback) { if (!callback) { callback = options; options = null; } var filename = sprintf('/tmp/databag-%s.json', misc.randstr(8)); async.series([ fs.writeFile.bind(null, filename, JSON.stringify(obj)), dataBagFromFile.bind(null, bagName, filename, options), fs.unlink.bind(null, filename) ], callback); } function knifeNodeList(options, callback) { if (!callback) { callback = options; options = null; } knife(['node', 'list', '-F', 'json'], options)(callback); } function queryAndRun(baton, args, query, cmd, msg, options, callback) { if (!callback) { callback = options; options = null; } var parallelLimitFunc, stopOnFailure, getHostParams; parallelLimitFunc = options && options.parallelLimitFunc || null; stopOnFailure = !!parallelLimitFunc; getHostParams = options && options.getHostParams ? options.getHostParams : function(hostObj) { return { ip: hostObj.automatic.ipaddress }; }; query = sprintf(query, args); function execute(hostObj, callback) { var name = hostObj.name, hostParams, curCmd; try { hostParams = getHostParams(hostObj); } catch (e) { baton.log.errorf('error retrieving host parameters for ${name}: ${err}', { name: hostObj.name, err: e }); if (stopOnFailure) { callback(e); } else { callback(null, e); } return; } function onComplete(err) { if (!err) { baton.log.infof(msg, misc.merge({name: name}, hostParams)); } if (stopOnFailure) { callback(err); } else { // Do not short circuit on error callback(null, err); } } if (typeof cmd === 'function') { cmd(hostObj, onComplete); } else { curCmd = cmd.map(function(arg) { return sprintf(arg, misc.merge(args, hostParams)); }); misc.taskSpawn(baton, args, curCmd, null, onComplete); } } baton.log.infof('searching for nodes: ${query}', { query: query }); exports.search('node', query, options, function(err, results) { if (err) { callback(err); return; } baton.log.infof('found ${length} nodes', { length: results.rows.length }); var eachFunc, eachFuncCallback; eachFunc = async.map; eachFuncCallback = function(err, errors) { // note, err is unused here. async will short circuit when err is passed, // and legacy functionality is to run cmd against every host, regardless // of errors. var failed = errors.filter(function(err) { return err; }).length; if (failed > 0) { baton.log.errorf('${type} failed on ${failed} out of ${length} nodes', { type: (typeof cmd === 'function') ? 'function' : 'command', failed: failed, length: results.rows.length }); callback(new Error('queryAndRun failed')); } else { callback(); } }; if (parallelLimitFunc) { eachFunc = function(arr, iterator, callback) { async.forEachLimit(arr, parallelLimitFunc(arr.length), iterator, callback); }; eachFuncCallback = function(err) { if (err) { baton.log.errorf('${type} failed on a node. Not running it against any more nodes', { type: (typeof cmd === 'function') ? 'function' : 'command', error: err }); callback(new Error('queryAndRun failed')); } else { callback(); } }; } eachFunc(results.rows, execute, eachFuncCallback); }); } /** Export Data Bag */ exports.dataBag = { 'set': dataBagSet, 'get': dataBagGet, 'setFromFile': dataBagFromFile }; /** Export Search */ exports.search = knifeSearch; /** Export Node */ exports.node = { list: knifeNodeList }; /** Export queryAndRun */ exports.queryAndRun = queryAndRun;
{ "content_hash": "8a968ccdc9201be70a400458576f5afa", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 96, "avg_line_length": 22.995983935742974, "alnum_prop": 0.5820817324484806, "repo_name": "ebensing/dreadnot", "id": "5698319b08d2702a0c3bed433c3207e6fe50df1b", "size": "6331", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/util/knife.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "49075" }, { "name": "HTML", "bytes": "7791" }, { "name": "JavaScript", "bytes": "150194" }, { "name": "Makefile", "bytes": "31" }, { "name": "Shell", "bytes": "910" } ], "symlink_target": "" }
package org.openshift.webservice; import java.util.ArrayList; import javax.enterprise.context.RequestScoped; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import org.openshift.haproxy.Gear; import org.openshift.haproxy.GearParser; @RequestScoped @Path("/gears") public class GearWS { //get all the gears for an application @GET() @Produces("application/json") public ArrayList<Gear> getAllGears(String appDNS){ String URL = new String("http://" + appDNS + "/haproxy-status/;csv"); ArrayList<Gear> gears = new ArrayList<Gear>(); GearParser gearParser = new GearParser(URL); gears = gearParser.getGears(); return (gears); } /****** Just for testing purposes ***********/ @GET() @Path("/test") @Produces("application/json") public ArrayList<Gear> sayHello() { String URL = new String("http://" + System.getenv("OPENSHIFT_APP_DNS") + "/haproxy-status/;csv"); System.out.println("URL: " + URL); ArrayList<Gear> gears = new ArrayList<Gear>(); GearParser gearParser = new GearParser(URL); gears = gearParser.getGears(); return (gears); } }
{ "content_hash": "0d96e33236931541fd2c777a90c5fa24", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 99, "avg_line_length": 24.434782608695652, "alnum_prop": 0.6903914590747331, "repo_name": "ryanj/targetlocations", "id": "e297df03b9bf41729cb9481d1c8370be44e3469c", "size": "1124", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/org/openshift/webservice/GearWS.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "928" }, { "name": "Java", "bytes": "12387" }, { "name": "Shell", "bytes": "1705" } ], "symlink_target": "" }
// Copyright 2009 Google Inc. All Rights Reserved. package com.google.devtools.simple.runtime.components.android; import com.google.devtools.simple.common.ComponentCategory; import com.google.devtools.simple.common.PropertyCategory; import com.google.devtools.simple.common.YaVersion; import com.google.devtools.simple.runtime.Dates; import com.google.devtools.simple.runtime.annotations.DesignerComponent; import com.google.devtools.simple.runtime.annotations.DesignerProperty; import com.google.devtools.simple.runtime.annotations.SimpleEvent; import com.google.devtools.simple.runtime.annotations.SimpleFunction; import com.google.devtools.simple.runtime.annotations.SimpleObject; import com.google.devtools.simple.runtime.annotations.SimpleProperty; import com.google.devtools.simple.runtime.components.AlarmHandler; import com.google.devtools.simple.runtime.components.Component; import com.google.devtools.simple.runtime.components.android.util.TimerInternal; import com.google.devtools.simple.runtime.errors.YailRuntimeError; import com.google.devtools.simple.runtime.events.EventDispatcher; import java.util.Calendar; /** * Clock provides the phone's clock, a timer, calendar and time calculations. * Everything is represented in milliseconds. * */ @DesignerComponent(version = YaVersion.CLOCK_COMPONENT_VERSION, description = "Non-visible component that provides the phone's clock, a timer, and " + "time calculations.", category = ComponentCategory.BASIC, nonVisible = true, iconName = "images/clock.png") @SimpleObject public final class Clock extends AndroidNonvisibleComponent implements Component, AlarmHandler, OnStopListener, OnResumeListener, Deleteable { private TimerInternal timerInternal; private boolean timerAlwaysFires = true; private boolean onScreen = false; /** * Creates a new Clock component. * * @param container ignored (because this is a non-visible component) */ public Clock(ComponentContainer container) { super(container.$form()); timerInternal = new TimerInternal(this); // Set up listeners form.registerForOnResume(this); form.registerForOnStop(this); } // Only the above constructor should be used in practice. public Clock() { super(null); // To allow testing without Timer } /** * Default Timer event handler. */ @SimpleEvent( description = "Timer has gone off.") public void Timer() { if (timerAlwaysFires || onScreen) { EventDispatcher.dispatchEvent(this, "Timer"); } } /** * Interval property getter method. * * @return timer interval in ms */ @SimpleProperty( category = PropertyCategory.BEHAVIOR) public int TimerInterval() { return timerInternal.Interval(); } /** * Interval property setter method: sets the interval between timer events. * * @param interval timer interval in ms */ @DesignerProperty(editorType = DesignerProperty.PROPERTY_TYPE_INTEGER, defaultValue = "1000") @SimpleProperty public void TimerInterval(int interval) { timerInternal.Interval(interval); } /** * Enabled property getter method. * * @return {@code true} indicates a running timer, {@code false} a stopped * timer */ @SimpleProperty( category = PropertyCategory.BEHAVIOR) public boolean TimerEnabled() { return timerInternal.Enabled(); } /** * Enabled property setter method: starts or stops the timer. * * @param enabled {@code true} starts the timer, {@code false} stops it */ @DesignerProperty(editorType = DesignerProperty.PROPERTY_TYPE_BOOLEAN, defaultValue = "True") @SimpleProperty public void TimerEnabled(boolean enabled) { timerInternal.Enabled(enabled); } /** * TimerAlwaysFires property getter method. * * return {@code true} if the timer event will fire even if the application * is not on the screen */ @SimpleProperty( category = PropertyCategory.BEHAVIOR) public boolean TimerAlwaysFires() { return timerAlwaysFires; } /** * TimerAlwaysFires property setter method: instructs when to disable * * @param always {@code true} if the timer event should fire even if the * application is not on the screen */ @DesignerProperty(editorType = DesignerProperty.PROPERTY_TYPE_BOOLEAN, defaultValue = "True") @SimpleProperty public void TimerAlwaysFires(boolean always) { timerAlwaysFires = always; } // AlarmHandler implementation @Override public void alarm() { Timer(); } /** * Returns the current system time in milliseconds. * * @return current system time in milliseconds */ @SimpleFunction (description = "The phone's internal time") public static long SystemTime() { return Dates.Timer(); } @SimpleFunction(description = "The instant in time read from phone's clock") public static Calendar Now() { return Dates.Now(); } /** * An instant in time specified by MM/DD/YYYY hh:mm:ss or MM/DD/YYYY or hh:mm * where MM is the month (01-12), DD the day (01-31), YYYY the year * (0000-9999), hh the hours (00-23), mm the minutes (00-59) and ss * the seconds (00-59). * * @param from string to convert * @return date */ @SimpleFunction( description = "An instant specified by MM/DD/YYYY hh:mm:ss or MM/DD/YYYY or hh:mm") public static Calendar MakeInstant(String from) { try { return Dates.DateValue(from); } catch (IllegalArgumentException e) { throw new YailRuntimeError( "Argument to MakeInstant should have form MM/DD/YYYY, hh:mm:ss, or MM/DD/YYYY or hh:mm", "Sorry to be so picky."); } } /** * Create an Calendar from ms since 1/1/1970 00:00:00.0000 * Probably should go in Calendar. * * @param millis raw millisecond number. */ @SimpleFunction(description = "An instant in time specified by the milliseconds since 1970.") public static Calendar MakeInstantFromMillis(long millis) { Calendar instant = Dates.Now(); // just to get our hands on an instant instant.setTimeInMillis(millis); return instant; } /** * Calendar property getter method: gets the raw millisecond representation of * a Calendar. * @param instant Calendar * @return milliseconds since 1/1/1970. */ @SimpleFunction (description = "The instant in time measured as milliseconds since 1970.") public static long GetMillis(Calendar instant) { return instant.getTimeInMillis(); } @SimpleFunction(description = "An instant in time some seconds after the argument") public static Calendar AddSeconds(Calendar instant, int seconds) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.SECOND, seconds); return newInstant; } @SimpleFunction(description = "An instant in time some minutes after the argument") public static Calendar AddMinutes(Calendar instant, int minutes) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.MINUTE, minutes); return newInstant; } @SimpleFunction(description = "An instant in time some hours after the argument") public static Calendar AddHours(Calendar instant, int hours) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.HOUR_OF_DAY, hours); return newInstant; } @SimpleFunction(description = "An instant in time some days after the argument") public static Calendar AddDays(Calendar instant, int days) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.DATE, days); return newInstant; } @SimpleFunction(description = "An instant in time some weeks after the argument") public static Calendar AddWeeks(Calendar instant, int weeks) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.WEEK_OF_YEAR, weeks); return newInstant; } @SimpleFunction(description = "An instant in time some months after the argument") public static Calendar AddMonths(Calendar instant, int months) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.MONTH, months); return newInstant; } @SimpleFunction(description = "An instant in time some years after the argument") public static Calendar AddYears(Calendar instant, int years) { Calendar newInstant = (Calendar) instant.clone(); Dates.DateAdd(newInstant, Calendar.YEAR, years); return newInstant; } /** * Returns the milliseconds by which end follows start (+ or -) * * @param start beginning instant * @param end ending instant * @return milliseconds */ @SimpleFunction (description = "Milliseconds between instants") public static long Duration(Calendar start, Calendar end) { return end.getTimeInMillis() - start.getTimeInMillis(); } /** * Returns the seconds for the given instant. * * @param instant instant to use seconds of * @return seconds (range 0 - 59) */ @SimpleFunction (description = "The second of the minute") public static int Second(Calendar instant) { return Dates.Second(instant); } /** * Returns the minutes for the given date. * * @param instant instant to use minutes of * @return minutes (range 0 - 59) */ @SimpleFunction(description = "The minute of the hour") public static int Minute(Calendar instant) { return Dates.Minute(instant); } /** * Returns the hours for the given date. * * @param instant Calendar to use hours of * @return hours (range 0 - 23) */ @SimpleFunction (description = "The hour of the day") public static int Hour(Calendar instant) { return Dates.Hour(instant); } /** * Returns the day of the month. * * @param instant instant to use day of the month of * @return day: [1...31] */ @SimpleFunction (description = "The day of the month") public static int DayOfMonth(Calendar instant) { return Dates.Day(instant); } /** * Returns the weekday for the given instant. * * @param instant instant to use day of week of * @return day of week: [1...7] starting with Sunday */ @SimpleFunction (description = "The day of the week. a number from 1 (Sunday) to 7 (Saturday)") public static int Weekday(Calendar instant) { return Dates.Weekday(instant); } /** * Returns the name of the weekday for the given instant. * * @param instant instant to use weekday of * @return weekday, as a string. */ @SimpleFunction (description = "The name of the day of the week") public static String WeekdayName(Calendar instant) { return Dates.WeekdayName(instant); } /** * Returns the number of the month for the given instant. * * @param instant instant to use month of * @return number of month */ @SimpleFunction (description = "The month of the year, a number from 1 to 12)") public static int Month(Calendar instant) { return Dates.Month(instant) + 1; } /** * Returns the name of the month for the given instant. * * @param instant instant to use month of * @return name of month */ @SimpleFunction (description = "The name of the month") public static String MonthName(Calendar instant) { return Dates.MonthName(instant); } /** * Returns the year of the given instant. * * @param instant instant to use year of * @return year */ @SimpleFunction(description = "The year") public static int Year(Calendar instant) { return Dates.Year(instant); } /** * Converts and formats the given instant into a string. * * * @param instant instant to format * @return formatted instant */ @SimpleFunction (description = "Text describing the date and time of an instant") public static String FormatDateTime(Calendar instant) { return Dates.FormatDateTime(instant); } /** * Converts and formats the given instant into a string. * * @param instant instant to format * @return formatted instant */ @SimpleFunction (description = "Text describing the date of an instant") public static String FormatDate(Calendar instant) { return Dates.FormatDate(instant); } /** * Converts and formats the given instant into a string. * * @param instant instant to format * @return formatted instant */ @SimpleFunction (description = "Text describing time time of an instant") public static String FormatTime(Calendar instant) { return Dates.FormatTime(instant); } @Override public void onStop() { onScreen = false; } @Override public void onResume() { onScreen = true; } @Override public void onDelete() { timerInternal.Enabled(false); } }
{ "content_hash": "c8500528cae0e24ef32087aab4abcfaa", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 98, "avg_line_length": 30.595693779904305, "alnum_prop": 0.7011494252873564, "repo_name": "mark-friedman/app-inventor-from-google-code", "id": "8ab9a3d412a6999fd8ec44299eb4cf3b81c38ea1", "size": "12789", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/components/runtime/components/android/Clock.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "886851" }, { "name": "Python", "bytes": "271878" } ], "symlink_target": "" }
An extension for UIViewController that lets it get the top most view controller being presented.
{ "content_hash": "b378ad4e9ce00e176abb39135eb12583", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 96, "avg_line_length": 97, "alnum_prop": 0.8350515463917526, "repo_name": "vitormf/UIViewController-TopViewController", "id": "da70704fc74688ed124bad56dec4bb81ee4166ea", "size": "134", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "13764" }, { "name": "Ruby", "bytes": "592" } ], "symlink_target": "" }
package org.springframework.polyglot.pl.beans.factory.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.AliasFor; /** * Polska wersia dla {@link Autowired @Autowired}. * * @author Mark Przemysław Paluch * @since 1.0 */ @Autowired @Target({ ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface AutomatycznieZakablowanie { @AliasFor(annotation = Autowired.class, attribute = "required") boolean potrzebne() default true; }
{ "content_hash": "a906eb91289938b6e74a2515c6f53d50", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 104, "avg_line_length": 28, "alnum_prop": 0.8017241379310345, "repo_name": "sbrannen/spring-polyglot", "id": "47a95f6ca7e40d9a7922e3600097d87867d23e6c", "size": "1433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/springframework/polyglot/pl/beans/factory/annotation/AutomatycznieZakablowanie.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "44820" } ], "symlink_target": "" }
package org.pac4j.oidc.client.azuread; import java.io.IOException; import java.net.URL; import com.nimbusds.jose.util.DefaultResourceRetriever; import com.nimbusds.jose.util.Resource; import com.nimbusds.jose.util.ResourceRetriever; /** * Specialized ResourceRetriever which escapes a possibly invalid issuer URI. * * @author Emond Papegaaij * @since 1.8.3 */ public class AzureAdResourceRetriever extends DefaultResourceRetriever implements ResourceRetriever { @Override public Resource retrieveResource(final URL url) throws IOException { final Resource ret = super.retrieveResource(url); return new Resource(ret.getContent().replace("{tenantid}", "%7Btenantid%7D"), ret.getContentType()); } }
{ "content_hash": "cd04c26d54a7def75df9395a65da6c33", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 108, "avg_line_length": 33.31818181818182, "alnum_prop": 0.7653478854024557, "repo_name": "zawn/pac4j", "id": "a7fd5adc7e44e5246980e9fdc37a082154c9763f", "size": "733", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "pac4j-oidc/src/main/java/org/pac4j/oidc/client/azuread/AzureAdResourceRetriever.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1980245" }, { "name": "Shell", "bytes": "2446" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "e83afb638226b5f907f5d5fb7e0453bb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7436ee2cfb1a9c2316eecc0706499a3abdbbae0b", "size": "179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Ranunculales/Papaveraceae/Cryptoceras/Cryptoceras pulchellum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
require 'bunny' require 'pp' require 'yaml' require 'json' class MQServer attr_accessor :url QUEUE = 'service.instances.create' def initialize(url,logger) @url = url @logger=logger @channel = Bunny.new(url,:automatically_recover => false).start.create_channel @topic = @channel.topic("son-kernel", :auto_delete => false) @queue = @channel.queue(QUEUE, :auto_delete => true).bind(@topic, :routing_key => QUEUE) self.consume end def publish(msg, correlation_id) logmsg= 'MQServer.publish' @logger.debug(logmsg) {"msg="+msg+", correlation_id="+correlation_id} @topic.publish(msg, :content_type =>'text/yaml', :routing_key => QUEUE, :correlation_id => correlation_id, :reply_to => @queue.name, :app_id => 'son-gkeeper') @logger.debug(logmsg) {"published msg '"+msg+"', with correlation_id="+correlation_id} end def consume logmsg= 'MQServer.consume' @logger.debug(logmsg) {" entered"} @queue.subscribe do |delivery_info, properties, payload| begin @logger.debug(logmsg) { "delivery_info: #{delivery_info}"} @logger.debug(logmsg) { "properties: #{properties}"} @logger.debug(logmsg) { "payload: #{payload}"} # We know our own messages, so just skip them unless properties[:app_id] == 'son-gkeeper' # We're interested in app_id == 'son-plugin.slm' parsed_payload = YAML.load(payload) @logger.debug(logmsg) { "parsed_payload: #{parsed_payload}"} status = parsed_payload['status'] if status @logger.debug(logmsg) { "status: #{status}"} request = Request.find_by(id: properties[:correlation_id]) if request @logger.debug(logmsg) { "request['status'] #{request['status']} turned into "+status} request['status']=status # if this is a final answer, there'll be an NSR service_instance = parsed_payload['nsr'] if service_instance && service_instance.key?('id') service_instance_uuid = parsed_payload['nsr']['id'] @logger.debug(logmsg) { "request['service_instance_uuid'] turned into "+service_instance_uuid} request['service_instance_uuid'] = service_instance_uuid end begin request.save @logger.debug(logmsg) { "request saved"} rescue Exception => e @logger.error e.message @logger.error e.backtrace.inspect end else @logger.error(logmsg) { "request "+properties[:correlation_id]+" not found"} end else @logger.error(logmsg) {'status not present'} end end @logger.debug(logmsg) {" leaving..."} rescue Exception => e @logger.error e.message @logger.error e.backtrace.inspect @logger.debug(logmsg) {" leaving..."} end end end end
{ "content_hash": "cdea629d80e8acecd31f5bd8c3fbd916", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 111, "avg_line_length": 38.164556962025316, "alnum_prop": 0.5824212271973466, "repo_name": "alfonsoegio/son-gkeeper", "id": "3e77ef0aff23b45376b4dfdd1d2cb7765ab54341", "size": "4268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "son-gtksrv/models/mq_server.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "53312" }, { "name": "Mako", "bytes": "412" }, { "name": "Python", "bytes": "20258" }, { "name": "Ruby", "bytes": "546633" }, { "name": "Shell", "bytes": "6699" } ], "symlink_target": "" }
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="TbSysQfieldLog"> <resultMap type="org.qifu.po.TbSysQfieldLog" id="baseResultMap"> <id column="OID" property="oid"/> <result column="SYSTEM" property="system"/> <result column="PROG_ID" property="progId"/> <result column="METHOD_NAME" property="methodName"/> <result column="FIELD_NAME" property="fieldName"/> <result column="FIELD_VALUE" property="fieldValue"/> <result column="QUERY_USER_ID" property="queryUserId"/> <result column="CUSERID" property="cuserid"/> <result column="CDATE" property="cdate"/> <result column="UUSERID" property="uuserid"/> <result column="UDATE" property="udate"/> </resultMap> <select id="selectByParams" resultMap="baseResultMap" > select * from tb_sys_qfield_log where 1=1 <if test="oid != null"> AND OID = #{oid} </if> <if test="system != null"> AND SYSTEM = #{system} </if> <if test="progId != null"> AND PROG_ID = #{progId} </if> <if test="queryUserId != null"> AND QUERY_USER_ID = #{queryUserId} </if> </select> <select id="selectByValue" resultMap="baseResultMap" > select * from tb_sys_qfield_log where 1=1 <if test="oid != null"> AND OID = #{oid} </if> <if test="system != null"> AND SYSTEM = #{system} </if> <if test="progId != null"> AND PROG_ID = #{progId} </if> <if test="queryUserId != null"> AND QUERY_USER_ID = #{queryUserId} </if> </select> </mapper>
{ "content_hash": "45b80479f91acc193155243c1e0041f9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 65, "avg_line_length": 30.30188679245283, "alnum_prop": 0.6114570361145704, "repo_name": "billchen198318/qifu", "id": "a3fe47d5b15be8d1cdbb2477bec73fd1e07be008", "size": "1606", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core-base/resource/mappers/TbSysQfieldLog.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "196" }, { "name": "CSS", "bytes": "299475" }, { "name": "FreeMarker", "bytes": "11626" }, { "name": "Groovy", "bytes": "3813" }, { "name": "HTML", "bytes": "361731" }, { "name": "Java", "bytes": "1865080" }, { "name": "JavaScript", "bytes": "386638" }, { "name": "Shell", "bytes": "246" }, { "name": "Stata", "bytes": "250" } ], "symlink_target": "" }
namespace BullsAndCows.Web.Api.Models.Guesses { using System; using AutoMapper; using Data.Models; using Infrastructure.Mappings; public class GuessDetailsResponseModel : IMapFrom<Guess>, IHaveCustomMappings { public int Id { get; set; } public string UserId { get; set; } public string Username { get; set; } public int GameId { get; set; } public string Number { get; set; } public DateTime DateMade { get; set; } public int CowsCount { get; set; } public int BullsCount { get; set; } public void CreateMappings(IConfiguration configuration) { Mapper.CreateMap<Guess, GuessDetailsResponseModel>() .ForMember(g => g.Username, opts => opts.MapFrom(g => g.User.Email)); } } }
{ "content_hash": "ac507c75bbfbed4bd5d25178177113de", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 85, "avg_line_length": 25.90625, "alnum_prop": 0.6103739445114595, "repo_name": "vasilevhr/BullsAndCows-WebApi", "id": "bf94f38478278e89b18d22fc001e5a5c71a5e925", "size": "831", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BullsAndCows/Web/BullsAndCows.Web.Api/Models/Guesses/GuessDetailsResponseModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "114" }, { "name": "C#", "bytes": "212184" }, { "name": "CSS", "bytes": "2626" }, { "name": "JavaScript", "bytes": "10918" } ], "symlink_target": "" }
int Vendedor::total = 0; vector<Vendedor*> vendedores; Vendedor::Vendedor() { cout << "unidade de trabalho: "; cin >> unidadeDeTrabalho; getchar(); comissao = 0; setId(total++); } Vendedor::~Vendedor() { unidadeDeTrabalho = ""; comissao = 0; total--; } string Vendedor::getUnidadeDeTrabalho() const { return unidadeDeTrabalho; } void Vendedor::setUnidadeDeTrabalho(const string &value) { unidadeDeTrabalho = value; } float Vendedor::getComissao() const { return comissao; } void Vendedor::setComissao(float value) { comissao = value; } int Vendedor::getTotal() { return total; } void Vendedor::print() { Funcionario::print(); } void Vendedor::print_details() { Funcionario::print_details(); cout << "unidade de trabalho: " << unidadeDeTrabalho << endl; cout << "comissao: " << comissao << endl; }
{ "content_hash": "fe2805fdd7d4b111210d12ac98ba4c0f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 65, "avg_line_length": 14.88135593220339, "alnum_prop": 0.6469248291571754, "repo_name": "VitorDiToro/EC206-EngenhariaDeSoftware2", "id": "ffce1c8de8ac9fb6110f2b517176171222651c6d", "size": "938", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SIF_CONSOLE/Model/Vendedor.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "412" }, { "name": "C++", "bytes": "114901" }, { "name": "QMake", "bytes": "4172" } ], "symlink_target": "" }
// This code is auto-generated, do not modify using Ds3.Calls; using Ds3.Models; using Ds3.Runtime; using System.Linq; using System.Net; using System.Xml.Linq; namespace Ds3.ResponseParsers { internal class GetTapePartitionFailuresSpectraS3ResponseParser : IResponseParser<GetTapePartitionFailuresSpectraS3Request, GetTapePartitionFailuresSpectraS3Response> { public GetTapePartitionFailuresSpectraS3Response Parse(GetTapePartitionFailuresSpectraS3Request request, IWebResponse response) { using (response) { ResponseParseUtilities.HandleStatusCode(response, (HttpStatusCode)200); using (var stream = response.GetResponseStream()) { return new GetTapePartitionFailuresSpectraS3Response( ModelParsers.ParseTapePartitionFailureList( XmlExtensions.ReadDocument(stream).ElementOrThrow("Data")), ResponseParseUtilities.ParseIntHeader("page-truncated", response.Headers), ResponseParseUtilities.ParseIntHeader("total-result-count", response.Headers) ); } } } } }
{ "content_hash": "d47ae063381dd4057c70c5373dfe1984", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 169, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6561488673139159, "repo_name": "SpectraLogic/ds3_net_sdk", "id": "3b098aacdb9d69765972d009b7e2f25a7f718f90", "size": "1993", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Ds3/ResponseParsers/GetTapePartitionFailuresSpectraS3ResponseParser.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "617" }, { "name": "C#", "bytes": "3680393" }, { "name": "Dockerfile", "bytes": "162" }, { "name": "Makefile", "bytes": "657" }, { "name": "Ruby", "bytes": "2446" }, { "name": "Shell", "bytes": "453" } ], "symlink_target": "" }
package org.elasticsearch.common.geo.builders; import org.elasticsearch.common.geo.GeoShapeType; import org.elasticsearch.common.geo.parsers.GeoWKTParser; import org.elasticsearch.common.geo.parsers.ShapeParser; import org.locationtech.spatial4j.shape.Rectangle; import com.vividsolutions.jts.geom.Coordinate; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; public class EnvelopeBuilder extends ShapeBuilder<Rectangle, EnvelopeBuilder> { public static final GeoShapeType TYPE = GeoShapeType.ENVELOPE; private final Coordinate topLeft; private final Coordinate bottomRight; /** * Build an envelope from the top left and bottom right coordinates. */ public EnvelopeBuilder(Coordinate topLeft, Coordinate bottomRight) { Objects.requireNonNull(topLeft, "topLeft of envelope cannot be null"); Objects.requireNonNull(bottomRight, "bottomRight of envelope cannot be null"); if (Double.isNaN(topLeft.z) != Double.isNaN(bottomRight.z)) { throw new IllegalArgumentException("expected same number of dimensions for topLeft and bottomRight"); } this.topLeft = topLeft; this.bottomRight = bottomRight; } /** * Read from a stream. */ public EnvelopeBuilder(StreamInput in) throws IOException { topLeft = readFromStream(in); bottomRight = readFromStream(in); } @Override public void writeTo(StreamOutput out) throws IOException { writeCoordinateTo(topLeft, out); writeCoordinateTo(bottomRight, out); } public Coordinate topLeft() { return this.topLeft; } public Coordinate bottomRight() { return this.bottomRight; } @Override protected StringBuilder contentToWKT() { StringBuilder sb = new StringBuilder(); sb.append(GeoWKTParser.LPAREN); // minX, maxX, maxY, minY sb.append(topLeft.x); sb.append(GeoWKTParser.COMMA); sb.append(GeoWKTParser.SPACE); sb.append(bottomRight.x); sb.append(GeoWKTParser.COMMA); sb.append(GeoWKTParser.SPACE); // TODO support Z?? sb.append(topLeft.y); sb.append(GeoWKTParser.COMMA); sb.append(GeoWKTParser.SPACE); sb.append(bottomRight.y); sb.append(GeoWKTParser.RPAREN); return sb; } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(ShapeParser.FIELD_TYPE.getPreferredName(), TYPE.shapeName()); builder.startArray(ShapeParser.FIELD_COORDINATES.getPreferredName()); toXContent(builder, topLeft); toXContent(builder, bottomRight); builder.endArray(); return builder.endObject(); } @Override public Rectangle build() { return SPATIAL_CONTEXT.makeRectangle(topLeft.x, bottomRight.x, bottomRight.y, topLeft.y); } @Override public GeoShapeType type() { return TYPE; } @Override public int numDimensions() { return Double.isNaN(topLeft.z) ? 2 : 3; } @Override public int hashCode() { return Objects.hash(topLeft, bottomRight); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } EnvelopeBuilder other = (EnvelopeBuilder) obj; return Objects.equals(topLeft, other.topLeft) && Objects.equals(bottomRight, other.bottomRight); } }
{ "content_hash": "f3ddacdfbc1b62af9e63a7f70d6aebed", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 113, "avg_line_length": 30.4, "alnum_prop": 0.6676315789473685, "repo_name": "kalimatas/elasticsearch", "id": "34da7e7fc2f6c600204abd57e20e6d7f9f276050", "size": "4588", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "server/src/main/java/org/elasticsearch/common/geo/builders/EnvelopeBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11082" }, { "name": "Batchfile", "bytes": "14049" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "323566" }, { "name": "HTML", "bytes": "3275" }, { "name": "Java", "bytes": "41136489" }, { "name": "Perl", "bytes": "7271" }, { "name": "Python", "bytes": "54395" }, { "name": "Shell", "bytes": "112601" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>concat: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.0 / concat - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> concat <small> 8.10.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-31 07:04:33 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-31 07:04:33 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.12 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.7.0 Formal proof management system. num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release 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;[email protected]&quot; homepage: &quot;https://github.com/http://logical.inria.fr/~saibi/docCatV6.ps&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ConCaT&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: category theory&quot; &quot;category: Mathematics/Category Theory&quot; ] authors: [ &quot;Amokrane Saïbi&quot; ] bug-reports: &quot;https://github.com/coq-contribs/concat/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/concat.git&quot; synopsis: &quot;Constructive Category Theory&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/concat/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=6127c436068507e75e49c6cda9907414&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-concat.8.10.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.0). The following dependencies couldn&#39;t be met: - coq-concat -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-concat.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <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": "5044c02308ab670699ebe1eb32b8471e", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 157, "avg_line_length": 39.86309523809524, "alnum_prop": 0.5336717933403017, "repo_name": "coq-bench/coq-bench.github.io", "id": "20513dfabc8e83a0b44493fd6c37478ac2d2ab83", "size": "6700", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.7.0/concat/8.10.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
valgrind --tool=memcheck --leak-check=yes -v ./rpc_download
{ "content_hash": "a59d4aa8eb107e9d96a56049b15a2d46", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 59, "avg_line_length": 60, "alnum_prop": 0.7333333333333333, "repo_name": "hankwing/Squirrel", "id": "df65b6049f6dd73d1e8fad578fe8a1f87b4d9aeb", "size": "71", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "library/acl/lib_acl_cpp/samples/rpc_download/valgrind.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "13229278" }, { "name": "C++", "bytes": "9491127" }, { "name": "HTML", "bytes": "3722579" }, { "name": "Inno Setup", "bytes": "2119" }, { "name": "Makefile", "bytes": "759750" }, { "name": "Objective-C", "bytes": "445312" }, { "name": "Perl", "bytes": "2134" }, { "name": "Protocol Buffer", "bytes": "36933" }, { "name": "Roff", "bytes": "46897" }, { "name": "Shell", "bytes": "53138" } ], "symlink_target": "" }
package ru.stqa.pft.addressbook.generators; import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.thoughtworks.xstream.XStream; import ru.stqa.pft.addressbook.model.ContactData; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.List; public class ContactDataGenetator { @Parameter(names = "-c", description = "Contact count") public int count; @Parameter(names = "-f", description = "Target contact file") public String file; @Parameter(names = "-d", description = "Data format") public String format; public static void main(String[] args) throws IOException { System.out.println(new File(".").getAbsolutePath()); ContactDataGenetator genetator = new ContactDataGenetator(); JCommander jCommander = new JCommander(genetator); try { jCommander.parse(args); } catch (ParameterException ex) { jCommander.usage(); return; } genetator.run(); } private void run() throws IOException { List<ContactData> contacts = generateContacts(count); if (format.equals("csv")) { saveAsCsv(contacts, new File(file)); } else if (format.equals("xml")) { saveAsXml(contacts, new File(file)); } else if (format.equals("json")) { saveAsJson(contacts, new File(file)); } else { System.out.println("Unrecognized format " + format); } } private void saveAsJson(List<ContactData> contacts, File file) throws IOException { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().setPrettyPrinting().create(); String json = gson.toJson(contacts); Writer writer = new FileWriter(file); writer.write(json); writer.close(); } private void saveAsXml(List<ContactData> contacts, File file) throws IOException { XStream xstream = new XStream(); xstream.processAnnotations(ContactData.class); //xstream.alias("group", GroupData.class); String xml = xstream.toXML(contacts); Writer writer = new FileWriter(file); writer.write(xml); writer.close(); } private void saveAsCsv(List<ContactData> contacts, File file) throws IOException { System.out.println(new File(".").getAbsolutePath()); Writer writer = new FileWriter(file); for (ContactData contact : contacts) { writer.write(String.format("%s;%s;%s;%s;%s\n", contact.getFirstname(), contact.getMiddlename(), contact.getLastname(), contact.getAddress(), contact.getEmail(), contact.getMobile())); } writer.close(); } private List<ContactData> generateContacts(int count) { List<ContactData> contacts = new ArrayList<ContactData>(); for (int i = 0; i <count; i++) { contacts.add(new ContactData() .withFirstname((String.format("First %s", i))).withMiddlename(String.format("Middle %s", i)).withLastname(String.format("Last %s", i)) .withAddress(String.format("Address %s", i)) .withEmail(String.format("Email%[email protected]", i)).withMobile(String.format("+7901000%s", i))); } return contacts; } }
{ "content_hash": "a3af31be6fdfd7678f7f511421db3b83", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 189, "avg_line_length": 34.51063829787234, "alnum_prop": 0.6917385943279901, "repo_name": "PavelGirkalo/java_pft", "id": "9fea1b2c512ef6d882bb398cf01961feaa432dcb", "size": "3244", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/generators/ContactDataGenetator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "91669" }, { "name": "PHP", "bytes": "343" } ], "symlink_target": "" }
function process(req,res){ var tmpl = global.swig.compileFile(__dirname+'/../Templates/downloads.html'); var html = tmpl.render({page:'downloads'}); res.send(html); } global.express.all('/downloads/', process); global.express.all('/downloads', process);
{ "content_hash": "8b6067d1637bd6e21fa685ab3c916274", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 78, "avg_line_length": 32.125, "alnum_prop": 0.7120622568093385, "repo_name": "tikalk/redis-v8", "id": "17ac81929e36979916d05349b3dd4a060ee1bd86", "size": "257", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "redis-v8.com/App/downloads.js", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3587221" }, { "name": "C++", "bytes": "37175098" }, { "name": "CSS", "bytes": "178674" }, { "name": "JavaScript", "bytes": "14481110" }, { "name": "Lua", "bytes": "25752" }, { "name": "Objective-C", "bytes": "50588" }, { "name": "PHP", "bytes": "455118" }, { "name": "Perl", "bytes": "170502" }, { "name": "Python", "bytes": "543687" }, { "name": "Ruby", "bytes": "34649" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "91333" }, { "name": "Tcl", "bytes": "304383" }, { "name": "XSLT", "bytes": "303" } ], "symlink_target": "" }
// Copyright 2014 The Rector & Visitors of the University of Virginia // // 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. namespace Sensus.Anonymization.Anonymizers { /// <summary> /// Anonymizer that operates by adding a random offset to the longitude /// of a GPS coordinate pair. The offset is chosen to be participant- /// specific. Thus, the resulting coordinates are only meaningful relative /// to other coordinates within a single participant's data set. They have /// no meaning in absolute terms, and they have no meaning relative to other /// participants' data. /// </summary> public class LongitudeParticipantOffsetGpsAnonymizer : LongitudeOffsetGpsAnonymizer { public override string DisplayText { get { return "Offset Within Participant"; } } protected override double GetOffset(Protocol protocol) { return protocol.GpsLongitudeAnonymizationParticipantOffset; } } }
{ "content_hash": "913051cef6a3598044082066a2ebdee6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 87, "avg_line_length": 38.725, "alnum_prop": 0.6914138153647514, "repo_name": "predictive-technology-laboratory/sensus", "id": "6d40828d0f7959951c78b9266abd84102a3d6a57", "size": "1551", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Sensus.Shared/Anonymization/Anonymizers/LongitudeParticipantOffsetGpsAnonymizer.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "2340482" }, { "name": "HTML", "bytes": "109896" }, { "name": "JavaScript", "bytes": "1068" }, { "name": "Python", "bytes": "13651" }, { "name": "R", "bytes": "30597" }, { "name": "Shell", "bytes": "42994" } ], "symlink_target": "" }
<div class="grid_1"> <div class="container"> <div class="box_1 wow fadeInUpBig" data-wow-delay="0.4s"> <h3>How to search names..</h3> <p> just select the year , gender , apply filters and click on submit button to get results in seconds. </p> </div>
{ "content_hash": "ca7253c76ccdd5fc4aef3ad9f455374e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 103, "avg_line_length": 34.25, "alnum_prop": 0.635036496350365, "repo_name": "aditi1795/miniproject_sem5th", "id": "3c13c1896aca9f76461b0226d2f0c3b446acca7f", "size": "274", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mid1.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "27495" }, { "name": "CoffeeScript", "bytes": "6135" }, { "name": "JavaScript", "bytes": "11806" }, { "name": "PHP", "bytes": "13637" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.InteropServices; using Xunit; // 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("Microsoft.WindowsAzure.Commands.Test")] [assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] [assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] [assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] // 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("88accda2-ccb3-4813-8141-5d1a2640f93d")] // 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.5.1")] [assembly: AssemblyFileVersion("1.5.1")] [assembly: CollectionBehavior(DisableTestParallelization = true)]
{ "content_hash": "3f37cf36112a702c6c4a3ccbc7702701", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 103, "avg_line_length": 45.4375, "alnum_prop": 0.78060522696011, "repo_name": "akurmi/azure-powershell", "id": "0268292d2621323517af5b2d5f379a96037f3adc", "size": "1456", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/ServiceManagement/Services/Commands.Test/Properties/AssemblyInfo.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "15822" }, { "name": "C#", "bytes": "29663399" }, { "name": "HTML", "bytes": "209" }, { "name": "JavaScript", "bytes": "4979" }, { "name": "PHP", "bytes": "41" }, { "name": "PowerShell", "bytes": "3086042" }, { "name": "Shell", "bytes": "50" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for io.js v1.6.3: v8::Private Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for io.js v1.6.3 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_private.html">Private</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="classv8_1_1_private-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">v8::Private Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="v8_8h_source.html">v8.h</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for v8::Private:</div> <div class="dyncontent"> <div class="center"> <img src="classv8_1_1_private.png" usemap="#v8::Private_map" alt=""/> <map id="v8::Private_map" name="v8::Private_map"> <area href="classv8_1_1_data.html" alt="v8::Data" shape="rect" coords="0,0,72,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a346820b1e830262d7f4f31e5c5ac7304"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a346820b1e830262d7f4f31e5c5ac7304"></a> <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_value.html">Value</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Name</b> () const </td></tr> <tr class="separator:a346820b1e830262d7f4f31e5c5ac7304"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:ae43aa9516121ed7a24cf5bba1654b653"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae43aa9516121ed7a24cf5bba1654b653"></a> static <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_private.html">Private</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>New</b> (<a class="el" href="classv8_1_1_isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_string.html">String</a> &gt; name=<a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_string.html">String</a> &gt;())</td></tr> <tr class="separator:ae43aa9516121ed7a24cf5bba1654b653"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0ab8628387166b8a8abc6e9b6f40ad55"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ab8628387166b8a8abc6e9b6f40ad55"></a> static <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_private.html">Private</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>ForApi</b> (<a class="el" href="classv8_1_1_isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1_local.html">Local</a>&lt; <a class="el" href="classv8_1_1_string.html">String</a> &gt; name)</td></tr> <tr class="separator:a0ab8628387166b8a8abc6e9b6f40ad55"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A private symbol</p> <p>This is an experimental feature. Use at your own risk. </p> </div><hr/>The documentation for this class was generated from the following file:<ul> <li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:49:35 for V8 API Reference Guide for io.js v1.6.3 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
{ "content_hash": "bd59c9177bd1f868e661778862a3aad0", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 514, "avg_line_length": 54.07142857142857, "alnum_prop": 0.6645970937912814, "repo_name": "v8-dox/v8-dox.github.io", "id": "4d2ae221263374dc37682ce3851bb3685d66f6e8", "size": "7570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "318d9d8/html/classv8_1_1_private.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/*global $*/ var lo = 10; var Inherit = (function(){ var classes = []; var constructorName = "const"; var parentName = "super"; var parentClassName = "class"; var className = "className"; var instanceofName = "instanceof"; var classofName = "classof"; function Class(name, c1, c2){ if(typeof name != "string"){ throw new Error("A name must be provided"); } if(classes.indexOf(name)!=-1){ throw new Error("A class with the same name already exists"); } classes.push(name); /*retrieve the constructor, copy parent's constructor if class doesn't contain a constructor, create empty constructor if no parent is defined*/ var constructor = c1[constructorName]; var orConstructor = constructor; if(!constructor) if(c2){ constructor = function(){c2.apply(this, arguments)}; orConstructor = c2; }else{ constructor = function(){}; orConstructor = constructor; } /*retrieving the path of extended classes, in order to display when a object is logged*/ var constructorString = orConstructor.toString().replace(/((\w*(:| ))*)(function ?\()/, "$4"); constructorString = name+" "+constructorString; var parentStr = ""; if(c2){ var n = c2; do{ parentStr = n[className]+":"+parentStr; }while(n[parentName] && (n = n[parentName][parentClassName])); constructorString = parentStr+constructorString; } /*the parent object that will be added to the class and the object */ var parent = {}; /*the object of which was last ran a function, this is used to determine what Class.parent.someFunction should do, as it then knows what object is running the parent function*/ var currentObject; /*transfer the class name to the constructor (unfortunately through a function eval)*/ var oldConstructor = constructor; // console.log(name, constructor); constructor = new Function(["constr","f"], "return function "+name+`(){ var prevParent = this.parent; f(this); var value = constr.apply(this,arguments); this.parent = prevParent; return value; }`)(oldConstructor, function(obj){ currentObject = obj; // console.log(obj, parent.className); obj.parent = parent; }); constructor.toString = function(){return "Class "+constructorString}; c1[className] = name; /*add a custom instanceof function that also checks super classes */ // console.log(constructor); c1[instanceofName] = function(clas){ var n = constructor; while(n != clas){ n = n[parentName]; if(n) n =n[parentClassName]; else return false; } return true; }; constructor[classofName] = function(object){ if(this!=constructor) throw new Error("You can only call this function on an class"); if(object.instanceof==null) return false; return object.instanceof(constructor); }; /*retrieve class fields*/ var classFields = Object.keys(c1); if(c2) var parentClassFields = Object.keys(c2.prototype); /*loop through fields in order to copy them to the constructor*/ for(var i=0; i<classFields.length; i++){ var field = classFields[i]; var fieldVal = c1[field]; if(fieldVal instanceof Function){ /*set the function to a function that sets currentObject to object and run the original defined function*/ fieldVal = (function(fieldVal){ var func = function(){ currentObject = this; var prevParent = this.parent; this.parent = parent; console.log(this, this.parent.className) if(lo--<0) throw Error("stop"); var value = fieldVal.apply(this, arguments); this.parent = prevParent; return value; }; func.toString = function(){return fieldVal.toString()}; //fix the tostring function return func; })(fieldVal); constructor.prototype[field] = fieldVal; }else{ /*copy non function fields to both the prototype and the original object, meaning that this.field can be used to retrieve constants and Class.field can be used as static values*/ constructor.prototype[field] = fieldVal; constructor[field] = fieldVal; } } /*inherit parent fields*/ if(c2){ parent[parentClassName] = c2; /*loop through parent fields*/ for(var i=0; i<parentClassFields.length; i++){ var field = parentClassFields[i]; (function(field){ //encapsulate field as it changes when looping through the fields /*setup the function for Class.parent.field, make it execute the function with currentObject as this*/ if(c2.prototype[field] instanceof Function){ parent[field] = function(){ console.log(parent.className, currentObject.parent.className); return c2.prototype[field].apply(currentObject, arguments); }; parent[field].toString = function(){ return parentStr+c2.prototype[field].toString(); }; /*define getter and setter to return the value of the parent class*/ }else{ parent.__defineGetter__(field, function(){ return c2[field]; }); parent.__defineSetter__(field, function(val){ c2[field] = val; }); } })(field); /*add parent field to prototype if it is not defined in class*/ if(classFields.indexOf(field)==-1) constructor.prototype[field] = c2.prototype[field]; } constructor[parentName] = parent; constructor.prototype[parentName] = parent; } return constructor; } /*create a class and instantiate it right away */ function Inherit(name, o, c){ return new (Class(name, o, c))(); } return [Class, Inherit]; })(); var Class = Inherit[0]; var Inherit = Inherit[1];
{ "content_hash": "dbd25d53ee8755017fa7128b922447be", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 103, "avg_line_length": 42.38285714285714, "alnum_prop": 0.5031683969259808, "repo_name": "sancarn/LaunchMenu-ahk", "id": "695366ba70734a051b2bc34a4dbeb561b109c84d", "size": "7417", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "js/outdated code/class.js", "mode": "33188", "license": "mit", "language": [ { "name": "AutoHotkey", "bytes": "10177" }, { "name": "C#", "bytes": "4045" }, { "name": "CSS", "bytes": "35040" }, { "name": "HTML", "bytes": "11341" }, { "name": "JavaScript", "bytes": "330680" }, { "name": "Visual Basic", "bytes": "810" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.IO; using System.ComponentModel; using System.Data; using System.Drawing; using System.Runtime.InteropServices; using System.Resources; namespace MarioObjects { class Media { public static Boolean SOUND_ENABLE = false; public enum SoundType { ST_level1, ST_level2, ST_Brick, ST_Coin, ST_Jump, ST_Block, ST_Stomp, ST_Mush, ST_FireBall }; private FMOD.System soundsystem = null; private FMOD.Sound s_level1 = null; private FMOD.Sound s_level2 = null; private FMOD.Sound s_brick = null; private FMOD.Sound s_coin = null; private FMOD.Sound s_jump = null; private FMOD.Sound s_block = null; private FMOD.Sound s_stomp = null; private FMOD.Sound s_mush = null; private FMOD.Sound s_fireball = null; private FMOD.Channel channel = null; public static Media instance=null; public void Destroy() { FMOD.RESULT result; result = s_level1.release(); ERRCHECK(result); result = s_level2.release(); ERRCHECK(result); result = s_jump.release(); ERRCHECK(result); result = s_coin.release(); ERRCHECK(result); result = s_brick.release(); ERRCHECK(result); result = s_block.release(); ERRCHECK(result); result = s_stomp.release(); ERRCHECK(result); result = s_mush.release(); ERRCHECK(result); result = s_fireball.release(); ERRCHECK(result); result = soundsystem.close(); ERRCHECK(result); result = soundsystem.release(); ERRCHECK(result); } public static Media Instance { get { if (instance == null) instance = new Media(); return instance; } } public void UpdateSound(string name,ref FMOD.Sound s,Boolean Loop) { FMOD.RESULT result; string strNameSpace = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString(); Stream str = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(strNameSpace + ".Sounds." + name); //Block = new Bitmap(str); byte[] Arr = new byte[str.Length]; str.Read(Arr, 0, (int)str.Length); FMOD.CREATESOUNDEXINFO inf = new FMOD.CREATESOUNDEXINFO(); inf.cbsize = Marshal.SizeOf(inf); inf.length = (uint)str.Length; result = soundsystem.createSound(Arr, FMOD.MODE.SOFTWARE | FMOD.MODE.OPENMEMORY | FMOD.MODE._3D, ref inf, ref s); ERRCHECK(result); if (!Loop) s.setMode(FMOD.MODE.LOOP_OFF); else s.setMode(FMOD.MODE.LOOP_NORMAL); ERRCHECK(result); } public void LoadFromResource() { UpdateSound("level1.mp3", ref s_level1,true); UpdateSound("level2.mp3", ref s_level2, true); UpdateSound("brick.wav", ref s_brick, false); UpdateSound("coin.wav", ref s_coin, false); UpdateSound("jump.wav", ref s_jump, false); UpdateSound("block.wav", ref s_block, false); UpdateSound("stomp.wav", ref s_stomp, false); UpdateSound("mush.wav", ref s_mush, false); UpdateSound("fireball.wav", ref s_fireball, false); } public FMOD.Sound GetSound(SoundType type) { switch (type) { case SoundType.ST_level1: { return s_level1; } case SoundType.ST_level2: { return s_level2; } case SoundType.ST_Brick: { return s_brick; } case SoundType.ST_Coin: { return s_coin; } case SoundType.ST_Jump: { return s_jump; } case SoundType.ST_Block: { return s_block; } case SoundType.ST_Stomp: { return s_stomp; } case SoundType.ST_Mush: { return s_mush; } case SoundType.ST_FireBall: { return s_fireball; } } return null; } public void PlayInnerSound(SoundType type) { FMOD.RESULT result; FMOD.Sound sound = GetSound(type); if (sound != null) { result = soundsystem.playSound(FMOD.CHANNELINDEX.FREE, sound, false, ref channel); ERRCHECK(result); if (type == SoundType.ST_level1 || type == SoundType.ST_level2) channel.setVolume(1f); else channel.setVolume(0.15f); } } public static void PlaySound(SoundType type) { if (!SOUND_ENABLE) return; Instance.PlayInnerSound(type); } public Media() { uint version = 0; FMOD.RESULT result; /* Create a System object and initialize. */ result = FMOD.Factory.System_Create(ref soundsystem); ERRCHECK(result); result = soundsystem.getVersion(ref version); ERRCHECK(result); if (version < FMOD.VERSION.number) { MessageBox.Show("Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + FMOD.VERSION.number.ToString("X") + "."); Application.Exit(); } result = soundsystem.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null); ERRCHECK(result); LoadFromResource(); } private void ERRCHECK(FMOD.RESULT result) { if (result != FMOD.RESULT.OK) { //timer.Stop(); //MessageBox.Show("FMOD error! " + result + " - " + FMOD.Error.String(result)); //Environment.Exit(-1); } } } }
{ "content_hash": "531e86e1eeb952c631c3486df05e1386", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 177, "avg_line_length": 30.56132075471698, "alnum_prop": 0.5079487575243093, "repo_name": "jazzyjester/Mario-Objects", "id": "8756fb0111272e6dd59e94ff6808682d37686bce", "size": "6479", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "MarioObjects/Sound.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "511862" } ], "symlink_target": "" }
// Copyright (c) 2017 Pronin S.V. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* The fmtc overrides the print functions of the fmt package, but with the ability to color output in bash using HTML tags Available text decoration tags: <b></b> - make font Bold <strong></strong> - make font Bold <u></u> - make text Underlined <dim></dim> - make font Dim <reverse></reverse> - Reverse background anf font color <blink></blink> - make text Blink (not working on Mint/Ubuntu) <black></black> - set font color Black (Dark) <red></red> - set font color Red <green></green> - set font color Green <yellow></yellow> - set font color Yellow <blue></blue> - set font color Blue <magenta></magenta> - set font color Magenta <cyan></cyan> - set font color Cyan <grey></grey> - set font color Grey (Smokey) <white></white> - set font color White Available background colors tags: <bg color="black"></bg> - black background color <bg color="red"></bg> - red background color <bg color="green"></bg> - green background color <bg color="yellow"></bg> - yellow background color <bg color="blue"></bg> - blue background color <bg color="magenta"></bg> - magenta background color <bg color="cyan"></bg> - cyan background color <bg color="grey"></bg> - grey background color <bg color="white"></bg> - white background color <b_black></b_black> - black background color <b_red></b_red> - red background color <b_green></b_green> - green background color <b_yellow></b_yellow> - yellow background color <b_blue></b_blue> - blue background color <b_magenta></b_magenta> - magenta background color <b_cyan></b_cyan> - cyan background color <b_grey></b_grey> - grey background color <b_white></b_white> - white background color Examples: fmtc.Print("<b>HELLO <blue>WORLD</blue></b>") fmtc.Println("<bg color=\"yellow\"><b>HELLO <blue>WORLD</blue></b></bg>") fmtc.Printf("<b>%v:</b> <green>%v</green>", name, result) */ package fmtc
{ "content_hash": "b84d652fccee36a36dfdb69d40c8819c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 120, "avg_line_length": 40.60377358490566, "alnum_prop": 0.6384758364312267, "repo_name": "Pronin1986/fmtc", "id": "3035d2c8b37dfb37576842a19617034031904c3e", "size": "2152", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "16751" } ], "symlink_target": "" }
<!doctype html> <!-- Copyright (c) 2014 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> <html> <head> <title>core-ajax</title> <script src="../../webcomponentsjs/webcomponents.js"></script> <script src="../../web-component-tester/browser.js"></script> <link rel="import" href="../core-ajax.html"> </head> <body> <core-ajax></core-ajax> <script> suite('core-ajax', function() { var xhr, requests, ajax; suiteSetup(function() { xhr = sinon.useFakeXMLHttpRequest(); ajax = document.querySelector("core-ajax"); xhr.onCreate = function (xhr) { requests.push(xhr); }; // Reset the core-ajax element before each test. ajax.auto = false; ajax.url = ''; ajax.params = ''; ajax.handleAs = 'text'; ajax.body = ''; }); setup(function() { requests = []; }); suite('handleAs', function() { suite('text', function(){ var headers = { "Content-Type": "text/plain" }; setup(function(done){ async.series([ function(cb){ ajax.handleAs = 'text'; ajax.url = "http://example.com/text"; ajax.auto = true; cb(); }, animationFrameFlush, function(cb){ requests[0].respond(200, headers, "test text"); cb(); } ], done); }); test('Raw text should pass through', function(){ assert.equal(ajax.response, "test text"); }); }); suite('xml', function(){ var headers = { "Content-Type": "text/xml" }; setup(function(done){ async.series([ function(cb){ ajax.handleAs = 'xml'; ajax.url = "http://example.com/xml"; ajax.auto = true; cb(); }, animationFrameFlush, function(cb){ requests[0].respond(200, headers, "<note>" + "<to>AJ</to>" + "<from>Dog</from>" + "<subject>Reminder</subject>" + "<body><q>Feed me!</q></body>" + "</note>"); cb(); } ], done); }); test('XML should be returned with queryable structure', function(){ var q = ajax.response.querySelector("note body q"); assert.equal(q.childNodes[0].textContent, "Feed me!"); var to = ajax.response.querySelector("to"); assert.equal(to.childNodes[0].textContent, "AJ"); })}); suite('json', function(){ var headers = { "Content-Type": "text/json" }; setup(function(done){ async.series([ function(cb){ ajax.handleAs = 'json'; ajax.url = "http://example.com/json"; ajax.auto = true; cb(); }, animationFrameFlush, function(cb){ requests[0].respond(200, headers, '{"object" : {"list" : [2, 3, {"key": "value"}]}}'); cb(); } ], done); }); test('JSON should be returned as an Object', function(){ var r = ajax.response; assert.equal(r.object.list[1], 3); assert.equal(r.object.list[2].key, "value"); }); }); suite('arraybuffer', function(){ var headers = { "Content-Type": "text/plain" }; setup(function(done){ async.series([ function(cb){ ajax.handleAs = 'arraybuffer'; ajax.url = "http://example.com/data"; ajax.auto = true; cb(); }, animationFrameFlush, function(cb){ var buf = new ArrayBuffer(8*4); var resp = new Int32Array(buf); resp[3] = 12; resp[6] = 21; requests[0].response = buf; requests[0].respond(200, headers, 'blahblahblah'); cb(); } ], done); }); test('arraybuffer response should be passed through', function(){ var r = ajax.response; var ints = new Int32Array(r); assert.equal(ints[3], 12); assert.equal(ints[6], 21); }); }); suite('blob', function(){}); suite('document', function(){}); }); suite('auto', function() { suiteSetup(function(){ ajax.url = "http://example.com/"; ajax.auto = true; }); test('url change should trigger request', function(done){ async.series([ function(cb){ ajax.url = "http://example.com/auto"; cb(); }, animationFrameFlush, function(cb){ assert.equal(requests.length, 1); cb(); } ], done); }); test('params change should trigger request', function(done){ async.series([ function(cb){ ajax.params = {param: "value"}; cb(); }, animationFrameFlush, function(cb){ assert.equal(requests.length, 1); cb(); } ], done); }); test('body change should trigger request', function(done){ async.series([ function(cb){ ajax.method = "POST"; ajax.body = "bodystuff"; cb(); }, animationFrameFlush, function(cb){ assert.equal(requests.length, 1); cb(); } ], done); }); }); suite('events', function(){ var headers = { "Content-Type": "text/plain" }; var body = "somebodytext"; var responded; setup(function(done){ async.series([ function(cb){ ajax.auto = false; cb(); }, animationFrameFlush, function(cb){; ajax.handleAs = 'text'; ajax.url = "http://example.com/text"; ajax.auto = true; cb(); }, animationFrameFlush, ], done); responded = false; }); suite('core-response', function(){ test('core-response should be fired on success', function(done){ window.addEventListener('core-response', function(response, xhr){ responded = true; }); requests[0].respond(200, headers, body); assert.isTrue(responded); done(); }); test('core-response should not be fired on failure', function(done){ window.addEventListener('core-response', function(response, xhr){ responded = true; }); requests[0].respond(404, headers, body); assert.isFalse(responded); done(); }); }); suite('core-error', function(){ test('core-error should be fired on failure', function(done){ window.addEventListener('core-error', function(response, xhr){ responded = true; }); requests[0].respond(404, headers, body); assert.isTrue(responded); done(); }); test('core-error should not be fired on success', function(done){ var responded = false; window.addEventListener('core-error', function(response, xhr){ responded = true; }); requests[0].respond(200, headers, body); assert.isFalse(responded); done(); }); }); suite('core-complete', function(){ test('core-complete should be fired on success', function(done){ window.addEventListener('core-complete', function(response, xhr){ responded = true; }); requests[0].respond(200, headers, body); assert.isTrue(responded); done(); }); test('core-complete should be fired on failure', function(done){ var responded = false; window.addEventListener('core-complete', function(response, xhr){ responded = true; }); requests[0].respond(404, headers, body); assert.isTrue(responded); done(); }); }); }); }); </script> </body> </html>
{ "content_hash": "634ace4d172965f6149d013fb1cd79eb", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 100, "avg_line_length": 31.076655052264808, "alnum_prop": 0.48626527637627537, "repo_name": "dart-archive/core-elements", "id": "6de4a835d6ce3f94f2afc9dcdad7b1e867361c5c", "size": "8919", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/src/core-ajax/test/core-ajax.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "31685" }, { "name": "Dart", "bytes": "313798" }, { "name": "HTML", "bytes": "1167153" }, { "name": "JavaScript", "bytes": "742431" }, { "name": "Shell", "bytes": "5026" } ], "symlink_target": "" }
import * as firestore from '@firebase/firestore-types'; import { Blob } from '../../src/api/blob'; import { DocumentKeyReference } from '../../src/api/user_data_converter'; import { DatabaseId } from '../../src/core/database_info'; import { Bound, Filter, OrderBy } from '../../src/core/query'; import { SnapshotVersion } from '../../src/core/snapshot_version'; import { ProtoByteString, TargetId } from '../../src/core/types'; import { LimboDocumentChange, View, ViewChange } from '../../src/core/view'; import { LocalViewChanges } from '../../src/local/local_view_changes'; import { QueryData, QueryPurpose } from '../../src/local/query_data'; import { DocumentKeySet, MaybeDocumentMap } from '../../src/model/collections'; import { Document, DocumentOptions, MaybeDocument, NoDocument, UnknownDocument } from '../../src/model/document'; import { DocumentComparator } from '../../src/model/document_comparator'; import { DocumentKey } from '../../src/model/document_key'; import { DocumentSet } from '../../src/model/document_set'; import { FieldValue, JsonObject, ObjectValue } from '../../src/model/field_value'; import { DeleteMutation, MutationResult, PatchMutation, Precondition, SetMutation, TransformMutation } from '../../src/model/mutation'; import { FieldPath, ResourcePath } from '../../src/model/path'; import { RemoteEvent, TargetChange } from '../../src/remote/remote_event'; import { AnyJs } from '../../src/util/misc'; import { Dict } from '../../src/util/obj'; import { SortedMap } from '../../src/util/sorted_map'; import { SortedSet } from '../../src/util/sorted_set'; export declare type TestSnapshotVersion = number; /** * A string sentinel that can be used with patchMutation() to mark a field for * deletion. */ export declare const DELETE_SENTINEL = "<DELETE>"; export declare function version(v: TestSnapshotVersion): SnapshotVersion; export declare function ref(dbIdStr: string, keyStr: string): DocumentKeyReference; export declare function doc(keyStr: string, ver: TestSnapshotVersion, json: JsonObject<AnyJs>, options?: DocumentOptions): Document; export declare function deletedDoc(keyStr: string, ver: TestSnapshotVersion, options?: DocumentOptions): NoDocument; export declare function unknownDoc(keyStr: string, ver: TestSnapshotVersion): UnknownDocument; export declare function removedDoc(keyStr: string): NoDocument; export declare function wrap(value: AnyJs): FieldValue; export declare function wrapObject(obj: JsonObject<AnyJs>): ObjectValue; export declare function dbId(project: string, database?: string): DatabaseId; export declare function key(path: string): DocumentKey; export declare function keys(...documents: Array<MaybeDocument | string>): DocumentKeySet; export declare function path(path: string, offset?: number): ResourcePath; export declare function field(path: string): FieldPath; export declare function blob(...bytes: number[]): Blob; export declare function filter(path: string, op: string, value: AnyJs): Filter; export declare function setMutation(keyStr: string, json: JsonObject<AnyJs>): SetMutation; export declare function patchMutation(keyStr: string, json: JsonObject<AnyJs>, precondition?: Precondition): PatchMutation; export declare function deleteMutation(keyStr: string): DeleteMutation; /** * Creates a TransformMutation by parsing any FieldValue sentinels in the * provided data. The data is expected to use dotted-notation for nested fields * (i.e. { "foo.bar": FieldValue.foo() } and must not contain any non-sentinel * data. */ export declare function transformMutation(keyStr: string, data: Dict<AnyJs>): TransformMutation; export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult; export declare function bound(values: Array<[string, {}, firestore.OrderByDirection]>, before: boolean): Bound; export declare function queryData(targetId: TargetId, queryPurpose: QueryPurpose, path: string): QueryData; export declare function docAddedRemoteEvent(doc: MaybeDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent; export declare function docUpdateRemoteEvent(doc: MaybeDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent; export declare function updateMapping(snapshotVersion: SnapshotVersion, added: Array<Document | string>, modified: Array<Document | string>, removed: Array<MaybeDocument | string>, current?: boolean): TargetChange; export declare function addTargetMapping(...docsOrKeys: Array<Document | string>): TargetChange; export declare function ackTarget(...docsOrKeys: Array<Document | string>): TargetChange; export declare function limboChanges(changes: { added?: Document[]; removed?: Document[]; }): LimboDocumentChange[]; export declare function localViewChanges(targetId: TargetId, changes: { added?: string[]; removed?: string[]; }): LocalViewChanges; /** Creates a resume token to match the given snapshot version. */ export declare function resumeTokenForSnapshot(snapshotVersion: SnapshotVersion): ProtoByteString; export declare function orderBy(path: string, op?: string): OrderBy; /** * Converts a sorted map to an array with inorder traversal */ export declare function mapAsArray<K, V>(sortedMap: SortedMap<K, V>): Array<{ key: K; value: V; }>; /** * Converts a list of documents or document keys to a sorted map. A document * key is used to represent a deletion and maps to null. */ export declare function documentUpdates(...docsOrKeys: Array<Document | DocumentKey>): MaybeDocumentMap; /** * Short for view.applyChanges(view.computeDocChanges(documentUpdates(docs))). */ export declare function applyDocChanges(view: View, ...docsOrKeys: Array<Document | DocumentKey>): ViewChange; /** * Constructs a document set. */ export declare function documentSet(comp: DocumentComparator, ...docs: Document[]): DocumentSet; export declare function documentSet(...docs: Document[]): DocumentSet; /** * Constructs a document key set. */ export declare function keySet(...keys: DocumentKey[]): DocumentKeySet; /** Converts a DocumentSet to an array. */ export declare function documentSetAsArray(docs: DocumentSet): Document[]; export declare class DocComparator { static byField(...fields: string[]): DocumentComparator; } /** * Two helper functions to simplify testing isEqual() method. */ export declare function expectEqual(left: any, right: any, message?: string): void; export declare function expectNotEqual(left: any, right: any, message?: string): void; export declare function expectEqualArrays(left: AnyJs[], right: AnyJs[], message?: string): void; /** * Checks that an ordered array of elements yields the correct pair-wise * comparison result for the supplied comparator */ export declare function expectCorrectComparisons<T extends AnyJs>(array: T[], comp: (left: T, right: T) => number): void; /** * Takes an array of "equality group" arrays and asserts that the comparator * returns the same as comparing the indexes of the "equality groups" * (0 for items in the same group). */ export declare function expectCorrectComparisonGroups<T extends AnyJs>(groups: T[][], comp: (left: T, right: T) => number): void; /** Compares SortedSet to an array */ export declare function expectSetToEqual<T>(set: SortedSet<T>, arr: T[]): void; /** * Takes an array of array of elements and compares each of the elements * to every other element. * * Elements in the same inner array are expect to be equal with regard to * the provided equality function to all other elements from the same array * (including itself) and unequal to all other elements from the other array */ export declare function expectEqualitySets<T>(elems: T[][], equalityFn: (v1: T, v2: T) => boolean): void; /** Returns the number of keys in this object. */ export declare function size(obj: JsonObject<AnyJs>): number; export declare function expectFirestoreError(err: Error): void;
{ "content_hash": "f2a341348317b4dad2618d6e4f2e351c", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 214, "avg_line_length": 60.06666666666667, "alnum_prop": 0.7410284868664447, "repo_name": "Birdinc/steem-rich", "id": "007acee5ed576e270c6a0b7de74b3eb9f1e45764", "size": "8729", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/@firebase/firestore/dist/test/util/helpers.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "245" }, { "name": "HTML", "bytes": "15272" }, { "name": "JavaScript", "bytes": "5002" } ], "symlink_target": "" }
package com.citrix.sharefile.api.models; import com.google.gson.annotations.SerializedName; import com.citrix.sharefile.api.enumerations.SFSafeEnum; import com.citrix.sharefile.api.enumerations.SFSafeEnumFlags; public enum SFTwoFactorAuthPasscodeType { OneTime, ApplicationSpecific, Cookie }
{ "content_hash": "8aaef5912cbfc9b4a6bc15db0e18752f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 27, "alnum_prop": 0.8417508417508418, "repo_name": "citrix/ShareFile-Java", "id": "b40f10b8cc5e9ce3d6b19ffc5ae7cb0cde7cdedc", "size": "732", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ShareFileJavaSDK/src/com/citrix/sharefile/api/models/SFTwoFactorAuthPasscodeType.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "396" }, { "name": "HTML", "bytes": "908" }, { "name": "Java", "bytes": "1937449" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=../../../openssl/ssl/struct.SslAcceptor.html"> </head> <body> <p>Redirecting to <a href="../../../openssl/ssl/struct.SslAcceptor.html">../../../openssl/ssl/struct.SslAcceptor.html</a>...</p> <script>location.replace("../../../openssl/ssl/struct.SslAcceptor.html" + location.search + location.hash);</script> </body> </html>
{ "content_hash": "8c169dddda87c4f1ce6fe87564da3f44", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 132, "avg_line_length": 41.7, "alnum_prop": 0.6474820143884892, "repo_name": "malept/guardhaus", "id": "60fce22220e240b628a68d81251d2e31bba9031d", "size": "417", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "main/openssl/ssl/connector/struct.SslAcceptor.html", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "73575" }, { "name": "Shell", "bytes": "1968" } ], "symlink_target": "" }
var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "Nieznana przeglądarka"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "nieznana nersja"; this.OS = this.searchString(this.dataOS) || "nieznany OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, width: function() { var winW = 0; if (document.body && document.body.offsetWidth) winW = document.body.offsetWidth; if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) winW = document.documentElement.offsetWidth; if (window.innerWidth && window.innerHeight) winW = window.innerWidth; return winW; }, height: function() { var winH = 0; if (document.body && document.body.offsetWidth) winH = document.body.offsetHeight; if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) winH = document.documentElement.offsetHeight; if (window.innerWidth && window.innerHeight) winH = window.innerHeight; return winH; }, dataBrowser: [ { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version" }, { prop: window.opera, identity: "Opera", versionSearch: "Version" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { // for newer Netscapes (6+) string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { // for older Netscapes (4-) string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ] }; BrowserDetect.init();
{ "content_hash": "cb5c8769bf59d5038b26d9e7f53857d1", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 89, "avg_line_length": 27.33783783783784, "alnum_prop": 0.5375679683638162, "repo_name": "gilek/BAB", "id": "85ce98fd9bc458924423e3b43818ba65b9a79998", "size": "4047", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/BrowserDetect.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "62777" }, { "name": "JavaScript", "bytes": "169380" }, { "name": "PHP", "bytes": "7983161" }, { "name": "Shell", "bytes": "1401" } ], "symlink_target": "" }
<?php global $wp_roles,$wpwaf,$topic_restriction_params; extract($topic_restriction_params); $user_roles = $wp_roles->get_names(); $visibility = get_post_meta( $post->ID, '_wpwaf_topic_visibility', true ); $redirection_url = get_post_meta( $post->ID, '_wpwaf_topic_redirection_url', true ); $visible_roles = get_post_meta( $post->ID, '_wpwaf_topic_roles', true ); if(!is_array($visible_roles)){ $visible_roles = array(); } $show_role_field = ''; if( $visibility == 'role'){ $show_role_field = " style='display:block;' "; } ?> <div class="wpwaf_post_meta_row"> <div class="wpwaf_post_meta_row_label"><strong><?php _e('Visibility','wpwaf'); ?></strong></div> <div class="wpwaf_post_meta_row_field"> <select id="wpwaf_topic_visibility" name="wpwaf_topic_visibility" class="wpwaf-select2-setting"> <option value='none' <?php selected('none',$visibility); ?> ><?php _e('Please Select','wpwaf'); ?></option> <option value='all' <?php selected('all',$visibility); ?> ><?php _e('Everyone','wpwaf'); ?></option> <option value='guest' <?php selected('guest',$visibility); ?> ><?php _e('Guests','wpwaf'); ?></option> <option value='member' <?php selected('member',$visibility); ?> ><?php _e('Members','wpwaf'); ?></option> <option value='role' <?php selected('role',$visibility); ?> ><?php _e('Selected User Roles','wpwaf'); ?></option> </select> </div> </div> <div class="wpwaf-clear"></div> <div id="wpwaf_topic_role_panel" class="wpwaf_post_meta_row" <?php echo $show_role_field; ?> > <div class="wpwaf_post_meta_row_label"><strong><?php _e('Allowed User Roles','wpwaf'); ?></strong></div> <div class="wpwaf_post_meta_row_field"> <?php foreach($user_roles as $role_key => $role){ $checked_val = ''; if(in_array($role_key, $visible_roles) ){ $checked_val = ' checked '; } if($role_key != 'administrator'){ ?> <input type="checkbox" <?php echo $checked_val; ?> name="wpwaf_topic_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/> <?php } ?> <?php } ?> </div> </div> <div class="wpwaf-clear"></div> <div class="wpwaf_post_meta_row"> <div class="wpwaf_post_meta_row_label"><strong><?php _e('Redirection URL','wpwaf'); ?></strong></div> <div class="wpwaf_post_meta_row_field"> <input type='text' id="wpwaf_topic_redirection_url" name="wpwaf_topic_redirection_url" value="<?php echo $redirection_url; ?>" /> </div> </div> <div class="wpwaf-clear"></div> <?php wp_nonce_field( 'wpwaf_restriction_settings', 'wpwaf_restriction_settings_nonce' ); ?>
{ "content_hash": "4993e65ffa91a859e3a0262cbd1fe983", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 139, "avg_line_length": 39.56716417910448, "alnum_prop": 0.6046774801961524, "repo_name": "RutujaV1129/Wordpress-Web-Application-Development-Third-Edition", "id": "66af8778550fc3e3cad249536902aad5c9ae163b", "size": "2651", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Chapter05/wpwa-forum/templates/topic-restriction-meta-template.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "42512" }, { "name": "JavaScript", "bytes": "15297" }, { "name": "PHP", "bytes": "1049161" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "66ae179835b769ee9656b3cb95a66a9b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "0ef62d3e3af2352d2ba37be8fc1e402ff1a13339", "size": "184", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Magnoliales/Myristicaceae/Myristica/Myristica rumphii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/** */ /* * Created on 23.11.2004 * */ package org.apache.harmony.test.func.api.java.io.share; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * */ public class MockWriter extends Writer { StringBuffer sb = new StringBuffer(); List log = Collections.synchronizedList(new ArrayList()); public MockWriter(Object lock) { super(lock); } public MockWriter() { super(); } public void write(char[] arg0, int arg1, int arg2) throws IOException { if(arg1 < 0 || arg2 < 0 ) { throw new ArrayIndexOutOfBoundsException(); } for (int i = arg1; i < arg1 + arg2; ++i) { sb.append(arg0[i]); } } public void close() throws IOException { log.add("close"); } public void flush() throws IOException { log.add("flush"); } public List getLog() { return log; } public String toString() { return sb.toString(); } }
{ "content_hash": "2c242ef93479d540d82ce835cc202096", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 19.418181818181818, "alnum_prop": 0.5795880149812734, "repo_name": "freeVM/freeVM", "id": "14f4210e55d554963f88f84d3da7c198aafa9f21", "size": "1880", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "enhanced/buildtest/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/MockWriter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "116828" }, { "name": "C", "bytes": "17860389" }, { "name": "C++", "bytes": "19007206" }, { "name": "CSS", "bytes": "217777" }, { "name": "Java", "bytes": "152108632" }, { "name": "Objective-C", "bytes": "106412" }, { "name": "Objective-J", "bytes": "11029421" }, { "name": "Perl", "bytes": "305690" }, { "name": "Scilab", "bytes": "34" }, { "name": "Shell", "bytes": "153821" }, { "name": "XSLT", "bytes": "152859" } ], "symlink_target": "" }
.. SPDX-License-Identifier: CC-BY-4.0 Copyright Contributors to the OpenColorIO Project. Do not edit! This file was automatically generated by share/docs/frozendoc.py. .. py:class:: ExposureContrastTransform :module: PyOpenColorIO Applies exposure, gamma, and pivoted contrast adjustments. Adjusts the math to be appropriate for linear, logarithmic, or video color spaces. .. py:method:: ExposureContrastTransform.__init__(*args, **kwargs) :module: PyOpenColorIO Overloaded function. 1. __init__(self: PyOpenColorIO.ExposureContrastTransform) -> None 2. __init__(self: PyOpenColorIO.ExposureContrastTransform, style: PyOpenColorIO.ExposureContrastStyle = <ExposureContrastStyle.EXPOSURE_CONTRAST_LINEAR: 0>, exposure: float = 0.0, contrast: float = 1.0, gamma: float = 1.0, pivot: float = 0.18, logExposureStep: float = 0.088, logMidGray: float = 0.435, dynamicExposure: bool = False, dynamicContrast: bool = False, dynamicGamma: bool = False, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None .. py:method:: ExposureContrastTransform.equals(self: PyOpenColorIO.ExposureContrastTransform, other: PyOpenColorIO.ExposureContrastTransform) -> bool :module: PyOpenColorIO Checks if this exactly equals other. .. py:method:: ExposureContrastTransform.getContrast(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getDirection(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformDirection :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getExposure(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getFormatMetadata(self: PyOpenColorIO.ExposureContrastTransform) -> PyOpenColorIO.FormatMetadata :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getGamma(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getLogExposureStep(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getLogMidGray(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getPivot(self: PyOpenColorIO.ExposureContrastTransform) -> float :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getStyle(self: PyOpenColorIO.ExposureContrastTransform) -> PyOpenColorIO.ExposureContrastStyle :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.getTransformType(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformType :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.isContrastDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> bool :module: PyOpenColorIO Contrast can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several :ref:`ExposureContrastTransform` only one can have a dynamic contrast. .. py:method:: ExposureContrastTransform.isExposureDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> bool :module: PyOpenColorIO Exposure can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several :ref:`ExposureContrastTransform` only one can have a dynamic exposure. .. py:method:: ExposureContrastTransform.isGammaDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> bool :module: PyOpenColorIO Gamma can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several :ref:`ExposureContrastTransform` only one can have a dynamic gamma. .. py:method:: ExposureContrastTransform.makeContrastDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.makeContrastNonDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.makeExposureDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.makeExposureNonDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.makeGammaDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.makeGammaNonDynamic(self: PyOpenColorIO.ExposureContrastTransform) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.setContrast(self: PyOpenColorIO.ExposureContrastTransform, contrast: float) -> None :module: PyOpenColorIO Applies a contrast/gamma adjustment around a pivot point. The contrast and gamma are mathematically the same, but two controls are provided to enable the use of separate dynamic parameters. Contrast is usually a scene-referred adjustment that pivots around gray whereas gamma is usually a display-referred adjustment that pivots around white. .. py:method:: ExposureContrastTransform.setDirection(self: PyOpenColorIO.Transform, direction: PyOpenColorIO.TransformDirection) -> None :module: PyOpenColorIO Note that this only affects the evaluation and not the values stored in the object. .. py:method:: ExposureContrastTransform.setExposure(self: PyOpenColorIO.ExposureContrastTransform, exposure: float) -> None :module: PyOpenColorIO Applies an exposure adjustment. The value is in units of stops (regardless of style), for example, a value of -1 would be equivalent to reducing the lighting by one half. .. py:method:: ExposureContrastTransform.setGamma(self: PyOpenColorIO.ExposureContrastTransform, gamma: float) -> None :module: PyOpenColorIO .. py:method:: ExposureContrastTransform.setLogExposureStep(self: PyOpenColorIO.ExposureContrastTransform, logExposureStep: float) -> None :module: PyOpenColorIO Set the increment needed to move one stop for the log-style algorithm. For example, ACEScct is 0.057, LogC is roughly 0.074, and Cineon is roughly 90/1023 = 0.088. The default value is 0.088. .. py:method:: ExposureContrastTransform.setLogMidGray(self: PyOpenColorIO.ExposureContrastTransform, logMidGray: float) -> None :module: PyOpenColorIO Set the position of 18% gray for use by the log-style algorithm. For example, ACEScct is about 0.41, LogC is about 0.39, and ADX10 is 445/1023 = 0.435. The default value is 0.435. .. py:method:: ExposureContrastTransform.setPivot(self: PyOpenColorIO.ExposureContrastTransform, pivot: float) -> None :module: PyOpenColorIO Set the pivot point around which the contrast and gamma controls will work. Regardless of whether linear/video/log-style is being used, the pivot is always expressed in linear. In other words, a pivot of 0.18 is always mid-gray. .. py:method:: ExposureContrastTransform.setStyle(self: PyOpenColorIO.ExposureContrastTransform, style: PyOpenColorIO.ExposureContrastStyle) -> None :module: PyOpenColorIO Select the algorithm for linear, video or log color spaces. .. py:method:: ExposureContrastTransform.validate(self: PyOpenColorIO.Transform) -> None :module: PyOpenColorIO Will throw if data is not valid.
{ "content_hash": "17c7b18c625a9ad244def1b55a3da785", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 499, "avg_line_length": 47.11875, "alnum_prop": 0.768536941238891, "repo_name": "AcademySoftwareFoundation/OpenColorIO", "id": "5245656a425e95785ea97d5221b82c8636df0c45", "size": "7539", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/api/python/frozen/pyopencolorio_exposurecontrasttransform.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "25967" }, { "name": "C", "bytes": "271137" }, { "name": "C++", "bytes": "7403561" }, { "name": "CMake", "bytes": "199749" }, { "name": "Java", "bytes": "73341" }, { "name": "Objective-C", "bytes": "6826" }, { "name": "Objective-C++", "bytes": "37610" }, { "name": "Python", "bytes": "588894" }, { "name": "Roff", "bytes": "867637" }, { "name": "Shell", "bytes": "15460" } ], "symlink_target": "" }
from waldur_core.core import WaldurExtension class AzureExtension(WaldurExtension): @staticmethod def django_app(): return 'waldur_azure' @staticmethod def rest_urls(): from .urls import register_in return register_in @staticmethod def get_cleanup_executor(): from .executors import AzureCleanupExecutor return AzureCleanupExecutor
{ "content_hash": "94a6af45e44f279798312f4e130928e5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 51, "avg_line_length": 21.157894736842106, "alnum_prop": 0.6840796019900498, "repo_name": "opennode/waldur-mastermind", "id": "375cc78221afa431d6c965b55ad9ebe1ec6d99cc", "size": "402", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "src/waldur_azure/extension.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4429" }, { "name": "Dockerfile", "bytes": "6258" }, { "name": "HTML", "bytes": "42329" }, { "name": "JavaScript", "bytes": "729" }, { "name": "Python", "bytes": "5520019" }, { "name": "Shell", "bytes": "15429" } ], "symlink_target": "" }