text
stringlengths
2
1.04M
meta
dict
package com.izforge.izpack; import com.izforge.izpack.util.OsConstraint; import java.io.File; import java.io.FileNotFoundException; import java.util.List; import java.util.Map; /** * Extends the packfile by the information at which file position an entry is stored * * @author Dennis Reil, <Dennis.Reil@reddot.de> */ public class XPackFile extends PackFile { private static final long serialVersionUID = 5875050264763504283L; protected long archivefileposition; /** * @param src * @param target * @param osList * @param override * @throws FileNotFoundException */ public XPackFile(File baseDir, File src, String target, List<OsConstraint> osList, int override) throws FileNotFoundException { super(baseDir, src, target, osList, override); this.archivefileposition = 0; } /** * @param src * @param target * @param osList * @param override * @param additionals * @throws FileNotFoundException */ public XPackFile(File baseDir, File src, String target, List<OsConstraint> osList, int override, Map additionals) throws FileNotFoundException { super(baseDir, src, target, osList, override, additionals); this.archivefileposition = 0; } public XPackFile(PackFile packf) throws FileNotFoundException { super(new File(packf.sourcePath), packf.relativePath, packf.getTargetPath(), packf.osConstraints(), packf .override(), packf.getAdditionals()); this.archivefileposition = 0; } public long getArchivefileposition() { return archivefileposition; } public void setArchivefileposition(long archivefileposition) { this.archivefileposition = archivefileposition; } public PackFile getPackfile() { return this; } }
{ "content_hash": "c00aeb52648b2a71c8458bf4aabdf323", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 117, "avg_line_length": 26.47887323943662, "alnum_prop": 0.6707446808510639, "repo_name": "awilhelm/izpack-with-ips", "id": "6dc5f9f4f41b47289af8f1fdd1aa9181acb7ba61", "size": "2592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/lib/com/izforge/izpack/XPackFile.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "145580" }, { "name": "Java", "bytes": "2863250" }, { "name": "JavaScript", "bytes": "1380" }, { "name": "Python", "bytes": "3466" }, { "name": "Shell", "bytes": "18384" } ], "symlink_target": "" }
<?xml version="1.0" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <!-- <parameters> <parameter key="dj_blog.example.class">DJ\BlogBundle\Example</parameter> </parameters> <services> <service id="dj_blog.example" class="%dj_blog.example.class%"> <argument type="service" id="service_id" /> <argument>plain_value</argument> <argument>%parameter_name%</argument> </service> </services> --> </container>
{ "content_hash": "90b1f12ade4b0a9db7af8fffd44f0d55", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 120, "avg_line_length": 34.05, "alnum_prop": 0.631424375917768, "repo_name": "biomechanoid/project-TRVL", "id": "2a736b7d4172ebebbcb82ab3452c97a2b41f8734", "size": "681", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/DJ/BlogBundle/Resources/config/services.xml", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2907" }, { "name": "CSS", "bytes": "162710" }, { "name": "HTML", "bytes": "285445" }, { "name": "JavaScript", "bytes": "49571" }, { "name": "PHP", "bytes": "176589" } ], "symlink_target": "" }
<?php // autoload.php @generated by Composer require_once __DIR__ . '/composer' . '/autoload_real.php'; return ComposerAutoloaderInit92b5a0e34775bc72bc82d97b9614e6aa::getLoader();
{ "content_hash": "a675f4ad44112ad80096aedc9daeb287", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 75, "avg_line_length": 26.142857142857142, "alnum_prop": 0.7595628415300546, "repo_name": "albertogcatalan/product-hunt-clone", "id": "c403c842939255911358e71339a29af63a3b9831", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Quaver/Lib/yaml/vendor/autoload.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "452" }, { "name": "CSS", "bytes": "87642" }, { "name": "HTML", "bytes": "41310" }, { "name": "JavaScript", "bytes": "36043" }, { "name": "PHP", "bytes": "1098205" }, { "name": "Shell", "bytes": "4442" } ], "symlink_target": "" }
<!-- Description: feed link rel='self' Expect: not bozo and feed['links'][0]['rel'] == 'self' --> <feed xmlns="http://www.w3.org/2005/Atom"> <link rel="self" type="application/atom+xml" href="http://www.example.com/"/> </feed>
{ "content_hash": "b959f26f2db1c3962ffb07b701ce0d99", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 79, "avg_line_length": 33.42857142857143, "alnum_prop": 0.6239316239316239, "repo_name": "simplepie/simplepie-ng", "id": "2dd731f834394c4a2395da1a0a8fe045adcddfa7", "size": "234", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/Integration/feeds/wellformed/atom10/feed_link_rel_self.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "22404" }, { "name": "Makefile", "bytes": "8026" }, { "name": "PHP", "bytes": "505427" }, { "name": "Python", "bytes": "10399" }, { "name": "Roff", "bytes": "2170" }, { "name": "Shell", "bytes": "271" }, { "name": "XSLT", "bytes": "734" } ], "symlink_target": "" }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } class C { // Output should not use `_initialiseProps` constructor(T) { _defineProperty(this, "x", void 0); _defineProperty(this, "y", 0); } }
{ "content_hash": "7b71acb4918fa977a30cb996f54097ca", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 209, "avg_line_length": 33.54545454545455, "alnum_prop": 0.6504065040650406, "repo_name": "samwgoldman/babel", "id": "e6d715c07a9a21d860de0875bc5b438441eba9c9", "size": "369", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/babel-plugin-proposal-class-properties/test/fixtures/compile-to-class/constructor-collision-ignores-types/output.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3207" }, { "name": "JavaScript", "bytes": "3322394" }, { "name": "Makefile", "bytes": "4671" }, { "name": "Shell", "bytes": "1014" } ], "symlink_target": "" }
package org.jpmml.evaluator; import java.util.*; import org.dmg.pmml.*; import com.google.common.collect.*; abstract public class EvaluationContext { private Map<FieldName, FieldValue> fields = Maps.newLinkedHashMap(); private List<String> warnings = Lists.newArrayList(); abstract public DerivedField resolveDerivedField(FieldName name); abstract public DefineFunction resolveFunction(String name); /** * @see #getFieldEntry(FieldName) */ public FieldValue getField(FieldName name){ Map.Entry<FieldName, FieldValue> entry = getFieldEntry(name); if(entry != null){ return entry.getValue(); } return null; } public Map.Entry<FieldName, FieldValue> getFieldEntry(FieldName name){ Map<FieldName, FieldValue> fields = getFields(); if(fields.containsKey(name)){ Map.Entry<FieldName, FieldValue> entry = new AbstractMap.SimpleEntry<FieldName, FieldValue>(name, fields.get(name)); return entry; } return null; } public boolean declare(FieldName name, Object value){ if(value instanceof FieldValue){ return declare(name, (FieldValue)value); } return declare(name, createFieldValue(name, value)); } /** * @return <code>true</code> If the field was already declared, <code>false</code> otherwise. */ public boolean declare(FieldName name, FieldValue value){ Map<FieldName, FieldValue> fields = getFields(); boolean duplicate = fields.containsKey(name); fields.put(name, value); return duplicate; } public boolean declareAll(Map<FieldName, ?> fields){ boolean result = false; Collection<? extends Map.Entry<FieldName, ?>> entries = fields.entrySet(); for(Map.Entry<FieldName, ?> entry : entries){ result |= declare(entry.getKey(), entry.getValue()); } return result; } public FieldValue createFieldValue(FieldName name, Object value){ return FieldValueUtil.create(value); } public void addWarning(String warning){ List<String> warnings = getWarnings(); warnings.add(warning); } public Map<FieldName, FieldValue> getFields(){ return this.fields; } public List<String> getWarnings(){ return this.warnings; } }
{ "content_hash": "617e2a2681c4578a795014e9efc908f2", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 119, "avg_line_length": 21.693877551020407, "alnum_prop": 0.7234242709313264, "repo_name": "jpmml/jpmml", "id": "c12177a7f76b95fa898db601220f30de00a049be", "size": "2169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pmml-evaluator/src/main/java/org/jpmml/evaluator/EvaluationContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "421204" }, { "name": "R", "bytes": "10035" }, { "name": "XSLT", "bytes": "4230" } ], "symlink_target": "" }
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_ #include "application_manager/commands/command_notification_impl.h" #include "utils/macro.h" namespace application_manager { namespace commands { /** * @brief OnHMIStatusNotification class **/ class OnHMIStatusNotification : public CommandNotificationImpl { public: /** * @brief OnHMIStatusNotification class constructor * * @param message Incoming SmartObject message **/ OnHMIStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); /** * @brief OnHMIStatusNotification class destructor **/ virtual ~OnHMIStatusNotification(); /** * @brief Execute command **/ virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
{ "content_hash": "ac831e88e0b657f7c31299ba54e9ee77", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 119, "avg_line_length": 27.348837209302324, "alnum_prop": 0.7517006802721088, "repo_name": "LuxoftAKutsan/sdl_core", "id": "58659cbc4bb36ae6d3c3033b989dce9094a482bc", "size": "2689", "binary": false, "copies": "2", "ref": "refs/heads/feature/sdl_remote_control_baseline", "path": "src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "812977" }, { "name": "C++", "bytes": "17300536" }, { "name": "CMake", "bytes": "240889" }, { "name": "HTML", "bytes": "1138" }, { "name": "JavaScript", "bytes": "32716" }, { "name": "M4", "bytes": "25347" }, { "name": "Makefile", "bytes": "185714" }, { "name": "PLpgSQL", "bytes": "12609" }, { "name": "Python", "bytes": "516485" }, { "name": "QML", "bytes": "1405955" }, { "name": "QMake", "bytes": "2050" }, { "name": "Shell", "bytes": "689989" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2014 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="top" android:orientation="vertical"> <FrameLayout android:id="@+id/search_bar_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f2f2f2"> <androidx.cardview.widget.CardView android:id="@+id/search_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" app:cardBackgroundColor="?android:attr/colorBackground" app:cardCornerRadius="2dp" app:cardElevation="2dp"> <androidx.appcompat.widget.Toolbar android:id="@+id/search_toolbar" android:layout_width="match_parent" android:layout_height="48dp" android:background="?android:attr/selectableItemBackground" android:contentInsetStart="0dp" android:contentInsetStartWithNavigation="0dp"> <androidx.appcompat.widget.SearchView android:id="@+id/search_view" android:layout_width="match_parent" android:layout_height="match_parent" android:iconifiedByDefault="false" android:imeOptions="actionSearch|flagNoExtractUi" android:importantForAutofill="noExcludeDescendants" android:queryHint="content://..." android:searchIcon="@null" /> </androidx.appcompat.widget.Toolbar> </androidx.cardview.widget.CardView> </FrameLayout> <androidx.recyclerview.widget.RecyclerView android:id="@+id/slice_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false" android:paddingBottom="@dimen/vertical_page_margin" android:paddingEnd="@dimen/horizontal_page_margin" android:paddingStart="@dimen/horizontal_page_margin" android:paddingTop="@dimen/vertical_page_margin" app:layoutManager="LinearLayoutManager" /> </LinearLayout>
{ "content_hash": "339ee206bb8163bfb3f55ab4cd837076", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 77, "avg_line_length": 42.774647887323944, "alnum_prop": 0.6437273625288114, "repo_name": "googlearchive/android-SliceViewer", "id": "68284802cb44e6e267b93bc8822a865005638532", "size": "3037", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/activity_slice_viewer.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Kotlin", "bytes": "30715" } ], "symlink_target": "" }
@class DBTEAMLOGTeamBrandingPolicy; NS_ASSUME_NONNULL_BEGIN #pragma mark - API Object /// /// The `TeamBrandingPolicy` union. /// /// Policy for controlling team access to setting up branding feature /// /// This class implements the `DBSerializable` protocol (serialize and /// deserialize instance methods), which is required for all Obj-C SDK API route /// objects. /// @interface DBTEAMLOGTeamBrandingPolicy : NSObject <DBSerializable, NSCopying> #pragma mark - Instance fields /// The `DBTEAMLOGTeamBrandingPolicyTag` enum type represents the possible tag /// states with which the `DBTEAMLOGTeamBrandingPolicy` union can exist. typedef NS_CLOSED_ENUM(NSInteger, DBTEAMLOGTeamBrandingPolicyTag){ /// (no description). DBTEAMLOGTeamBrandingPolicyDisabled, /// (no description). DBTEAMLOGTeamBrandingPolicyEnabled, /// (no description). DBTEAMLOGTeamBrandingPolicyOther, }; /// Represents the union's current tag state. @property (nonatomic, readonly) DBTEAMLOGTeamBrandingPolicyTag tag; #pragma mark - Constructors /// /// Initializes union class with tag state of "disabled". /// /// @return An initialized instance. /// - (instancetype)initWithDisabled; /// /// Initializes union class with tag state of "enabled". /// /// @return An initialized instance. /// - (instancetype)initWithEnabled; /// /// Initializes union class with tag state of "other". /// /// @return An initialized instance. /// - (instancetype)initWithOther; - (instancetype)init NS_UNAVAILABLE; #pragma mark - Tag state methods /// /// Retrieves whether the union's current tag state has value "disabled". /// /// @return Whether the union's current tag state has value "disabled". /// - (BOOL)isDisabled; /// /// Retrieves whether the union's current tag state has value "enabled". /// /// @return Whether the union's current tag state has value "enabled". /// - (BOOL)isEnabled; /// /// Retrieves whether the union's current tag state has value "other". /// /// @return Whether the union's current tag state has value "other". /// - (BOOL)isOther; /// /// Retrieves string value of union's current tag state. /// /// @return A human-readable string representing the union's current tag state. /// - (NSString *)tagName; @end #pragma mark - Serializer Object /// /// The serialization class for the `DBTEAMLOGTeamBrandingPolicy` union. /// @interface DBTEAMLOGTeamBrandingPolicySerializer : NSObject /// /// Serializes `DBTEAMLOGTeamBrandingPolicy` instances. /// /// @param instance An instance of the `DBTEAMLOGTeamBrandingPolicy` API object. /// /// @return A json-compatible dictionary representation of the /// `DBTEAMLOGTeamBrandingPolicy` API object. /// + (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMLOGTeamBrandingPolicy *)instance; /// /// Deserializes `DBTEAMLOGTeamBrandingPolicy` instances. /// /// @param dict A json-compatible dictionary representation of the /// `DBTEAMLOGTeamBrandingPolicy` API object. /// /// @return An instantiation of the `DBTEAMLOGTeamBrandingPolicy` object. /// + (DBTEAMLOGTeamBrandingPolicy *)deserialize:(NSDictionary<NSString *, id> *)dict; @end NS_ASSUME_NONNULL_END
{ "content_hash": "408c1cb53d93cfc75055ec613b94b015", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 93, "avg_line_length": 25.642276422764226, "alnum_prop": 0.7336715282181357, "repo_name": "dropbox/dropbox-sdk-obj-c", "id": "57c7b954ecb72589c54983a1a30ded6c623398eb", "size": "3340", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Source/ObjectiveDropboxOfficial/Shared/Generated/ApiObjects/TeamLog/Headers/DBTEAMLOGTeamBrandingPolicy.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1288" }, { "name": "CSS", "bytes": "6608" }, { "name": "Objective-C", "bytes": "18903013" }, { "name": "Python", "bytes": "7087" }, { "name": "Ruby", "bytes": "1819" }, { "name": "Shell", "bytes": "4527" } ], "symlink_target": "" }
<?php require_once 'Tree/tests/copy_tree.php'; /** * @package TreeDatabaseTiein * @subpackage Tests */ class ezcTreeDbCopyTest extends ezcTreeCopyTest { protected $tables = array( 'materialized_path', 'nested_set', 'parent_child', 'data', 'datam' ); protected function setUp() { static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; try { $this->dbh = ezcDbInstance::get(); $this->removeTables(); $this->loadSchemas(); } catch ( Exception $e ) { $this->markTestSkipped( $e->getMessage() ); } $this->storeFrom = new ezcTreeDbExternalTableDataStore( $this->dbh, 'dataFrom', 'id', 'data' ); $this->storeTo = new ezcTreeDbExternalTableDataStore( $this->dbh, 'dataTo', 'id', 'data' ); $this->storeFromXml = new ezcTreeXmlInternalDataStore(); $this->storeFromMem = new ezcTreeMemoryDataStore(); $this->storeToXml = new ezcTreeXmlInternalDataStore(); $this->storeToMem = new ezcTreeMemoryDataStore(); } protected function tearDown() { $this->removeTempDir(); } private function loadSchemas() { $schema = ezcDbSchema::createFromFile( 'array', dirname( __FILE__ ) . "/files/all-types.dba" ); $schema->writeToDb( $this->dbh ); } protected function emptyTables() { $db = $this->dbh; foreach ( $this->tables as $table ) { $q = $db->createDeleteQuery(); $q->deleteFrom( $table ); $s = $q->prepare(); $s->execute(); } } protected function removeTables() { try { foreach ( $this->tables as $table ) { $this->dbh->exec( "DROP TABLE $table" ); } } catch ( Exception $e ) { // ignore } } public function testTreeParentChildToMaterializedPath() { $treeFrom = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbMaterializedPath( $this->dbh, 'materialized_path', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeParentChildToNestedSet() { $treeFrom = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbNestedSet( $this->dbh, 'nested_set', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeParentChildToXML() { $treeFrom = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = ezcTreeXml::create( $this->tempDir . 'testTreeParentChildToXML.xml', $this->storeToXml ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeParentChildToMemory() { $treeFrom = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = ezcTreeMemory::create( $this->storeToMem ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeMaterializedPathToParentChild() { $treeFrom = new ezcTreeDbMaterializedPath( $this->dbh, 'materialized_path', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeMaterializedPathToNestedSet() { $treeFrom = new ezcTreeDbMaterializedPath( $this->dbh, 'materialized_path', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbNestedSet( $this->dbh, 'nested_set', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeNestedSetToMaterializedPath() { $treeFrom = new ezcTreeDbNestedSet( $this->dbh, 'nested_set', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbMaterializedPath( $this->dbh, 'materialized_path', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public function testTreeNestedSetToParentChild() { $treeFrom = new ezcTreeDbNestedSet( $this->dbh, 'nested_set', $this->storeFrom ); $this->addTestData( $treeFrom ); $treeTo = new ezcTreeDbParentChild( $this->dbh, 'parent_child', $this->storeTo ); self::doCopyTest( $treeFrom, $treeTo ); } public static function suite() { return new PHPUnit_Framework_TestSuite( "ezcTreeDbCopyTest" ); } } ?>
{ "content_hash": "10d83c7d84b038bc7d1f9fb161ced897", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 107, "avg_line_length": 33.16438356164384, "alnum_prop": 0.590871540685667, "repo_name": "evp/ezcomponents", "id": "fdaddc9ac67f652d22cc0f1085586151494286ec", "size": "5065", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "TreeDatabaseTiein/tests/copy_tree.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "153" }, { "name": "C++", "bytes": "146" }, { "name": "CSS", "bytes": "4095" }, { "name": "HTML", "bytes": "712397" }, { "name": "PHP", "bytes": "24323507" }, { "name": "PLSQL", "bytes": "874" }, { "name": "Python", "bytes": "54500" }, { "name": "Shell", "bytes": "71" }, { "name": "Smarty", "bytes": "7063" }, { "name": "SourcePawn", "bytes": "12" } ], "symlink_target": "" }
using GalaSoft.MvvmLight; namespace RealEstateInspector.ViewModel { /// <summary> /// This class contains properties that the main View can data bind to. /// <para> /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel. /// </para> /// <para> /// You can also use Blend to data bind with the tool's support. /// </para> /// <para> /// See http://www.galasoft.ch/mvvm /// </para> /// </summary> public class MainViewModel : ViewModelBase { /// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} } } }
{ "content_hash": "2d6a0e17fd5699535191fe82c4d2ff64", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 95, "avg_line_length": 27.852941176470587, "alnum_prop": 0.5068637803590285, "repo_name": "nickrandolph/realestateinspector", "id": "9304e0d6a1b63940c981f45c0910143802d053aa", "size": "947", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "RealEstateInspector/RealEstateInspector.WindowsPhone/ViewModel/MainViewModel.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "113" }, { "name": "C#", "bytes": "436724" }, { "name": "Groff", "bytes": "32858" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="th_TH" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Digitalgold</source> <translation>เกี่ยวกับ บิตคอย์น</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Digitalgold&lt;/b&gt; version</source> <translation>&lt;b&gt;บิตคอย์น&lt;b&gt;รุ่น</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Digitalgold developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>สมุดรายชื่อ</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>ดับเบิลคลิก เพื่อแก้ไขที่อยู่ หรือชื่อ</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>สร้างที่อยู่ใหม่</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>คัดลอกที่อยู่ที่ถูกเลือกไปยัง คลิปบอร์ดของระบบ</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Digitalgold addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Digitalgold address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Digitalgold address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>ลบ</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Digitalgold addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>ส่งออกรายชื่อทั้งหมด</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>ส่งออกผิดพลาด</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>ชื่อ</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ไม่มีชื่อ)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>ใส่รหัสผ่าน</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>รหัสผา่นใหม่</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>กรุณากรอกรหัสผ่านใหม่อีกครั้งหนึ่ง</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>กระเป๋าสตางค์ที่เข้ารหัส</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>เปิดกระเป๋าสตางค์</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>ถอดรหัสกระเป๋าสตางค์</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>เปลี่ยนรหัสผ่าน</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>กรอกรหัสผ่านเก่าและรหัสผ่านใหม่สำหรับกระเป๋าสตางค์</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>ยืนยันการเข้ารหัสกระเป๋าสตางค์</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>กระเป๋าสตางค์ถูกเข้ารหัสเรียบร้อยแล้ว</translation> </message> <message> <location line="-56"/> <source>Digitalgold will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your digitalgolds from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>การเข้ารหัสกระเป๋าสตางค์ผิดพลาด</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>รหัสผ่านที่คุณกรอกไม่ตรงกัน</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Show information about Digitalgold</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a Digitalgold address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for Digitalgold</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>Digitalgold</source> <translation type="unfinished"/> </message> <message> <location line="-530"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About Digitalgold</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Digitalgold addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Digitalgold addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Digitalgold client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Digitalgold network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Digitalgold address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Digitalgold can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Digitalgold address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Digitalgold-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Digitalgold after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Digitalgold on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the Digitalgold client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the Digitalgold network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Digitalgold.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show Digitalgold addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Digitalgold.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Digitalgold network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-124"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start digitalgold: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Digitalgold-Qt help message to get a list with possible Digitalgold command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>Digitalgold - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Digitalgold Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the Digitalgold debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Digitalgold RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Digitalgold address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Digitalgold address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Digitalgold address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Digitalgold address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter Digitalgold signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Digitalgold developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation>วันนี้</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation>ชื่อ</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>ส่งออกผิดพลาด</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Digitalgold version</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Send command to -server or digitalgoldd</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Specify configuration file (default: digitalgold.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Specify pid file (default: digitalgoldd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=digitalgoldrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Digitalgold Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Digitalgold is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Digitalgold will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>SSL options: (see the Digitalgold Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+165"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Digitalgold</source> <translation type="unfinished"/> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Digitalgold to complete</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Digitalgold is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
{ "content_hash": "d22e074eb8c3ae767f57ce1b1e310915", "timestamp": "", "source": "github", "line_count": 2917, "max_line_length": 395, "avg_line_length": 33.19814878299623, "alnum_prop": 0.5860965107033324, "repo_name": "Userperson321/DigitalGold", "id": "a022dbeead1e9a1eae45547ca9d97a38b2f7a87b", "size": "98005", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_th_TH.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "32394" }, { "name": "C++", "bytes": "2613709" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50615" }, { "name": "Makefile", "bytes": "13405" }, { "name": "NSIS", "bytes": "6184" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "5864" }, { "name": "Python", "bytes": "69729" }, { "name": "QMake", "bytes": "14726" }, { "name": "Roff", "bytes": "18284" }, { "name": "Shell", "bytes": "16339" } ], "symlink_target": "" }
<?php namespace Codelint\Laravel\Database; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; /** * MetaTableOperator: * @date 15/11/15 * @time 01:07 * @author Ray.Zhang <codelint@foxmail.com> **/ class MetaTableOperator extends DBOperator { function __construct($table, $primaryKey, $meta_key = 'iid', $fields = []) { parent::__construct($table, $primaryKey, $meta_key, $fields); if (!Schema::hasTable($this->table())) { $this->build(); } } public function build() { $table = $this->table(); Schema::create($table, function($table) { $table->bigIncrements('id'); $table->bigInteger('iid'); $table->char('key', 64); $table->string('value', 192); $table->index(['iid', 'key', 'value']); }); // $sql = sprintf('CREATE TABLE `%s%s` ( // `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, // `iid` bigint(20) unsigned NOT NULL DEFAULT "0", // `key` char(64) NOT NULL DEFAULT "", // `value` varchar(192) NOT NULL DEFAULT "", // PRIMARY KEY (`id`), // KEY `index_%s_iid_key_value` (`iid`,`key`,`value`) // ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT="%s data"', // $prefix, $table, $table, $table); // DB::statement($sql); } /** * 按条件查询,条件规则位 [$field1 => $value, $field2 => [$operator, $value]] * @param array $conds * @param array $fields 要查询的字段 * @param int $max 查询记录数, 0为不限制 * @throws \Exception * @return mixed 结果记录 */ public function findBy(array $conds, $fields = [], $max = 0) { $list = parent::findBy($conds, $fields, $max); if (empty($fields) || in_array('value', $fields)) { foreach ($list as &$item) { $item['value'] = json_decode($item['value'], true); } } return $list; } public function _wheres($conds) { if (isset($conds['value'])) { if (is_array($conds['value']) && $conds['value'][0] != '=') { throw new \Exception('only support equal for meta.value findBy condition'); } $conds['value'] = json_encode($conds['value']); } return parent::_wheres($conds); } /** * @param $table * @param $key $table.key * @param string|bool $fkey $this->table.key * @return $this */ public function leftJoinOn($table, $key = 'id', $fkey = 'iid') { return parent::leftJoinOn($table, $key, $fkey); } /** * @param string $table table name * @param string $key $table.key * @param string|bool $fkey $this->table.key * @return $this */ public function innerJoinOn($table, $key = 'id', $fkey = 'iid') { return parent::innerJoinOn($table, $key, $fkey); } /** * 插入记录 * @param array $obj * @return bool|array 成功返回带id的对象,否则返回false */ function insert($obj) { $orig = $obj; if (isset($obj['value'])) { $obj['value'] = json_encode($obj['value']); } $obj = parent::insert($obj); return array_replace($obj, $orig); } public function updateBy($obj, $cri) { $orig = $obj; if (isset($obj['value'])) { $obj['value'] = json_encode($obj['value']); } parent::updateBy($obj, $cri); return $orig; } public function meta_operator() { throw new \Exception('Do not support meta data for meta table'); } /** * 活动对应得meta值,例如order,则会从表order_meta中读取或者设置meta值 * @param string $iid * @param bool|string $key * @param mixed $val * @throws \Exception * @return mixed */ public function meta($iid, $key, $val = null) { throw new \Exception('Do not support meta data for meta table'); } /** * Get/update all the meta data of the object * @param int|string $iid object id * @param bool|array $data * @throws \Exception * @return array */ public function metadata($iid, $data = false) { throw new \Exception('Do not support meta data for meta table'); } }
{ "content_hash": "3bd942420af2f0ae360d32ee7b09b006", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 99, "avg_line_length": 27.402439024390244, "alnum_prop": 0.511793502447708, "repo_name": "codelint/laravel-tool", "id": "349f6012aaba5827409f91ee32f8c4130064b56c", "size": "4632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Codelint/Laravel/Database/MetaTableOperator.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "72" }, { "name": "HTML", "bytes": "2127" }, { "name": "JavaScript", "bytes": "503" }, { "name": "PHP", "bytes": "133238" } ], "symlink_target": "" }
<?php /** * PHPExcel_Comment * * @category PHPExcel * @package PHPExcel * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) */ class PHPExcel_Comment implements PHPExcel_IComparable { /** * Author * * @var string */ private $_author; /** * Rich text comment * * @var PHPExcel_RichText */ private $_text; /** * Comment width (CSS style, i.e. XXpx or YYpt) * * @var string */ private $_width = '96pt'; /** * Left margin (CSS style, i.e. XXpx or YYpt) * * @var string */ private $_marginLeft = '59.25pt'; /** * Top margin (CSS style, i.e. XXpx or YYpt) * * @var string */ private $_marginTop = '1.5pt'; /** * Visible * * @var boolean */ private $_visible = false; /** * Comment height (CSS style, i.e. XXpx or YYpt) * * @var string */ private $_height = '55.5pt'; /** * Comment fill color * * @var PHPExcel_Style_Color */ private $_fillColor; /** * Alignment * * @var string */ private $_alignment; /** * Create a new PHPExcel_Comment * * @throws PHPExcel_Exception */ public function __construct() { // Initialise variables $this->_author = 'Author'; $this->_text = new PHPExcel_RichText(); $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); $this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; } /** * Get Author * * @return string */ public function getAuthor() { return $this->_author; } /** * Set Author * * @param string $pValue * * @return PHPExcel_Comment */ public function setAuthor($pValue = '') { $this->_author = $pValue; return $this; } /** * Get Rich text comment * * @return PHPExcel_RichText */ public function getText() { return $this->_text; } /** * Set Rich text comment * * @param PHPExcel_RichText $pValue * * @return PHPExcel_Comment */ public function setText(PHPExcel_RichText $pValue) { $this->_text = $pValue; return $this; } /** * Get comment width (CSS style, i.e. XXpx or YYpt) * * @return string */ public function getWidth() { return $this->_width; } /** * Set comment width (CSS style, i.e. XXpx or YYpt) * * @param string $value * * @return PHPExcel_Comment */ public function setWidth($value = '96pt') { $this->_width = $value; return $this; } /** * Get comment height (CSS style, i.e. XXpx or YYpt) * * @return string */ public function getHeight() { return $this->_height; } /** * Set comment height (CSS style, i.e. XXpx or YYpt) * * @param string $value * * @return PHPExcel_Comment */ public function setHeight($value = '55.5pt') { $this->_height = $value; return $this; } /** * Get left margin (CSS style, i.e. XXpx or YYpt) * * @return string */ public function getMarginLeft() { return $this->_marginLeft; } /** * Set left margin (CSS style, i.e. XXpx or YYpt) * * @param string $value * * @return PHPExcel_Comment */ public function setMarginLeft($value = '59.25pt') { $this->_marginLeft = $value; return $this; } /** * Get top margin (CSS style, i.e. XXpx or YYpt) * * @return string */ public function getMarginTop() { return $this->_marginTop; } /** * Set top margin (CSS style, i.e. XXpx or YYpt) * * @param string $value * * @return PHPExcel_Comment */ public function setMarginTop($value = '1.5pt') { $this->_marginTop = $value; return $this; } /** * Is the comment visible by default? * * @return boolean */ public function getVisible() { return $this->_visible; } /** * Set comment default visibility * * @param boolean $value * * @return PHPExcel_Comment */ public function setVisible($value = false) { $this->_visible = $value; return $this; } /** * Get fill color * * @return PHPExcel_Style_Color */ public function getFillColor() { return $this->_fillColor; } /** * Set Alignment * * @param string $pValue * * @return PHPExcel_Comment */ public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) { $this->_alignment = $pValue; return $this; } /** * Get Alignment * * @return string */ public function getAlignment() { return $this->_alignment; } /** * Get hash code * * @return string Hash code */ public function getHashCode() { return md5($this->_author . $this->_text->getHashCode() . $this->_width . $this->_height . $this->_marginLeft . $this->_marginTop . ($this->_visible ? 1 : 0) . $this->_fillColor->getHashCode() . $this->_alignment . __CLASS__); } /** * Implement PHP __clone to create a deep clone, not just a shallow copy. */ public function __clone() { $vars = get_object_vars($this); foreach ($vars as $key => $value) { if (is_object($value)) { $this->$key = clone $value; } else { $this->$key = $value; } } } /** * Convert to string * * @return string */ public function __toString() { return $this->_text->getPlainText(); } }
{ "content_hash": "afda280d38eb043d5fb8a3adef6f286e", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 228, "avg_line_length": 16.37741935483871, "alnum_prop": 0.5924758715777033, "repo_name": "slayerhover/yaf-cms-backoffice", "id": "b2a9c9b2bd4563d1199959f953c63ea51a01c48f", "size": "6127", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/PHPExcel/Comment.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1216063" }, { "name": "Groovy", "bytes": "1321" }, { "name": "HTML", "bytes": "1875441" }, { "name": "JavaScript", "bytes": "9333862" }, { "name": "Lua", "bytes": "19437" }, { "name": "Makefile", "bytes": "5584" }, { "name": "PHP", "bytes": "6859795" }, { "name": "Python", "bytes": "7780" }, { "name": "Scheme", "bytes": "612" }, { "name": "Shell", "bytes": "214" }, { "name": "Smarty", "bytes": "2994" } ], "symlink_target": "" }
package com.netflix.spectator.tdigest; import com.netflix.spectator.api.Registry; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; /** * Write measurements to a file. This class is mostly used for testing. */ public class FileTDigestWriter extends StreamTDigestWriter { /** Create a new instance. */ public FileTDigestWriter(Registry registry, TDigestConfig config, File file) throws FileNotFoundException { super(registry, config, new FileOutputStream(file)); } }
{ "content_hash": "5e2bd1becb30e2c3630494494f07d76a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 26.55, "alnum_prop": 0.768361581920904, "repo_name": "rspieldenner/spectator", "id": "bd8263d5db08fc98ec5fc2144d31027936e6212b", "size": "1128", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "spectator-reg-tdigest/src/main/java/com/netflix/spectator/tdigest/FileTDigestWriter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "642240" }, { "name": "Shell", "bytes": "3769" } ], "symlink_target": "" }
<html> <head> <title>pcrepartial specification</title> </head> <body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB"> <h1>pcrepartial man page</h1> <p> Return to the <a href="index.html">PCRE index page</a>. </p> <p> This page is part of the PCRE HTML documentation. It was generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong. <br> <ul> <li><a name="TOC1" href="#SEC1">PARTIAL MATCHING IN PCRE</a> <li><a name="TOC2" href="#SEC2">PARTIAL MATCHING USING pcre_exec()</a> <li><a name="TOC3" href="#SEC3">PARTIAL MATCHING USING pcre_dfa_exec()</a> <li><a name="TOC4" href="#SEC4">PARTIAL MATCHING AND WORD BOUNDARIES</a> <li><a name="TOC5" href="#SEC5">FORMERLY RESTRICTED PATTERNS</a> <li><a name="TOC6" href="#SEC6">EXAMPLE OF PARTIAL MATCHING USING PCRETEST</a> <li><a name="TOC7" href="#SEC7">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec()</a> <li><a name="TOC8" href="#SEC8">MULTI-SEGMENT MATCHING WITH pcre_exec()</a> <li><a name="TOC9" href="#SEC9">ISSUES WITH MULTI-SEGMENT MATCHING</a> <li><a name="TOC10" href="#SEC10">AUTHOR</a> <li><a name="TOC11" href="#SEC11">REVISION</a> </ul> <br><a name="SEC1" href="#TOC1">PARTIAL MATCHING IN PCRE</a><br> <P> In normal use of PCRE, if the subject string that is passed to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> matches as far as it goes, but is too short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. There are circumstances where it might be helpful to distinguish this case from other cases in which there is no match. </P> <P> Consider, for example, an application where a human is required to type in data for a field with specific formatting requirements. An example might be a date in the form <i>ddmmmyy</i>, defined by this pattern: <pre> ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$ </pre> If the application sees the user's keystrokes one by one, and can check that what has been typed so far is potentially valid, it is able to raise an error as soon as a mistake is made, by beeping and not reflecting the character that has been typed, for example. This immediate feedback is likely to be a better user interface than a check that is delayed until the entire string has been entered. Partial matching can also sometimes be useful when the subject string is very long and is not all available at once. </P> <P> PCRE supports partial matching by means of the PCRE_PARTIAL_SOFT and PCRE_PARTIAL_HARD options, which can be set when calling <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>. For backwards compatibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. The essential difference between the two options is whether or not a partial match is preferred to an alternative complete match, though the details differ between the two matching functions. If both options are set, PCRE_PARTIAL_HARD takes precedence. </P> <P> Setting a partial matching option disables two of PCRE's optimizations. PCRE remembers the last literal byte in a pattern, and abandons matching immediately if such a byte is not present in the subject string. This optimization cannot be used for a subject string that might match only partially. If the pattern was studied, PCRE knows the minimum length of a matching string, and does not bother to run the matching function on shorter strings. This optimization is also disabled for partial matching. </P> <br><a name="SEC2" href="#TOC1">PARTIAL MATCHING USING pcre_exec()</a><br> <P> A partial match occurs during a call to <b>pcre_exec()</b> whenever the end of the subject string is reached successfully, but matching cannot continue because more characters are needed. However, at least one character must have been matched. (In other words, a partial match can never be an empty string.) </P> <P> If PCRE_PARTIAL_SOFT is set, the partial match is remembered, but matching continues as normal, and other alternatives in the pattern are tried. If no complete match can be found, <b>pcre_exec()</b> returns PCRE_ERROR_PARTIAL instead of PCRE_ERROR_NOMATCH. If there are at least two slots in the offsets vector, the first of them is set to the offset of the earliest character that was inspected when the partial match was found. For convenience, the second offset points to the end of the string so that a substring can easily be identified. </P> <P> For the majority of patterns, the first offset identifies the start of the partially matched string. However, for patterns that contain lookbehind assertions, or \K, or begin with \b or \B, earlier characters have been inspected while carrying out the match. For example: <pre> /(?&#60;=abc)123/ </pre> This pattern matches "123", but only if it is preceded by "abc". If the subject string is "xyzabc12", the offsets after a partial match are for the substring "abc12", because all these characters are needed if another match is tried with extra characters added. </P> <P> If there is more than one partial match, the first one that was found provides the data that is returned. Consider this pattern: <pre> /123\w+X|dogY/ </pre> If this is matched against the subject string "abc123dog", both alternatives fail to match, but the end of the subject is reached during matching, so PCRE_ERROR_PARTIAL is returned instead of PCRE_ERROR_NOMATCH. The offsets are set to 3 and 9, identifying "123dog" as the first partial match that was found. (In this example, there are two partial matches, because "dog" on its own partially matches the second alternative.) </P> <P> If PCRE_PARTIAL_HARD is set for <b>pcre_exec()</b>, it returns PCRE_ERROR_PARTIAL as soon as a partial match is found, without continuing to search for possible complete matches. The difference between the two options can be illustrated by a pattern such as: <pre> /dog(sbody)?/ </pre> This matches either "dog" or "dogsbody", greedily (that is, it prefers the longer string if possible). If it is matched against the string "dog" with PCRE_PARTIAL_SOFT, it yields a complete match for "dog". However, if PCRE_PARTIAL_HARD is set, the result is PCRE_ERROR_PARTIAL. On the other hand, if the pattern is made ungreedy the result is different: <pre> /dog(sbody)??/ </pre> In this case the result is always a complete match because <b>pcre_exec()</b> finds that first, and it never continues after finding a match. It might be easier to follow this explanation by thinking of the two patterns like this: <pre> /dog(sbody)?/ is the same as /dogsbody|dog/ /dog(sbody)??/ is the same as /dog|dogsbody/ </pre> The second pattern will never match "dogsbody" when <b>pcre_exec()</b> is used, because it will always find the shorter match first. </P> <br><a name="SEC3" href="#TOC1">PARTIAL MATCHING USING pcre_dfa_exec()</a><br> <P> The <b>pcre_dfa_exec()</b> function moves along the subject string character by character, without backtracking, searching for all possible matches simultaneously. If the end of the subject is reached before the end of the pattern, there is the possibility of a partial match, again provided that at least one character has matched. </P> <P> When PCRE_PARTIAL_SOFT is set, PCRE_ERROR_PARTIAL is returned only if there have been no complete matches. Otherwise, the complete matches are returned. However, if PCRE_PARTIAL_HARD is set, a partial match takes precedence over any complete matches. The portion of the string that was inspected when the longest partial match was found is set as the first matching string, provided there are at least two slots in the offsets vector. </P> <P> Because <b>pcre_dfa_exec()</b> always searches for all possible matches, and there is no difference between greedy and ungreedy repetition, its behaviour is different from <b>pcre_exec</b> when PCRE_PARTIAL_HARD is set. Consider the string "dog" matched against the ungreedy pattern shown above: <pre> /dog(sbody)??/ </pre> Whereas <b>pcre_exec()</b> stops as soon as it finds the complete match for "dog", <b>pcre_dfa_exec()</b> also finds the partial match for "dogsbody", and so returns that when PCRE_PARTIAL_HARD is set. </P> <br><a name="SEC4" href="#TOC1">PARTIAL MATCHING AND WORD BOUNDARIES</a><br> <P> If a pattern ends with one of sequences \b or \B, which test for word boundaries, partial matching with PCRE_PARTIAL_SOFT can give counter-intuitive results. Consider this pattern: <pre> /\bcat\b/ </pre> This matches "cat", provided there is a word boundary at either end. If the subject string is "the cat", the comparison of the final "t" with a following character cannot take place, so a partial match is found. However, <b>pcre_exec()</b> carries on with normal matching, which matches \b at the end of the subject when the last character is a letter, thus finding a complete match. The result, therefore, is <i>not</i> PCRE_ERROR_PARTIAL. The same thing happens with <b>pcre_dfa_exec()</b>, because it also finds the complete match. </P> <P> Using PCRE_PARTIAL_HARD in this case does yield PCRE_ERROR_PARTIAL, because then the partial match takes precedence. </P> <br><a name="SEC5" href="#TOC1">FORMERLY RESTRICTED PATTERNS</a><br> <P> For releases of PCRE prior to 8.00, because of the way certain internal optimizations were implemented in the <b>pcre_exec()</b> function, the PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be used with all patterns. From release 8.00 onwards, the restrictions no longer apply, and partial matching with <b>pcre_exec()</b> can be requested for any pattern. </P> <P> Items that were formerly restricted were repeated single characters and repeated metasequences. If PCRE_PARTIAL was set for a pattern that did not conform to the restrictions, <b>pcre_exec()</b> returned the error code PCRE_ERROR_BADPARTIAL (-13). This error code is no longer in use. The PCRE_INFO_OKPARTIAL call to <b>pcre_fullinfo()</b> to find out if a compiled pattern can be used for partial matching now always returns 1. </P> <br><a name="SEC6" href="#TOC1">EXAMPLE OF PARTIAL MATCHING USING PCRETEST</a><br> <P> If the escape sequence \P is present in a <b>pcretest</b> data line, the PCRE_PARTIAL_SOFT option is used for the match. Here is a run of <b>pcretest</b> that uses the date example quoted above: <pre> re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ data&#62; 25jun04\P 0: 25jun04 1: jun data&#62; 25dec3\P Partial match: 23dec3 data&#62; 3ju\P Partial match: 3ju data&#62; 3juj\P No match data&#62; j\P No match </pre> The first data string is matched completely, so <b>pcretest</b> shows the matched substrings. The remaining four strings do not match the complete pattern, but the first two are partial matches. Similar output is obtained when <b>pcre_dfa_exec()</b> is used. </P> <P> If the escape sequence \P is present more than once in a <b>pcretest</b> data line, the PCRE_PARTIAL_HARD option is set for the match. </P> <br><a name="SEC7" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec()</a><br> <P> When a partial match has been found using <b>pcre_dfa_exec()</b>, it is possible to continue the match by providing additional subject data and calling <b>pcre_dfa_exec()</b> again with the same compiled regular expression, this time setting the PCRE_DFA_RESTART option. You must pass the same working space as before, because this is where details of the previous partial match are stored. Here is an example using <b>pcretest</b>, using the \R escape sequence to set the PCRE_DFA_RESTART option (\D specifies the use of <b>pcre_dfa_exec()</b>): <pre> re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ data&#62; 23ja\P\D Partial match: 23ja data&#62; n05\R\D 0: n05 </pre> The first call has "23ja" as the subject, and requests partial matching; the second call has "n05" as the subject for the continued (restarted) match. Notice that when the match is complete, only the last part is shown; PCRE does not retain the previously partially-matched string. It is up to the calling program to do that if it needs to. </P> <P> You can set the PCRE_PARTIAL_SOFT or PCRE_PARTIAL_HARD options with PCRE_DFA_RESTART to continue partial matching over multiple segments. This facility can be used to pass very long subject strings to <b>pcre_dfa_exec()</b>. </P> <br><a name="SEC8" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_exec()</a><br> <P> From release 8.00, <b>pcre_exec()</b> can also be used to do multi-segment matching. Unlike <b>pcre_dfa_exec()</b>, it is not possible to restart the previous match with a new segment of data. Instead, new data must be added to the previous subject string, and the entire match re-run, starting from the point where the partial match occurred. Earlier data can be discarded. Consider an unanchored pattern that matches dates: <pre> re&#62; /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/ data&#62; The date is 23ja\P Partial match: 23ja </pre> At this stage, an application could discard the text preceding "23ja", add on text from the next segment, and call <b>pcre_exec()</b> again. Unlike <b>pcre_dfa_exec()</b>, the entire matching string must always be available, and the complete matching process occurs for each call, so more memory and more processing time is needed. </P> <P> <b>Note:</b> If the pattern contains lookbehind assertions, or \K, or starts with \b or \B, the string that is returned for a partial match will include characters that precede the partially matched string itself, because these must be retained when adding on more characters for a subsequent matching attempt. </P> <br><a name="SEC9" href="#TOC1">ISSUES WITH MULTI-SEGMENT MATCHING</a><br> <P> Certain types of pattern may give problems with multi-segment matching, whichever matching function is used. </P> <P> 1. If the pattern contains tests for the beginning or end of a line, you need to pass the PCRE_NOTBOL or PCRE_NOTEOL options, as appropriate, when the subject string for any call does not contain the beginning or end of a line. </P> <P> 2. Lookbehind assertions at the start of a pattern are catered for in the offsets that are returned for a partial match. However, in theory, a lookbehind assertion later in the pattern could require even earlier characters to be inspected, and it might not have been reached when a partial match occurs. This is probably an extremely unlikely case; you could guard against it to a certain extent by always including extra characters at the start. </P> <P> 3. Matching a subject string that is split into multiple segments may not always produce exactly the same result as matching over one single long string, especially when PCRE_PARTIAL_SOFT is used. The section "Partial Matching and Word Boundaries" above describes an issue that arises if the pattern ends with \b or \B. Another kind of difference may occur when there are multiple matching possibilities, because a partial match result is given only when there are no completed matches. This means that as soon as the shortest match has been found, continuation to a new subject segment is no longer possible. Consider again this <b>pcretest</b> example: <pre> re&#62; /dog(sbody)?/ data&#62; dogsb\P 0: dog data&#62; do\P\D Partial match: do data&#62; gsb\R\P\D 0: g data&#62; dogsbody\D 0: dogsbody 1: dog </pre> The first data line passes the string "dogsb" to <b>pcre_exec()</b>, setting the PCRE_PARTIAL_SOFT option. Although the string is a partial match for "dogsbody", the result is not PCRE_ERROR_PARTIAL, because the shorter string "dog" is a complete match. Similarly, when the subject is presented to <b>pcre_dfa_exec()</b> in several parts ("do" and "gsb" being the first two) the match stops when "dog" has been found, and it is not possible to continue. On the other hand, if "dogsbody" is presented as a single string, <b>pcre_dfa_exec()</b> finds both matches. </P> <P> Because of these problems, it is probably best to use PCRE_PARTIAL_HARD when matching multi-segment data. The example above then behaves differently: <pre> re&#62; /dog(sbody)?/ data&#62; dogsb\P\P Partial match: dogsb data&#62; do\P\D Partial match: do data&#62; gsb\R\P\P\D Partial match: gsb </PRE> </P> <P> 4. Patterns that contain alternatives at the top level which do not all start with the same pattern item may not work as expected when PCRE_DFA_RESTART is used with <b>pcre_dfa_exec()</b>. For example, consider this pattern: <pre> 1234|3789 </pre> If the first part of the subject is "ABC123", a partial match of the first alternative is found at offset 3. There is no partial match for the second alternative, because such a match does not start at the same point in the subject string. Attempting to continue with the string "7890" does not yield a match because only those alternatives that match at one point in the subject are remembered. The problem arises because the start of the second alternative matches within the first alternative. There is no problem with anchored patterns or patterns such as: <pre> 1234|ABCD </pre> where no string can be a partial match for both alternatives. This is not a problem if <b>pcre_exec()</b> is used, because the entire match has to be rerun each time: <pre> re&#62; /1234|3789/ data&#62; ABC123\P Partial match: 123 data&#62; 1237890 0: 3789 </pre> Of course, instead of using PCRE_DFA_PARTIAL, the same technique of re-running the entire match can also be used with <b>pcre_dfa_exec()</b>. Another possibility is to work with two buffers. If a partial match at offset <i>n</i> in the first buffer is followed by "no match" when PCRE_DFA_RESTART is used on the second buffer, you can then try a new match starting at offset <i>n+1</i> in the first buffer. </P> <br><a name="SEC10" href="#TOC1">AUTHOR</a><br> <P> Philip Hazel <br> University Computing Service <br> Cambridge CB2 3QH, England. <br> </P> <br><a name="SEC11" href="#TOC1">REVISION</a><br> <P> Last updated: 19 October 2009 <br> Copyright &copy; 1997-2009 University of Cambridge. <br> <p> Return to the <a href="index.html">PCRE index page</a>. </p>
{ "content_hash": "bd1dbdb112815533b8f8cc9f4092ab96", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 86, "avg_line_length": 45.3225, "alnum_prop": 0.7489105852501516, "repo_name": "ericmckean/syzygy", "id": "040ac88f30a684e90b0166f7f35fc209d22a0af3", "size": "18129", "binary": false, "copies": "54", "ref": "refs/heads/master", "path": "third_party/pcre/files/doc/html/pcrepartial.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "13748" }, { "name": "C", "bytes": "8422" }, { "name": "C++", "bytes": "7598735" }, { "name": "CSS", "bytes": "1333" }, { "name": "HTML", "bytes": "3182" }, { "name": "Protocol Buffer", "bytes": "6472" }, { "name": "Python", "bytes": "841963" }, { "name": "Shell", "bytes": "19040" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G.cpp Label Definition File: CWE789_Uncontrolled_Mem_Alloc__malloc.label.xml Template File: sources-sinks-84_goodB2G.tmpl.cpp */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: rand Set data to result of rand(), which may be zero * GoodSource: Small number greater than zero * Sinks: * GoodSink: Allocate memory with malloc() and check the size of the memory to be allocated * BadSink : Allocate memory with malloc(), but incorrectly check the size of the memory to be allocated * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use * * */ #ifndef OMITGOOD #include "std_testcase.h" #include "CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84.h" #define HELLO_STRING L"hello" namespace CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84 { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G::CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G(size_t dataCopy) { data = dataCopy; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G::~CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G() { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } } #endif /* OMITGOOD */
{ "content_hash": "3fb625de88626259798abf2c8e5e6e4b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 146, "avg_line_length": 39.72727272727273, "alnum_prop": 0.6704805491990846, "repo_name": "maurer/tiamat", "id": "3d528f25eabba535aa69031186c88bc16c3e7da9", "size": "2185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE789_Uncontrolled_Mem_Alloc/s01/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_84_goodB2G.cpp", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package collector import ( "errors" "fmt" "os" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" ) const ( sockStatSubsystem = "sockstat" ) // Used for calculating the total memory bytes on TCP and UDP. var pageSize = os.Getpagesize() type sockStatCollector struct { logger log.Logger } func init() { registerCollector(sockStatSubsystem, defaultEnabled, NewSockStatCollector) } // NewSockStatCollector returns a new Collector exposing socket stats. func NewSockStatCollector(logger log.Logger) (Collector, error) { return &sockStatCollector{logger}, nil } func (c *sockStatCollector) Update(ch chan<- prometheus.Metric) error { fs, err := procfs.NewFS(*procPath) if err != nil { return fmt.Errorf("failed to open procfs: %w", err) } // If IPv4 and/or IPv6 are disabled on this kernel, handle it gracefully. stat4, err := fs.NetSockstat() switch { case err == nil: case errors.Is(err, os.ErrNotExist): level.Debug(c.logger).Log("msg", "IPv4 sockstat statistics not found, skipping") default: return fmt.Errorf("failed to get IPv4 sockstat data: %w", err) } stat6, err := fs.NetSockstat6() switch { case err == nil: case errors.Is(err, os.ErrNotExist): level.Debug(c.logger).Log("msg", "IPv6 sockstat statistics not found, skipping") default: return fmt.Errorf("failed to get IPv6 sockstat data: %w", err) } stats := []struct { isIPv6 bool stat *procfs.NetSockstat }{ { stat: stat4, }, { isIPv6: true, stat: stat6, }, } for _, s := range stats { c.update(ch, s.isIPv6, s.stat) } return nil } func (c *sockStatCollector) update(ch chan<- prometheus.Metric, isIPv6 bool, s *procfs.NetSockstat) { if s == nil { // IPv6 disabled or similar; nothing to do. return } // If sockstat contains the number of used sockets, export it. if !isIPv6 && s.Used != nil { // TODO: this must be updated if sockstat6 ever exports this data. ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, sockStatSubsystem, "sockets_used"), "Number of IPv4 sockets in use.", nil, nil, ), prometheus.GaugeValue, float64(*s.Used), ) } // A name and optional value for a sockstat metric. type ssPair struct { name string v *int } // Previously these metric names were generated directly from the file output. // In order to keep the same level of compatibility, we must map the fields // to their correct names. for _, p := range s.Protocols { pairs := []ssPair{ { name: "inuse", v: &p.InUse, }, { name: "orphan", v: p.Orphan, }, { name: "tw", v: p.TW, }, { name: "alloc", v: p.Alloc, }, { name: "mem", v: p.Mem, }, { name: "memory", v: p.Memory, }, } // Also export mem_bytes values for sockets which have a mem value // stored in pages. if p.Mem != nil { v := *p.Mem * pageSize pairs = append(pairs, ssPair{ name: "mem_bytes", v: &v, }) } for _, pair := range pairs { if pair.v == nil { // This value is not set for this protocol; nothing to do. continue } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName( namespace, sockStatSubsystem, fmt.Sprintf("%s_%s", p.Protocol, pair.name), ), fmt.Sprintf("Number of %s sockets in state %s.", p.Protocol, pair.name), nil, nil, ), prometheus.GaugeValue, float64(*pair.v), ) } } }
{ "content_hash": "b6f1501deae51b214287465dae7df29e", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 101, "avg_line_length": 21.37278106508876, "alnum_prop": 0.6389811738648948, "repo_name": "siavashs/node_exporter", "id": "8f5a99fab1f27251bb2305f7063359b3638ff71e", "size": "4228", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "collector/sockstat_linux.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "3845" }, { "name": "Go", "bytes": "344812" }, { "name": "Makefile", "bytes": "4198" }, { "name": "Python", "bytes": "7250" }, { "name": "Shell", "bytes": "16009" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>&lt;div&gt; with no role; global state or property "" value of "true"</title> </head> <body> <div aria-atomic="true"> Placeholder content </div> <div id="obj1">obj1</div> <div id="obj2">obj2</div> </body> </html>
{ "content_hash": "ef853651046359d0252641725c3585f6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 90, "avg_line_length": 26.2, "alnum_prop": 0.544529262086514, "repo_name": "youtube/cobalt", "id": "84faaeb86e4b61ac0d6fb6e198d827cc0503a17b", "size": "393", "binary": false, "copies": "261", "ref": "refs/heads/master", "path": "third_party/web_platform_tests/conformance-checkers/html-aria/properties-global-norole/properties-global-norole-aria-atomic.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_43) on Wed May 22 21:49:17 UTC 2013 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> CacheableDeserializer (HBase 0.94.8 API) </TITLE> <META NAME="date" CONTENT="2013-05-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="CacheableDeserializer (HBase 0.94.8 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CacheableDeserializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/Cacheable.html" title="interface in org.apache.hadoop.hbase.io.hfile"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CacheableDeserializer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.hadoop.hbase.io.hfile</FONT> <BR> Interface CacheableDeserializer&lt;T extends <A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/Cacheable.html" title="interface in org.apache.hadoop.hbase.io.hfile">Cacheable</A>&gt;</H2> <HR> <DL> <DT><PRE>public interface <B>CacheableDeserializer&lt;T extends <A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/Cacheable.html" title="interface in org.apache.hadoop.hbase.io.hfile">Cacheable</A>&gt;</B></DL> </PRE> <P> Interface for a deserializer. Throws an IOException if the serialized data is incomplete or wrong. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html" title="type parameter in CacheableDeserializer">T</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html#deserialize(java.nio.ByteBuffer)">deserialize</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;b)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the deserialized object.</TD> </TR> </TABLE> &nbsp; <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="deserialize(java.nio.ByteBuffer)"><!-- --></A><H3> deserialize</H3> <PRE> <A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html" title="type parameter in CacheableDeserializer">T</A> <B>deserialize</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;b) throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> <DL> <DD>Returns the deserialized object. <P> <DD><DL> <DT><B>Returns:</B><DD>T the deserialized object. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CacheableDeserializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/Cacheable.html" title="interface in org.apache.hadoop.hbase.io.hfile"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CacheableDeserializer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "490a6bab8a13d60bd7eb1d8db59d09e0", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 312, "avg_line_length": 46.027522935779814, "alnum_prop": 0.6295594977077935, "repo_name": "algarecu/hbase-0.94.8-qod", "id": "33587d7e6c9a76284137fea579e00134a4bacb0c", "size": "10034", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/apidocs/org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "19836" }, { "name": "CSS", "bytes": "20794" }, { "name": "HTML", "bytes": "139288" }, { "name": "Java", "bytes": "24259991" }, { "name": "Makefile", "bytes": "2514" }, { "name": "PHP", "bytes": "14700" }, { "name": "Perl", "bytes": "17334" }, { "name": "Python", "bytes": "29070" }, { "name": "Ruby", "bytes": "779544" }, { "name": "Shell", "bytes": "175912" }, { "name": "Thrift", "bytes": "69092" }, { "name": "XSLT", "bytes": "8758" } ], "symlink_target": "" }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /*! * jQuery blockUI plugin * Version 2.42 (11-MAY-2012) * @requires jQuery v1.2.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2010 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ (function() { function setup($) { if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); return; } $.fn._fadeIn = $.fn.fadeIn; var noOp = function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // retarded userAgent strings on Vista) var mode = document.documentMode || 0; var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode; // global $ methods for blocking/unblocking the entire page $.blockUI = function(opts) { install(window, opts); }; $.unblockUI = function(opts) { remove(window, opts); }; // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) $.growlUI = function(title, message, timeout, onClose) { var $m = $('<div class="growlUI"></div>'); if (title) $m.append('<h1>'+title+'</h1>'); if (message) $m.append('<h2>'+message+'</h2>'); if (timeout == undefined) timeout = 3000; $.blockUI({ message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, timeout: timeout, showOverlay: false, onUnblock: onClose, css: $.blockUI.defaults.growlCSS }); }; // plugin method for blocking element content $.fn.block = function(opts) { var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); this.each(function() { var $el = $(this); if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) return; $el.unblock({ fadeOut: 0 }); }); return this.each(function() { if ($.css(this,'position') == 'static') this.style.position = 'relative'; if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' install(this, opts); }); }; // plugin method for unblocking element content $.fn.unblock = function(opts) { return this.each(function() { remove(this, opts); }); }; $.blockUI.version = 2.42; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { // message displayed when blocking (use null for no message) message: '<h1>Por favor, espere mientras se completa el proceso...</h1>', title: null, // title string; only used when theme == true draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) theme: false, // set to true to use with jQuery UI themes // styles for the message when blocking; if you wish to disable // these and use an external stylesheet then do this in your code: // $.blockUI.defaults.css = {}; css: { padding: 0, margin: 0, width: '30%', top: '30%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #8DBDD8', backgroundColor:'#fff', cursor: 'wait' }, // minimal style set used when themes are used themedCSS: { width: '30%', top: '40%', left: '35%' }, // styles for the overlay overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, // styles applied when using $.growlUI growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'border-radius': '10px' }, // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w // (hat tip to Jorge H. N. de Vasconcelos) iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', // force usage of iframe in non-IE browsers (handy for blocking applets) forceIframe: false, // z-index for the blocking overlay baseZ: 1000, // set these to true to have the message automatically centered centerX: true, // <-- only effects element blocking (page block controlled via css above) centerY: true, // allow body element to be stetched in ie6; this makes blocking look better // on "short" pages. disable if you wish to prevent changes to the body height allowBodyStretch: true, // enable if you want key and mouse events to be disabled for content that is blocked bindEvents: true, // be default blockUI will supress tab navigation from leaving blocking content // (if bindEvents is true) constrainTabKey: true, // fadeIn time in millis; set to 0 to disable fadeIn on block fadeIn: 200, // fadeOut time in millis; set to 0 to disable fadeOut on unblock fadeOut: 400, // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock timeout: 0, // disable if you don't want to show the overlay showOverlay: true, // if true, focus will be placed in the first available input field when // page blocking focusInput: true, // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) applyPlatformOpacityRules: true, // callback method invoked when fadeIn has completed and blocking message is visible onBlock: null, // callback method invoked when unblocking has completed; the callback is // passed the element that has been unblocked (which is the window object for page // blocks) and the options that were passed to the unblock call: // onUnblock(element, options) onUnblock: null, // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 quirksmodeOffsetHack: 4, // class name of the message block blockMsgClass: 'blockMsg', // if it is already blocked, then ignore it (don't unblock and reblock) ignoreIfBlocked: false }; // private data and functions follow... var pageBlock = null; var pageBlockEls = []; function install(el, opts) { var css, themedCSS; var full = (el == window); var msg = (opts && opts.message !== undefined ? opts.message : undefined); opts = $.extend({}, $.blockUI.defaults, opts || {}); if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) return; opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); msg = msg === undefined ? opts.message : msg; // remove the current block (if there is one) if (full && pageBlock) remove(window, {fadeOut:0}); // if an existing element is being used as the blocking content then we capture // its current place in the DOM (and current display style) so we can restore // it when we unblock if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { var node = msg.jquery ? msg[0] : msg; var data = {}; $(el).data('blockUI.history', data); data.el = node; data.parent = node.parentNode; data.display = node.style.display; data.position = node.style.position; if (data.parent) data.parent.removeChild(node); } $(el).data('blockUI.onUnblock', opts.onUnblock); var z = opts.baseZ; // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; // layer1 is the iframe layer which is used to supress bleed through of underlying content // layer2 is the overlay layer which has opacity and a wait cursor (by default) // layer3 is the message content that is displayed while blocking var lyr1 = ($.browser.msie || opts.forceIframe) ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>') : $('<div class="blockUI" style="display:none"></div>'); var lyr2 = opts.theme ? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>') : $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); var lyr3, s; if (opts.theme && full) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">' + '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' + '<div class="ui-widget-content ui-dialog-content"></div>' + '</div>'; } else if (opts.theme) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">' + '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' + '<div class="ui-widget-content ui-dialog-content"></div>' + '</div>'; } else if (full) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>'; } else { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>'; } lyr3 = $(s); // if we have a message, style it if (msg) { if (opts.theme) { lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } // style the overlay if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed' : 'absolute'); // make iframe layer transparent in IE if ($.browser.msie || opts.forceIframe) lyr1.css('opacity',0.0); //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); $.each(layers, function() { this.appendTo($par); }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0); if (ie6 || expr) { // give body 100% height if (full && opts.allowBodyStretch && $.boxModel) $('html,body').css('height','100%'); // fix ie6 issue when blocked element has a border width if ((ie6 || !$.boxModel) && !full) { var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); var fixT = t ? '(0 - '+t+')' : 0; var fixL = l ? '(0 - '+l+')' : 0; } // simulate fixed position $.each([lyr1,lyr2,lyr3], function(i,o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"') : s.setExpression('height','this.parentNode.offsetHeight + "px"'); full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : s.setExpression('width','this.parentNode.offsetWidth + "px"'); if (fixL) s.setExpression('left', fixL); if (fixT) s.setExpression('top', fixT); } else if (opts.centerY) { if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0; } else if (!opts.centerY && full) { var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; s.setExpression('top',expression); } }); } // show the message if (msg) { if (opts.theme) lyr3.find('.ui-widget-content').append(msg); else lyr3.append(msg); if (msg.jquery || msg.nodeType) $(msg).show(); } if (($.browser.msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { var cb = opts.onBlock ? opts.onBlock : noOp; var cb1 = (opts.showOverlay && !msg) ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if (msg) lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); if (opts.onBlock) opts.onBlock(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(':input:enabled:visible',pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if (opts.timeout) { // auto-unblock var to = setTimeout(function() { full ? $.unblockUI(opts) : $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); } }; // remove the block function remove(el, opts) { var full = (el == window); var $el = $(el); var data = $el.data('blockUI.history'); var to = $el.data('blockUI.timeout'); if (to) { clearTimeout(to); $el.removeData('blockUI.timeout'); } opts = $.extend({}, $.blockUI.defaults, opts || {}); bind(0, el, opts); // unbind events if (opts.onUnblock === null) { opts.onUnblock = $el.data('blockUI.onUnblock'); $el.removeData('blockUI.onUnblock'); } var els; if (full) // crazy selector to handle odd field errors in ie6/7 els = $('body').children().filter('.blockUI').add('body > .blockUI'); else els = $('.blockUI', el); if (full) pageBlock = pageBlockEls = null; if (opts.fadeOut) { els.fadeOut(opts.fadeOut); setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); } else reset(els, data, opts, el); }; // move blocking element back into the DOM where it started function reset(els,data,opts,el) { els.each(function(i,o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) this.parentNode.removeChild(this); }); if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; if (data.parent) data.parent.appendChild(data.el); $(el).removeData('blockUI.history'); } if (typeof opts.onUnblock == 'function') opts.onUnblock(el,opts); }; // bind/unbind the handler function bind(b, el, opts) { var full = el == window, $el = $(el); // don't bother unbinding if there is nothing to unbind if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) return; $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false if (!opts.bindEvents || (b && !opts.showOverlay)) return; // bind anchors and inputs for mouse and key events var events = 'mousedown mouseup keydown keypress'; b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler); // former impl... // var $e = $('a,:input'); // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); }; // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) if (e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length-1]; var back = e.shiftKey && e.target === els[0]; if (fwd || back) { setTimeout(function(){focus(back)},10); return false; } } } var opts = e.data; // allow events within the message content if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0) return true; // allow events for content that is not being blocked return $(e.target).parents().children().filter('div.blockUI').length == 0; }; function focus(back) { if (!pageBlockEls) return; var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; if (e) e.focus(); }; function center(el, x, y) { var p = el.parentNode, s = el.style; var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); if (x) s.left = l > 0 ? (l+'px') : '0'; if (y) s.top = t > 0 ? (t+'px') : '0'; }; function sz(el, p) { return parseInt($.css(el,p))||0; }; }; if (typeof define === 'function' && define.amd && define.amd.jQuery) { define(['jquery'], setup); } else { setup(jQuery); } })();
{ "content_hash": "86772114d525d8c48687f57a57dbf78d", "timestamp": "", "source": "github", "line_count": 531, "max_line_length": 257, "avg_line_length": 33.13747645951036, "alnum_prop": 0.6229256649238464, "repo_name": "RooseveltJavier/Proyecto", "id": "6898b31f313188ed8fbfa70c4047a704aad066a0", "size": "17596", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "resources/js/comunes/jquery.blockUI_x.js", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "63928" }, { "name": "ApacheConf", "bytes": "1845" }, { "name": "C++", "bytes": "18108" }, { "name": "CSS", "bytes": "1610567" }, { "name": "HTML", "bytes": "12253707" }, { "name": "JavaScript", "bytes": "11039034" }, { "name": "PHP", "bytes": "8802607" }, { "name": "Ruby", "bytes": "2917" }, { "name": "Shell", "bytes": "7697" } ], "symlink_target": "" }
Imports System.ComponentModel Imports System.Drawing.Design Imports System.Drawing.Imaging Imports System.Globalization Imports System.Management Imports System.Runtime.InteropServices Imports System.Text Imports System.Text.RegularExpressions Imports System.Threading Imports System.Windows.Forms.VisualStyles Imports Microsoft.Win32 Imports StaxRip.UI Imports VB6 = Microsoft.VisualBasic Public Module ShortcutModule Public g As New GlobalClass Public p As New Project Public s As New ApplicationSettings End Module Public Enum MediaInformation VideoFormat DAR End Enum Public Class GlobalClass Property ProjectPath As String Property MainForm As MainForm Property MinimizedWindows As Boolean Property SavedProject As New Project Property DefaultCommands As New GlobalCommands Property IsProcessing As Boolean Property PreventSaveSettings As Boolean ReadOnly Property StartupTemplatePath() As String Get Dim ret = Folder.Template + s.StartupTemplate + ".srip" If Not File.Exists(ret) Then ret = Folder.Template + "x264.srip" s.StartupTemplate = "x264" End If Return ret End Get End Property ReadOnly Property SettingsFile() As String Get Return Folder.Settings + "SettingsV2.dat" End Get End Property Function BrowseFolder(defaultFolder As String) As String Using d As New FolderBrowserDialog d.Description = "Please select a directory." d.SetSelectedPath(defaultFolder) If d.ShowDialog = DialogResult.OK Then Return d.SelectedPath End Using End Function Function VerifyRequirements() As Boolean For Each pack In Package.Items.Values If Not pack.VerifyOK Then Return False Next If Not p.Script.IsFilterActive("Source") Then MsgWarn("No active filter of category 'Source' found.") Return False End If Return True End Function Function ShowVideoSourceWarnings(files As IEnumerable(Of String)) As Boolean For Each i In files If Not i.IsANSICompatible AndAlso p.Script.Engine = ScriptEngine.AviSynth Then MsgError(Strings.NoUnicode) Return True End If If i.Contains("#") Then If Filepath.GetExtFull(i) = ".mp4" OrElse MediaInfo.GetGeneral(i, "Audio_Codec_List").Contains("AAC") Then MsgError("Character # can't be processed by MP4Box, please rename." + BR2 + i) Return True End If End If If i.Length > 170 Then MsgError("Generated temp files might exceed 260 character file path limit, please use shorter file paths." + BR2 + i) Return True End If If i.Ext = "dga" Then MsgError("There is no properly working x64 source filters available for DGA. There are several newer and faster x64 source filters available.") Return True End If If i.Ext = "dgi" AndAlso File.ReadAllText(i).Contains("DGIndexIM") Then MsgError("Please rename the file extension from dgi to dgim.") Return True End If Next End Function Function Get0ForInfinityOrNaN(arg As Double) As Double If Double.IsNaN(arg) OrElse Double.IsInfinity(arg) Then Return 0 Else Return arg End If End Function Sub PlayScript(doc As VideoScript) If File.Exists(p.Audio0.File) Then PlayScript(doc, p.Audio0) Else PlayScript(doc, p.Audio1) End If End Sub Sub PlayScript(doc As VideoScript, ap As AudioProfile) Dim script As New VideoScript script.Engine = doc.Engine script.Path = p.TempDir + p.TargetFile.Base + "_play." + script.FileType script.Filters = doc.GetFiltersCopy If script.Engine = ScriptEngine.AviSynth Then Dim par = Calc.GetTargetPAR If Not par = New Point(1, 1) Then Dim targetWidth = CInt((p.TargetHeight * Calc.GetTargetDAR) / 4) * 4 script.Filters.Add(New VideoFilter("LanczosResize(" & targetWidth & "," & p.TargetHeight & ")")) End If If File.Exists(ap.File) Then script.Filters.Add(New VideoFilter("KillAudio()")) Dim nic = Audio.GetNicAudioCode(ap) If nic <> "" Then script.Filters.Add(New VideoFilter(nic)) Else script.Filters.Add(New VideoFilter("AudioDub(last, DirectShowSource(""" + ap.File + """, video = false))")) End If script.Filters.Add(New VideoFilter("DelayAudio(" & (ap.Delay / 1000).ToString(CultureInfo.InvariantCulture) & ")")) Dim cutFilter = script.GetFilter("Cutting") If Not cutFilter Is Nothing Then script.RemoveFilter("Cutting") script.Filters.Add(cutFilter) End If End If Else Dim par = Calc.GetTargetPAR If Not par = New Point(1, 1) Then Dim targetWidth = CInt((p.TargetHeight * Calc.GetTargetDAR) / 4) * 4 script.Filters.Add(New VideoFilter("clip = core.resize.Bicubic(clip, " & targetWidth & "," & p.TargetHeight & ")")) End If End If script.Synchronize(True) g.Play(script.Path) End Sub Function ExtractDelay(value As String) As Integer Dim match = Regex.Match(value, " (-?\d+)ms") If match.Success Then Return CInt(match.Groups(1).Value) End Function Sub ShowCode(title As String, content As String) Dim f As New HelpForm() f.Doc.WriteStart(title) f.Doc.Writer.WriteRaw("<pre><code>" + content + "</pre></code>") f.Show() End Sub Sub ShowHelp(title As String, content As String) If title <> "" Then title = title.TrimEnd("."c, ":"c) MsgInfo(title, content) End Sub Sub PopulateProfileMenu( ic As ToolStripItemCollection, profiles As IList, dialogAction As Action, loadAction As Action(Of Profile)) For Each iProfile As Profile In profiles Dim a = iProfile.Name.SplitNoEmpty("|") Dim l = ic For i = 0 To a.Length - 1 Dim found = False For Each iItem As ToolStripItem In l If i < a.Length - 1 Then If iItem.Text = a(i) Then found = True l = DirectCast(iItem, ToolStripMenuItem).DropDownItems End If End If Next If Not found Then If i = a.Length - 1 Then Dim item As New ActionMenuItem(a(i), Sub() loadAction(iProfile)) l.Add(item) l = item.DropDownItems Else Dim item As New MenuItemEx(a(i)) l.Add(item) l = item.DropDownItems End If End If Next Next If Not dialogAction Is Nothing Then ic.Add(New ToolStripSeparator) ic.Add(New ActionMenuItem("Edit Profiles...", dialogAction, "Opens the profiles editor")) End If If profiles.Count > 0 Then If TypeOf profiles(0) Is VideoEncoder Then Dim helpURL = If(g.IsCulture("de"), "http://encodingwissen.de/codecs", "http://en.wikipedia.org/wiki/Video_codec") ic.Add(New ActionMenuItem("Help...", Sub() g.ShellExecute(helpURL))) End If End If End Sub Function GetAutoSize(percentage As Integer) As Integer Dim ret As Integer Dim size = p.TargetSize Dim bitrate = p.VideoBitrate For i = 1 To 100000 p.TargetSize = i p.VideoBitrate = CInt(Calc.GetVideoBitrate) If CInt(Calc.GetPercent) >= percentage Then ret = i Exit For End If Next p.TargetSize = size p.VideoBitrate = bitrate If ret = 0 Then ret = size Return ret End Function Function GetPreviewPosMS() As Integer Dim fr = p.Script.GetFramerate If fr = 0 Then fr = 25 Return CInt((s.LastPosition / fr) * 1000) End Function Function GetTextEditor() As String Dim ret = GetAssociatedApplication(".txt") If ret <> "" Then Return ret Return "notepad.exe" End Function Function GetAssociatedApplication(ext As String) As String Dim c = 0UI 'ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE If 1 = Native.AssocQueryString(&H40, 2, ext, Nothing, Nothing, c) Then If c > 0 Then Dim sb As New StringBuilder(CInt(c)) 'ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE If 0 = Native.AssocQueryString(&H40, 2, ext, Nothing, sb, c) Then Dim ret = sb.ToString If File.Exists(ret) Then Return ret End If End If End If End Function Sub SaveSettings() Try If Not g.PreventSaveSettings Then SafeSerialization.Serialize(s, g.SettingsFile) Catch ex As Exception g.ShowException(ex) End Try End Sub Sub LoadVideoEncoder(profile As Profile) Dim currentMuxer = p.VideoEncoder.Muxer p.VideoEncoder = DirectCast(ObjectHelp.GetCopy(profile), VideoEncoder) If currentMuxer.IsSupported(p.VideoEncoder.OutputExt) Then p.VideoEncoder.Muxer = currentMuxer Else p.VideoEncoder.Muxer.Init() End If MainForm.tbTargetFile.Text = p.TargetFile.ChangeExt(p.VideoEncoder.Muxer.OutputExt) p.VideoEncoder.OnStateChange() MainForm.RecalcBitrate() MainForm.Assistant() End Sub Sub RaiseAppEvent(appEvent As ApplicationEvent) For Each i In s.EventCommands If i.Enabled AndAlso i.Event = appEvent Then Dim matches = 0 For Each i2 In i.CriteriaList i2.PropertyString = Macro.Solve(i2.Macro) If i2.Eval Then matches += 1 Next If (i.CriteriaList.Count = 0 OrElse (i.OrOnly AndAlso matches > 0) OrElse (Not i.OrOnly AndAlso matches = i.CriteriaList.Count)) AndAlso Not i.CommandParameters Is Nothing Then Log.WriteHeader("Process Event Command '" + i.Name + "'") Log.WriteLine("Event: " + DispNameAttribute.GetValueForEnum(i.Event)) Dim command = g.MainForm.CustomMainMenu.CommandManager.GetCommand(i.CommandParameters.MethodName) Log.WriteLine("Command: " + command.MethodInfo.Name) Log.WriteLine(command.GetParameterHelp(i.CommandParameters.Parameters)) g.MainForm.CustomMainMenu.CommandManager.Process(i.CommandParameters) End If End If Next End Sub Sub SetTempDir() If p.SourceFile <> "" Then p.TempDir = Macro.Solve(p.TempDir) If p.TempDir = "" Then If FileTypes.VideoOnly.Contains(p.SourceFile.Ext) OrElse FileTypes.VideoText.Contains(p.SourceFile.Ext) OrElse p.SourceFile.Dir.EndsWith("_temp\") Then p.TempDir = p.SourceFile.Dir Else Dim base = Filepath.GetBase(p.SourceFile) If base.Length > 60 Then base = base.Shorten(30) + "..." p.TempDir = p.SourceFile.Dir + base + "_temp\" End If End If p.TempDir = p.TempDir.AppendSeparator If Not Directory.Exists(p.TempDir) Then Try Directory.CreateDirectory(p.TempDir) Catch Try p.TempDir = Filepath.GetDirAndBase(p.SourceFile) + "_temp\" If Not Directory.Exists(p.TempDir) Then Directory.CreateDirectory(p.TempDir) Catch MsgWarn("Failed to create a temp directory. By default it's created in the directory of the source file so it's not possible to open files directly from a optical drive unless a temp directory is defined in the options. Usually discs are copied to the hard drive first using a application like MakeMKV, DVDfab or AnyDVD.") Throw New AbortException End Try End Try End If End If End Sub Function IsProjectDirty() As Boolean Return ObjectHelp.GetCompareString(g.SavedProject) <> ObjectHelp.GetCompareString(p) End Function Sub ShowCommandLinePreview(value As String) Using f As New StringEditorForm f.tb.ReadOnly = True f.cbWrap.Checked = Not value.Contains(BR) f.tb.Text = value f.tb.SelectionStart = 0 f.tb.SelectionLength = 0 f.Text = "Command Line" f.Width = 1000 f.Height = 500 f.bOK.Visible = False f.bCancel.Text = "Close" f.ShowDialog() End Using End Sub Sub ffmsindex(sourcePath As String, cachePath As String, Optional indexAudio As Boolean = False, Optional noLog As Boolean = False) If File.Exists(sourcePath) AndAlso Not File.Exists(cachePath) AndAlso Not FileTypes.VideoText.Contains(Filepath.GetExt(sourcePath)) Then Using proc As New Proc proc.NoLog = noLog proc.Init("Index with ffmsindex", "Indexing, please wait...") proc.File = Package.ffms2.GetDir + "ffmsindex.exe" proc.Arguments = If(indexAudio, "-t -1 ", "") + """" + sourcePath + """ """ + cachePath + """" proc.Start() End Using End If End Sub Function IsValidSource(Optional warn As Boolean = True) As Boolean If p.SourceScript.GetFrames = 0 Then If warn Then MsgWarn("Failed to load source.") End If Return False End If If Not p.SourceScript.GetErrorMessage Is Nothing Then MsgError(p.SourceScript.GetErrorMessage) Return False End If Return True End Function Function IsSourceSameOrSimilar(path As String) As Boolean Return IsSourceSame(path) OrElse IsSourceSimilar(path) End Function Function IsCOMObjectRegistered(guid As String) As Boolean Return File.Exists(Registry.ClassesRoot.GetString("CLSID\" + guid + "\InprocServer32", Nothing)) End Function Function IsSourceSame(path As String) As Boolean Return Filepath.GetBase(path).StartsWith(Filepath.GetBase(p.SourceFile)) End Function Function GetFilesInTempDirAndParent() As List(Of String) Dim ret As New List(Of String) If p.TempDir <> "" Then ret.AddRange(Directory.GetFiles(p.TempDir)) If p.TempDir <> Filepath.GetDir(p.FirstOriginalSourceFile) Then ret.AddRange(Directory.GetFiles(Filepath.GetDir(p.FirstOriginalSourceFile))) End If Return ret End Function Function IsSourceSimilar(path As String) As Boolean If p.SourceFile.Contains("_") Then Dim src = Filepath.GetBase(p.SourceFile) While src.Length > 2 AndAlso src.ToCharArray.Last.IsDigit src = src.DeleteRight(1) End While If src.EndsWith("_") AndAlso Filepath.GetBase(path).StartsWith(src.TrimEnd("_"c)) Then Return True End If End If End Function Function IsCulture(twoLetterCode As String) As Boolean Return CultureInfo.CurrentCulture.TwoLetterISOLanguageName = twoLetterCode End Function Private ExceptionHandled As Boolean Sub OnException(ex As Exception) If ExceptionHandled Then Exit Sub Else ExceptionHandled = True End If If TypeOf ex Is AbortException Then ProcessForm.CloseProcessForm() Else Try If File.Exists(p.SourceFile) Then Dim name = Filepath.GetBase(p.TargetFile) If name = "" Then name = Filepath.GetBase(p.SourceFile) End If Dim path = Filepath.GetDir(p.SourceFile) + "crash.srip" g.MainForm.SaveProjectPath(path) End If g.SaveSettings() Catch End Try Try ShowException(ex, "Exception") MakeBugReport(ex) Catch g.ShowException(ex) End Try Process.GetCurrentProcess.Kill() End If End Sub Sub ShowException(e As Exception, Optional msg As String = Nothing, Optional timeout As Integer = 0) Try Using td As New TaskDialog(Of String) If msg = "" Then If TypeOf e Is ErrorAbortException Then td.MainInstruction = DirectCast(e, ErrorAbortException).Title Else td.MainInstruction = e.GetType.Name End If Else td.MainInstruction = msg End If td.Timeout = timeout td.Content = e.Message td.MainIcon = TaskDialogIcon.Error td.ExpandedInformation = e.ToString td.Footer = Strings.TaskDialogFooter td.Show() End Using Catch Dim title As String If TypeOf e Is ErrorAbortException Then title = DirectCast(e, ErrorAbortException).Title Else title = e.GetType.Name End If VB6.MsgBox(title + BR2 + e.Message + BR2 + e.ToString, VB6.MsgBoxStyle.Critical) End Try End Sub Sub SetRenderer(ms As ToolStrip) If VisualStyleInformation.IsEnabledByUser Then ms.Renderer = New ToolStripRendererEx(s.ToolStripRenderModeEx) Else ms.Renderer = New ToolStripSystemRenderer() End If End Sub Sub Play(file As String, Optional cliOptions As String = Nothing) If Package.MPC.VerifyOK(True) Then Dim args = """" + file + """" If cliOptions <> "" Then args += " " + cliOptions g.ShellExecute(Package.MPC.Path, args) End If End Sub Sub ShellExecute(cmd As String, Optional args As String = Nothing) Try Process.Start(cmd, args) Catch ex As Exception If cmd Like "http*://*" Then MsgError("Failed to open URL with browser." + BR2 + cmd, ex.Message) ElseIf File.Exists(cmd) Then MsgError("Failed to launch file." + BR2 + cmd, ex.Message) ElseIf Directory.Exists(cmd) Then MsgError("Failed to launch directory." + BR2 + cmd, ex.Message) Else g.ShowException(ex, "Failed to execute command:" + BR2 + cmd + BR2 + "Arguments:" + BR2 + args) End If End Try End Sub Sub OpenDirAndSelectFile(filepath As String, handle As IntPtr) If File.Exists(filepath) Then g.ShellExecute(StaxRip.Filepath.GetDir(filepath)) Try For x = 0 To 9 Thread.Sleep(300) Application.DoEvents() If handle <> Native.GetForegroundWindow Then Explorer.SelectFile(Native.GetForegroundWindow, filepath) Exit For End If Next Catch End Try ElseIf Directory.Exists(StaxRip.Filepath.GetDir(filepath)) Then g.ShellExecute(StaxRip.Filepath.GetDir(filepath)) End If End Sub Sub OnUnhandledException(sender As Object, e As ThreadExceptionEventArgs) OnException(e.Exception) End Sub Sub OnUnhandledException(sender As Object, e As UnhandledExceptionEventArgs) OnException(DirectCast(e.ExceptionObject, Exception)) End Sub Sub MakeBugReport(e As Exception) If e Is Nothing AndAlso Not g.IsValidSource(False) Then Exit Sub End If If Not e Is Nothing Then SyncLock p.Log If p.Log.Length = 0 Then Log.WriteEnvironment() End SyncLock Log.WriteHeader("Exception") Log.WriteLine(e.ToString) End If Dim fp = If(File.Exists(p.SourceFile) AndAlso Directory.Exists(p.TempDir), p.TempDir + p.Name + "_staxrip.log", Folder.Settings + "Log.txt") SyncLock p.Log p.Log.ToString.WriteUTF8File(fp) End SyncLock g.OpenDirAndSelectFile(fp, g.MainForm.Handle) g.ShellExecute(g.GetTextEditor(), """" + fp + """") g.ShellExecute("https://github.com/stax76/staxrip/issues") End Sub Function WasFileJustWritten(path As String) As Boolean For x = 0 To 50 If File.Exists(path) Then Return True Thread.Sleep(1000) Next End Function Sub ShutdownPC() ShutdownPC(CType(Registry.CurrentUser.GetInt("Software\" + Application.ProductName, "ShutdownMode"), ShutdownMode)) End Sub Sub ShutdownPC(mode As ShutdownMode) If mode <> ShutdownMode.Nothing Then SavedProject = p g.MainForm.Close() If Process.GetProcessesByName("StaxRip").Length = 1 Then Registry.CurrentUser.Write("Software\" + Application.ProductName, "ShutdownMode", 0) Shutdown.Commit(mode) End If End If End Sub Sub Highlight(highlight As Boolean, c As Control) If highlight Then c.BackColor = Color.Orange Else If TypeOf c Is Label OrElse TypeOf c Is GroupBox Then c.BackColor = SystemColors.Control ElseIf TypeOf c Is TextBox AndAlso DirectCast(c, TextBox).ReadOnly Then c.BackColor = SystemColors.Control Else c.BackColor = SystemColors.Window End If End If End Sub Function EnableFilter(cat As String) As Boolean For Each i In p.Script.Filters If i.Category = cat Then If Not i.Active Then i.Active = True g.MainForm.AviSynthListView.Load() End If Return True End If Next End Function Function BrowseFile(filter As String, Optional defaultFilepath As String = Nothing) As String Using d As New OpenFileDialog d.Filter = filter If File.Exists(defaultFilepath) Then d.InitialDirectory = Filepath.GetDir(defaultFilepath) d.FileName = Filepath.GetName(defaultFilepath) End If If d.ShowDialog = DialogResult.OK Then Return d.FileName End If End Using End Function Sub ShowDirectShowWarning() If Not p.BatchMode Then If Not g.IsCOMObjectRegistered(GUIDS.LAVSplitter) OrElse Not g.IsCOMObjectRegistered(GUIDS.LAVVideoDecoder) Then MsgError("DirectShow Filter Setup", "An error occurred that could possibly be solved by installing [http://code.google.com/p/lavfilters LAV Filters].") End If End If End Sub Sub AddHardcodedSubtitle() For Each subtitle In p.VideoEncoder.Muxer.Subtitles If subtitle.Path.Ext.EqualsAny("srt", "ass", "idx") Then If subtitle.Enabled Then subtitle.Enabled = False p.AddHardcodedSubtitleFilter(subtitle.Path, False) Exit Sub End If End If Next End Sub Sub RunAutoCrop() p.SourceScript.Synchronize(True) Using avi As New AVIFile(p.SourceScript.Path) Dim segmentCount = 20 Dim len = avi.FrameCount \ (segmentCount + 1) Dim crops(segmentCount - 1) As AutoCrop For x = 1 To segmentCount avi.Position = len * x Using bmp = avi.GetBitmap crops(x - 1) = AutoCrop.Start(bmp.Clone(New Rectangle(0, 0, bmp.Width, bmp.Height), PixelFormat.Format32bppRgb), avi.Position) End Using Next Dim leftCrops = crops.SelectMany(Function(arg) arg.Left).OrderBy(Function(arg) arg) p.CropLeft = leftCrops(leftCrops.Count \ 10) Dim topCrops = crops.SelectMany(Function(arg) arg.Top).OrderBy(Function(arg) arg) p.CropTop = topCrops(topCrops.Count \ 10) Dim rightCrops = crops.SelectMany(Function(arg) arg.Right).OrderBy(Function(arg) arg) p.CropRight = rightCrops(rightCrops.Count \ 10) Dim bottomCrops = crops.SelectMany(Function(arg) arg.Bottom).OrderBy(Function(arg) arg) p.CropBottom = bottomCrops(bottomCrops.Count \ 10) CorrectCropMod() End Using End Sub Sub SmartCrop() If Not p.Script.IsFilterActive("Resize") Then Exit Sub End If Dim tempLeft = p.CropLeft Dim tempRight = p.CropRight Dim ae = Math.Abs(Calc.GetAspectRatioError) While (p.SourceWidth - p.CropLeft - p.CropRight) > 64 p.CropLeft += 2 p.CropRight += 2 If Math.Abs(Calc.GetAspectRatioError()) < ae Then tempLeft = p.CropLeft tempRight = p.CropRight ae = Math.Abs(Calc.GetAspectRatioError()) End If End While p.CropLeft = tempLeft p.CropRight = tempRight Dim tempTop = p.CropTop Dim tempBottom = p.CropBottom While (p.SourceHeight - p.CropTop - p.CropBottom) > 64 p.CropTop += 2 p.CropBottom += 2 If Math.Abs(Calc.GetAspectRatioError()) < ae Then tempTop = p.CropTop tempBottom = p.CropBottom ae = Math.Abs(Calc.GetAspectRatioError()) End If End While p.CropTop = tempTop p.CropBottom = tempBottom End Sub Sub OvercropWidth() If p.AutoSmartOvercrop > 0 AndAlso p.AutoSmartOvercrop < Calc.GetTargetDAR Then Dim newar = p.AutoSmartOvercrop Dim croph = p.SourceHeight - p.CropTop - p.CropBottom g.MainForm.tbTargetHeight.Text = Calc.FixMod16(CInt(p.TargetWidth / newar)).ToString newar = CSng(p.TargetWidth / p.TargetHeight) Dim cropw = (newar / Calc.GetSourceDAR * (croph / p.SourceHeight)) * p.SourceWidth p.CropLeft = CInt((p.SourceWidth - cropw) / 2) p.CropRight = p.CropLeft If p.CropLeft < 0 Then p.CropLeft = 0 p.CropRight = 0 End If CorrectCropMod() End If End Sub Function ConvertPath(value As String) As String If value.Contains("Constant Quality") Then value = value.Replace("Constant Quality", "CQ") End If If value.Contains("Misc | ") Then value = value.Replace("Misc | ", "") End If If value.Contains("Advanced | ") Then value = value.Replace("Advanced | ", "") End If If value.Contains(" | ") Then value = value.Replace(" | ", " - ") End If If value.Contains(" ") Then value = value.Replace(" ", " ") End If Return value End Function Sub CorrectCropMod() CorrectCropMod(False) End Sub Sub ForceCropMod() If Not g.EnableFilter("Crop") Then p.Script.InsertAfter("Source", New VideoFilter("Crop", "Crop", "Crop(%crop_left%, %crop_top%, -%crop_right%, -%crop_bottom%)")) End If CorrectCropMod(True) End Sub Private Sub CorrectCropMod(force As Boolean) If p.AutoCorrectCropValues OrElse force Then p.CropLeft += p.CropLeft Mod 2 p.CropRight += p.CropRight Mod 2 p.CropTop += p.CropTop Mod 2 p.CropBottom += p.CropBottom Mod 2 Dim modValue = 4 If Not p.Script.IsFilterActive("Resize") Then modValue = p.ForcedOutputMod End If Dim whalf = ((p.SourceWidth - p.CropLeft - p.CropRight) Mod modValue) \ 2 If p.CropLeft > p.CropRight Then p.CropLeft += whalf - whalf Mod 2 p.CropRight += whalf + whalf Mod 2 Else p.CropRight += whalf - whalf Mod 2 p.CropLeft += whalf + whalf Mod 2 End If Dim hhalf = ((p.SourceHeight - p.CropTop - p.CropBottom) Mod modValue) \ 2 If p.CropTop > p.CropBottom Then p.CropTop += hhalf - hhalf Mod 2 p.CropBottom += hhalf + hhalf Mod 2 Else p.CropBottom += hhalf - hhalf Mod 2 p.CropTop += hhalf + hhalf Mod 2 End If g.MainForm.AviSynthListView.Load() End If End Sub End Class Public Enum AudioMode DirectStreamCopy FullProcessingMode End Enum Public Enum RegistryRoot CurrentUser LocalMachine ClassesRoot End Enum <Serializable()> Public Class Range Implements IComparable(Of Range) Public Start As Integer Public [End] As Integer Sub New(startPosition As Integer, endPosition As Integer) Me.Start = startPosition Me.End = endPosition End Sub Function GetLenght() As Integer Return Me.End - Start End Function Function CompareTo(other As Range) As Integer Implements System.IComparable(Of Range).CompareTo Return Start.CompareTo(other.Start) End Function End Class Class Log Shared StartTime As DateTime Shared Event Update(text As String) Shared Sub Write(title As String, content As String) StartTime = DateTime.Now SyncLock p.Log If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append(FormatHeader(title)) End SyncLock If content <> "" Then If content.EndsWith(BR) Then SyncLock p.Log p.Log.Append(content) End SyncLock Else SyncLock p.Log p.Log.AppendLine(content) End SyncLock End If End If RaiseUpdate() End Sub Shared Sub WriteHeader(value As String) StartTime = DateTime.Now If value <> "" Then SyncLock p.Log If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append(FormatHeader(value)) End SyncLock RaiseUpdate() End If End Sub 'TODO: hide when bug is found Shared Sub Debug(title As String, value As String, Optional requiredContent As String = Nothing) If requiredContent <> "" AndAlso Not p.Log.ToString.Contains(requiredContent) Then Exit Sub Write(title, value) End Sub Shared Sub WriteLine(value As String) If value <> "" Then If value.EndsWith(BR) Then SyncLock p.Log p.Log.Append(value) End SyncLock Else SyncLock p.Log p.Log.AppendLine(value) End SyncLock End If RaiseUpdate() End If End Sub Shared Function FormatHeader(value As String) As String Return "-=".Multiply(30) + "-" + BR + value.PadLeft(30 + value.Length \ 2) + BR + "-=".Multiply(30) + "-" + BR2 End Function Shared Sub WriteEnvironment() If p.Log.ToString.Contains("Environment" + BR + "-=") Then Exit Sub Dim staxrip = "-=".Multiply(30) + "-" + BR + " _________ __ __________.__ / _____// |______ ___ __\______ \__|_____ \_____ \\ __\__ \ \ \/ /| _/ \____ \ / \| | / __ \_> < | | \ | |_> > /_______ /|__| (____ /__/\_ \|____|_ /__| __/ \/ \/ \/ \/ |__| " WriteLine(staxrip) WriteHeader("Environment") Dim mc As New ManagementClass("Win32_VideoController") Dim videoControllerCaptions = From i2 In mc.GetInstances().OfType(Of ManagementBaseObject)() Select CStr(i2("Caption")) Dim temp = "StaxRip x64: " + Application.ProductVersion + BR + "OS: " + Registry.LocalMachine.GetString("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName") + BR + "Language: " + CultureInfo.CurrentCulture.EnglishName + BR + "CPU: " + Registry.LocalMachine.GetString("HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString") + BR + "GPU: " + String.Join(", ", videoControllerCaptions) WriteLine(temp.FormatColumn(":")) End Sub Shared Sub Save() If p.SourceFile <> "" Then SyncLock p.Log If Directory.Exists(p.TempDir) Then p.Log.ToString.WriteUTF8File(p.TempDir + p.Name + "_staxrip.log") End If End SyncLock End If End Sub Shared Sub WriteStats() WriteStats(StartTime) End Sub Shared Sub WriteStats(start As DateTime) Dim n = DateTime.Now.Subtract(start) SyncLock p.Log If Not p.Log.ToString.EndsWith(BR2) Then p.Log.AppendLine() p.Log.Append("Start: ".PadRight(10) + start.ToLongTimeString + BR) p.Log.Append("End: ".PadRight(10) + DateTime.Now.ToLongTimeString + BR) p.Log.Append("Duration: " + CInt(Math.Floor(n.TotalHours)).ToString("d2") + ":" + n.Minutes.ToString("d2") + ":" + n.Seconds.ToString("d2") + BR) p.Log.AppendLine() End SyncLock RaiseUpdate() End Sub Private Shared Sub RaiseUpdate() SyncLock p.Log RaiseEvent Update(p.Log.ToString) End SyncLock End Sub End Class Class Calc Shared Function GetYFromTwoPointForm(x1 As Single, y1 As Single, x2 As Single, y2 As Single, x As Single) As Integer 'Zweipunkteform nach y aufgelöst Return CInt((((y2 - y1) / (x2 - x1)) * (x - x1)) + y1) End Function Shared Function GetPercent() As Double If p.Compressibility = 0 Then Return 0 Return (GetBPF() / p.Compressibility) * 100 End Function Shared Function GetBPF() As Double Dim framerate = p.Script.GetFramerate If framerate = 0 Then Return 0 If p.TargetWidth = 0 Then Return 0 If p.TargetHeight = 0 Then Return 0 Return p.VideoBitrate * 1024L / (p.TargetWidth * p.TargetHeight * CLng(framerate)) End Function Shared Function GetSize() As Double Dim ret = (Calc.GetVideoKBytes() + Calc.GetAudioKBytes() + GetSubtitleKBytes() + Calc.GetOverheadKBytes()) / 1024 If ret < 1 Then ret = 1 Return ret End Function Shared Function GetVideoBitrate() As Double If p.TargetSeconds = 0 Then Return 0 Dim kbytes = p.TargetSize * 1024 - GetAudioKBytes() - GetSubtitleKBytes() - GetOverheadKBytes() Dim ret = kbytes * 8 * 1.024 / p.TargetSeconds If ret < 1 Then ret = 1 Return ret End Function Shared Function GetVideoKBytes() As Double Return ((p.VideoBitrate * p.TargetSeconds) / 8) / 1.024 End Function Shared Function GetSubtitleKBytes() As Double Return Aggregate i In p.VideoEncoder.Muxer.Subtitles Into Sum(If(i.Enabled, i.Size / 1024 / 3, 0)) End Function Shared Function GetOverheadKBytes() As Double Dim ret As Double Dim frames = p.Script.GetFrames If {"avi", "divx"}.Contains(p.VideoEncoder.Muxer.OutputExt) Then ret += frames * 0.024 If p.Audio0.File <> "" Then ret += frames * 0.04 If p.Audio1.File <> "" Then ret += frames * 0.04 ElseIf p.VideoEncoder.Muxer.OutputExt = "mp4" Then ret += 10.4 / 1024 * frames ElseIf p.VideoEncoder.Muxer.OutputExt = "mkv" Then ret += frames * 0.013 End If Return ret End Function Shared Function GetAudioKBytes() As Double Return ((Calc.GetAudioBitrate() * p.TargetSeconds) / 8) / 1.024 End Function Shared Function GetAudioBitrate() As Double Dim b0, b1 As Double If p.Audio0.File <> "" Then b0 = p.Audio0.Bitrate If p.Audio1.File <> "" Then b1 = p.Audio1.Bitrate Return b0 + b1 + p.AudioTracks.Sum(Function(arg) arg.Bitrate) End Function Shared Function GetBitrateFromFile(path As String, seconds As Integer) As Double Try If path = "" OrElse seconds = 0 Then Return 0 Dim kBits = New FileInfo(path).Length * 8 / 1000 Return kBits / seconds Catch ex As Exception g.ShowException(ex) End Try End Function Shared Function IsARSignalingRequired() As Boolean If Not p.Script Is Nothing AndAlso p.AutoARSignaling Then Dim par = GetTargetPAR() If par.X <> par.Y Then If p.Script.IsFilterActive("Resize") Then Return Math.Abs(GetAspectRatioError()) > p.MaxAspectRatioError Else Return True End If End If End If End Function Private Shared Function GetSimplePar(par As Point) As Point If par.Y > 0 Then For Each i In New Point() {New Point(12, 11), New Point(10, 11), New Point(16, 11), New Point(40, 33)} If Math.Abs((par.X / par.Y) / (i.X / i.Y) * 100 - 100) < 1 Then Return i End If Next End If If par.X > 255 OrElse par.Y > 255 Then Dim x = par.X / 255 Dim y = par.Y / 255 If x > y Then par.X = CInt(par.X / x) par.Y = CInt(par.Y / x) Else par.X = CInt(par.X / y) par.Y = CInt(par.Y / y) End If End If If par.X = par.Y Then par.X = 1 par.Y = 1 End If Return par End Function Shared Function ParseCustomAR(value As String) As Point If value.Contains(":") OrElse value.Contains("/") Then Dim a = value.Split(":/".ToCharArray) If a.Length = 2 AndAlso a(0).IsInt AndAlso a(1).IsInt Then Return New Point(a(0).ToInt, a(1).ToInt) End If ElseIf Double.TryParse(value, Nothing) Then Return New Point(CInt(CDbl(value) * 100000), 100000) End If End Function Shared Function GetSourceDAR() As Double Try Dim par = GetSourcePAR() Return (par.X * p.SourceWidth) / (par.Y * p.SourceHeight) Catch ex As Exception Return 4 / 3 End Try End Function Shared Function GetSimpleSourcePAR() As Point Return GetSimplePar(GetSourcePAR) End Function Shared Function GetSourcePAR() As Point If p.CustomPAR <> "" Then Return Reduce(ParseCustomAR(p.CustomPAR)) If p.CustomDAR <> "" Then Dim r = ParseCustomAR(p.CustomDAR) Return Reduce(New Point(p.SourceHeight * r.X, p.SourceWidth * r.Y)) End If Dim par As New Point(1, 1) Dim w = p.SourceWidth, h = p.SourceHeight If (h = 576 OrElse h = 480) AndAlso w <= 768 Then Dim f As VideoFormat For Each i In Formats If i.Width = p.SourceWidth AndAlso i.Height = p.SourceHeight Then f = i Exit For End If Next If f.Width > 0 Then Dim samplingWidth = 52.0 If Not p.ITU Then samplingWidth = f.Width / f.SamplingRate End If Dim dar = (p.SourcePAR.X * p.SourceWidth) / (p.SourcePAR.Y * p.SourceHeight) par.X = CInt(If(p.SourceAnamorphic OrElse dar > 1.7, 16 / 9, 4 / 3) * f.Height) par.Y = CInt(f.SamplingRate * samplingWidth) Return Reduce(par) Else Dim dar = If(p.SourceAnamorphic, 16 / 9, 4 / 3) If p.ITU Then dar *= 1.0255 End If par.X = CInt(dar * h) par.Y = CInt(w) Return Reduce(par) End If End If If h = 720 OrElse h = 1080 OrElse h = 1088 Then If p.SourcePAR.X = 1364 Then p.SourcePAR.X = 4 p.SourcePAR.Y = 3 End If End If Return Reduce(p.SourcePAR) End Function Shared Function GetTargetPAR() As Point Try Dim par = GetSourcePAR() Dim cw = p.SourceWidth Dim ch = p.SourceHeight If p.Script.IsFilterActive("Crop") Then cw -= p.CropLeft + p.CropRight ch -= p.CropTop + p.CropBottom End If If p.TargetWidth <> cw OrElse p.TargetHeight <> ch Then Dim par2 = Reduce(New Point(cw * p.TargetHeight, ch * p.TargetWidth)) par.X = par.X * par2.X par.Y = par.Y * par2.Y par = Reduce(par) End If Return GetSimplePar(par) Catch ex As Exception Return New Point(1, 1) End Try End Function Shared Function GetTargetDAR() As Double Dim w = p.SourceWidth, h = p.SourceHeight Dim cropw = w, croph = h If p.Script.IsFilterActive("Crop") Then cropw = w - p.CropLeft - p.CropRight croph = h - p.CropTop - p.CropBottom End If Return ((cropw / w) / (croph / h)) * GetSourceDAR() End Function Shared Function GetAspectRatioError() As Double Return ((p.TargetWidth / p.TargetHeight) / Calc.GetTargetDAR) * 100 - 100 End Function Shared Function Reduce(p As Point) As Point If p.X <> 0 AndAlso p.Y <> 0 Then Dim gcd = GetGCD(p.X, p.Y) p.X \= gcd p.Y \= gcd End If Return p End Function Shared Function GetGCD(a As Integer, b As Integer) As Integer If b = 0 Then Return a Else Return GetGCD(b, a Mod b) End If End Function Shared Function FixMod16(value As Integer) As Integer Return CInt(value / 16) * 16 End Function Shared Function FixMod(value As Integer, modValue As Integer) As Integer Return CInt(value / modValue) * modValue End Function Shared Function GetMod( w As Integer, h As Integer, Optional skip16 As Boolean = True) As String Dim wmod, hmod As Integer For Each x In {1, 2, 4, 8, 16} If w Mod x = 0 Then wmod = x If h Mod x = 0 Then hmod = x Next If wmod = 16 AndAlso hmod = 16 Then If skip16 Then Return "" Else Return "16/16" End If Else Dim x = w - FixMod16(w) Dim xval As String If x = 8 OrElse x = -8 Then xval = "±8" ElseIf x > 0 Then xval = "+" & x Else xval = x.ToString End If Dim y = h - FixMod16(h) Dim yval As String If y = 8 OrElse y = -8 Then yval = "±8" ElseIf y > 0 Then yval = "+" & y Else yval = y.ToString End If Return wmod & "/" & hmod & " (" & xval & "/" & yval & ")" End If End Function Shared Function GetNextMod(val As Integer, step1 As Integer) As Integer Do val += 1 Loop Until val Mod step1 = 0 Return val End Function Shared Function GetPreviousMod(val As Integer, step1 As Integer) As Integer Do val -= 1 Loop Until val Mod step1 = 0 Return val End Function Private Shared FormatsValue As VideoFormat() Shared ReadOnly Property Formats() As VideoFormat() Get If FormatsValue Is Nothing Then FormatsValue = { New VideoFormat(768, 576, 14.75), New VideoFormat(768, 560, 14.75), New VideoFormat(720, 576, 13.5), New VideoFormat(704, 576, 13.5), New VideoFormat(702, 576, 13.5), New VideoFormat(544, 576, 10.125), New VideoFormat(480, 576, 9.0), New VideoFormat(384, 288, 7.375), New VideoFormat(384, 280, 7.375), New VideoFormat(352, 576, 6.75), New VideoFormat(352, 288, 6.75), New VideoFormat(176, 144, 3.375), New VideoFormat(720, 486, 13.5), New VideoFormat(720, 480, 13.5), New VideoFormat(711, 486, 13.5), New VideoFormat(704, 486, 13.5), New VideoFormat(704, 480, 13.5), New VideoFormat(640, 480, 12.27272), New VideoFormat(480, 480, 9.0), New VideoFormat(352, 480, 6.75), New VideoFormat(352, 240, 6.75), New VideoFormat(320, 240, 6.13636) } End If Return FormatsValue End Get End Property End Class Public Structure VideoFormat Sub New(width As Integer, height As Integer, samplingRate As Double) Me.Width = width Me.Height = height Me.SamplingRate = samplingRate End Sub Public Width As Integer Public Height As Integer Public SamplingRate As Double End Structure <Serializable()> Public Class Language Implements IComparable(Of Language) <NonSerialized> Public IsCommon As Boolean Sub New() Me.New("") End Sub Sub New(ci As CultureInfo, Optional isCommon As Boolean = False) Me.IsCommon = isCommon CultureInfoValue = ci End Sub Sub New(twoLetterCode As String, Optional isCommon As Boolean = False) Try Me.IsCommon = isCommon Select Case twoLetterCode Case "iw" twoLetterCode = "he" Case "jp" twoLetterCode = "ja" End Select CultureInfoValue = New CultureInfo(twoLetterCode) Catch ex As Exception CultureInfoValue = CultureInfo.InvariantCulture End Try End Sub Private CultureInfoValue As CultureInfo ReadOnly Property CultureInfo() As CultureInfo Get Return CultureInfoValue End Get End Property ReadOnly Property TwoLetterCode() As String Get Return CultureInfo.TwoLetterISOLanguageName End Get End Property <NonSerialized()> Private ThreeLetterCodeValue As String ReadOnly Property ThreeLetterCode() As String Get If ThreeLetterCodeValue Is Nothing Then If CultureInfo.TwoLetterISOLanguageName = "iv" Then ThreeLetterCodeValue = "und" Else Select Case CultureInfo.ThreeLetterISOLanguageName Case "deu" ThreeLetterCodeValue = "ger" Case "ces" ThreeLetterCodeValue = "cze" Case "zho" ThreeLetterCodeValue = "chi" Case "nld" ThreeLetterCodeValue = "dut" Case "ell" ThreeLetterCodeValue = "gre" Case "fra" ThreeLetterCodeValue = "fre" Case "sqi" ThreeLetterCodeValue = "alb" Case "hye" ThreeLetterCodeValue = "arm" Case "eus" ThreeLetterCodeValue = "baq" Case "mya" ThreeLetterCodeValue = "bur" Case "kat" ThreeLetterCodeValue = "geo" Case "isl" ThreeLetterCodeValue = "ice" Case "bng" ThreeLetterCodeValue = "ben" Case Else ThreeLetterCodeValue = CultureInfo.ThreeLetterISOLanguageName End Select End If End If Return ThreeLetterCodeValue End Get End Property ReadOnly Property Name() As String Get If CultureInfo.TwoLetterISOLanguageName = "iv" Then Return "Undetermined" Else Return CultureInfo.EnglishName End If End Get End Property Private Shared LanguagesValue As List(Of Language) Shared ReadOnly Property Languages() As List(Of Language) Get If LanguagesValue Is Nothing Then Dim l As New List(Of Language) l.Add(New Language("en", True)) l.Add(New Language("es", True)) l.Add(New Language("de", True)) l.Add(New Language("fr", True)) l.Add(New Language("it", True)) l.Add(New Language("ru", True)) l.Add(New Language("zh", True)) l.Add(New Language("hi", True)) l.Add(New Language("ja", True)) l.Add(New Language("pt", True)) l.Add(New Language("ar", True)) l.Add(New Language("bn", True)) l.Add(New Language("pa", True)) l.Add(New Language("ms", True)) l.Add(New Language("ko", True)) l.Add(New Language(CultureInfo.InvariantCulture, True)) Dim current = l.Where(Function(a) a.TwoLetterCode = CultureInfo.CurrentCulture.TwoLetterISOLanguageName).FirstOrDefault If current Is Nothing Then l.Add(CurrentCulture) l.Sort() Dim l2 As New List(Of Language) For Each i In CultureInfo.GetCultures(CultureTypes.NeutralCultures) l2.Add(New Language(i)) Next l2.Sort() l.AddRange(l2) LanguagesValue = l End If Return LanguagesValue End Get End Property Shared ReadOnly Property CurrentCulture As Language Get Return New Language(CultureInfo.CurrentCulture.NeutralCulture, True) End Get End Property Overrides Function ToString() As String Return Name End Function Function CompareTo(other As Language) As Integer Implements System.IComparable(Of Language).CompareTo Return Name.CompareTo(other.Name) End Function Overrides Function Equals(o As Object) As Boolean If TypeOf o Is Language Then Return CultureInfo.Equals(DirectCast(o, Language).CultureInfo) End If End Function End Class Class CmdlTypeEditor Inherits UITypeEditor Overloads Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object Using f As New MacroEditor f.SetBatchDefaults() f.MacroEditorControl.Value = CStr(value) If f.ShowDialog = DialogResult.OK Then Return f.MacroEditorControl.Value Else Return value End If End Using End Function Overloads Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle Return UITypeEditorEditStyle.Modal End Function End Class Class ScriptTypeEditor Inherits UITypeEditor Overloads Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object Using f As New MacroEditor f.SetScriptDefaults() f.MacroEditorControl.Value = CStr(value) If f.ShowDialog = DialogResult.OK Then Return f.MacroEditorControl.Value Else Return value End If End Using End Function Overloads Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle Return UITypeEditorEditStyle.Modal End Function End Class Class MacroStringTypeEditor Inherits UITypeEditor Overloads Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object Using f As New MacroEditor f.SetMacroDefaults() f.MacroEditorControl.Value = CStr(value) If f.ShowDialog = DialogResult.OK Then Return f.MacroEditorControl.Value Else Return value End If End Using End Function Overloads Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle Return UITypeEditorEditStyle.Modal End Function End Class <Serializable()> Public MustInherit Class Profile Implements IComparable(Of Profile) Sub New() End Sub Sub New(name As String) Me.Name = name End Sub Private NameValue As String Overridable Property Name() As String Get If NameValue = "" Then Return DefaultName Return NameValue End Get Set(Value As String) If Value = DefaultName Then NameValue = Nothing Else NameValue = Value End If End Set End Property Overridable ReadOnly Property DefaultName As String Get Return "untitled" End Get End Property Protected CanEditValue As Boolean Overridable ReadOnly Property CanEdit() As Boolean Get Return CanEditValue End Get End Property Overridable Function Edit() As DialogResult End Function Overridable Function CreateEditControl() As Control Return Nothing End Function Overridable Sub Clean() End Sub Overridable Function GetCopy() As Profile Return DirectCast(ObjectHelp.GetCopy(Me), Profile) End Function Overrides Function ToString() As String Return Name End Function Function CompareTo(other As Profile) As Integer Implements System.IComparable(Of Profile).CompareTo Return Name.CompareTo(other.Name) End Function End Class <Serializable()> Class Macro Implements IComparable(Of Macro) Sub New() MyClass.New("", "", GetType(String), "") End Sub Sub New(name As String, friendlyName As String, type As Type, description As String) If name.StartsWith("$") Then Me.Name = name Else Me.Name = "%" + name + "%" End If Me.FriendlyName = friendlyName Me.Type = type Me.Description = description End Sub Private NameValue As String Property Name() As String Get If NameValue Is Nothing Then NameValue = "" Return NameValue End Get Set(Value As String) If (Not Value.StartsWith("%") AndAlso Not Value.StartsWith("$")) OrElse (Not Value.EndsWith("%") AndAlso Not Value.EndsWith("$")) Then Throw New Exception("Macro must start and end with '%' or '$'") End If NameValue = Value End Set End Property Private FriendlyNameValue As String Property FriendlyName() As String Get If FriendlyNameValue = "" AndAlso NameValue <> "" Then FriendlyNameValue = NameValue.Replace("_", " ").Replace("%", " ").Trim(" "c).ToTitleCase End If If FriendlyNameValue Is Nothing Then FriendlyNameValue = "" Return FriendlyNameValue End Get Set(Value As String) FriendlyNameValue = Value End Set End Property Private TypeValue As Type Property Type As Type Get If TypeValue Is Nothing Then TypeValue = GetType(String) Return TypeValue End Get Set(Value As Type) TypeValue = Value End Set End Property Private DescriptionValue As String Property Description() As String Get If DescriptionValue Is Nothing Then DescriptionValue = "" Return DescriptionValue End Get Set(Value As String) DescriptionValue = Value End Set End Property Shared Function GetTips() As StringPairList Dim ret As New StringPairList For Each i In GetMacros(True) ret.Add(i.Name, i.Description) Next Return ret End Function Shared Function GetTipsFriendly(convertHTMLChars As Boolean) As StringPairList Dim ret As New StringPairList For Each i As Macro In GetMacros() If convertHTMLChars Then ret.Add(HelpDocument.ConvertChars(i.FriendlyName), i.Description) Else ret.Add(i.FriendlyName, i.Description) End If Next Return ret End Function Overrides Function ToString() As String Return Name End Function Function CompareTo(other As Macro) As Integer Implements System.IComparable(Of Macro).CompareTo Return Name.CompareTo(other.Name) End Function Shared Function GetMacros(Optional includeSpecial As Boolean = False) As List(Of Macro) Dim ret As New List(Of Macro) If includeSpecial Then ret.Add(New Macro("eval:<expression>", "Eval Math Expression", GetType(String), "Evaluates a math expression which may contain default macros.")) ret.Add(New Macro("filter:<name>", "Filter", GetType(String), "Returns the script code of a filter of the active project that matches the specified name.")) ret.Add(New Macro("media_info_video:<property>", "MediaInfo Video Property", GetType(String), "Returns a MediaInfo video property for the source file.")) ret.Add(New Macro("media_info_audio:<property>", "MediaInfo Audio Property", GetType(String), "Returns a MediaInfo audio property for the video source file.")) ret.Add(New Macro("app:<name>", "Application File Path", GetType(String), "Returns the path of a aplication. Possible names are: " + Package.Items.Values.Select(Function(arg) arg.Name).Join(", "))) ret.Add(New Macro("app_dir:<name>", "Application Directory", GetType(String), "Returns the directory of a aplication. Possible names are: " + Package.Items.Values.Select(Function(arg) arg.Name).Join(", "))) ret.Add(New Macro("$select:<param1;param2;...>$", "Select", GetType(String), "String selected from dropdown.")) ret.Add(New Macro("$enter_text:<prompt>$", "Enter Text (Params)", GetType(String), "Text entered in a input box.")) ret.Add(New Macro("$browse_file$", "Browse For File", GetType(String), "Filepath returned from a file browser.")) ret.Add(New Macro("$enter_text$", "Enter Text", GetType(String), "Text entered in a input box.")) End If ret.Add(New Macro("audio_bitrate", "Audio Bitrate", GetType(Integer), "Overall audio bitrate.")) ret.Add(New Macro("audio_file1", "First Audio File", GetType(String), "File path of the first audio file.")) ret.Add(New Macro("audio_file2", "Second Audio File", GetType(String), "File path of the second audio file.")) ret.Add(New Macro("compressibility", "Compressibility", GetType(Integer), "Compressibility value.")) ret.Add(New Macro("crop_bottom", "Crop Bottom", GetType(Integer), "Bottom crop value.")) ret.Add(New Macro("crop_height", "Crop Height", GetType(Integer), "Crop height.")) ret.Add(New Macro("crop_left", "Crop Left", GetType(Integer), "Left crop value.")) ret.Add(New Macro("crop_right", "Crop Right", GetType(Integer), "Right crop value.")) ret.Add(New Macro("crop_top", "Crop Top", GetType(Integer), "Top crop value.")) ret.Add(New Macro("crop_width", "Crop Width", GetType(Integer), "Crop width.")) ret.Add(New Macro("delay", "Audio Delay 1", GetType(Integer), "Audio delay of the first audio track.")) ret.Add(New Macro("delay2", "Audio Delay 2", GetType(Integer), "Audio delay of the second audio track.")) ret.Add(New Macro("encoder_ext", "Encoder File Extension", GetType(String), "File extension of the format the encoder of the active project outputs.")) ret.Add(New Macro("encoder_out_file", "Encoder Output File", GetType(String), "Output file of the video encoder.")) ret.Add(New Macro("muxer_ext", "Muxer Extension", GetType(String), "Output extension of the active muxer.")) ret.Add(New Macro("player", "Player", GetType(Integer), "Path of MPC Player.")) ret.Add(New Macro("plugin_dir", "Plugin Directory", GetType(String), "AviSynth/VapourSynth plugin directory.")) ret.Add(New Macro("pos_frame", "Position In Frames", GetType(Integer), "Current preview position in frames.")) ret.Add(New Macro("pos_ms", "Position In Millisecons", GetType(Integer), "Current preview position in milliseconds.")) ret.Add(New Macro("processing", "Processing", GetType(String), "Returns 'True' if a job is currently processing otherwise 'False'.")) ret.Add(New Macro("programs_dir", "Programs Directory", GetType(String), "Programs system directory.")) ret.Add(New Macro("script_dir", "Script Directory", GetType(String), "Users C# and PowerShell scripts directory.")) ret.Add(New Macro("script_ext", "Script File Extension", GetType(String), "File extension of the AviSynth/VapourSynth script so either avs or vpy.")) ret.Add(New Macro("script_file", "Script Path", GetType(String), "Path of the AviSynth/VapourSynth script.")) ret.Add(New Macro("sel_end", "Selection End", GetType(Integer), "End position of the first selecion in the preview.")) ret.Add(New Macro("sel_start", "Selection Start", GetType(Integer), "Start position of the first selecion in the preview.")) ret.Add(New Macro("settings_dir", "Settings Directory", GetType(String), "Path of the settings direcory.")) ret.Add(New Macro("source_dir", "Source Directory", GetType(String), "Directory of the source file.")) ret.Add(New Macro("source_dir_name", "Source Directory Name", GetType(String), "Name of the source file directory.")) ret.Add(New Macro("source_dir_parent", "Source Directory Parent", GetType(String), "Parent directory of the source file directory.")) ret.Add(New Macro("source_file", "Source File Path", GetType(String), "File path of the source video.")) ret.Add(New Macro("source_files", "Source Files Blank", GetType(String), "Source files in quotes separated by a blank.")) ret.Add(New Macro("source_files_comma", "Source Files Comma", GetType(String), "Source files in quotes separated by comma.")) ret.Add(New Macro("source_framerate", "Source Framerate", GetType(Integer), "Frame rate returned by the source filter AviSynth section.")) ret.Add(New Macro("source_frames", "Source Frames", GetType(Integer), "Length in frames of the source video.")) ret.Add(New Macro("source_height", "Source Image Height", GetType(Integer), "Image height of the source video.")) ret.Add(New Macro("source_name", "Source Filename Without Extension", GetType(String), "The name of the source file without file extension.")) ret.Add(New Macro("source_seconds", "Source Seconds", GetType(Integer), "Length in seconds of the source video.")) ret.Add(New Macro("source_temp_file", "Source Temp File", GetType(String), "File located in the temp directory using the same name as the source file.")) ret.Add(New Macro("source_width", "Source Image Width", GetType(Integer), "Image width of the source video.")) ret.Add(New Macro("startup_dir", "Startup Directory", GetType(String), "Directory of the application.")) ret.Add(New Macro("system_dir", "System Directory", GetType(String), "System directory.")) ret.Add(New Macro("target_dir", "Target Directory", GetType(String), "Directory of the target file.")) ret.Add(New Macro("target_file", "Target File Path", GetType(String), "File path of the target file.")) ret.Add(New Macro("target_framerate", "Target Framerate", GetType(Integer), "Frame rate of the target video.")) ret.Add(New Macro("target_frames", "Target Frames", GetType(Integer), "Length in frames of the target video.")) ret.Add(New Macro("target_height", "Target Image Height", GetType(Integer), "Image height of the target video.")) ret.Add(New Macro("target_name", "Target Filename Without Extension", GetType(String), "Name of the target file without file extension.")) ret.Add(New Macro("target_sar", "Target Sample Aspect Ratio", GetType(String), "Target sample aspect ratio (also known as PAR (pixel aspect ratio)).")) ret.Add(New Macro("target_seconds", "Target Seconds", GetType(Integer), "Length in seconds of the target video.")) ret.Add(New Macro("target_size", "Target Size", GetType(Integer), "Size of the target video in kilo bytes.")) ret.Add(New Macro("target_temp_file", "Target Temp File", GetType(String), "File located in the temp directory using the same name as the target file.")) ret.Add(New Macro("target_width", "Target Image Width", GetType(Integer), "Image width of the target video.")) ret.Add(New Macro("temp_file", "Temp File", GetType(String), "File located in the temp directory using the same name as the source file.")) ret.Add(New Macro("template_name", "Template Name", GetType(String), "Name of the template the active project is based on.")) ret.Add(New Macro("text_editor", "Text Editor", GetType(String), "Path of the application currently associated with TXT files.")) ret.Add(New Macro("version", "Version", GetType(String), "StaxRip version.")) ret.Add(New Macro("video_bitrate", "Video Bitrate", GetType(Integer), "Video bitrate in Kbps")) ret.Add(New Macro("working_dir", "Working Directory", GetType(String), "Directory of the source file or the temp directory if enabled.")) ret.Sort() Return ret End Function Shared Function Solve(value As String) As String Return Solve(value, False) End Function Shared Function SolveInteractive(value As String) As String If value.Contains("$") Then If value.Contains("$browse_file$") Then Using d As New OpenFileDialog If d.ShowDialog = DialogResult.OK Then value = value.Replace("$browse_file$", d.FileName) End Using Return value End If If value.Contains("$enter_text$") Then Dim text = InputBox.Show("Please enter some text.") If text <> "" Then value = value.Replace("$enter_text$", text) Return value End If If value.Contains("$enter_text:") Then Dim mc = Regex.Matches(value, "\$enter_text:(.+?)\$") For Each i As Match In mc Dim v = InputBox.Show(i.Groups(1).Value) If v <> "" Then value = value.Replace(i.Value, v) Next Return value End If If value.Contains("$select:") Then Dim mc = Regex.Matches(value, "\$select:(.+?)\$") For Each i As Match In mc Dim items = i.Groups(1).Value.SplitNoEmpty(";").ToList If items.Count > 0 Then Dim f As New SelectionBox(Of String) f.Title = "Select" If items?(0)?.StartsWith("msg:") Then f.Text = items(0).Substring(4) items.RemoveAt(0) Else f.Text = "Please select a item." End If For Each iItem As String In items If iItem.Contains("|") Then f.AddItem(iItem.Left("|"), iItem.Right("|")) Else f.AddItem(iItem) End If Next If f.Show = DialogResult.OK Then value = value.Replace(i.Value, f.SelectedItem) End If Next Return value End If End If Return value End Function Shared Function Solve(value As String, silent As Boolean) As String If value = "" Then Return "" If Not silent AndAlso value.Contains("$") Then value = SolveInteractive(value) If Not value.Contains("%") Then Return value If value.Contains("%source_file%") Then value = value.Replace("%source_file%", p.SourceFile) If Not value.Contains("%") Then Return value If value.Contains("%working_dir%") Then value = value.Replace("%working_dir%", p.TempDir) If Not value.Contains("%") Then Return value If value.Contains("%temp_file%") Then value = value.Replace("%temp_file%", p.TempDir + p.SourceFile.Base) If Not value.Contains("%") Then Return value If value.Contains("%source_temp_file%") Then value = value.Replace("%source_temp_file%", p.TempDir + p.SourceFile.Base) If Not value.Contains("%") Then Return value If value.Contains("%target_temp_file%") Then value = value.Replace("%target_temp_file%", p.TempDir + p.TargetFile.Base) If Not value.Contains("%") Then Return value If value.Contains("%source_name%") Then value = value.Replace("%source_name%", p.SourceFile.Base) If Not value.Contains("%") Then Return value If value.Contains("%version%") Then value = value.Replace("%version%", Application.ProductVersion) If Not value.Contains("%") Then Return value If value.Contains("%source_width%") Then value = value.Replace("%source_width%", p.SourceWidth.ToString) If Not value.Contains("%") Then Return value If value.Contains("%source_height%") Then value = value.Replace("%source_height%", p.SourceHeight.ToString) If Not value.Contains("%") Then Return value If value.Contains("%source_seconds%") Then value = value.Replace("%source_seconds%", p.SourceSeconds.ToString) If Not value.Contains("%") Then Return value If value.Contains("%source_frames%") Then value = value.Replace("%source_frames%", p.SourceFrames.ToString) If Not value.Contains("%") Then Return value If value.Contains("%source_framerate%") Then value = value.Replace("%source_framerate%", p.SourceFrameRate.ToString("f6", CultureInfo.InvariantCulture)) If Not value.Contains("%") Then Return value If value.Contains("%source_dir%") Then value = value.Replace("%source_dir%", Filepath.GetDir(p.SourceFile)) If Not value.Contains("%") Then Return value If value.Contains("%source_dir_parent%") Then value = value.Replace("%source_dir_parent%", DirPath.GetParent(Filepath.GetDir(p.SourceFile))) If Not value.Contains("%") Then Return value If value.Contains("%source_dir_name%") Then value = value.Replace("%source_dir_name%", DirPath.GetName(Filepath.GetDir(p.SourceFile))) If Not value.Contains("%") Then Return value If value.Contains("%target_width%") Then value = value.Replace("%target_width%", p.TargetWidth.ToString) If Not value.Contains("%") Then Return value If value.Contains("%target_height%") Then value = value.Replace("%target_height%", p.TargetHeight.ToString) If Not value.Contains("%") Then Return value If value.Contains("%target_seconds%") Then value = value.Replace("%target_seconds%", p.TargetSeconds.ToString) If Not value.Contains("%") Then Return value If value.Contains("%target_frames%") Then value = value.Replace("%target_frames%", p.Script.GetFrames.ToString) If Not value.Contains("%") Then Return value If value.Contains("%target_framerate%") Then value = value.Replace("%target_framerate%", p.Script.GetFramerate.ToString("f6", CultureInfo.InvariantCulture)) If Not value.Contains("%") Then Return value If value.Contains("%target_size%") Then value = value.Replace("%target_size%", (p.TargetSize * 1024).ToString) If Not value.Contains("%") Then Return value If value.Contains("%target_file%") Then value = value.Replace("%target_file%", p.TargetFile) If Not value.Contains("%") Then Return value If value.Contains("%target_dir%") Then value = value.Replace("%target_dir%", Filepath.GetDir(p.TargetFile)) If Not value.Contains("%") Then Return value If value.Contains("%target_name%") Then value = value.Replace("%target_name%", p.Name) If Not value.Contains("%") Then Return value If value.Contains("%target_sar%") Then Dim par = Calc.GetTargetPAR value = value.Replace("%target_sar%", par.X & ":" & par.Y) End If If Not value.Contains("%") Then Return value If value.Contains("%crop_width%") Then value = value.Replace("%crop_width%", (p.SourceWidth - p.CropLeft - p.CropRight).ToString) If Not value.Contains("%") Then Return value If value.Contains("%crop_height%") Then value = value.Replace("%crop_height%", (p.SourceHeight - p.CropTop - p.CropBottom).ToString) If Not value.Contains("%") Then Return value If value.Contains("%crop_left%") Then value = value.Replace("%crop_left%", p.CropLeft.ToString) If Not value.Contains("%") Then Return value If value.Contains("%crop_top%") Then value = value.Replace("%crop_top%", p.CropTop.ToString) If Not value.Contains("%") Then Return value If value.Contains("%crop_right%") Then value = value.Replace("%crop_right%", p.CropRight.ToString) If Not value.Contains("%") Then Return value If value.Contains("%crop_bottom%") Then value = value.Replace("%crop_bottom%", p.CropBottom.ToString) If Not value.Contains("%") Then Return value If value.Contains("%video_bitrate%") Then value = value.Replace("%video_bitrate%", p.VideoBitrate.ToString) If Not value.Contains("%") Then Return value If value.Contains("%audio_bitrate%") Then value = value.Replace("%audio_bitrate%", (p.Audio0.Bitrate + p.Audio1.Bitrate).ToString) If Not value.Contains("%") Then Return value If value.Contains("%audio_file1%") Then value = value.Replace("%audio_file1%", p.Audio0.File) If Not value.Contains("%") Then Return value If value.Contains("%audio_file2%") Then value = value.Replace("%audio_file2%", p.Audio1.File) If Not value.Contains("%") Then Return value If value.Contains("%delay%") Then value = value.Replace("%delay%", p.Audio0.Delay.ToString) If Not value.Contains("%") Then Return value If value.Contains("%delay2%") Then value = value.Replace("%delay2%", p.Audio1.Delay.ToString) If Not value.Contains("%") Then Return value If value.Contains("%startup_dir%") Then value = value.Replace("%startup_dir%", Folder.Startup) If Not value.Contains("%") Then Return value If value.Contains("%system_dir%") Then value = value.Replace("%system_dir%", Folder.System) If Not value.Contains("%") Then Return value If value.Contains("%script_dir%") Then value = value.Replace("%script_dir%", Folder.Script) If Not value.Contains("%") Then Return value If value.Contains("%programs_dir%") Then value = value.Replace("%programs_dir%", Folder.Programs) If Not value.Contains("%") Then Return value If value.Contains("%plugin_dir%") Then value = value.Replace("%plugin_dir%", Folder.Plugins) If Not value.Contains("%") Then Return value If value.Contains("%source_files_comma%") Then value = value.Replace("%source_files_comma%", """" + String.Join(""",""", p.SourceFiles.ToArray) + """") If Not value.Contains("%") Then Return value If value.Contains("%source_files%") Then value = value.Replace("%source_files%", """" + String.Join(""" """, p.SourceFiles.ToArray) + """") If Not value.Contains("%") Then Return value If value.Contains("%compressibility%") Then value = value.Replace("%compressibility%", Math.Round(p.Compressibility, 3).ToString.Replace(",", ".")) If Not value.Contains("%") Then Return value If value.Contains("%encoder_out_file%") Then value = value.Replace("%encoder_out_file%", p.VideoEncoder.OutputPath) If Not value.Contains("%") Then Return value If value.Contains("%encoder_ext%") Then value = value.Replace("%encoder_ext%", p.VideoEncoder.OutputExt) If Not value.Contains("%") Then Return value If value.Contains("%muxer_ext%") Then value = value.Replace("%muxer_ext%", p.VideoEncoder.Muxer.OutputExt) If Not value.Contains("%") Then Return value If value.Contains("%script_ext%") Then value = value.Replace("%script_ext%", p.Script.FileType) If Not value.Contains("%") Then Return value If value.Contains("%pos_frame%") Then value = value.Replace("%pos_frame%", s.LastPosition.ToString) If Not value.Contains("%") Then Return value If value.Contains("%template_name%") Then value = value.Replace("%template_name%", p.TemplateName) If Not value.Contains("%") Then Return value If value.Contains("%settings_dir%") Then value = value.Replace("%settings_dir%", Folder.Settings) If Not value.Contains("%") Then Return value If value.Contains("%player%") Then value = value.Replace("%player%", Package.MPC.Path) If Not value.Contains("%") Then Return value If value.Contains("%text_editor%") Then value = value.Replace("%text_editor%", g.GetTextEditor) If Not value.Contains("%") Then Return value If value.Contains("%processing%") Then value = value.Replace("%processing%", g.IsProcessing.ToString) If Not value.Contains("%") Then Return value If value.Contains("%script_file%") Then p.Script.Synchronize() value = value.Replace("%script_file%", p.Script.Path) End If If p.Ranges.Count > 0 Then If value.Contains("%sel_start%") Then value = value.Replace("%sel_start%", p.Ranges(0).Start.ToString) If Not value.Contains("%") Then Return value If value.Contains("%sel_end%") Then value = value.Replace("%sel_end%", p.Ranges(0).End.ToString) If Not value.Contains("%") Then Return value Else If value.Contains("%sel_start%") Then value = value.Replace("%sel_start%", 0.ToString) If Not value.Contains("%") Then Return value If value.Contains("%sel_end%") Then value = value.Replace("%sel_end%", 0.ToString) If Not value.Contains("%") Then Return value End If If value.Contains("%pos_ms%") Then value = value.Replace("%pos_ms%", g.GetPreviewPosMS.ToString) If Not value.Contains("%") Then Return value If value.Contains("%app:") Then Dim mc = Regex.Matches(value, "%app:(.+?)%") For Each i As Match In mc Dim package = StaxRip.Package.Items.Values.FirstOrDefault(Function(a) a.Name = i.Groups(1).Value) If package?.VerifyOK Then Dim path = package.Path If path <> "" Then value = value.Replace(i.Value, path) If Not value.Contains("%") Then Return value End If End If Next End If If value.Contains("%media_info_video:") Then For Each i As Match In Regex.Matches(value, "%media_info_video:(.+?)%") value = value.Replace(i.Value, MediaInfo.GetVideo(p.LastOriginalSourceFile, i.Groups(1).Value)) Next End If If value.Contains("%media_info_audio:") Then For Each i As Match In Regex.Matches(value, "%media_info_audio:(.+?)%") value = value.Replace(i.Value, MediaInfo.GetAudio(p.LastOriginalSourceFile, i.Groups(1).Value)) Next End If If Not value.Contains("%") Then Return value If value.Contains("%app_dir:") Then For Each i As Match In Regex.Matches(value, "%app_dir:(.+?)%") Dim package = StaxRip.Package.Items.Values.FirstOrDefault(Function(a) a.Name = i.Groups(1).Value) If package?.VerifyOK Then Dim path = package.Path If path <> "" Then value = value.Replace(i.Value, Filepath.GetDir(path)) If Not value.Contains("%") Then Return value End If End If Next End If If Not value.Contains("%") Then Return value If value.Contains("%filter:") Then Dim mc = Regex.Matches(value, "%filter:(.+?)%") For Each i As Match In mc For Each i2 In p.Script.Filters If i2.Active AndAlso i2.Path.ToUpper = i.Groups(1).Value.ToUpper Then value = value.Replace(i.Value, i2.Script) If Not value.Contains("%") Then Return value Exit For End If Next value = value.Replace(i.Value, "") Next End If If Not value.Contains("%") Then Return value If value.Contains("%eval:") Then If Not value.Contains("%eval:<expression>%") Then Dim mc = Regex.Matches(value, "%eval:(.+?)%") For Each i As Match In mc Try value = value.Replace(i.Value, Misc.Eval(i.Groups(1).Value).ToString) If Not value.Contains("%") Then Return value End If Catch ex As Exception MsgWarn("Failed to solve macro '" + i.Value + "': " + ex.Message) End Try Next End If End If Return value End Function End Class <Serializable()> Public Class ObjectStorage Private StringDictionary As New Dictionary(Of String, String) Private IntDictionary As New Dictionary(Of String, Integer) Private BoolDictionaryValue As Dictionary(Of String, Boolean) ReadOnly Property BoolDictionary() As Dictionary(Of String, Boolean) Get If BoolDictionaryValue Is Nothing Then BoolDictionaryValue = New Dictionary(Of String, Boolean) End If Return BoolDictionaryValue End Get End Property Function GetBool(key As String) As Boolean Return GetBool(key, False) End Function Function GetBool(key As String, defaultValue As Boolean) As Boolean If BoolDictionary.ContainsKey(key) Then Return BoolDictionary(key) End If Return defaultValue End Function Sub SetBool(key As String, Value As Boolean) BoolDictionary(key) = Value End Sub Function GetInt(key As String) As Integer Return GetInt(key, 0) End Function Function GetInt(key As String, defaultValue As Integer) As Integer If IntDictionary.ContainsKey(key) Then Return IntDictionary(key) End If Return defaultValue End Function Sub SetInt(key As String, value As Integer) IntDictionary(key) = value End Sub Function GetString(key As String) As String Return GetString(key, Nothing) End Function Function GetString(key As String, defaultValue As String) As String If StringDictionary.ContainsKey(key) Then Return StringDictionary(key) End If Return defaultValue End Function Sub SetString(key As String, value As String) StringDictionary(key) = value End Sub End Class Public Enum CompCheckAction [Nothing] <DispName("image size")> AdjustImageSize <DispName("file size")> AdjustFileSize End Enum <Serializable()> Public Class EventCommand Property Name As String = "???" Property Enabled As Boolean = True Property CriteriaList As New List(Of Criteria) Property OrOnly As Boolean Property CommandParameters As CommandParameters Property [Event] As ApplicationEvent Overrides Function ToString() As String Return Name End Function End Class Public Enum ApplicationEvent <DispName("After Project Loaded")> ProjectLoaded <DispName("After Project Encoded")> JobEncoded <DispName("Before Project Encoding")> BeforeEncoding <DispName("After Source Loaded")> AfterSourceLoaded <DispName("Application Exit")> ApplicationExit <DispName("After Project Or Source Loaded")> ProjectOrSourceLoaded <DispName("After Jobs Encoded")> JobsEncoded End Enum Public Enum DynamicMenuItemID Audio1Profiles Audio2Profiles EncoderProfiles FilterSetupProfiles MuxerProfiles RecentProjects TemplateProjects HelpApplications Scripts End Enum Public Enum SourceInputMode Combine FileBatch DirectoryBatch End Enum Class Startup <STAThread()> Shared Sub Main() AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf g.OnUnhandledException 'TODO: remove dead code 'SetProcDpiAware() 'SetProcessDPIAware() Application.EnableVisualStyles() 'use new GDI/TextRenderer by default instead of old GDI+/Graphics.DrawString Application.SetCompatibleTextRenderingDefault(False) Dim args = Environment.GetCommandLineArgs.Skip(1) If args.Count = 2 AndAlso args(0) = "-mediainfo" Then ToolStripManager.Renderer = New ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault) Application.Run(New MediaInfoForm(args(1)) With {.ShowInTaskbar = True}) Else Application.Run(New MainForm()) End If End Sub 'TODO: remove dead code 'Shared Sub SetProcDpiAware() ' If OSVersion.Current >= OSVersion.Windows10 Then ' SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.Process_Per_Monitor_DPI_Aware) ' Else ' SetProcessDPIAware() ' End If 'End Sub '<DllImport("user32.dll")> 'Shared Function SetProcessDPIAware() As Boolean 'End Function '<DllImport("SHCore.dll")> 'Shared Function SetProcessDpiAwareness(awareness As PROCESS_DPI_AWARENESS) As Boolean 'End Function 'Enum PROCESS_DPI_AWARENESS ' Process_DPI_Unaware ' Process_System_DPI_Aware ' Process_Per_Monitor_DPI_Aware 'End Enum End Class <Serializable()> Class Dummy End Class Class KeyValueList(Of T1, T2) Inherits List(Of KeyValuePair(Of T1, T2)) Overloads Sub Add(key As T1, value As T2) Add(New KeyValuePair(Of T1, T2)(key, value)) End Sub End Class Class GUIDS Shared Property LAVSplitter As String = "{171252A0-8820-4AFE-9DF8-5C92B2D66B04}" Shared Property LAVVideoDecoder As String = "{EE30215D-164F-4A92-A4EB-9D4C13390F9F}" Shared Property HaaliMuxer As String = "{A28F324B-DDC5-4999-AA25-D3A7E25EF7A8}" End Class Class M2TSStream Property Text As String = "Nothing" Property Codec As String = "" Property OutputType As String = "" Property Options As String = "" Property ID As Integer Property IsVideo As Boolean Property IsAudio As Boolean Property IsSubtitle As Boolean Property IsChapters As Boolean Property Language As New Language Property Checked As Boolean Property ListViewItem As ListViewItem Sub UpdateListViewItem() ListViewItem.Text = ToString() End Sub Public Overrides Function ToString() As String Dim ret = Text If ret.Contains("TrueHD/AC3") Then ret = ret.Replace("TrueHD/AC3", "THD+AC3") If ret.Contains("DTS Master Audio") Then ret = ret.Replace("DTS Master Audio", "DTS-MA") If ret.Contains("DTS Hi-Res") Then ret = ret.Replace("DTS Hi-Res", "DTS-HRA") If ret.Contains("DTS Express") Then ret = ret.Replace("DTS Express", "DTS-EX") If IsAudio Then ret += " -> " + OutputType If Options <> "" Then ret += ": " + Options End If End If Return ret End Function End Class <Serializable> Public Class AudioStream Property BitDepth As Integer Property Bitrate As Integer Property BitrateCore As Integer Property Channels As Integer Property ChannelsCore As Integer Property Codec As String Property CodecString As String Property Delay As Integer Property Format As String Property FormatProfile As String 'was only field to show DTS MA Property ID As Integer Property Language As Language Property SamplingRate As Integer Property StreamOrder As Integer Property Title As String Property Enabled As Boolean = True ReadOnly Property Name As String Get Dim sb As New StringBuilder() sb.Append("ID" & (StreamOrder + 1)) If CodecString <> "" Then Select Case CodecString Case "MPEG-1 Audio layer 2" sb.Append(" MP2") Case "MPEG-1 Audio layer 3" sb.Append(" MP3") Case "TrueHD / AC3" sb.Append(" THD+AC3") Case "AC3+" sb.Append(" E-AC3") Case Else Select Case Codec Case "Atmos / TrueHD" sb.Append(" THD Atmos") Case "TrueHD / AC3" sb.Append(" THD+AC3") Case Else Select Case FormatProfile Case "MA / Core" sb.Append(" DTS MA/Core") Case "HRA / Core" sb.Append(" DTS HRA/Core") Case Else sb.Append(" " + CodecString) End Select End Select End Select End If If ChannelsCore > 0 Then sb.Append(" " & Channels & "/" & ChannelsCore & "ch") ElseIf Channels > 0 Then sb.Append(" " & Channels & "ch") End If If BitDepth > 0 Then sb.Append(" " & BitDepth & "Bit") If SamplingRate > 0 Then sb.Append(" " & SamplingRate & "Hz") If BitrateCore > 0 Then sb.Append(" " & If(Bitrate = 0, "?", Bitrate.ToString) & "/" & BitrateCore & "Kbps") ElseIf Bitrate > 0 Then sb.Append(" " & Bitrate & "Kbps") End If If Delay <> 0 Then sb.Append(" " & Delay & "ms") If Language.TwoLetterCode <> "iv" Then sb.Append(" " + Language.Name) If Title <> "" AndAlso Title <> " " Then sb.Append(" " + Title) Return sb.ToString End Get End Property ReadOnly Property Extension() As String Get Select Case CodecString Case "AAC LC", "AAC LC-SBR", "AAC LC-SBR-PS" Return ".m4a" Case "AC3" Return ".ac3" Case "DTS" Return ".dts" Case "DTS-HD" If FormatProfile = "MA / Core" Then Return ".dtsma" ElseIf FormatProfile = "HRA / Core" Then Return ".dtshr" Else Return ".dtshd" End If Case "PCM", "ADPCM" Return ".wav" Case "MPEG-1 Audio layer 2" Return ".mp2" Case "MPEG-1 Audio layer 3" Return ".mp3" Case "TrueHD / AC3" Return ".thd" Case "Flac" Return ".flac" Case "Vorbis" Return ".ogg" Case "Opus" Return ".opus" Case "TrueHD", "Atmos / TrueHD" Return ".thd" Case "AC3+" Return ".eac3" Case Else Return ".mka" End Select End Get End Property Public Overrides Function ToString() As String Return Name End Function End Class Public Class VideoStream Property Format As String Property StreamOrder As Integer ReadOnly Property Extension() As String Get Select Case Format Case "MPEG Video" Return ".mpg" Case "AVC" Return ".h264" Case "MPEG-4 Visual", "JPEG" Return ".avi" Case "HEVC" Return "h265" End Select End Get End Property End Class Class Video Shared Sub DemuxMKV(sourcefile As String) Dim streams = MediaInfo.GetVideoStreams(sourcefile) If streams.Count = 0 Then Exit Sub Dim stream = streams(0) If stream.Extension = "" Then Throw New Exception("demuxing of video stream format is not implemented") Dim outPath = p.TempDir + sourcefile.Base + "_out" + stream.Extension Using proc As New Proc proc.Init("Demux video using mkvextract " + Package.mkvextract.Version, "Progress: ") proc.Encoding = Encoding.UTF8 proc.File = Package.mkvextract.Path proc.Arguments = "tracks """ + sourcefile + """ " & stream.StreamOrder & ":""" + outPath + """ --ui-language en" proc.AllowedExitCodes = {0, 1, 2} proc.Start() End Using If File.Exists(outPath) Then Log.WriteLine(MediaInfo.GetSummary(outPath)) Else Log.Write("Error", "no output found") End If End Sub End Class <Serializable()> Public Class Subtitle Property Title As String = "" Property Path As String Property CodecString As String Property Format As String Property ID As Integer Property StreamOrder As Integer Property IndexIDX As Integer Property Language As Language Property [Default] As Boolean Property Forced As Boolean Property Enabled As Boolean = True Property Size As Long Sub New() Language = New Language End Sub Sub New(lang As Language) Language = lang End Sub ReadOnly Property Filename As String Get Dim ret = "ID" & (StreamOrder + 1) ret += " " + Language.Name If Title <> "" AndAlso Title <> " " AndAlso Not Title.ContainsUnicode AndAlso p.SourceFile <> "" AndAlso p.SourceFile.Length < 130 Then ret += " " + Title.Shorten(30) End If If Not Filepath.IsValidFileSystemName(ret) Then ret = Filepath.RemoveIllegalCharsFromName(ret) End If Return ret End Get End Property ReadOnly Property Extension As String Get Select Case CodecString Case "VobSub" Return ".idx" Case "S_HDMV/PGS", "PGS" Return ".sup" Case "S_TEXT/ASS", "ASS" Return ".ass" Case "S_TEXT/UTF8", "UTF-8" Return ".srt" Case "S_TEXT/SSA", "SSA" Return ".ssa" Case "S_TEXT/USF", "USF" Return ".usf" Case "Timed" Return ".srt" End Select End Get End Property ReadOnly Property TypeName As String Get Dim ret = Extension If ret = "" Then ret = Path.ExtFull Return ret.TrimStart("."c).ToUpper.Replace("SUP", "PGS").Replace("IDX", "VobSub") End Get End Property Shared Function Create(path As String) As List(Of Subtitle) Dim ret As New List(Of Subtitle) If New FileInfo(path).Length = 0 Then Return ret If path.Ext = "idx" Then Dim indexData As Integer Dim st As Subtitle = Nothing For Each i In File.ReadAllText(path).SplitLinesNoEmpty If i.StartsWith("id: ") AndAlso i Like "id: ??, index: *" Then st = New Subtitle If path.Contains("forced") Then st.Forced = True Try st.Language = New Language(New CultureInfo(i.Substring(4, 2))) Catch st.Language = New Language(CultureInfo.InvariantCulture) End Try Dim autoCode = p.PreferredSubtitles.ToLower.SplitNoEmptyAndWhiteSpace(",", ";", " ") st.Enabled = autoCode.ContainsAny("all", st.Language.TwoLetterCode, st.Language.ThreeLetterCode) If Not st Is Nothing Then st.IndexIDX = CInt(Regex.Match(i, ", index: (\d+)").Groups(1).Value) End If End If If Not st Is Nothing AndAlso i.StartsWith("timestamp: ") Then st.StreamOrder = indexData st.Path = path indexData += 1 st.Size = CInt(New FileInfo(path).Length / 1024) Dim subFile = path.ChangeExt("sub") If File.Exists(subFile) Then st.Size += New FileInfo(subFile).Length ret.Add(st) st = Nothing End If Next ElseIf path.Ext.EqualsAny("mkv", "mp4", "m2ts") Then For Each i In MediaInfo.GetSubtitles(path) If i.Size = 0 Then Select Case i.TypeName Case "SRT" i.Size = 10L * p.TargetSeconds Case "VobSub" i.Size = 1250L * p.TargetSeconds Case "PGS" i.Size = 5000L * p.TargetSeconds End Select End If i.Path = path ret.Add(i) Next Else Dim st As New Subtitle() st.Size = New FileInfo(path).Length Dim match = Regex.Match(path, " ID(\d+)") If match.Success Then st.StreamOrder = match.Groups(1).Value.ToInt - 1 For Each i In Language.Languages If path.Contains(i.CultureInfo.EnglishName) Then st.Language = i Exit For End If Next Dim autoCode = p.PreferredSubtitles.ToLower.SplitNoEmptyAndWhiteSpace(",", ";", " ") st.Enabled = autoCode.ContainsAny("all", st.Language.TwoLetterCode, st.Language.ThreeLetterCode) st.Path = path ret.Add(st) End If Return ret End Function End Class <Serializable> Public Class PrimitiveStore Property Bool As New Dictionary(Of String, Boolean) Property Int As New Dictionary(Of String, Integer) Property Sng As New Dictionary(Of String, Single) Property [String] As New Dictionary(Of String, String) End Class Public Enum ContainerStreamType Unknown Audio Video Subtitle Attachment Chapters End Enum Class FileTypes Shared Property Audio As String() = {"aac", "ac3", "dts", "dtsma", "dtshr", "dtshd", "eac3", "flac", "m4a", "mka", "mp2", "mp3", "mpa", "ogg", "opus", "thd", "thd+ac3", "true-hd", "truehd", "wav"} Shared Property VideoAudio As String() = {"avi", "mp4", "mkv", "divx", "flv", "mov", "mpeg", "mpg", "ts", "m2ts", "vob", "webm", "wmv", "pva", "ogg", "ogm"} Shared Property BeSweetInput As String() = {"wav", "mp2", "mpa", "mp3", "ac3", "ogg"} Shared Property DGDecNVInput As String() = {"264", "h264", "avc", "mkv", "mp4", "mpg", "vob", "ts", "m2ts", "mts", "m2t", "mpv", "m2v"} Shared Property eac3toInput As String() = {"dts", "dtshd", "dtshr", "dtsma", "evo", "mkv", "vob", "ts", "m2ts", "wav", "w64", "pcm", "raw", "flac", "ac3", "eac3", "thd", "thd+ac3", "mlp", "mp2", "mp3", "mpa"} Shared Property NicAudioInput As String() = {"wav", "mp2", "mpa", "mp3", "ac3", "dts"} Shared Property qaacInput As String() = {"wav", "flac"} Shared Property SubtitleExludingContainers As String() = {"srt", "ass", "idx", "sup", "ttxt", "ssa", "smi"} Shared Property SubtitleIncludingContainers As String() = {"m2ts", "mkv", "mp4", "ass", "idx", "smi", "srt", "ssa", "sup", "ttxt"} Shared Property TextSub As String() = {"ass", "idx", "smi", "srt", "ssa", "ttxt", "usf", "ssf", "psb", "sub"} Shared Property Video As String() = {"264", "avc", "avi", "avs", "d2v", "dgi", "dgim", "divx", "flv", "h264", "m2t", "mts", "m2ts", "m2v", "mkv", "mov", "mp4", "mpeg", "mpg", "mpv", "ogg", "ogm", "pva", "rmvb", "ts", "vob", "webm", "wmv", "y4m"} Shared Property VideoNoText As String() = {"264", "avc", "avi", "divx", "flv", "h264", "m2t", "mts", "m2ts", "m2v", "mkv", "mov", "mp4", "mpeg", "mpg", "mpv", "ogg", "ogm", "pva", "rmvb", "ts", "vob", "webm", "wmv", "y4m"} Shared Property VideoIndex As String() = {"d2v", "dgi", "dga", "dgim"} Shared Property VideoOnly As String() = {"m4v", "m2v", "y4m", "mpv", "avc", "hevc", "264", "h264", "265", "h265"} Shared Property VideoRaw As String() = {"h264", "h265", "264", "265", "avc", "hevc"} Shared Property VideoText As String() = {"d2v", "dgi", "dga", "dgim", "avs", "vpy"} Shared Property VirtualDubModInput As String() = {"ac3", "mp3", "mp2", "mpa", "wav"} Shared Property mkvmergeInput As String() = {"avi", "wav", "mp4", "m4a", "aac", "flv", "mov", "264", "h264", "avc", "265", "h265", "hevc", "ac3", "eac3", "thd+ac3", "thd", "mkv", "mka", "webm", "mp2", "mpa", "mp3", "ogg", "ogm", "dts", "dtsma", "dtshr", "dtshd", "mpg", "m2v", "mpv", "ts", "m2ts", "opus", "flac"} End Class <Serializable> Class StringBooleanPair Property Key As String Property Value As Boolean Sub New(key As String, value As Boolean) Me.Key = key Me.Value = value End Sub Public Overrides Function ToString() As String Return Key End Function End Class Class OSVersion Shared Property Windows7 As Single = 6.1 Shared Property Windows8 As Single = 6.2 Shared Property Windows10 As Single = 10.0 Shared ReadOnly Property Current As Single Get Return CSng(Environment.OSVersion.Version.Major + Environment.OSVersion.Version.Minor / 10) End Get End Property End Class <Serializable> Public Class eac3toProfile Property Match As String Property Output As String Property Options As String Sub New() End Sub Sub New(match As String, output As String, options As String) Me.Match = match Me.Output = output Me.Options = options End Sub End Class Class BitmapUtil Property Data As Byte() Property BitmapData As BitmapData Shared Function Create(bmp As Bitmap) As BitmapUtil Dim util As New BitmapUtil Dim rect As New Rectangle(0, 0, bmp.Width, bmp.Height) util.BitmapData = bmp.LockBits(rect, Imaging.ImageLockMode.ReadWrite, bmp.PixelFormat) Dim ptr = util.BitmapData.Scan0 Dim bytesCount = Math.Abs(util.BitmapData.Stride) * bmp.Height util.Data = New Byte(bytesCount - 1) {} Marshal.Copy(ptr, util.Data, 0, bytesCount) bmp.UnlockBits(util.BitmapData) Return util End Function Function GetPixel(x As Integer, y As Integer) As Color Dim pos = y * BitmapData.Stride + x * 4 Return Color.FromArgb(Data(pos), Data(pos + 1), Data(pos + 2)) End Function Function GetMax(x As Integer, y As Integer) As Integer Dim col = GetPixel(x, y) Dim max = Math.Max(col.R, col.G) Return Math.Max(max, col.B) End Function End Class Class AutoCrop Public Top As Integer() Public Bottom As Integer() Public Left As Integer() Public Right As Integer() Shared Function Start(bmp As Bitmap, position As Integer) As AutoCrop Dim ret As New AutoCrop Dim u = BitmapUtil.Create(bmp) Dim max = 20 Dim xCount = 20 Dim yCount = 20 Dim xValues(xCount) As Integer For x = 0 To xCount xValues(x) = CInt(bmp.Width / (xCount + 1) * x) Next ret.Top = New Integer(xValues.Length - 1) {} ret.Bottom = New Integer(xValues.Length - 1) {} For xValue = 0 To xValues.Length - 1 For y = 0 To u.BitmapData.Height \ 4 If u.GetMax(xValues(xValue), y) < max Then ret.Top(xValue) = y + 1 Else Exit For End If Next For y = u.BitmapData.Height - 1 To u.BitmapData.Height - u.BitmapData.Height \ 4 Step -1 If u.GetMax(xValues(xValue), y) < max Then ret.Bottom(xValue) = u.BitmapData.Height - y Else Exit For End If Next Next Dim yValues(yCount) As Integer For x = 0 To yCount yValues(x) = CInt(bmp.Height / (yCount + 1) * x) Next ret.Left = New Integer(yValues.Length - 1) {} ret.Right = New Integer(yValues.Length - 1) {} For yValue = 0 To yValues.Length - 1 For x = 0 To u.BitmapData.Width \ 4 If u.GetMax(x, yValues(yValue)) < max Then ret.Left(yValue) = x + 1 Else Exit For End If Next For x = u.BitmapData.Width - 1 To u.BitmapData.Width - u.BitmapData.Width \ 4 Step -1 If u.GetMax(x, yValues(yValue)) < max Then ret.Right(yValue) = u.BitmapData.Width - x Else Exit For End If Next Next Return ret End Function End Class Public Enum MsgIcon None = MessageBoxIcon.None Info = MessageBoxIcon.Information [Error] = MessageBoxIcon.Error Warning = MessageBoxIcon.Warning Question = MessageBoxIcon.Question End Enum Public Enum DemuxMode <DispName("Show Dialog")> Dialog Preferred All None End Enum Public Class StringLogicalComparer Implements IComparer, IComparer(Of String) <DllImport("shlwapi.dll", CharSet:=CharSet.Unicode)> Public Shared Function StrCmpLogical(x As String, y As String) As Integer End Function Private Function IComparer_Compare(x As Object, y As Object) As Integer Implements IComparer.Compare Return StrCmpLogical(x.ToString(), y.ToString()) End Function Private Function IComparerOfString_Compare(x As String, y As String) As Integer Implements IComparer(Of String).Compare Return StrCmpLogical(x, y) End Function End Class Class Comparer(Of T) Implements IComparer(Of T) Property PropName As String Property Ascending As Boolean = True Sub New(propName As String, Optional ascending As Boolean = True) Me.PropName = propName Me.Ascending = ascending End Sub Public Function Compare(x As T, y As T) As Integer Implements IComparer(Of T).Compare If Not Ascending Then Dim x1 = x x = y y = x1 End If Dim type = x.GetType Dim propInfo = type.GetProperty(PropName) Return DirectCast(propInfo.GetValue(x), IComparable).CompareTo(propInfo.GetValue(y)) End Function End Class Public Enum Symbol None = 0 [Error] = &HE783 [Like] = &HE8E1 [Next] = &HE893 [Stop] = &HE71A Accept = &HE8FB AcceptLegacy = &HE10B Accident = &HE81F AccidentSolid = &HEA8E Accounts = &HE910 AccountsLegacy = &HE168 ActionCenter = &HE91C ActionCenterAsterisk = &HEA21 ActionCenterMirrored = &HED0D ActionCenterNotification = &HE7E7 ActionCenterNotificationMirrored = &HED0C ActionCenterQuiet = &HEE79 ActionCenterQuietNotification = &HEE7A Add = &HE710 AddFriend = &HE8FA AddFriendLegacy = &HE1E2 AddLegacy = &HE109 AddRemoteDevice = &HE836 AddSurfaceHub = &HECC4 AddTo = &HECC8 AdjustHologram = &HEBD2 Admin = &HE7EF AdminLegacy = &HE1A7 Airplane = &HE709 AirplaneSolid = &HEB4C AlignCenter = &HE8E3 AlignCenterLegacy = &HE1A1 AlignLeft = &HE8E4 AlignLeftLegacy = &HE1A2 AlignRight = &HE8E2 AlignRightLegacy = &HE1A0 AllApps = &HE71D AllAppsLegacy = &HE179 AllAppsLegacyMirrored = &HE1EC AllAppsMirrored = &HEA40 Annotation = &HE924 AppIconDefault = &HECAA ArrowHTMLLegacy = &HED5 ArrowHTMLLegacyMirrored = &HEAE AspectRatio = &HE799 Asterisk = &HEA38 AsteriskBadge12 = &HEDAD Attach = &HE723 AttachCamera = &HE8A2 AttachCameraLegacy = &HE12D AttachLegacy = &HE16C Audio = &HE8D6 AudioLegacy = &HE189 Back = &HE72B BackBttnArrow20Legacy = &HEC4 BackBttnArrow42Legacy = &HEA6 BackBttnMirroredArrow20Legacy = &HEAD BackBttnMirroredArrow42Legacy = &HEAB BackgroundToggle = &HEF1F BackLegacy = &HE112 BackSpaceQWERTY = &HE750 BackSpaceQWERTYLg = &HEB96 BackSpaceQWERTYMd = &HE926 BackSpaceQWERTYSm = &HE925 BackToWindow = &HE73F BackToWindowLegacy = &HE1D8 Badge = &HEC1B Bank = &HE825 BarcodeScanner = &HEC5A Battery0 = &HE850 Battery1 = &HE851 Battery10 = &HE83F Battery2 = &HE852 Battery3 = &HE853 Battery4 = &HE854 Battery5 = &HE855 Battery6 = &HE856 Battery7 = &HE857 Battery8 = &HE858 Battery9 = &HE859 BatteryCharging0 = &HE85A BatteryCharging1 = &HE85B BatteryCharging10 = &HEA93 BatteryCharging2 = &HE85C BatteryCharging3 = &HE85D BatteryCharging4 = &HE85E BatteryCharging5 = &HE85F BatteryCharging6 = &HE860 BatteryCharging7 = &HE861 BatteryCharging8 = &HE862 BatteryCharging9 = &HE83E BatterySaver0 = &HE863 BatterySaver1 = &HE864 BatterySaver10 = &HEA95 BatterySaver2 = &HE865 BatterySaver3 = &HE866 BatterySaver4 = &HE867 BatterySaver5 = &HE868 BatterySaver6 = &HE869 BatterySaver7 = &HE86A BatterySaver8 = &HE86B BatterySaver9 = &HEA94 BatteryUnknown = &HE996 Beta = &HEA24 BidiLtr = &HE9AA BidiRtl = &HE9AB BlockContact = &HE8F8 BlockContactLegacy = &HE1E0 BlockedLegacy = &HE25B Bluetooth = &HE702 BodyCam = &HEC80 Bold = &HE8DD BoldFLegacy = &HE1B3 BoldGLegacy = &HE1B1 BoldKoreanLegacy = &HE1BD BoldLegacy = &HE19B BoldNLegacy = &HE1B7 BoldRussionLegacy = &HE1B9 Bookmarks = &HE8A4 BookmarksLegacy = &HE12F BookmarksLegacyMirrored = &HE1EE BookmarksMirrored = &HEA41 Brightness = &HE706 Broom = &HEA99 BrowsePhotos = &HE7C5 BrowsePhotosLegacy = &HE155 BrushSize = &HEDA8 BuildingEnergy = &HEC0B BulletedList = &HE8FD BulletedListLegacy = &HE292 BulletedListLegacyMirrored = &HE299 BulletedListMirrored = &HEA42 Bus = &HE806 BusSolid = &HEB47 Calculator = &HE8EF CalculatorAddition = &HE948 CalculatorBackspace = &HE94F CalculatorDivide = &HE94A CalculatorEqualTo = &HE94E CalculatorLegacy = &HE1D0 CalculatorMultiply = &HE947 CalculatorNegate = &HE94D CalculatorPercentage = &HE94C CalculatorSquareroot = &HE94B CalculatorSubtract = &HE949 Calendar = &HE787 CalendarDay = &HE8BF CalendarDayLegacy = &HE161 CalendarLegacy = &HE163 CalendarLegacyMirrored = &HE1DC CalendarMirrored = &HED28 CalendarReply = &HE8F5 CalendarReplyLegacy = &HE1DB CalendarSolid = &HEA89 CalendarWeek = &HE8C0 CalendarWeekLegacy = &HE162 CaligraphyPen = &HEDFB CallForwarding = &HE7F2 CallForwardingMirrored = &HEA97 CallForwardInternational = &HE87A CallForwardInternationalMirrored = &HEA43 CallForwardRoaming = &HE87B CallForwardRoamingMirrored = &HEA44 Camera = &HE722 CameraLegacy = &HE114 Cancel = &HE711 CancelLegacy = &HE10A Caption = &HE8BA CaptionLegacy = &HE15A Car = &HE804 CashDrawer = &HEC59 CC = &HE7F0 CCEuroLegacy = &HE18F CCJapanLegacy = &HE18E CCLegacy = &HE190 CellPhone = &HE8EA CellPhoneLegacy = &HE1C9 Certificate = &HEB95 Characters = &HE8C1 CharactersLegacy = &HE164 ChatBubbles = &HE8F2 Checkbox = &HE739 CheckboxComposite = &HE73A CheckboxCompositeLegacy = &HEA2 CheckboxCompositeReversed = &HE73D CheckboxCompositeReversedLegacy = &HE5 CheckboxFill = &HE73B CheckboxFillLegacy = &HE2 CheckboxFillZeroWidthLegacy = &HE9 CheckboxIndeterminate = &HE73C CheckboxIndeterminateLegacy = &HE4 CheckboxLegacy = &HE3 CheckMark = &HE73E CheckMarkLegacy = &HE1 CheckmarkListviewLegacy = &HE81 CheckmarkMenuLegacy = &HEE7 CheckMarkZeroWidthLegacy = &HE8 ChevronDown = &HE70D ChevronDown1Legacy = &HE99 ChevronDown2Legacy = &HE9D ChevronDown3Legacy = &HE15 ChevronDown4Legacy = &HEA1 ChevronDownMed = &HE972 ChevronDownSmall = &HE96E ChevronDownSmLegacy = &HE228 ChevronFlipDownLegacy = &HEE5 ChevronFlipLeftLegacy = &HEE2 ChevronFlipRightLegacy = &HEE3 ChevronFlipUpLegacy = &HEE4 ChevronLeft = &HE76B ChevronLeft1Legacy = &HE96 ChevronLeft2Legacy = &HE9A ChevronLeft3Legacy = &HE12 ChevronLeft4Legacy = &HE9E ChevronLeftMed = &HE973 ChevronLeftSmall = &HE96F ChevronLeftSmLegacy = &HE26C ChevronRight = &HE76C ChevronRight1Legacy = &HE97 ChevronRight2Legacy = &HE9B ChevronRight3Legacy = &HE13 ChevronRight4Legacy = &HE9F ChevronRightMed = &HE974 ChevronRightSmall = &HE970 ChevronRightSmLegacy = &HE26B ChevronUp = &HE70E ChevronUp1Legacy = &HE98 ChevronUp2Legacy = &HE9C ChevronUp3Legacy = &HE14 ChevronUp4Legacy = &HEA0 ChevronUpMed = &HE971 ChevronUpSmall = &HE96D ChineseBoPoMoFo = &HE989 ChineseChangjie = &HE981 ChinesePinyin = &HE98A ChineseQuick = &HE984 ChromeAnnotate = &HE931 ChromeBack = &HE830 ChromeBackMirrored = &HEA47 ChromeBackToWindow = &HE92C ChromeClose = &HE8BB ChromeFullScreen = &HE92D ChromeMaximize = &HE922 ChromeMinimize = &HE921 ChromeRestore = &HE923 CircleFill = &HEA3B CircleFillBadge12 = &HEDB0 CircleRing = &HEA3A CircleRingBadge12 = &HEDAF CityNext = &HEC06 CityNext2 = &HEC07 Clear = &HE894 ClearAllInk = &HED62 ClearAllInkMirrored = &HEF19 ClearLegacy = &HE106 ClearSelection = &HE8E6 ClearSelectionLegacy = &HE1C5 ClearSelectionLegacyMirrored = &HE1F4 ClearSelectionMirrored = &HEA48 Click = &HE8B0 ClockLegacy = &HE121 ClosePane = &HE89F ClosePaneLegacy = &HE126 ClosePaneLegacyMirrored = &HE1BF ClosePaneMirrored = &HEA49 Cloud = &HE753 CloudPrinter = &HEDA6 Code = &HE943 Color = &HE790 ColorLegacy = &HE2B1 CommaKey = &HE9AD CommandPrompt = &HE756 Comment = &HE90A CommentInlineLegacy = &HE206 CommentLegacy = &HE134 Communications = &HE95A CompanionApp = &HEC64 CompanionDeviceFramework = &HED5D Completed = &HE930 CompletedSolid = &HEC61 Component = &HE950 Connect = &HE703 ConnectApp = &HED5C Construction = &HE822 ConstructionCone = &HE98F ConstructionSolid = &HEA8D Contact = &HE77B Contact2 = &HE8D4 Contact2Legacy = &HE187 Contact3Legacy = &HE2AF ContactInfo = &HE779 ContactInfoLegacy = &HE136 ContactInfoMirrored = &HEA4A ContactLegacy = &HE13D ContactPresence = &HE8CF ContactPresenceLegacy = &HE181 ContactSolid = &HEA8C Copy = &HE8C8 CopyLegacy = &HE16F Courthouse = &HEC08 Crop = &HE7A8 CropLegacy = &HE123 Cut = &HE8C6 CutLegacy = &HE16B DashKey = &HE9AE DataSense = &HE791 DataSenseBar = &HE7A5 DateTime = &HEC92 DateTimeMirrored = &HEE93 DecreaseIndentLegacy = &HE290 DecreaseIndentLegacyMirrored = &HE297 DefenderApp = &HE83D Delete = &HE74D DeleteLegacy = &HE107 DeveloperTools = &HEC7A DeviceDiscovery = &HEBDE DeviceLaptopNoPic = &HE7F8 DeviceLaptopPic = &HE7F7 DeviceMonitorLeftPic = &HE7FA DeviceMonitorNoPic = &HE7FB DeviceMonitorRightPic = &HE7F9 Devices = &HE772 Devices2 = &HE975 Devices3 = &HEA6C Devices4 = &HEB66 DevicesLegacy = &HE212 DevUpdate = &HECC5 Diagnostic = &HE9D9 Dialpad = &HE75F DialUp = &HE83C Dictionary = &HE82D DictionaryAdd = &HE82E DictionaryCloud = &HEBC3 DirectAccess = &HE83B Directions = &HE8F0 DirectionsLegacy = &HE1D1 DisableUpdates = &HE8D8 DisableUpdatesLegacy = &HE194 DisconnectDisplay = &HEA14 DisconnectDrive = &HE8CD DisconnectDriveLegacy = &HE17A Dislike = &HE8E0 DislikeLegacy = &HE19E DMC = &HE951 Dock = &HE952 DockBottom = &HE90E DockBottomLegacy = &HE147 DockLeft = &HE90C DockLeftLegacy = &HE145 DockLeftLegacyMirrored = &HE1AB DockLeftMirrored = &HEA4C DockRight = &HE90D DockRightLegacy = &HE146 DockRightLegacyMirrored = &HE1AC DockRightMirrored = &HEA4B Document = &HE8A5 DocumentLegacy = &HE130 Down = &HE74B DownLegacy = &HE1FD Download = &HE896 DownloadLegacy = &HE118 DownloadMap = &HE826 DownShiftKey = &HE84A Draw = &HEC87 DrawSolid = &HEC88 DrivingMode = &HE7EC Drop = &HEB42 DullSound = &HE911 DullSoundKey = &HE9AF EaseOfAccess = &HE776 EaseOfAccessLegacy = &HE7F Edit = &HE70F EditLegacy = &HE104 EditLegacyMirrored = &HE1C2 EditMirrored = &HEB7E Education = &HE7BE Emoji = &HE899 Emoji2 = &HE76E Emoji2Legacy = &HE170 EmojiLegacy = &HE11D EmojiSwatch = &HED5B EmojiTabCelebrationObjects = &HED55 EmojiTabFavorites = &HED5A EmojiTabFoodPlants = &HED56 EmojiTabPeople = &HED53 EmojiTabSmilesAnimals = &HED54 EmojiTabSymbols = &HED58 EmojiTabTextSmiles = &HED59 EmojiTabTransitPlaces = &HED57 EndPoint = &HE81B EndPointSolid = &HEB4B EraseTool = &HE75C EraseToolFill = &HE82B EraseToolFill2 = &HE82C ErrorBadge = &HEA39 ErrorBadge12 = &HEDAE eSIM = &HED2A eSIMBusy = &HED2D eSIMLocked = &HED2C eSIMNoProfile = &HED2B Ethernet = &HE839 EthernetError = &HEB55 EthernetWarning = &HEB56 ExpandTile = &HE976 ExpandTileLegacy = &HE13F ExpandTileLegacyMirrored = &HE176 ExpandTileMirrored = &HEA4E ExploreContent = &HECCD Export = &HEDE1 ExportMirrored = &HEDE2 FastForward = &HEB9D Favorite2Legacy = &HE249 FavoriteInlineLegacy = &HE208 FavoriteLegacy = &HE113 FavoriteList = &HE728 FavoriteStar = &HE734 FavoriteStarFill = &HE735 Feedback = &HED15 FeedbackApp = &HE939 Ferry = &HE7E3 FerrySolid = &HEB48 FileExplorer = &HEC50 FileExplorerApp = &HEC51 Filter = &HE71C FilterLegacy = &HE16E FindLegacy = &HE11A FingerInking = &HED5F Fingerprint = &HE928 Flag = &HE7C1 FlagLegacy = &HE129 Flashlight = &HE754 FlickDown = &HE935 FlickLeft = &HE937 FlickRight = &HE938 FlickUp = &HE936 Folder = &HE8B7 FolderFill = &HE8D5 FolderLegacy = &HE188 Font = &HE8D2 FontColor = &HE8D3 FontColorKoreanLegacy = &HE1BE FontColorLegacy = &HE186 FontDecrease = &HE8E7 FontDecreaseLegacy = &HE1C6 FontIncrease = &HE8E8 FontIncreaseLegacy = &HE1C7 FontLegacy = &HE185 FontSize = &HE8E9 FontSizeLegacy = &HE1C8 FontStyleKoreanLegacy = &HE1BA Forward = &HE72A ForwardLegacy = &HE111 ForwardSm = &HE9AC FourBars = &HE908 FourBarsLegacy = &HE1E9 Frigid = &HE9CA FullAlpha = &HE97F FullCircleMask = &HE91F FullHiragana = &HE986 FullKatakana = &HE987 FullScreen = &HE740 FullScreenLegacy = &HE1D9 Game = &HE7FC GameConsole = &HE967 GlobalNavButton = &HE700 Globe = &HE774 GlobeLegacy = &HE12B Go = &HE8AD GoLegacy = &HE143 GoLegacyMirrored = &HE1AA GoMirrored = &HEA4F GoToStart = &HE8FC GoToStartLegacy = &HE1E4 GotoToday = &HE8D1 GotoTodayLegacy = &HE184 GripperBarHorizontal = &HE76F GripperBarVertical = &HE784 GripperResize = &HE788 GripperResizeMirrored = &HEA50 GripperTool = &HE75E Groceries = &HEC09 GuestUser = &HEE57 HalfAlpha = &HE97E HalfDullSound = &HE9B0 HalfKatakana = &HE988 HalfStarLeft = &HE7C6 HalfStarRight = &HE7C7 Handwriting = &HE929 HangUp = &HE778 HangUpLegacy = &HE137 HardDrive = &HEDA2 Headphone = &HE7F6 Headphone0 = &HED30 Headphone1 = &HED31 Headphone2 = &HED32 Headphone3 = &HED33 Headset = &HE95B Health = &HE95E Heart = &HEB51 HeartBroken = &HEA92 HeartBrokenLegacy = &HE7 HeartBrokenZeroWidthLegacy = &HEC HeartFill = &HEB52 HeartFillLegacy = &HEA5 HeartFillZeroWidthLegacy = &HEB HeartLegacy = &HE6 Help = &HE897 HelpLegacy = &HE11B HelpLegacyMirrored = &HE1F3 HelpMirrored = &HEA51 HideBcc = &HE8C5 HideBccLegacy = &HE16A Highlight = &HE7E6 HighlightFill = &HE891 HighlightFill2 = &HE82A HighlightLegacy = &HE193 History = &HE81C Home = &HE80F HomeGroup = &HEC26 HomeLegacy = &HE10F HomeSolid = &HEA8A HorizontalTabKey = &HE7FD IBeam = &HE933 IBeamOutline = &HE934 ImageExport = &HEE71 Import = &HE8B5 ImportAll = &HE8B6 ImportAllLegacy = &HE151 ImportAllLegacyMirrored = &HE1AE ImportAllMirrored = &HEA53 Important = &HE8C9 ImportantBadge12 = &HEDB1 ImportantLegacy = &HE171 ImportLegacy = &HE150 ImportLegacyMirrored = &HE1AD ImportMirrored = &HEA52 IncidentTriangle = &HE814 IncreaseIndentLegacy = &HE291 IncreaseIndentLegacyMirrored = &HE298 Info = &HE946 Info2 = &HEA1F InkingCaret = &HED65 InkingColorFill = &HED67 InkingColorOutline = &HED66 InkingTool = &HE76D InkingToolFill = &HE88F InkingToolFill2 = &HE829 InPrivate = &HE727 Input = &HE961 InsiderHubApp = &HEC24 InternetSharing = &HE704 Italic = &HE8DB ItalicCLegacy = &HE1B0 ItalicILegacy = &HE1B6 ItalicKLegacy = &HE1B4 ItalicKoreanLegacy = &HE1BC ItalicLegacy = &HE199 ItalicRussianLegacy = &HE1EA Japanese = &HE985 JpnRomanji = &HE87C JpnRomanjiLock = &HE87D JpnRomanjiShift = &HE87E JpnRomanjiShiftLock = &HE87F Key12On = &HE980 KeyboardBrightness = &HED39 KeyboardClassic = &HE765 KeyboardDismiss = &HE92F KeyboardFull = &HEC31 KeyboardLeftHanded = &HE763 KeyBoardLegacy = &HE144 KeyboardLowerBrightness = &HED3A KeyboardOneHanded = &HED4C KeyboardRightHanded = &HE764 KeyboardShortcut = &HEDA7 KeyboardSplit = &HE766 KeyboardSplitLegacy = &HE8F KeyboardStandard = &HE92E KeyboardStandardLegacy = &HE87 Korean = &HE97D Label = &HE932 LangJPN = &HE7DE LanguageChs = &HE88D LanguageCht = &HE88C LanguageJpn = &HEC45 LanguageKor = &HE88B LaptopSelected = &HEC76 LayoutLegacy = &HE2AE Leaf = &HE8BE LeaveChat = &HE89B LeaveChatLegacy = &HE11F LeaveChatMirrored = &HEA54 LEDLight = &HE781 LeftArrowKeyTime0 = &HEC52 LeftDoubleQuote = &HE9B2 LeftQuote = &HE848 LengthLegacy = &HE2AD Library = &HE8F1 LibraryLegacy = &HE1D3 Light = &HE793 Lightbulb = &HEA80 LightningBolt = &HE945 LikeDislike = &HE8DF LikeDislikeLegacy = &HE19D LikeInlineLegacy = &HE209 LikeLegacy = &HE19F Link = &HE71B LinkLegacy = &HE167 List = &HEA37 ListLegacy = &HE14C ListLegacyMirrored = &HE175 ListMirrored = &HEA55 Location = &HE81D LocationLegacy = &HE1D2 Lock = &HE72E LockLegacy = &HE1F6 LockscreenDesktop = &HEE3F LockScreenGlance = &HEE65 LowerBrightness = &HEC8A MagStripeReader = &HEC5C Mail = &HE715 MailBadge12 = &HEDB3 MailFill = &HE8A8 MailFillLegacy = &HE135 MailForward = &HE89C MailForwardLegacy = &HE120 MailForwardLegacyMirrored = &HE1A8 MailForwardMirrored = &HEA56 MailLegacy = &HE119 MailMessageLegacy = &HE20B MailReply = &HE8CA MailReplyAll = &HE8C2 MailReplyAllLegacy = &HE165 MailReplyAllLegacyMirrored = &HE1F2 MailReplyAllMirrored = &HEA58 MailReplyLegacy = &HE172 MailReplyLegacyMirrored = &HE1AF MailReplyMirrored = &HEA57 Manage = &HE912 ManageLegacy = &HE178 MapCompassBottom = &HE813 MapCompassTop = &HE812 MapDirections = &HE816 MapDrive = &HE8CE MapDriveLegacy = &HE17B MapLayers = &HE81E MapLegacy = &HE1C4 MapPin = &HE707 MapPin2 = &HE7B7 MapPinLegacy = &HE139 Marker = &HED64 Marquee = &HEF20 Media = &HEA69 MediaStorageTower = &HE965 Megaphone = &HE789 Memo = &HE77C MemoLegacy = &HE1D5 Message = &HE8BD MessageLegacy = &HE15F MicClipping = &HEC72 MicError = &HEC56 MicOff = &HEC54 MicOn = &HEC71 Microphone = &HE720 MicrophoneLegacy = &HE1D6 MicSleep = &HEC55 MiracastLogoLarge = &HEC16 MiracastLogoSmall = &HEC15 MobActionCenter = &HEC42 MobAirplane = &HEC40 MobBattery0 = &HEBA0 MobBattery1 = &HEBA1 MobBattery10 = &HEBAA MobBattery2 = &HEBA2 MobBattery3 = &HEBA3 MobBattery4 = &HEBA4 MobBattery5 = &HEBA5 MobBattery6 = &HEBA6 MobBattery7 = &HEBA7 MobBattery8 = &HEBA8 MobBattery9 = &HEBA9 MobBatteryCharging0 = &HEBAB MobBatteryCharging1 = &HEBAC MobBatteryCharging10 = &HEBB5 MobBatteryCharging2 = &HEBAD MobBatteryCharging3 = &HEBAE MobBatteryCharging4 = &HEBAF MobBatteryCharging5 = &HEBB0 MobBatteryCharging6 = &HEBB1 MobBatteryCharging7 = &HEBB2 MobBatteryCharging8 = &HEBB3 MobBatteryCharging9 = &HEBB4 MobBatterySaver0 = &HEBB6 MobBatterySaver1 = &HEBB7 MobBatterySaver10 = &HEBC0 MobBatterySaver2 = &HEBB8 MobBatterySaver3 = &HEBB9 MobBatterySaver4 = &HEBBA MobBatterySaver5 = &HEBBB MobBatterySaver6 = &HEBBC MobBatterySaver7 = &HEBBD MobBatterySaver8 = &HEBBE MobBatterySaver9 = &HEBBF MobBatteryUnknown = &HEC02 MobBluetooth = &HEC41 MobCallForwarding = &HEC7E MobCallForwardingMirrored = &HEC7F MobDrivingMode = &HEC47 MobileContactLegacy = &HE25A MobileLocked = &HEC20 MobileSelected = &HEC75 MobileTablet = &HE8CC MobLocation = &HEC43 MobQuietHours = &HEC46 MobSignal1 = &HEC37 MobSignal2 = &HEC38 MobSignal3 = &HEC39 MobSignal4 = &HEC3A MobSignal5 = &HEC3B MobWifi1 = &HEC3C MobWifi2 = &HEC3D MobWifi3 = &HEC3E MobWifi4 = &HEC3F MobWifiHotspot = &HEC44 More = &HE712 MoreLegacy = &HE10C Mouse = &HE962 MoveToFolder = &HE8DE MoveToFolderLegacy = &HE19C Movies = &HE8B2 MultimediaDMP = &HED47 MultimediaDMS = &HE953 MultimediaDVR = &HE954 MultimediaPMP = &HE955 MultiSelect = &HE762 MultiSelectLegacy = &HE133 MultiSelectLegacyMirrored = &HE1EF MultiSelectMirrored = &HEA98 Multitask = &HE7C4 Multitask16 = &HEE40 MultitaskExpanded = &HEB91 MusicAlbum = &HE93C MusicInfo = &HE90B MusicInfoLegacy = &HE142 MusicNote = &HEC4F Mute = &HE74F MuteLegacy = &HE198 MyNetwork = &HEC27 Narrator = &HED4D NarratorForward = &HEDA9 NarratorForwardMirrored = &HEDAA Network = &HE968 NetworkAdapter = &HEDA3 NetworkPrinter = &HEDA5 NetworkTower = &HEC05 NewFolder = &HE8F4 NewFolderLegacy = &HE1DA NewWindow = &HE78B NewWindowLegacy = &HE17C NextLegacy = &HE101 NUIFace = &HEB68 NUIFPContinueSlideAction = &HEB85 NUIFPContinueSlideHand = &HEB84 NUIFPPressAction = &HEB8B NUIFPPressHand = &HEB8A NUIFPPressRepeatAction = &HEB8D NUIFPPressRepeatHand = &HEB8C NUIFPRollLeftAction = &HEB89 NUIFPRollLeftHand = &HEB88 NUIFPRollRightHand = &HEB86 NUIFPRollRightHandAction = &HEB87 NUIFPStartSlideAction = &HEB83 NUIFPStartSlideHand = &HEB82 NUIIris = &HEB67 OEM = &HE74C OneBar = &HE905 OneBarLegacy = &HE1E6 OpenFile = &HE8E5 OpenFileLegacy = &HE1A5 OpenInNewWindow = &HE8A7 OpenInNewWindowLegacy = &HE2B4 OpenLocal = &HE8DA OpenLocalLegacy = &HE197 OpenPane = &HE8A0 OpenPaneLegacy = &HE127 OpenPaneLegacyMirrored = &HE1C0 OpenPaneMirrored = &HEA5B OpenWith = &HE7AC OpenWithLegacy = &HE17D OpenWithLegacyMirrored = &HE1ED OpenWithMirrored = &HEA5C Orientation = &HE8B4 OrientationLegacy = &HE14F OtherUser = &HE7EE OtherUserLegacy = &HE1A6 OutlineStarLegacy = &HE1CE Package = &HE7B8 Page = &HE7C3 PageFillLegacy = &HE132 PageLeft = &HE760 PageLegacy = &HE160 PageRight = &HE761 PageSolid = &HE729 PanMode = &HECE9 ParkingLocation = &HE811 ParkingLocationMirrored = &HEA5E ParkingLocationSolid = &HEA8B PartyLeader = &HECA7 PasswordKeyHide = &HE9A9 PasswordKeyShow = &HE9A8 Paste = &HE77F PasteLegacy = &HE16D Pause = &HE769 PauseBadge12 = &HEDB4 PauseLegacy = &HE103 PC1 = &HE977 PC1Legacy = &HE211 Pencil = &HED63 PenPalette = &HEE56 PenPaletteMirrored = &HEF16 PenWorkspace = &HEDC6 PenWorkspaceMirrored = &HEF15 People = &HE716 PeopleLegacy = &HE125 PeriodKey = &HE843 Permissions = &HE8D7 PermissionsLegacy = &HE192 PersonalFolder = &HEC25 Personalize = &HE771 Phone = &HE717 PhoneBook = &HE780 PhoneBookLegacy = &HE1D4 PhoneLegacy = &HE13A Photo = &HE91B Photo2 = &HEB9F Picture = &HE8B9 PictureLegacy = &HE158 PieSingle = &HEB05 Pin = &HE718 PinFill = &HE841 PinLegacy = &HE141 Pinned = &HE840 PinnedFill = &HE842 PlaceFolderLegacy = &HE18A PLAP = &HEC19 Play = &HE768 Play36 = &HEE4A PlaybackRate1x = &HEC57 PlaybackRateOther = &HEC58 PlayBadge12 = &HEDB5 PlayLegacy = &HE102 PlayOnLegacy = &HE29B PointErase = &HED61 PointEraseMirrored = &HEF18 PoliceCar = &HEC81 PostUpdate = &HE8F3 PostUpdateLegacy = &HE1D7 PowerButton = &HE7E8 PresenceChicklet = &HE978 PresenceChickletLegacy = &HE25E PresenceChickletVideo = &HE979 PresenceChickletVideoLegacy = &HE25D Preview = &HE8FF PreviewLegacy = &HE295 PreviewLink = &HE8A1 PreviewLinkLegacy = &HE12A Previous = &HE892 PreviousLegacy = &HE100 Print = &HE749 Printer3D = &HE914 Printer3DLegacy = &HE2F7 PrintfaxPrinterFile = &HE956 PrintLegacy = &HE2F6 Priority = &HE8D0 PriorityLegacy = &HE182 Process = &HE9F3 Project = &HEBC6 Projector = &HE95D ProtectedDocument = &HE8A6 ProtectedDocumentLegacy = &HE131 ProvisioningPackage = &HE835 PuncKey = &HE844 PuncKey0 = &HE84C PuncKey1 = &HE9B4 PuncKey2 = &HE9B5 PuncKey3 = &HE9B6 PuncKey4 = &HE9B7 PuncKey5 = &HE9B8 PuncKey6 = &HE9B9 PuncKey7 = &HE9BB PuncKey8 = &HE9BC PuncKey9 = &HE9BA PuncKeyLeftBottom = &HE84D PuncKeyRightBottom = &HE9B3 Puzzle = &HEA86 QuickNote = &HE70B QuietHours = &HE708 QWERTYOff = &HE983 QWERTYOn = &HE982 RadioBtnOff = &HECCA RadioBtnOn = &HECCB RadioBullet = &HE915 RadioBullet2 = &HECCC RatingStarFillLegacy = &HEB4 RatingStarFillReducedPaddingHTMLLegacy = &HE82 RatingStarFillSmallLegacy = &HEB5 RatingStarFillZeroWidthLegacy = &HEA RatingStarLegacy = &HE224 Read = &HE8C3 ReadingList = &HE7BC ReadLegacy = &HE166 ReceiptPrinter = &HEC5B Recent = &HE823 Record = &HE7C8 RecordLegacy = &HE1F5 Redo = &HE7A6 RedoLegacy = &HE10D ReduceTileLegacy = &HE140 ReduceTileLegacyMirrored = &HE177 Refresh = &HE72C RefreshLegacy = &HE149 RememberedDevice = &HE70C Reminder = &HEB50 ReminderFill = &HEB4F Remote = &HE8AF RemoteLegacy = &HE148 Remove = &HE738 RemoveFrom = &HECC9 RemoveLegacy = &HE108 Rename = &HE8AC RenameLegacy = &HE13E Repair = &HE90F RepairLegacy = &HE15E RepeatAll = &HE8EE RepeatAllLegacy = &HE1CD RepeatOne = &HE8ED RepeatOneLegacy = &HE1CC Reply = &HE97A ReplyLegacy = &HE248 ReplyMirrored = &HEE35 ReportHacked = &HE730 ReportHackedLegacy = &HE1DE ResetDevice = &HED10 ResetDrive = &HEBC4 Reshare = &HE8EB ReshareLegacy = &HE1CA ResizeMouseLarge = &HE747 ResizeMouseMedium = &HE744 ResizeMouseMediumMirrored = &HEA5F ResizeMouseSmall = &HE743 ResizeMouseSmallMirrored = &HEA60 ResizeMouseTall = &HE746 ResizeMouseTallMirrored = &HEA61 ResizeMouseWide = &HE745 ResizeTouchLarger = &HE741 ResizeTouchNarrower = &HE7EA ResizeTouchNarrowerMirrored = &HEA62 ResizeTouchShorter = &HE7EB ResizeTouchSmaller = &HE742 ResolutionLegacy = &HE2AC ReturnKey = &HE751 ReturnKeyLg = &HEB97 ReturnKeySm = &HE966 ReturnToWindow = &HE944 ReturnToWindowLegacy = &HE2B3 RevealPasswordLegacy = &HE52 RevToggleKey = &HE845 Rewind = &HEB9E RightArrowKeyTime0 = &HEBE7 RightArrowKeyTime1 = &HE846 RightArrowKeyTime2 = &HE847 RightArrowKeyTime3 = &HE84E RightArrowKeyTime4 = &HE84F RightDoubleQuote = &HE9B1 RightQuote = &HE849 Ringer = &HEA8F RingerBadge12 = &HEDAC RingerSilent = &HE7ED RoamingDomestic = &HE879 RoamingInternational = &HE878 Robot = &HE99A Rotate = &HE7AD RotateCamera = &HE89E RotateCameraLegacy = &HE124 RotateLegacy = &HE14A RotateMapLeft = &HE80D RotateMapRight = &HE80C RotationLock = &HE755 Ruler = &HED5E Save = &HE74E SaveAs = &HE792 SaveAsLegacy = &HE28F SaveCopy = &HEA35 SaveLegacy = &HE105 SaveLocal = &HE78C SaveLocalLegacy = &HE159 Scan = &HE8FE ScanLegacy = &HE294 ScrollChevronDownBoldLegacy = &HE19 ScrollChevronDownLegacy = &HE11 ScrollChevronLeftBoldLegacy = &HE16 ScrollChevronLeftLegacy = &HEE ScrollChevronRightBoldLegacy = &HE17 ScrollChevronRightLegacy = &HEF ScrollChevronUpBoldLegacy = &HE18 ScrollChevronUpLegacy = &HE10 ScrollMode = &HECE7 ScrollUpDown = &HEC8F SDCard = &HE7F1 Search = &HE721 SearchAndApps = &HE773 SearchboxLegacy = &HE94 SelectAll = &HE8B3 SelectAllLegacy = &HE14E SemanticZoomLegacy = &HEB8 Send = &HE724 SendFill = &HE725 SendFillMirrored = &HEA64 SendLegacy = &HE122 SendMirrored = &HEA63 Sensor = &HE957 SetlockScreen = &HE7B5 SetlockScreenLegacy = &HE18C SetTile = &HE97B SetTileLegacy = &HE18D Settings = &HE713 SettingsBattery = &HEE63 SettingsDisplaySound = &HE7F3 SettingsLegacy = &HE115 Share = &HE72D ShareBroadband = &HE83A Shop = &HE719 ShopLegacy = &HE14D ShoppingCart = &HE7BF ShowAllFiles1Legacy = &HE153 ShowAllFiles3Legacy = &HE152 ShowAllFilesLegacy = &HE154 ShowBcc = &HE8C4 ShowBccLegacy = &HE169 ShowResults = &HE8BC ShowResultsLegacy = &HE15C ShowResultsLegacyMirrored = &HE1F1 ShowResultsMirrored = &HEA65 Shuffle = &HE8B1 ShuffleLegacy = &HE14B SignalBars1 = &HE86C SignalBars2 = &HE86D SignalBars3 = &HE86E SignalBars4 = &HE86F SignalBars5 = &HE870 SignalError = &HED2E SignalNotConnected = &HE871 SignalRoaming = &HEC1E SIMLock = &HE875 SIMMissing = &HE876 SIPMove = &HE759 SIPRedock = &HE75B SIPUndock = &HE75A SizeLegacy = &HE2B2 SkipBack10 = &HED3C SkipForward30 = &HED3D SliderThumb = &HEC13 Slideshow = &HE786 SlideshowLegacy = &HE173 Smartcard = &HE963 SmartcardVirtual = &HE964 SolidStarLegacy = &HE1CF Sort = &HE8CB SortLegacy = &HE174 Speakers = &HE7F5 SpeedHigh = &HEC4A SpeedMedium = &HEC49 SpeedOff = &HEC48 StartPoint = &HE819 StartPointSolid = &HEB49 StatusCircle = &HEA81 StatusCircleLeft = &HEBFD StatusConnecting1 = &HEB57 StatusConnecting2 = &HEB58 StatusDataTransfer = &HE880 StatusDataTransferVPN = &HE881 StatusDualSIM1 = &HE884 StatusDualSIM1VPN = &HE885 StatusDualSIM2 = &HE882 StatusDualSIM2VPN = &HE883 StatusError = &HEA83 StatusErrorFull = &HEB90 StatusErrorLeft = &HEBFF StatusSGLTE = &HE886 StatusSGLTECell = &HE887 StatusSGLTEDataVPN = &HE888 StatusTriangle = &HEA82 StatusTriangleLeft = &HEBFE StatusUnsecure = &HEB59 StatusVPN = &HE889 StatusWarning = &HEA84 StatusWarningLeft = &HEC00 StockDown = &HEB0F StockUp = &HEB11 StopLegacy = &HE15B StopPoint = &HE81A StopPointSolid = &HEB4A StopSlideshowLegacy = &HE191 Stopwatch = &HE916 StorageNetworkWireless = &HE969 StorageOptical = &HE958 StorageTape = &HE96A Streaming = &HE93E StreamingEnterprise = &HED2F Street = &HE913 StreetLegacy = &HE1C3 StreetsideSplitExpand = &HE803 StreetsideSplitMinimize = &HE802 StrokeErase = &HED60 StrokeEraseMirrored = &HEF17 Subtitles = &HED1E SubtitlesAudio = &HED1F SurfaceHub = &HE8AE Sustainable = &HEC0A Swipe = &HE927 SwipeRevealArt = &HEC6D Switch = &HE8AB SwitchApps = &HE8F9 SwitchAppsLegacy = &HE1E1 SwitchLegacy = &HE13C SwitchUser = &HE748 Sync = &HE895 SyncBadge12 = &HEDAB SyncError = &HEA6A SyncFolder = &HE8F7 SyncFolderLegacy = &HE1DF SyncLegacy = &HE117 System = &HE770 Tablet = &HE70A TabletMode = &HEBFC TabletSelected = &HEC74 Tag = &HE8EC TagLegacy = &HE1CB TapAndSend = &HE9A1 TaskbarPhone = &HEE64 ThisPC = &HEC4E ThoughtBubble = &HEA91 ThreeBars = &HE907 ThreeBarsLegacy = &HE1E8 Tiles = &HECA5 TiltDown = &HE80A TiltUp = &HE809 TimeLanguage = &HE775 ToggleBorder = &HEC12 ToggleFilled = &HEC11 ToggleThumb = &HEC14 ToolTip = &HE82F Touch = &HE815 TouchPointer = &HE7C9 TouchPointerLegacy = &HE1E3 Touchscreen = &HEDA4 Trackers = &HEADF TrackersMirrored = &HEE92 Train = &HE7C0 TrainSolid = &HEB4D TreeFolderFolder = &HED41 TreeFolderFolderFill = &HED42 TreeFolderFolderOpen = &HED43 TreeFolderFolderOpenFill = &HED44 Trim = &HE78A TrimLegacy = &HE12C TVMonitor = &HE7F4 TVMonitorSelected = &HEC77 TwoBars = &HE906 TwoBarsLegacy = &HE1E7 TwoPage = &HE89A TwoPageLegacy = &HE11E Type = &HE97C TypeLegacy = &HE2B0 TypingIndicatorLegacy = &HE25C Underline = &HE8DC UnderlineLegacy = &HE19A UnderlineLKoreanLegacy = &HE1BB UnderlineRussianLegacy = &HE1B8 UnderlineSLegacy = &HE1B2 UnderlineULegacy = &HE1B5 UnderscoreSpace = &HE75D Undo = &HE7A7 UndoLegacy = &HE10E Unfavorite = &HE8D9 Unfavorite2Legacy = &HE24A UnfavoriteLegacy = &HE195 Unit = &HECC6 Unlock = &HE785 UnlockLegacy = &HE1F7 Unpin = &HE77A UnpinLegacy = &HE196 UnsyncFolder = &HE8F6 UnsyncFolderLegacy = &HE1DD Up = &HE74A UpArrowShiftKey = &HE752 UpdateRestore = &HE777 UpLegacy = &HE110 Upload = &HE898 UploadLegacy = &HE11C UploadSkyDriveLegacy = &HE183 UpShiftKey = &HE84B USB = &HE88E USBSafeConnect = &HECF3 Vibrate = &HE877 Video = &HE714 VideoChat = &HE8AA VideoChatLegacy = &HE13B VideoInlineLegacy = &HE20A VideoLegacy = &HE116 View = &HE890 ViewAll = &HE8A9 ViewAllLegacy = &HE138 ViewLegacy = &HE18B Volume = &HE767 Volume0 = &HE992 Volume1 = &HE993 Volume2 = &HE994 Volume3 = &HE995 VolumeBars = &HEBC5 VolumeLegacy = &HE15D VPN = &HE705 Walk = &HE805 WalkSolid = &HE726 Warning = &HE7BA Webcam = &HE8B8 Webcam2 = &HE960 WebcamLegacy = &HE156 Wheel = &HEE94 Wifi = &HE701 Wifi1 = &HE872 Wifi2 = &HE873 Wifi3 = &HE874 WifiAttentionOverlay = &HE998 WifiCall0 = &HEBD5 WifiCall1 = &HEBD6 WifiCall2 = &HEBD7 WifiCall3 = &HEBD8 WifiCall4 = &HEBD9 WifiCallBars = &HEBD4 WifiError0 = &HEB5A WifiError1 = &HEB5B WifiError2 = &HEB5C WifiError3 = &HEB5D WifiError4 = &HEB5E WifiEthernet = &HEE77 WifiHotspot = &HE88A WifiWarning0 = &HEB5F WifiWarning1 = &HEB60 WifiWarning2 = &HEB61 WifiWarning3 = &HEB62 WifiWarning4 = &HEB63 WindDirection = &HEBE6 WiredUSB = &HECF0 WirelessUSB = &HECF1 Work = &HE821 WorkSolid = &HEB4E World = &HE909 WorldLegacy = &HE128 XboxOneConsole = &HE990 ZeroBars = &HE904 ZeroBarsLegacy = &HE1E5 Zoom = &HE71E ZoomIn = &HE8A3 ZoomInLegacy = &HE12E ZoomLegacy = &HE1A3 ZoomMode = &HECE8 ZoomOut = &HE71F ZoomOutLegacy = &HE1A4 fa_500px = &HF26E fa_address_book = &HF2B9 fa_address_book_o = &HF2BA fa_address_card = &HF2BB fa_address_card_o = &HF2BC fa_adjust = &HF042 fa_adn = &HF170 fa_align_center = &HF037 fa_align_justify = &HF039 fa_align_left = &HF036 fa_align_right = &HF038 fa_amazon = &HF270 fa_ambulance = &HF0F9 fa_american_sign_language_interpreting = &HF2A3 fa_anchor = &HF13D fa_android = &HF17B fa_angellist = &HF209 fa_angle_double_down = &HF103 fa_angle_double_left = &HF100 fa_angle_double_right = &HF101 fa_angle_double_up = &HF102 fa_angle_down = &HF107 fa_angle_left = &HF104 fa_angle_right = &HF105 fa_angle_up = &HF106 fa_apple = &HF179 fa_archive = &HF187 fa_area_chart = &HF1FE fa_arrow_circle_down = &HF0AB fa_arrow_circle_left = &HF0A8 fa_arrow_circle_o_down = &HF01A fa_arrow_circle_o_left = &HF190 fa_arrow_circle_o_right = &HF18E fa_arrow_circle_o_up = &HF01B fa_arrow_circle_right = &HF0A9 fa_arrow_circle_up = &HF0AA fa_arrow_down = &HF063 fa_arrow_left = &HF060 fa_arrow_right = &HF061 fa_arrow_up = &HF062 fa_arrows = &HF047 fa_arrows_alt = &HF0B2 fa_arrows_h = &HF07E fa_arrows_v = &HF07D fa_asl_interpreting = &HF2A3 fa_assistive_listening_systems = &HF2A2 fa_asterisk = &HF069 fa_at = &HF1FA fa_audio_description = &HF29E fa_automobile = &HF1B9 fa_backward = &HF04A fa_balance_scale = &HF24E fa_ban = &HF05E fa_bandcamp = &HF2D5 fa_bank = &HF19C fa_bar_chart = &HF080 fa_bar_chart_o = &HF080 fa_barcode = &HF02A fa_bars = &HF0C9 fa_bath = &HF2CD fa_bathtub = &HF2CD fa_battery = &HF240 fa_battery_0 = &HF244 fa_battery_1 = &HF243 fa_battery_2 = &HF242 fa_battery_3 = &HF241 fa_battery_4 = &HF240 fa_battery_empty = &HF244 fa_battery_full = &HF240 fa_battery_half = &HF242 fa_battery_quarter = &HF243 fa_battery_three_quarters = &HF241 fa_bed = &HF236 fa_beer = &HF0FC fa_behance = &HF1B4 fa_behance_square = &HF1B5 fa_bell = &HF0F3 fa_bell_o = &HF0A2 fa_bell_slash = &HF1F6 fa_bell_slash_o = &HF1F7 fa_bicycle = &HF206 fa_binoculars = &HF1E5 fa_birthday_cake = &HF1FD fa_bitbucket = &HF171 fa_bitbucket_square = &HF172 fa_bitcoin = &HF15A fa_black_tie = &HF27E fa_blind = &HF29D fa_bluetooth = &HF293 fa_bluetooth_b = &HF294 fa_bold = &HF032 fa_bolt = &HF0E7 fa_bomb = &HF1E2 fa_book = &HF02D fa_bookmark = &HF02E fa_bookmark_o = &HF097 fa_braille = &HF2A1 fa_briefcase = &HF0B1 fa_btc = &HF15A fa_bug = &HF188 fa_building = &HF1AD fa_building_o = &HF0F7 fa_bullhorn = &HF0A1 fa_bullseye = &HF140 fa_bus = &HF207 fa_buysellads = &HF20D fa_cab = &HF1BA fa_calculator = &HF1EC fa_calendar = &HF073 fa_calendar_check_o = &HF274 fa_calendar_minus_o = &HF272 fa_calendar_o = &HF133 fa_calendar_plus_o = &HF271 fa_calendar_times_o = &HF273 fa_camera = &HF030 fa_camera_retro = &HF083 fa_car = &HF1B9 fa_caret_down = &HF0D7 fa_caret_left = &HF0D9 fa_caret_right = &HF0DA fa_caret_square_o_down = &HF150 fa_caret_square_o_left = &HF191 fa_caret_square_o_right = &HF152 fa_caret_square_o_up = &HF151 fa_caret_up = &HF0D8 fa_cart_arrow_down = &HF218 fa_cart_plus = &HF217 fa_cc = &HF20A fa_cc_amex = &HF1F3 fa_cc_diners_club = &HF24C fa_cc_discover = &HF1F2 fa_cc_jcb = &HF24B fa_cc_mastercard = &HF1F1 fa_cc_paypal = &HF1F4 fa_cc_stripe = &HF1F5 fa_cc_visa = &HF1F0 fa_certificate = &HF0A3 fa_chain = &HF0C1 fa_chain_broken = &HF127 fa_check = &HF00C fa_check_circle = &HF058 fa_check_circle_o = &HF05D fa_check_square = &HF14A fa_check_square_o = &HF046 fa_chevron_circle_down = &HF13A fa_chevron_circle_left = &HF137 fa_chevron_circle_right = &HF138 fa_chevron_circle_up = &HF139 fa_chevron_down = &HF078 fa_chevron_left = &HF053 fa_chevron_right = &HF054 fa_chevron_up = &HF077 fa_child = &HF1AE fa_chrome = &HF268 fa_circle = &HF111 fa_circle_o = &HF10C fa_circle_o_notch = &HF1CE fa_circle_thin = &HF1DB fa_clipboard = &HF0EA fa_clock_o = &HF017 fa_clone = &HF24D fa_close = &HF00D fa_cloud = &HF0C2 fa_cloud_download = &HF0ED fa_cloud_upload = &HF0EE fa_cny = &HF157 fa_code = &HF121 fa_code_fork = &HF126 fa_codepen = &HF1CB fa_codiepie = &HF284 fa_coffee = &HF0F4 fa_cog = &HF013 fa_cogs = &HF085 fa_columns = &HF0DB fa_comment = &HF075 fa_comment_o = &HF0E5 fa_commenting = &HF27A fa_commenting_o = &HF27B fa_comments = &HF086 fa_comments_o = &HF0E6 fa_compass = &HF14E fa_compress = &HF066 fa_connectdevelop = &HF20E fa_contao = &HF26D fa_copy = &HF0C5 fa_copyright = &HF1F9 fa_creative_commons = &HF25E fa_credit_card = &HF09D fa_credit_card_alt = &HF283 fa_crop = &HF125 fa_crosshairs = &HF05B fa_css3 = &HF13C fa_cube = &HF1B2 fa_cubes = &HF1B3 fa_cut = &HF0C4 fa_cutlery = &HF0F5 fa_dashboard = &HF0E4 fa_dashcube = &HF210 fa_database = &HF1C0 fa_deaf = &HF2A4 fa_deafness = &HF2A4 fa_dedent = &HF03B fa_delicious = &HF1A5 fa_desktop = &HF108 fa_deviantart = &HF1BD fa_diamond = &HF219 fa_digg = &HF1A6 fa_dollar = &HF155 fa_dot_circle_o = &HF192 fa_download = &HF019 fa_dribbble = &HF17D fa_drivers_license = &HF2C2 fa_drivers_license_o = &HF2C3 fa_dropbox = &HF16B fa_drupal = &HF1A9 fa_edge = &HF282 fa_edit = &HF044 fa_eercast = &HF2DA fa_eject = &HF052 fa_ellipsis_h = &HF141 fa_ellipsis_v = &HF142 fa_empire = &HF1D1 fa_envelope = &HF0E0 fa_envelope_o = &HF003 fa_envelope_open = &HF2B6 fa_envelope_open_o = &HF2B7 fa_envelope_square = &HF199 fa_envira = &HF299 fa_eraser = &HF12D fa_etsy = &HF2D7 fa_eur = &HF153 fa_euro = &HF153 fa_exchange = &HF0EC fa_exclamation = &HF12A fa_exclamation_circle = &HF06A fa_exclamation_triangle = &HF071 fa_expand = &HF065 fa_expeditedssl = &HF23E fa_external_link = &HF08E fa_external_link_square = &HF14C fa_eye = &HF06E fa_eye_slash = &HF070 fa_eyedropper = &HF1FB fa_fa = &HF2B4 fa_facebook = &HF09A fa_facebook_f = &HF09A fa_facebook_official = &HF230 fa_facebook_square = &HF082 fa_fast_backward = &HF049 fa_fast_forward = &HF050 fa_fax = &HF1AC fa_feed = &HF09E fa_female = &HF182 fa_fighter_jet = &HF0FB fa_file = &HF15B fa_file_archive_o = &HF1C6 fa_file_audio_o = &HF1C7 fa_file_code_o = &HF1C9 fa_file_excel_o = &HF1C3 fa_file_image_o = &HF1C5 fa_file_movie_o = &HF1C8 fa_file_o = &HF016 fa_file_pdf_o = &HF1C1 fa_file_photo_o = &HF1C5 fa_file_picture_o = &HF1C5 fa_file_powerpoint_o = &HF1C4 fa_file_sound_o = &HF1C7 fa_file_text = &HF15C fa_file_text_o = &HF0F6 fa_file_video_o = &HF1C8 fa_file_word_o = &HF1C2 fa_file_zip_o = &HF1C6 fa_files_o = &HF0C5 fa_film = &HF008 fa_filter = &HF0B0 fa_fire = &HF06D fa_fire_extinguisher = &HF134 fa_firefox = &HF269 fa_first_order = &HF2B0 fa_flag = &HF024 fa_flag_checkered = &HF11E fa_flag_o = &HF11D fa_flash = &HF0E7 fa_flask = &HF0C3 fa_flickr = &HF16E fa_floppy_o = &HF0C7 fa_folder = &HF07B fa_folder_o = &HF114 fa_folder_open = &HF07C fa_folder_open_o = &HF115 fa_font = &HF031 fa_font_awesome = &HF2B4 fa_fonticons = &HF280 fa_fort_awesome = &HF286 fa_forumbee = &HF211 fa_forward = &HF04E fa_foursquare = &HF180 fa_free_code_camp = &HF2C5 fa_frown_o = &HF119 fa_futbol_o = &HF1E3 fa_gamepad = &HF11B fa_gavel = &HF0E3 fa_gbp = &HF154 fa_ge = &HF1D1 fa_gear = &HF013 fa_gears = &HF085 fa_genderless = &HF22D fa_get_pocket = &HF265 fa_gg = &HF260 fa_gg_circle = &HF261 fa_gift = &HF06B fa_git = &HF1D3 fa_git_square = &HF1D2 fa_github = &HF09B fa_github_alt = &HF113 fa_github_square = &HF092 fa_gitlab = &HF296 fa_gittip = &HF184 fa_glass = &HF000 fa_glide = &HF2A5 fa_glide_g = &HF2A6 fa_globe = &HF0AC fa_google = &HF1A0 fa_google_plus = &HF0D5 fa_google_plus_circle = &HF2B3 fa_google_plus_official = &HF2B3 fa_google_plus_square = &HF0D4 fa_google_wallet = &HF1EE fa_graduation_cap = &HF19D fa_gratipay = &HF184 fa_grav = &HF2D6 fa_group = &HF0C0 fa_h_square = &HF0FD fa_hacker_news = &HF1D4 fa_hand_grab_o = &HF255 fa_hand_lizard_o = &HF258 fa_hand_o_down = &HF0A7 fa_hand_o_left = &HF0A5 fa_hand_o_right = &HF0A4 fa_hand_o_up = &HF0A6 fa_hand_paper_o = &HF256 fa_hand_peace_o = &HF25B fa_hand_pointer_o = &HF25A fa_hand_rock_o = &HF255 fa_hand_scissors_o = &HF257 fa_hand_spock_o = &HF259 fa_hand_stop_o = &HF256 fa_handshake_o = &HF2B5 fa_hard_of_hearing = &HF2A4 fa_hashtag = &HF292 fa_hdd_o = &HF0A0 fa_header = &HF1DC fa_headphones = &HF025 fa_heart = &HF004 fa_heart_o = &HF08A fa_heartbeat = &HF21E fa_history = &HF1DA fa_home = &HF015 fa_hospital_o = &HF0F8 fa_hotel = &HF236 fa_hourglass = &HF254 fa_hourglass_1 = &HF251 fa_hourglass_2 = &HF252 fa_hourglass_3 = &HF253 fa_hourglass_end = &HF253 fa_hourglass_half = &HF252 fa_hourglass_o = &HF250 fa_hourglass_start = &HF251 fa_houzz = &HF27C fa_html5 = &HF13B fa_i_cursor = &HF246 fa_id_badge = &HF2C1 fa_id_card = &HF2C2 fa_id_card_o = &HF2C3 fa_ils = &HF20B fa_image = &HF03E fa_imdb = &HF2D8 fa_inbox = &HF01C fa_indent = &HF03C fa_industry = &HF275 fa_info = &HF129 fa_info_circle = &HF05A fa_inr = &HF156 fa_instagram = &HF16D fa_institution = &HF19C fa_internet_explorer = &HF26B fa_intersex = &HF224 fa_ioxhost = &HF208 fa_italic = &HF033 fa_joomla = &HF1AA fa_jpy = &HF157 fa_jsfiddle = &HF1CC fa_key = &HF084 fa_keyboard_o = &HF11C fa_krw = &HF159 fa_language = &HF1AB fa_laptop = &HF109 fa_lastfm = &HF202 fa_lastfm_square = &HF203 fa_leaf = &HF06C fa_leanpub = &HF212 fa_legal = &HF0E3 fa_lemon_o = &HF094 fa_level_down = &HF149 fa_level_up = &HF148 fa_life_bouy = &HF1CD fa_life_buoy = &HF1CD fa_life_ring = &HF1CD fa_life_saver = &HF1CD fa_lightbulb_o = &HF0EB fa_line_chart = &HF201 fa_link = &HF0C1 fa_linkedin = &HF0E1 fa_linkedin_square = &HF08C fa_linode = &HF2B8 fa_linux = &HF17C fa_list = &HF03A fa_list_alt = &HF022 fa_list_ol = &HF0CB fa_list_ul = &HF0CA fa_location_arrow = &HF124 fa_lock = &HF023 fa_long_arrow_down = &HF175 fa_long_arrow_left = &HF177 fa_long_arrow_right = &HF178 fa_long_arrow_up = &HF176 fa_low_vision = &HF2A8 fa_magic = &HF0D0 fa_magnet = &HF076 fa_mail_forward = &HF064 fa_mail_reply = &HF112 fa_mail_reply_all = &HF122 fa_male = &HF183 fa_map = &HF279 fa_map_marker = &HF041 fa_map_o = &HF278 fa_map_pin = &HF276 fa_map_signs = &HF277 fa_mars = &HF222 fa_mars_double = &HF227 fa_mars_stroke = &HF229 fa_mars_stroke_h = &HF22B fa_mars_stroke_v = &HF22A fa_maxcdn = &HF136 fa_meanpath = &HF20C fa_medium = &HF23A fa_medkit = &HF0FA fa_meetup = &HF2E0 fa_meh_o = &HF11A fa_mercury = &HF223 fa_microchip = &HF2DB fa_microphone = &HF130 fa_microphone_slash = &HF131 fa_minus = &HF068 fa_minus_circle = &HF056 fa_minus_square = &HF146 fa_minus_square_o = &HF147 fa_mixcloud = &HF289 fa_mobile = &HF10B fa_mobile_phone = &HF10B fa_modx = &HF285 fa_money = &HF0D6 fa_moon_o = &HF186 fa_mortar_board = &HF19D fa_motorcycle = &HF21C fa_mouse_pointer = &HF245 fa_music = &HF001 fa_navicon = &HF0C9 fa_neuter = &HF22C fa_newspaper_o = &HF1EA fa_object_group = &HF247 fa_object_ungroup = &HF248 fa_odnoklassniki = &HF263 fa_odnoklassniki_square = &HF264 fa_opencart = &HF23D fa_openid = &HF19B fa_opera = &HF26A fa_optin_monster = &HF23C fa_outdent = &HF03B fa_pagelines = &HF18C fa_paint_brush = &HF1FC fa_paper_plane = &HF1D8 fa_paper_plane_o = &HF1D9 fa_paperclip = &HF0C6 fa_paragraph = &HF1DD fa_paste = &HF0EA fa_pause = &HF04C fa_pause_circle = &HF28B fa_pause_circle_o = &HF28C fa_paw = &HF1B0 fa_paypal = &HF1ED fa_pencil = &HF040 fa_pencil_square = &HF14B fa_pencil_square_o = &HF044 fa_percent = &HF295 fa_phone = &HF095 fa_phone_square = &HF098 fa_photo = &HF03E fa_picture_o = &HF03E fa_pie_chart = &HF200 fa_pied_piper = &HF2AE fa_pied_piper_alt = &HF1A8 fa_pied_piper_pp = &HF1A7 fa_pinterest = &HF0D2 fa_pinterest_p = &HF231 fa_pinterest_square = &HF0D3 fa_plane = &HF072 fa_play = &HF04B fa_play_circle = &HF144 fa_play_circle_o = &HF01D fa_plug = &HF1E6 fa_plus = &HF067 fa_plus_circle = &HF055 fa_plus_square = &HF0FE fa_plus_square_o = &HF196 fa_podcast = &HF2CE fa_power_off = &HF011 fa_print = &HF02F fa_product_hunt = &HF288 fa_puzzle_piece = &HF12E fa_qq = &HF1D6 fa_qrcode = &HF029 fa_question = &HF128 fa_question_circle = &HF059 fa_question_circle_o = &HF29C fa_quora = &HF2C4 fa_quote_left = &HF10D fa_quote_right = &HF10E fa_ra = &HF1D0 fa_random = &HF074 fa_ravelry = &HF2D9 fa_rebel = &HF1D0 fa_recycle = &HF1B8 fa_reddit = &HF1A1 fa_reddit_alien = &HF281 fa_reddit_square = &HF1A2 fa_refresh = &HF021 fa_registered = &HF25D fa_remove = &HF00D fa_renren = &HF18B fa_reorder = &HF0C9 fa_repeat = &HF01E fa_reply = &HF112 fa_reply_all = &HF122 fa_resistance = &HF1D0 fa_retweet = &HF079 fa_rmb = &HF157 fa_road = &HF018 fa_rocket = &HF135 fa_rotate_left = &HF0E2 fa_rotate_right = &HF01E fa_rouble = &HF158 fa_rss = &HF09E fa_rss_square = &HF143 fa_rub = &HF158 fa_ruble = &HF158 fa_rupee = &HF156 fa_s15 = &HF2CD fa_safari = &HF267 fa_save = &HF0C7 fa_scissors = &HF0C4 fa_scribd = &HF28A fa_search = &HF002 fa_search_minus = &HF010 fa_search_plus = &HF00E fa_sellsy = &HF213 fa_send = &HF1D8 fa_send_o = &HF1D9 fa_server = &HF233 fa_share = &HF064 fa_share_alt = &HF1E0 fa_share_alt_square = &HF1E1 fa_share_square = &HF14D fa_share_square_o = &HF045 fa_shekel = &HF20B fa_sheqel = &HF20B fa_shield = &HF132 fa_ship = &HF21A fa_shirtsinbulk = &HF214 fa_shopping_bag = &HF290 fa_shopping_basket = &HF291 fa_shopping_cart = &HF07A fa_shower = &HF2CC fa_sign_in = &HF090 fa_sign_language = &HF2A7 fa_sign_out = &HF08B fa_signal = &HF012 fa_signing = &HF2A7 fa_simplybuilt = &HF215 fa_sitemap = &HF0E8 fa_skyatlas = &HF216 fa_skype = &HF17E fa_slack = &HF198 fa_sliders = &HF1DE fa_slideshare = &HF1E7 fa_smile_o = &HF118 fa_snapchat = &HF2AB fa_snapchat_ghost = &HF2AC fa_snapchat_square = &HF2AD fa_snowflake_o = &HF2DC fa_soccer_ball_o = &HF1E3 fa_sort = &HF0DC fa_sort_alpha_asc = &HF15D fa_sort_alpha_desc = &HF15E fa_sort_amount_asc = &HF160 fa_sort_amount_desc = &HF161 fa_sort_asc = &HF0DE fa_sort_desc = &HF0DD fa_sort_down = &HF0DD fa_sort_numeric_asc = &HF162 fa_sort_numeric_desc = &HF163 fa_sort_up = &HF0DE fa_soundcloud = &HF1BE fa_space_shuttle = &HF197 fa_spinner = &HF110 fa_spoon = &HF1B1 fa_spotify = &HF1BC fa_square = &HF0C8 fa_square_o = &HF096 fa_stack_exchange = &HF18D fa_stack_overflow = &HF16C fa_star = &HF005 fa_star_half = &HF089 fa_star_half_empty = &HF123 fa_star_half_full = &HF123 fa_star_half_o = &HF123 fa_star_o = &HF006 fa_steam = &HF1B6 fa_steam_square = &HF1B7 fa_step_backward = &HF048 fa_step_forward = &HF051 fa_stethoscope = &HF0F1 fa_sticky_note = &HF249 fa_sticky_note_o = &HF24A fa_stop = &HF04D fa_stop_circle = &HF28D fa_stop_circle_o = &HF28E fa_street_view = &HF21D fa_strikethrough = &HF0CC fa_stumbleupon = &HF1A4 fa_stumbleupon_circle = &HF1A3 fa_subscript = &HF12C fa_subway = &HF239 fa_suitcase = &HF0F2 fa_sun_o = &HF185 fa_superpowers = &HF2DD fa_superscript = &HF12B fa_support = &HF1CD fa_table = &HF0CE fa_tablet = &HF10A fa_tachometer = &HF0E4 fa_tag = &HF02B fa_tags = &HF02C fa_tasks = &HF0AE fa_taxi = &HF1BA fa_telegram = &HF2C6 fa_television = &HF26C fa_tencent_weibo = &HF1D5 fa_terminal = &HF120 fa_text_height = &HF034 fa_text_width = &HF035 fa_th = &HF00A fa_th_large = &HF009 fa_th_list = &HF00B fa_themeisle = &HF2B2 fa_thermometer = &HF2C7 fa_thermometer_0 = &HF2CB fa_thermometer_1 = &HF2CA fa_thermometer_2 = &HF2C9 fa_thermometer_3 = &HF2C8 fa_thermometer_4 = &HF2C7 fa_thermometer_empty = &HF2CB fa_thermometer_full = &HF2C7 fa_thermometer_half = &HF2C9 fa_thermometer_quarter = &HF2CA fa_thermometer_three_quarters = &HF2C8 fa_thumb_tack = &HF08D fa_thumbs_down = &HF165 fa_thumbs_o_down = &HF088 fa_thumbs_o_up = &HF087 fa_thumbs_up = &HF164 fa_ticket = &HF145 fa_times = &HF00D fa_times_circle = &HF057 fa_times_circle_o = &HF05C fa_times_rectangle = &HF2D3 fa_times_rectangle_o = &HF2D4 fa_tint = &HF043 fa_toggle_down = &HF150 fa_toggle_left = &HF191 fa_toggle_off = &HF204 fa_toggle_on = &HF205 fa_toggle_right = &HF152 fa_toggle_up = &HF151 fa_trademark = &HF25C fa_train = &HF238 fa_transgender = &HF224 fa_transgender_alt = &HF225 fa_trash = &HF1F8 fa_trash_o = &HF014 fa_tree = &HF1BB fa_trello = &HF181 fa_tripadvisor = &HF262 fa_trophy = &HF091 fa_truck = &HF0D1 fa_try = &HF195 fa_tty = &HF1E4 fa_tumblr = &HF173 fa_tumblr_square = &HF174 fa_turkish_lira = &HF195 fa_tv = &HF26C fa_twitch = &HF1E8 fa_twitter = &HF099 fa_twitter_square = &HF081 fa_umbrella = &HF0E9 fa_underline = &HF0CD fa_undo = &HF0E2 fa_universal_access = &HF29A fa_university = &HF19C fa_unlink = &HF127 fa_unlock = &HF09C fa_unlock_alt = &HF13E fa_unsorted = &HF0DC fa_upload = &HF093 fa_usb = &HF287 fa_usd = &HF155 fa_user = &HF007 fa_user_circle = &HF2BD fa_user_circle_o = &HF2BE fa_user_md = &HF0F0 fa_user_o = &HF2C0 fa_user_plus = &HF234 fa_user_secret = &HF21B fa_user_times = &HF235 fa_users = &HF0C0 fa_vcard = &HF2BB fa_vcard_o = &HF2BC fa_venus = &HF221 fa_venus_double = &HF226 fa_venus_mars = &HF228 fa_viacoin = &HF237 fa_viadeo = &HF2A9 fa_viadeo_square = &HF2AA fa_video_camera = &HF03D fa_vimeo = &HF27D fa_vimeo_square = &HF194 fa_vine = &HF1CA fa_vk = &HF189 fa_volume_control_phone = &HF2A0 fa_volume_down = &HF027 fa_volume_off = &HF026 fa_volume_up = &HF028 fa_warning = &HF071 fa_wechat = &HF1D7 fa_weibo = &HF18A fa_weixin = &HF1D7 fa_whatsapp = &HF232 fa_wheelchair = &HF193 fa_wheelchair_alt = &HF29B fa_wifi = &HF1EB fa_wikipedia_w = &HF266 fa_window_close = &HF2D3 fa_window_close_o = &HF2D4 fa_window_maximize = &HF2D0 fa_window_minimize = &HF2D1 fa_window_restore = &HF2D2 fa_windows = &HF17A fa_won = &HF159 fa_wordpress = &HF19A fa_wpbeginner = &HF297 fa_wpexplorer = &HF2DE fa_wpforms = &HF298 fa_wrench = &HF0AD fa_xing = &HF168 fa_xing_square = &HF169 fa_y_combinator = &HF23B fa_y_combinator_square = &HF1D4 fa_yahoo = &HF19E fa_yc = &HF23B fa_yc_square = &HF1D4 fa_yelp = &HF1E9 fa_yen = &HF157 fa_yoast = &HF2B1 fa_youtube = &HF167 fa_youtube_play = &HF16A fa_youtube_square = &HF166 End Enum
{ "content_hash": "ce725e1d377a920b2ee385a341bdaba0", "timestamp": "", "source": "github", "line_count": 5136, "max_line_length": 346, "avg_line_length": 32.28621495327103, "alnum_prop": 0.5920686036834678, "repo_name": "amccool/staxrip", "id": "2bbeb2a8f5c28d8922fda4ecf1836f4c857771b3", "size": "165822", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "General/Misc.vb", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "200283" }, { "name": "Visual Basic", "bytes": "2180457" } ], "symlink_target": "" }
var ioc = require('./ioc'); // ## Components // // * [scenario.js](scenario.js.html) - the class used to define data population or testing scenarios; // * [scenario.ext.client.js](scenario.ext.client.js.html) - scenario extensions to make HTTP calls; // * [client.js](client.js.html) - a promise-based HTTP client around the [request](https://github.com/mikeal/request) library. // * [cli.logger.js](cli.logger.js.html) - a command line logger that listens to scenario events; // * [cli.command.js](cli.command.js.html) - class responsible for parsing the configuration file and command line options; // * [cli.js](cli.js.html) - function that runs API Copilot in the current working directory. // ## Exports // When requiring `api-copilot`, the following things are provided: // // * `Scenario` - the class used to define scenarios (see [scenario.js](scenario.js.html)); // * `cli` - a function that runs API Copilot in the current working directory; // // var copilot = require('api-copilot'); // copilot.cli(process.argv) // * `version` - the semantic version string (e.g. `1.2.3`). module.exports = { Scenario: ioc.create('scenario'), cli: ioc.create('cli'), version: require('../package').version };
{ "content_hash": "8473d3146c690d9e4a4793f9ab986839", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 127, "avg_line_length": 48.84, "alnum_prop": 0.6961506961506961, "repo_name": "AlphaHydrae/api-copilot", "id": "2d0fa66d1d46d487fac86d36ee28fe8f5a4dc9c5", "size": "1667", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "276057" } ], "symlink_target": "" }
#ifndef TIMER_TEST_H #define TIMER_TEST_H /* Setup the high frequency timer interrupt. */ void vSetupTimerTest( unsigned short usFrequencyHz ); #endif /* TIMER_TEST_H */
{ "content_hash": "5ab1304afe2aab5239705d7929873413", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 53, "avg_line_length": 15.75, "alnum_prop": 0.671957671957672, "repo_name": "openthread/ot-rtos", "id": "bdf782c225590dae2890f280d1d5c33611db4196", "size": "1488", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "third_party/freertos/repo/FreeRTOS/Demo/dsPIC_MPLAB/timertest.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "45552" }, { "name": "C++", "bytes": "14485" }, { "name": "CMake", "bytes": "6361" }, { "name": "Shell", "bytes": "17804" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <recipeml version="0.5"> <recipe> <head> <title>Banana and Pomegranate Salad</title> <categories> <cat>Salads</cat></categories> <yield>6</yield></head> <ingredients> <ing> <amt> <qty/> <unit/></amt> <item>Stephen Ceideburg</item></ing> <ing> <amt> <qty>1</qty> <unit>tablespoon</unit></amt> <item>Palm Sugar</item></ing> <ing> <amt> <qty>2</qty> <unit/></amt> <item>Pomegranates</item></ing> <ing> <amt> <qty>3</qty> <unit/></amt> <item>Bananas</item></ing> <ing> <amt> <qty/> <unit/></amt> <item>Juice of 2 limes</item></ing> <ing> <amt> <qty/> <unit/></amt> <item>Lime Dressing</item></ing></ingredients> <directions> <step> This is a side-dish from the north of India. It makes a refreshing and pretty contrast to a highly spiced dish and couldn't be simpler. Try it next time you are having a curry meal, or use it as one of several salads for entertaining. Mix together the juice of 2 limes and a tablespoon of palm sugar (or substitute brown sugar). Taste and adjust for sweet- sour balance if necessary. Cut 2 pomegranates which have been chilling in the fridge into quarters and twist each wedge to help free the seeds. Coax them out and mound them in the centre of a serving dish. Slice 3 bananas and arrange them around the peri- meter of the pomegranate seeds. Sprinkle with the lime dressing and serve. Posted by Stephen Ceideburg From an article by Meryl Constance in The Sydney Morning Herald, 5/11/93. Courtesy Mark Herron. From Gemini's MASSIVE MealMaster collection at www.synapse.com/~gemini </step></directions></recipe></recipeml>
{ "content_hash": "9233f1142d82697c5e73c2f60556ea6a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 84, "avg_line_length": 31.85483870967742, "alnum_prop": 0.5868354430379746, "repo_name": "coogle/coogle-recipes", "id": "3bba265ed881efdcec35e904cae8e18954745a18", "size": "1975", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "extras/recipes/Banana_and_Pomegranate_Salad.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Blade", "bytes": "70365" }, { "name": "CSS", "bytes": "2508" }, { "name": "HTML", "bytes": "1294" }, { "name": "JavaScript", "bytes": "1133" }, { "name": "PHP", "bytes": "130922" }, { "name": "Puppet", "bytes": "23814" }, { "name": "SCSS", "bytes": "1015" }, { "name": "Shell", "bytes": "3538" }, { "name": "Vue", "bytes": "559" } ], "symlink_target": "" }
package org.cdlib.xtf.util; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.util.Timer; import java.util.TimerTask; public class ProcessRunner { /** * Run the external process, applying a timeout if specified, feeding it * input on stdin and gathering the results from stdout. If a non-zero * exit status is returned, we throw an exception containing the output * string from stderr. The input and output are encoded using the * system-default charset. * * @throws IOException If something goes wrong starting the process. * @throws InterruptedException If process exceeds the given timeout. * @throws CommandFailedException If the process exits with non-zero status. */ public static String runAndGrab(String[] argArray, String input, int timeout) throws InterruptedException, CommandFailedException, IOException { Charset charset = Charset.defaultCharset(); ByteBuffer inBuf = charset.encode(input); inBuf.compact(); byte[] inBytes = inBuf.array(); byte[] outBytes = runAndGrab(argArray, inBytes, timeout); CharBuffer outBuf = charset.decode(ByteBuffer.wrap(outBytes)); String output = outBuf.toString(); return output; } /** * Run the external process, applying a timeout if specified, feeding it * input on stdin and gathering the results from stdout. If a non-zero * exit status is returned, we throw an exception containing the output * string from stderr. * * @throws IOException If something goes wrong starting the process. * @throws InterruptedException If process exceeds the given timeout. * @throws CommandFailedException If the process exits with non-zero status. */ public static byte[] runAndGrab(String[] argArray, byte[] inputBytes, int timeout) throws InterruptedException, CommandFailedException, IOException { // Empty arguments would result in very weird rsync behavior for (String arg : argArray) assert arg != null && arg.length() > 0; // Output a trace message showing the rsync command (debug mode only) if (Trace.getOutputLevel() >= Trace.debug) { StringBuilder buf = new StringBuilder(); buf.append("Running command: "); for (String arg : argArray) buf.append(arg + " "); Trace.debug(buf.toString()); } // Get ready to go Process process = null; InputStream stdout = null; OutputGrabber stdoutGrabber = null; InputStream stderr = null; OutputGrabber stderrGrabber = null; OutputStream stdin = null; InputStuffer stdinStuffer = null; Timer timer = null; Interrupter interrupter = null; boolean exception = false; try { // Fire up the process. process = Runtime.getRuntime().exec(argArray); // Stuff input into it (even if that input is nothing). stdin = process.getOutputStream(); stdinStuffer = new InputStuffer(stdin, inputBytes); stdinStuffer.start(); // Grab all the output stdout = process.getInputStream(); stdoutGrabber = new OutputGrabber(stdout); stderr = process.getErrorStream(); stderrGrabber = new OutputGrabber(stderr); stdoutGrabber.start(); stderrGrabber.start(); // Set a timer so we can stop the process if it exceeds the timeout. if (timeout > 0) { interrupter = new Interrupter(Thread.currentThread()); timer = new Timer(); timer.schedule(interrupter, timeout); } // Wait for the process to finish. process.waitFor(); } // try catch (IOException e) { exception = true; throw e; } catch (InterruptedException e) { exception = true; throw e; } finally { if (interrupter != null) { synchronized (interrupter) { timer.cancel(); // avoid further interruptions interrupter.mainThread = null; // make sure it can't get to us Thread.interrupted(); // clear out the interrupted flag. } } if (exception) { if (stdinStuffer != null) stdinStuffer.interrupt(); if (stdoutGrabber != null) stdoutGrabber.interrupt(); if (stderrGrabber != null) stderrGrabber.interrupt(); if (process != null) process.destroy(); if (stdin != null) try { stdin.close(); } catch (IOException e2) { /*ignore*/ } if (stdout != null) try { stdout.close(); } catch (IOException e2) { /*ignore*/ } if (stderr != null) try { stderr.close(); } catch (IOException e2) { /*ignore*/ } } } // finally // Wait for the stuffer and grabbers to finish their work. try { if (stdinStuffer != null) { while (true) { synchronized (stdinStuffer) { if (stdinStuffer.done) break; stdinStuffer.wait(); } } } while (true) { synchronized (stdoutGrabber) { if (stdoutGrabber.done) break; stdoutGrabber.wait(); } } while (true) { synchronized (stderrGrabber) { if (stderrGrabber.done) break; stderrGrabber.wait(); } } } catch (InterruptedException e) { assert false : "should not be interrupted at this stage"; } // Make sure all the streams are closed (to avoid leaking.) if (stdin != null) try { stdin.close(); } catch (IOException e) { /*ignore*/ } if (stdout != null) try { stdout.close(); } catch (IOException e) { /*ignore*/ } if (stderr != null) try { stderr.close(); } catch (IOException e) { /*ignore*/ } // If we got a non-zero exit status, and something came out on stderr, // then throw an exception. // if (process.exitValue() != 0) { String errStr = new String(stderrGrabber.outBytes); throw new CommandFailedException( "External command '" + argArray[0] + "' exited with status " + process.exitValue() + ". Output from stderr:\n" + errStr); } // Return the results from stdout return stdoutGrabber.outBytes; } /** Used to interrupt the main thread if a timeout occurs */ private static class Interrupter extends TimerTask { public Thread mainThread; public Interrupter(Thread mainThread) { this.mainThread = mainThread; } public synchronized void run() { if (mainThread != null) mainThread.interrupt(); } } // class Interrupter /** * Class to stuff input into the process's input stream (an OutputStream to * us). */ private static class InputStuffer extends Thread { private OutputStream outStream; private byte[] bytes; public Throwable error; public boolean done = false; public InputStuffer(OutputStream stream, byte[] bytes) throws UnsupportedEncodingException { this.outStream = stream; this.bytes = bytes; } public void run() { try { // Write all the data. outStream.write(bytes); // Inform the process that this is the end now. outStream.close(); } // try catch (IOException e) { error = e; } finally { synchronized (this) { done = true; notifyAll(); } } } // run() } // class InputStuffer /** * Class to accumulate the output from a process's output stream (which is * an InputStream to us), and turn it into a string. */ private static class OutputGrabber extends Thread { private InputStream inStream; private ByteArrayOutputStream buffer = new ByteArrayOutputStream(100); public byte[] outBytes = new byte[0]; public Throwable error; public boolean done = false; public OutputGrabber(InputStream stream) { this.inStream = stream; } public void run() { // Read data until it's exhausted (we will be interrupted when it's time // to stop.) // try { byte[] tmp = new byte[4096]; while (true) { // Read some stuff. int got = inStream.read(tmp); if (got < 0) break; // Save it up. buffer.write(tmp, 0, got); // If in debug trace mode, write it to stdout. if (Trace.getOutputLevel() >= Trace.debug) { try { Trace.more(Trace.debug, new String(tmp, 0, got)); } catch (Throwable t) { /* ignore charset translation problems */ } } } // Get a byte array that the caller can process. outBytes = buffer.toByteArray(); } // try catch (IOException e) { error = e; } finally { synchronized (this) { done = true; notifyAll(); } } } // run() } // class OutputGrabber /** * Exception thrown if an external command ends with a non-zero exit * status. */ public static class CommandFailedException extends Exception { public CommandFailedException() { super(); } public CommandFailedException(String s) { super(s); } } }
{ "content_hash": "ea17572c3cae9413619c16d781ac7592", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 84, "avg_line_length": 28.659701492537312, "alnum_prop": 0.6018123112175815, "repo_name": "CDLUC3/datashare", "id": "d03d1e61b448513e3caf6ec7f9e525e379691054", "size": "11205", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tomcat/webapps/xtf/WEB-INF/src/org/cdlib/xtf/util/ProcessRunner.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "432033" }, { "name": "Clean", "bytes": "14495" }, { "name": "Java", "bytes": "3222411" }, { "name": "JavaScript", "bytes": "441320" }, { "name": "Perl", "bytes": "22673" }, { "name": "Python", "bytes": "17715" }, { "name": "Shell", "bytes": "117963" }, { "name": "XQuery", "bytes": "4067" }, { "name": "XSLT", "bytes": "15712354" } ], "symlink_target": "" }
FROM node ENV NODE_PATH="/usr/local/lib/node_modules" RUN npm install juice -g ENTRYPOINT [""]
{ "content_hash": "8241bcadb330eda6cde8cfbc98191c8c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 43, "avg_line_length": 14, "alnum_prop": 0.7142857142857143, "repo_name": "prometheus/alertmanager", "id": "19d4be51a91f67aadd4cb4323d17e053c2b0c31e", "size": "98", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "template/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2085" }, { "name": "Dockerfile", "bytes": "1223" }, { "name": "Elm", "bytes": "223427" }, { "name": "Go", "bytes": "1067373" }, { "name": "HTML", "bytes": "11771" }, { "name": "JavaScript", "bytes": "1101" }, { "name": "Makefile", "bytes": "5450" }, { "name": "Procfile", "bytes": "621" }, { "name": "Shell", "bytes": "1648" } ], "symlink_target": "" }
package com.ericsson.eiffel.semantics.events; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Issuer { @SerializedName("name") @Expose private String name; @SerializedName("email") @Expose private String email; @SerializedName("id") @Expose private String id; @SerializedName("group") @Expose private String group; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getGroup() { return group; } public void setGroup(String group) { this.group = group; } }
{ "content_hash": "dfe047a044b844427f0cb3bc65aaa901", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 50, "avg_line_length": 18.574074074074073, "alnum_prop": 0.5702891326021934, "repo_name": "xdurvak/eiffel-remrem-semantics", "id": "8a67f1ffcee89ab4f2dacb5572ccb2a9acf78268", "size": "1687", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/com/ericsson/eiffel/semantics/events/Issuer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "520793" } ], "symlink_target": "" }
package org.apereo.portal.portlet.registry; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * JUnit test class for {@link PortletWindowIdStringUtilsTest} * * @author Gary Roybal * @version $Revision$ */ public class PortletWindowIdStringUtilsTest { @Before public void setUp() throws Exception {} @After public void tearDown() throws Exception {} @Test public void convertToDelegateLayoutNodeIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasNoWindowInstanceId() { // given final String portletWindowIdString = "88_n149_52"; // when final String result = PortletWindowIdStringUtils.convertToDelegateLayoutNodeId(portletWindowIdString); // then assertEquals("dlg-88-n149-52", result); } @Test public void convertToDelegateLayoutNodeIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasWindowInstanceId() { // given final String portletWindowIdString = "88_n149_52.tw"; // when final String result = PortletWindowIdStringUtils.convertToDelegateLayoutNodeId(portletWindowIdString); // then assertEquals("dlg-88-n149-52.tw", result); } @Test public void formatMethodShouldReturnCorrectResultWhenTheWindowInstanceIdIsNotNull() { // given final String portletEntityIdString = "88_n149_52"; final String portletWindowInstanceIdString = "tw"; // when final String result = PortletWindowIdStringUtils.format( portletEntityIdString, portletWindowInstanceIdString); // then assertEquals(portletEntityIdString + "." + portletWindowInstanceIdString, result); } @Test public void formatMethodShouldReturnCorrectResultWhenTheWindowInstanceIdIsNull() { // given final String portletEntityIdString = "88_n149_52"; final String portletWindowInstanceIdString = null; // when final String result = PortletWindowIdStringUtils.format( portletEntityIdString, portletWindowInstanceIdString); // then assertEquals(portletEntityIdString, result); } @Test public void hasCorrectNumberOfPartsMethodShouldReturnTrueWhenPortletWindowIdHasNoWindowInstanceId() { // given final String portletWindowIdString = "90_u110_18"; // when final boolean result = PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowIdString); // then assertTrue(result); } @Test public void hasCorrectNumberOfPartsMethodShouldReturnTrueWhenPortletWindowIdHasWindowInstanceId() { // given final String portletWindowIdString = "90_u110_18.tw"; // when final boolean result = PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowIdString); // then assertTrue(result); } @Test public void hasCorrectNumberOfPartsMethodShouldReturnFalseWhenPortletWindowIdHasTooManyParts() { // given final String portletWindowIdString = "90_u110_18.tw.blah"; // when final boolean result = PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowIdString); // then assertFalse(result); } @Test public void parsePortletEntityIdMethodShouldReturnResultEqualToInputWhenPortletWindowIdHasNoWindowInstanceId() { // given final String portletWindowIdString = "90_n155_18"; // when final String result = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowIdString); // then assertEquals(portletWindowIdString, result); } @Test public void parsePortletEntityIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasWindowInstanceId() { // given final String portletEntityIdString = "90_n155_18"; final String portletWindowIdString = portletEntityIdString + ".tw"; // when final String result = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowIdString); // then assertEquals(portletEntityIdString, result); } @Test public void parsePortletEntityIdMethodShouldReturnResultEqualToInputWhenPortletWindowIdHasNoWindowInstanceIdAndHasDelegateWithWindowInstanceId() { // given final String portletWindowIdString = "90_dlg-5-ctf1-18.tw_18"; // when final String result = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowIdString); // then assertEquals(portletWindowIdString, result); } @Test public void parsePortletEntityIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasWindowInstanceIdAndHasDelegateWithWindowInstanceId() { // given final String portletEntityIdString = "90_dlg-5-ctf1-18.tw_18"; final String portletWindowIdString = portletEntityIdString + ".tw"; // when final String result = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowIdString); // then assertEquals(portletEntityIdString, result); } @Test public void parsePortletWindowInstanceIdMethodShouldReturnNullWhenWhenPortletWindowIdHasNoWindowInstanceId() { // given final String portletWindowIdString = "90_n155_18"; // when final String result = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowIdString); // then assertNull(result); } @Test public void parsePortletWindowInstanceIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasWindowInstanceId() { // given final String portletEntityIdString = "90_n155_18"; final String portletWindowInstanceId = "tw"; final String portletWindowIdString = portletEntityIdString + "." + portletWindowInstanceId; // when final String result = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowIdString); // then assertEquals(portletWindowInstanceId, result); } @Test public void parsePortletWindowInstanceIdMethodShouldReturnNullWhenPortletWindowIdHasNoWindowInstanceIdAndHasDelegateWithWindowInstanceId() { // given final String portletWindowIdString = "90_dlg-5-ctf1-18.tw_18"; // when final String result = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowIdString); // then assertNull(result); } @Test public void parsePortletWindowInstanceIdMethodShouldReturnCorrectResultWhenPortletWindowIdHasWindowInstanceIdAndHasDelegateWithWindowInstanceId() { // given final String portletEntityIdString = "90_dlg-5-ctf1-18.1_18"; final String portletWindowInstanceId = "tw"; final String portletWindowIdString = portletEntityIdString + "." + portletWindowInstanceId; // when final String result = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowIdString); // then assertEquals(portletWindowInstanceId, result); } }
{ "content_hash": "725ff6ec1aa1eaf550ebd4ce839891d5", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 147, "avg_line_length": 35.695238095238096, "alnum_prop": 0.678495197438634, "repo_name": "jhelmer-unicon/uPortal", "id": "5602aed5b8173dc87ea20dbb5f376e9964ce47f8", "size": "8285", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "uportal-war/src/test/java/org/apereo/portal/portlet/registry/PortletWindowIdStringUtilsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "907" }, { "name": "CSS", "bytes": "431431" }, { "name": "Groovy", "bytes": "56703" }, { "name": "HTML", "bytes": "239109" }, { "name": "Java", "bytes": "9916495" }, { "name": "JavaScript", "bytes": "814195" }, { "name": "Perl", "bytes": "1769" }, { "name": "Shell", "bytes": "7292" }, { "name": "XSLT", "bytes": "298649" } ], "symlink_target": "" }
In general, the google-cloud-phishing_protection library uses [Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) credentials to connect to Google Cloud services. When running within [Google Cloud Platform environments](#google-cloud-platform-environments) the credentials will be discovered automatically. When running on other environments, the Service Account credentials can be specified by providing the path to the [JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for the account (or the JSON itself) in [environment variables](#environment-variables). Additionally, Cloud SDK credentials can also be discovered automatically, but this is only recommended during development. ## Quickstart 1. [Create a service account and credentials](#creating-a-service-account). 2. Set the [environment variable](#environment-variables). ```sh export PHISHING_PROTECTION_CREDENTIALS=path/to/keyfile.json ``` 3. Initialize the client. ```ruby require "google/cloud/phishing_protection" client = Google::Cloud::PhishingProtection.phishing_protection_service ``` ## Credential Lookup The google-cloud-phishing_protection library aims to make authentication as simple as possible, and provides several mechanisms to configure your system without requiring **Service Account Credentials** directly in code. **Credentials** are discovered in the following order: 1. Specify credentials in method arguments 2. Specify credentials in configuration 3. Discover credentials path in environment variables 4. Discover credentials JSON in environment variables 5. Discover credentials file in the Cloud SDK's path 6. Discover GCP credentials ### Google Cloud Platform environments When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. Code should be written as if already authenticated. ### Environment Variables The **Credentials JSON** can be placed in environment variables instead of declaring them directly in code. Each service has its own environment variable, allowing for different service accounts to be used for different services. (See the READMEs for the individual service gems for details.) The path to the **Credentials JSON** file can be stored in the environment variable, or the **Credentials JSON** itself can be stored for environments such as Docker containers where writing files is difficult or not encouraged. The environment variables that google-cloud-phishing_protection checks for credentials are configured on the service Credentials class (such as `::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Credentials`): * `PHISHING_PROTECTION_CREDENTIALS` - Path to JSON file, or JSON contents * `PHISHING_PROTECTION_KEYFILE` - Path to JSON file, or JSON contents * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file ```ruby require "google/cloud/phishing_protection" ENV["PHISHING_PROTECTION_CREDENTIALS"] = "path/to/keyfile.json" client = Google::Cloud::PhishingProtection.phishing_protection_service ``` ### Configuration The path to the **Credentials JSON** file can be configured instead of storing it in an environment variable. Either on an individual client initialization: ```ruby require "google/cloud/phishing_protection" client = Google::Cloud::PhishingProtection.phishing_protection_service do |config| config.credentials = "path/to/keyfile.json" end ``` Or globally for all clients: ```ruby require "google/cloud/phishing_protection" Google::Cloud::PhishingProtection.configure do |config| config.credentials = "path/to/keyfile.json" end client = Google::Cloud::PhishingProtection.phishing_protection_service ``` ### Cloud SDK This option allows for an easy way to authenticate during development. If credentials are not provided in code or in environment variables, then Cloud SDK credentials are discovered. To configure your system for this, simply: 1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` 3. Write code as if already authenticated. **NOTE:** This is _not_ recommended for running in production. The Cloud SDK *should* only be used during development. ## Creating a Service Account Google Cloud requires **Service Account Credentials** to connect to the APIs. You will use the **JSON key file** to connect to most services with google-cloud-phishing_protection. If you are not running this client within [Google Cloud Platform environments](#google-cloud-platform-environments), you need a Google Developers service account. 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). 2. Create a new project or click on an existing project. 3. Activate the menu in the upper left and select **APIs & Services**. From here, you will enable the APIs that your application requires. *Note: You may need to enable billing in order to use these services.* 4. Select **Credentials** from the side navigation. Find the "Create credentials" drop down near the top of the page, and select "Service account" to be guided through downloading a new JSON key file. If you want to re-use an existing service account, you can easily generate a new key file. Just select the account you wish to re-use, click the pencil tool on the right side to edit the service account, select the **Keys** tab, and then select **Add Key**. The key file you download will be used by this library to authenticate API requests and should be stored in a secure location.
{ "content_hash": "b2329948262a91f82c266eb8c0f96ccb", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 88, "avg_line_length": 39.308724832214764, "alnum_prop": 0.7857264811336861, "repo_name": "googleapis/google-cloud-ruby", "id": "a74e295430e0afddb6add0228fb6bb2c293ccf6e", "size": "5875", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "google-cloud-phishing_protection/AUTHENTICATION.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "23930" }, { "name": "CSS", "bytes": "1422" }, { "name": "DIGITAL Command Language", "bytes": "2216" }, { "name": "Go", "bytes": "1321" }, { "name": "HTML", "bytes": "66414" }, { "name": "JavaScript", "bytes": "1862" }, { "name": "Ruby", "bytes": "103945852" }, { "name": "Shell", "bytes": "19653" } ], "symlink_target": "" }
'use strict' var vows = require('vows') var assert = require('assert') var inherits = require('inherits') var ltx = require('..') var Element = ltx.Element vows.describe('Element').addBatch({ 'new element': { "doesn't reference original attrs object": function () { var o = { foo: 'bar' } var e = new Element('e', o) assert.notEqual(e.attrs, o) e.attrs.bar = 'foo' assert.equal(o.bar, undefined) o.foobar = 'barfoo' assert.equal(e.attrs.foobar, undefined) }, 'set xmlns attribute if a string is passed as second argument': function () { var ns = 'xmlns:test' var e = new Element('e', ns) assert.equal(e.attrs.xmlns, ns) assert.equal(e.getAttr('xmlns'), ns) } }, 'serialization': { 'serialize an element': function () { var e = new Element('e') assert.equal(e.toString(), '<e/>') }, 'serialize an element with attributes': function () { var e = new Element('e', { a1: 'foo' }) assert.equal(e.toString(), '<e a1="foo"/>') }, 'serialize an element with attributes to entities': function () { var e = new Element('e', { a1: '"well"' }) assert.equal(e.toString(), '<e a1="&quot;well&quot;"/>') }, 'serialize an element with text': function () { var e = new Element('e').t('bar').root() assert.equal(e.toString(), '<e>bar</e>') }, 'serialize an element with text to entities': function () { var e = new Element('e').t('1 < 2').root() assert.equal(e.toString(), '<e>1 &lt; 2</e>') }, 'serialize an element with a number attribute': function () { var e = new Element('e', { a: 23 }) assert.equal(e.toString(), '<e a="23"/>') }, 'serialize an element with number contents': function () { var e = new Element('e') e.c('foo').t(23) e.c('bar').t(0) assert.equal(e.toString(), '<e><foo>23</foo><bar>0</bar></e>') }, 'serialize with undefined attribute': function () { var e = new Element('e', { foo: undefined }) assert.equal(e.toString(), '<e/>') }, 'serialize with null attribute': function () { var e = new Element('e', { foo: null }) assert.equal(e.toString(), '<e/>') }, 'serialize with number attribute': function () { var e = new Element('e', { foo: 23, bar: 0 }) var s = e.toString() assert.ok(s.match(/foo="23"/)) assert.ok(s.match(/bar="0"/)) }, 'serialize with undefined child': function () { var e = new Element('e') e.children = [undefined] assert.equal(e.toString(), '<e></e>') }, 'serialize with null child': function () { var e = new Element('e') e.children = [null] assert.equal(e.toString(), '<e></e>') }, 'serialize with integer text': function () { var e = new Element('e').t(1000) assert.equal(e.getText(), 1000) }, 'serialize to json': function () { var e = new Element('e', { foo: 23, bar: 0, nil: null }).c('f').t(1000).up() assert.deepEqual(e.toJSON(), { name: 'e', attrs: { foo: 23, bar: 0, nil: null }, children: [ { name: 'f', attrs: {}, children: [1000] } ] }) } }, 'remove': { 'by element': function () { var el = new Element('e').c('c').c('x').up().up().c('c2').up().c('c').up() el.remove(el.getChild('c')) assert.equal(el.getChildren('c').length, 1) assert.equal(el.getChildren('c2').length, 1) }, 'by name': function () { var el = new Element('e').c('c').up().c('c2').up().c('c').up() el.remove('c') assert.equal(el.getChildren('c').length, 0) assert.equal(el.getChildren('c2').length, 1) } }, 'getAttr': { 'without ns': function () { var stanza = '<team xmlns:job="http://site.tld/job">' + '<person name="julien" job:title="hacker" /></team>' var doc = ltx.parse(stanza) var el = doc.getChild('person') assert.equal(el.getAttr('name'), 'julien') }, 'with ns': function () { var stanza = '<team xmlns:job="http://site.tld/job">' + '<person name="julien" job:title="hacker" /></team>' var doc = ltx.parse(stanza) var el = doc.getChild('person') assert.equal(el.getAttr('title', 'http://site.tld/job'), 'hacker') } }, // extensively tested in equality-test.js 'equality': { 'name': function () { var a = new Element('foo') var b = new Element('foo') assert.equal(a.nameEquals(a), true) assert.equal(a.nameEquals(b), true) assert.equal(b.nameEquals(a), true) b = new Element('b') assert.equal(a.nameEquals(b), false) assert.equal(b.nameEquals(a), false) }, 'attrs': function () { var a = new Element('foo', {foo: 'bar'}) var b = new Element('foo', {foo: 'bar'}) assert.equal(a.attrsEquals(a), true) assert.equal(a.attrsEquals(b), true) assert.equal(b.attrsEquals(a), true) b = new Element('foo', {bar: 'foo'}) assert.equal(a.attrsEquals(b), false) assert.equal(b.attrsEquals(a), false) }, 'children': function () { var a = new Element('foo').c('foo').root() var b = new Element('foo').c('foo').root() assert.equal(a.childrenEquals(a), true) assert.equal(a.childrenEquals(b), true) assert.equal(b.childrenEquals(a), true) b = new Element('foo').c('bar').root() assert.equal(a.childrenEquals(b), false) assert.equal(b.childrenEquals(a), false) } }, 'clone': { 'clones': function () { var orig = new Element('msg', { type: 'get' }).c('content').t('foo').root() var clone = orig.clone() assert.equal(clone.name, orig.name) assert.equal(clone.attrs.type, orig.attrs.type) assert.equal(clone.attrs.to, orig.attrs.to) assert.equal(clone.children.length, orig.children.length) assert.equal(clone.getChildText('content'), orig.getChildText('content')) assert.equal(orig.getChild('content').up(), orig) assert.equal(clone.getChild('content').up(), clone) }, 'mod attr': function () { var orig = new Element('msg', { type: 'get' }) var clone = orig.clone() clone.attrs.type += '-result' assert.equal(orig.attrs.type, 'get') assert.equal(clone.attrs.type, 'get-result') }, 'rm attr': function () { var orig = new Element('msg', { from: 'me' }) var clone = orig.clone() delete clone.attrs.from clone.attrs.to = 'you' assert.equal(orig.attrs.from, 'me') assert.equal(orig.attrs.to, undefined) assert.equal(clone.attrs.from, undefined) assert.equal(clone.attrs.to, 'you') }, 'mod child': function () { var orig = new Element('msg', { type: 'get' }).c('content').t('foo').root() var clone = orig.clone() clone.getChild('content').t('bar').name = 'description' assert.equal(orig.children[0].name, 'content') assert.equal(orig.getChildText('content'), 'foo') assert.equal(clone.children[0].name, 'description') assert.equal(clone.getChildText('description'), 'foobar') }, 'use original constructor for the clone': function () { var Foo = function (name, attrs) { Element.call(this, name, attrs) } inherits(Foo, Element) var foo = new Foo() assert(foo.clone() instanceof Element) assert(foo.clone() instanceof Foo) } }, 'children': { 'getChildren': function () { var el = new Element('a') .c('b') .c('b2').up().up() .t('foo') .c('c').t('cbar').up() .t('bar') .root() var children = el.children assert.equal(children.length, 4) assert.equal(children[0].name, 'b') assert.equal(children[1], 'foo') assert.equal(children[2].name, 'c') assert.equal(children[3], 'bar') }, 'getChildElements': function () { var el = new Element('a') .c('b') .c('b2').up().up() .t('foo') .c('c').t('cbar').up() .t('bar') .root() var children = el.getChildElements() assert.equal(children.length, 2) assert.equal(children[0].name, 'b') assert.equal(children[1].name, 'c') } }, 'recursive': { 'getChildrenByAttr': function () { var el = new Element('a') .c('b') .c('c', {myProperty: 'x'}).t('bar').up().up().up() .c('d', {id: 'x'}) .c('e', {myProperty: 'x'}).root() var results = el.getChildrenByAttr('myProperty', 'x', null, true) assert.equal(results[0].toString(), '<c myProperty="x">bar</c>') assert.equal(results[1].toString(), '<e myProperty="x"/>') }, 'getChildByAttr': function () { var el = new Element('a') .c('b') .c('c', {id: 'x'}) .t('bar').root() assert.equal(el.getChildByAttr('id', 'x', null, true).toString(), '<c id="x">bar</c>') } }, 'issue #15: Inconsistency with prefixed elements': { topic: function () { return ltx.parse('<root><x:foo>bar</x:foo></root>') }, 'getChildText prefixed': function (el) { assert.equal(el.getChildText('x:foo'), null) }, 'getChildText unprefixed': function (el) { assert.equal(el.getChildText('foo'), 'bar') }, 'getChild prefixed': function (el) { assert.equal(el.getChild('x:foo'), null) }, 'getChild unprefixed': function (el) { assert.equal(el.getChild('foo').getText(), 'bar') } }, 'issue-37: Element instanceof Fails': { 'instanceof': function () { var el = new Element('root').c('children') assert.ok(el instanceof Element) } } }).export(module)
{ "content_hash": "3c447342cbf4db94ed848297e9a478f5", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 92, "avg_line_length": 33.208191126279864, "alnum_prop": 0.5521068859198356, "repo_name": "samuelagm/ltx", "id": "b33db9202cced27748bfa946636f8f664577f255", "size": "9730", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/element-test.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "61326" } ], "symlink_target": "" }
namespace anki { /// @addtogroup collision /// @{ /// The type of the collision temporary allocator template<typename T> using CollisionTempAllocator = StackAllocator<T, false>; /// A temporary vector template<typename T> using CollisionTempVector = Vector<T, CollisionTempAllocator<T>>; /// @} } // end namespace anki #endif
{ "content_hash": "566d22cd1da5fb4bcae3c78ccc81bba7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 17.526315789473685, "alnum_prop": 0.7297297297297297, "repo_name": "svn2github/anki-3d-engine", "id": "bffb9438680984990b9d9dae4c68e2f74d26dadd", "size": "654", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "include/anki/collision/Common.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "123080" }, { "name": "C++", "bytes": "1205463" }, { "name": "Objective-C", "bytes": "12007" }, { "name": "Python", "bytes": "1099" }, { "name": "Shell", "bytes": "1019" } ], "symlink_target": "" }
require 'spec_helper' describe "default datapoint json templates" do before(:each) do @datapoint = PachubeDataFormats::Datapoint.new(datapoint_as_(:hash)) end it "should represent Pachube datapoints (only used by API v2)" do json = @datapoint.generate_json json[:value].should == @datapoint.value json[:at].should == @datapoint.at.iso8601(6) end end
{ "content_hash": "a8a37001b469a7a04b79ab760401d2c9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 72, "avg_line_length": 26.928571428571427, "alnum_prop": 0.7082228116710876, "repo_name": "smulube/pachube_data_formats", "id": "8c6359e23fcea7897d7bca2f69bc7f649eaa7eb6", "size": "377", "binary": false, "copies": "1", "ref": "refs/heads/version_0.3.xx_branch", "path": "spec/pachube_data_formats/templates/json/datapoint_defaults_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "253120" }, { "name": "Shell", "bytes": "476" } ], "symlink_target": "" }
LeaseSpec is a specification of a Lease. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **acquire_time** | **datetime** | acquireTime is a time when the current lease was acquired. | [optional] **holder_identity** | **str** | holderIdentity contains the identity of the holder of a current lease. | [optional] **lease_duration_seconds** | **int** | leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime. | [optional] **lease_transitions** | **int** | leaseTransitions is the number of transitions of a lease between holders. | [optional] **renew_time** | **datetime** | renewTime is a time when the current holder of a lease has last updated the lease. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
{ "content_hash": "6bebabc129cd2e9d03b7c03590e8d45b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 206, "avg_line_length": 76.6923076923077, "alnum_prop": 0.6800401203610833, "repo_name": "kubernetes-client/python", "id": "20f562702f6d5196160e0f5364b588cd21c4d20f", "size": "1012", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kubernetes/docs/V1LeaseSpec.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "356" }, { "name": "Python", "bytes": "11454299" }, { "name": "Shell", "bytes": "43108" } ], "symlink_target": "" }
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" tools:background="@drawable/no_face_poly"> <RelativeLayout android:id="@id/card_content" style="@style/card.peeking.bottom" android:layout_width="match_parent" android:layout_below="@id/fab_pivot" android:layout_height="wrap_content"> <TextView android:id="@id/main_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="3" android:paddingBottom="@dimen/padding_8" android:paddingLeft="@dimen/padding_16" android:paddingRight="@dimen/padding_16" android:paddingTop="@dimen/padding_16" android:textColor="@color/black_87" android:textSize="@dimen/font_22" android:textStyle="bold" tools:text="@string/placeholder_name"/> <TextView android:id="@id/short_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/main_info" android:ellipsize="end" android:maxLength="@integer/twit_length" android:paddingBottom="@dimen/padding_16" android:paddingLeft="@dimen/padding_16" android:paddingRight="@dimen/padding_16" android:textColor="@color/black_54" android:textSize="@dimen/font_14" tools:text="@string/placeholder_short_info"/> <TextView android:id="@id/extra_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@id/short_info" android:ellipsize="end" android:maxLength="@integer/twit_length" android:paddingBottom="@dimen/padding_16" android:paddingLeft="@dimen/padding_16" android:paddingRight="@dimen/padding_16" android:paddingTop="@dimen/padding_16" android:textColor="@color/black_54" android:textSize="@dimen/font_12" tools:text="@string/placeholder_top_stats"/> </RelativeLayout> <FrameLayout android:id="@id/fab_pivot" android:layout_width="match_parent" tools:background="@color/red_100" android:layout_alignParentTop="true" android:layout_height="@dimen/fab_offset_positive"/> <at.markushi.ui.CircleButton android:id="@id/expand" android:layout_width="@dimen/fab" android:layout_height="@dimen/fab" android:layout_below="@id/fab_pivot" android:layout_alignParentRight="true" android:layout_marginBottom="@dimen/fab_offset" android:layout_marginLeft="@dimen/padding_16" android:layout_marginRight="@dimen/padding_16" android:layout_marginTop="@dimen/fab_offset" android:src="@drawable/ic_navigation_accept" app:cb_color="@color/fab_done"/> </RelativeLayout>
{ "content_hash": "c77219484a0c79cf6e0146906b76621f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 62, "avg_line_length": 40.58024691358025, "alnum_prop": 0.61971402494676, "repo_name": "bhm/Cthulhator", "id": "c97728f79b0a1c7f34c6eac2ebc894064f63939f", "size": "3287", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cthulhator/src/main/res/layout/card_title.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1511868" } ], "symlink_target": "" }
"""Unit tests for rbtools.diffs.tools.base.diff_file_result.DiffFileResult. Version Added: 4.0 """ import inspect import io from rbtools.testing import TestCase from rbtools.diffs.tools.base.diff_file_result import DiffFileResult class DiffFileResultTests(TestCase): """Unit tests for DiffFileResult.""" def test_has_differences_with_text_changes(self): """Testing DiffFileResult.has_differences with text diff and changes """ diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO(b'...'), has_text_differences=True) self.assertTrue(diff_result.has_differences) def test_has_differences_with_text_no_changes(self): """Testing DiffFileResult.has_differences with text diff and no changes """ diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO(b''), has_text_differences=False) self.assertFalse(diff_result.has_differences) def test_has_differences_with_binary(self): """Testing DiffFileResult.has_differences with binary diff""" diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO(b''), is_binary=True, has_text_differences=False) self.assertTrue(diff_result.has_differences) def test_orig_file_header(self): """Testing DiffFileResult.orig_file_header""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 18) self.assertEqual(diff_result._line_offset_cache, [(0, 18)]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 18) self.assertEqual(diff_result._line_offset_cache, [(0, 18)]) def test_orig_file_header_with_crlf(self): """Testing DiffFileResult.orig_file_header with CRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified=file', diff=io.BytesIO( b'--- orig-file\txxx\r\n' b'+++ modified-file\txxx\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\r\n') self.assertEqual(diff_result.diff.tell(), 19) self.assertEqual(diff_result._line_offset_cache, [(0, 19)]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\r\n') self.assertEqual(diff_result.diff.tell(), 19) self.assertEqual(diff_result._line_offset_cache, [(0, 19)]) def test_orig_file_header_with_crcrlf(self): """Testing DiffFileResult.orig_file_header with CRCRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\r\n' b'+++ modified-file\txxx\r\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\r\n' b'+ bar\r\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\r\r\n') self.assertEqual(diff_result.diff.tell(), 20) self.assertEqual(diff_result._line_offset_cache, [(0, 20)]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\r\r\n') self.assertEqual(diff_result.diff.tell(), 20) self.assertEqual(diff_result._line_offset_cache, [(0, 20)]) def test_orig_file_header_with_no_text_diff(self): """Testing DiffFileResult.orig_file_header with no text differences""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', has_text_differences=False, is_binary=True, diff=io.BytesIO( b'Binary files orig-file and modified-file differ\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.orig_file_header, b'') self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result._line_offset_cache, []) def test_orig_file_header_with_no_header(self): """Testing DiffFileResult.orig_file_header with no '---' header""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', has_text_differences=True, diff=io.BytesIO( b'Something else\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.orig_file_header, b'') self.assertEqual(diff_result.diff.tell(), 15) self.assertEqual(diff_result._line_offset_cache, [(0, 15)]) def test_orig_file_header_with_out_of_bounds(self): """Testing DiffFileResult.orig_file_header with out-of-bounds line""" diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO()) self.assertEqual(diff_result.orig_file_header, b'') self.assertEqual(diff_result.diff.tell(), 0) def test_parsed_orig_file_header_with_tab(self): """Testing DiffFileResult.parsed_orig_file_header with tab separator""" diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file\txxx yyy zzz\n' b'+++ modified file\txxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_orig_file_header, { 'extra': b'xxx yyy zzz', 'marker': b'---', 'path': b'orig file', }) self.assertEqual(diff_result.diff.tell(), 26) self.assertEqual(diff_result._line_offset_cache, [(0, 26)]) def test_parsed_orig_file_header_with_spaces(self): """Testing DiffFileResult.parsed_orig_file_header with two-space separator """ diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file xxx yyy zzz\n' b'+++ modified file xxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_orig_file_header, { 'extra': b'xxx yyy zzz', 'marker': b'---', 'path': b'orig file', }) self.assertEqual(diff_result.diff.tell(), 27) self.assertEqual(diff_result._line_offset_cache, [(0, 27)]) def test_parsed_orig_file_header_with_no_separator(self): """Testing DiffFileResult.parsed_orig_file_header with no distinguishable separator """ diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file xxx yyy zzz\n' b'+++ modified file xxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_orig_file_header, { 'extra': b'', 'marker': b'---', 'path': b'orig file xxx yyy zzz', }) self.assertEqual(diff_result.diff.tell(), 26) self.assertEqual(diff_result._line_offset_cache, [(0, 26)]) def test_modified_file_header(self): """Testing DiffFileResult.modified_file_header""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), ]) def test_modified_file_header_with_crlf(self): """Testing DiffFileResult.modified_file_header with CRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\n' b'+++ modified-file\txxx\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\r\n') self.assertEqual(diff_result.diff.tell(), 42) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\r\n') self.assertEqual(diff_result.diff.tell(), 42) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), ]) def test_modified_file_header_with_crcrlf(self): """Testing DiffFileResult.modified_file_header with CRCRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\r\n' b'+++ modified-file\txxx\r\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\r\n' b'+ bar\r\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\r\r\n') self.assertEqual(diff_result.diff.tell(), 44) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\r\r\n') self.assertEqual(diff_result.diff.tell(), 44) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), ]) def test_modified_file_header_with_no_text_diff(self): """Testing DiffFileResult.modified_file_header with no text differences """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', has_text_differences=False, is_binary=True, diff=io.BytesIO( b'Binary files orig-file and modified-file differ\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.modified_file_header, b'') self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result._line_offset_cache, []) def test_modified_file_header_with_no_header(self): """Testing DiffFileResult.modified_file_header with no '+++' header""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', has_text_differences=True, diff=io.BytesIO( b'--- file1\txxx\n' b'Something else\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual(diff_result.modified_file_header, b'') self.assertEqual(diff_result.diff.tell(), 29) self.assertEqual(diff_result._line_offset_cache, [ (0, 14), (14, 15), ]) def test_modified_file_header_with_out_of_bounds(self): """Testing DiffFileResult.modified_file_header with out-of-bounds line """ diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO()) self.assertEqual(diff_result.modified_file_header, b'') self.assertEqual(diff_result.diff.tell(), 0) def test_modified_file_header_after_orig_header(self): """Testing DiffFileResult.modified_file_header after orig_file_header """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) # Start by fetching the first header. self.assertEqual(diff_result.orig_file_header, b'--- orig-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 18) self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), ]) def test_parsed_modified_file_header_with_tab(self): """Testing DiffFileResult.parsed_modified_file_header with tab separator """ diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file\txxx yyy zzz\n' b'+++ modified file\txxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_modified_file_header, { 'extra': b'xxx yyy zzz', 'marker': b'+++', 'path': b'modified file', }) self.assertEqual(diff_result.diff.tell(), 56) self.assertEqual(diff_result._line_offset_cache, [ (0, 26), (26, 30), ]) def test_parsed_modified_file_header_with_spaces(self): """Testing DiffFileResult.parsed_modified_file_header with two-space separator """ diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file xxx yyy zzz\n' b'+++ modified file xxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_modified_file_header, { 'extra': b'xxx yyy zzz', 'marker': b'+++', 'path': b'modified file', }) self.assertEqual(diff_result.diff.tell(), 58) self.assertEqual(diff_result._line_offset_cache, [ (0, 27), (27, 31), ]) def test_parsed_modified_file_header_with_no_separator(self): """Testing DiffFileResult.parsed_modified_file_header with no distinguishable separator """ diff_result = DiffFileResult( orig_path='orig file', modified_path='modified file', diff=io.BytesIO( b'--- orig file xxx yyy zzz\n' b'+++ modified file xxx yyy zzz\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.parsed_modified_file_header, { 'extra': b'', 'marker': b'+++', 'path': b'modified file xxx yyy zzz', }) self.assertEqual(diff_result.diff.tell(), 56) self.assertEqual(diff_result._line_offset_cache, [ (0, 26), (26, 30), ]) def test_hunks(self): """Testing DiffFileResult.hunks""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n') self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n') self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) def test_hunks_with_crlf(self): """Testing DiffFileResult.hunks with CRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\n' b'+++ modified-file\txxx\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n') self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n') self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) def test_hunks_with_crcrlf(self): """Testing DiffFileResult.hunks with CRCRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\r\n' b'+++ modified-file\txxx\r\r\n' b'@@ -1 +1 @@\r\r\n' b'- foo\r\r\n' b'+ bar\r\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\r\r\n' b'- foo\r\r\n' b'+ bar\r\r\n') self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\r\r\n' b'- foo\r\r\n' b'+ bar\r\r\n') self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) def test_hunks_with_no_text_diff(self): """Testing DiffFileResult.hunks with no text diff""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', has_text_differences=False, is_binary=True, diff=io.BytesIO( b'Binary files orig-file and modified-file differ\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( diff_result.hunks, b'Binary files orig-file and modified-file differ\n') self.assertEqual(diff_result.diff.tell(), 48) self.assertEqual(diff_result._line_offset_cache, []) def test_hunks_with_out_of_bounds(self): """Testing DiffFileResult.hunks with out-of-bounds line """ diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO()) self.assertEqual(diff_result.hunks, b'') self.assertEqual(diff_result.diff.tell(), 0) def test_hunks_after_orig_header(self): """Testing DiffFileResult.hunks after orig_file_header """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) # Start by fetching the first header. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n') self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( diff_result.hunks, b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n') self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) def test_iter_hunk_lines(self): """Testing DiffFileResult.iter_hunk_lines""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) lines = diff_result.iter_hunk_lines() self.assertTrue(inspect.isgenerator(lines)) self.assertEqual( list(lines), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) def test_iter_hunk_lines_with_keep_newlines(self): """Testing DiffFileResult.iter_hunk_lines with keep_newlines=True""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) self.assertEqual(diff_result.diff.tell(), 0) lines = diff_result.iter_hunk_lines(keep_newlines=True) self.assertTrue(inspect.isgenerator(lines)) self.assertEqual( list(lines), [ b'@@ -1 +1 @@\n', b'- foo\n', b'+ bar\n', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines(keep_newlines=True)), [ b'@@ -1 +1 @@\n', b'- foo\n', b'+ bar\n', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) def test_iter_hunk_lines_with_crlf(self): """Testing DiffFileResult.iter_hunk_lines with CRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\n' b'+++ modified-file\txxx\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) def test_iter_hunk_lines_with_crlf_and_keep_newlines(self): """Testing DiffFileResult.iter_hunk_lines with CRLF and keep_newlines=True """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\n' b'+++ modified-file\txxx\r\n' b'@@ -1 +1 @@\r\n' b'- foo\r\n' b'+ bar\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( list(diff_result.iter_hunk_lines(keep_newlines=True)), [ b'@@ -1 +1 @@\r\n', b'- foo\r\n', b'+ bar\r\n', ]) self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines(keep_newlines=True)), [ b'@@ -1 +1 @@\r\n', b'- foo\r\n', b'+ bar\r\n', ]) self.assertEqual(diff_result.diff.tell(), 69) self.assertEqual(diff_result._line_offset_cache, [ (0, 19), (19, 23), (42, 13), ]) def test_iter_hunk_lines_with_crcrlf(self): """Testing DiffFileResult.iter_hunk_lines with CRCRLF""" diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\r\n' b'+++ modified-file\txxx\r\r\n' b'@@ -1 +1 @@\r\r\n' b'- foo\r\r\n' b'+ bar\r\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) def test_iter_hunk_lines_with_crcrlf_and_keep_newlines(self): """Testing DiffFileResult.iter_hunk_lines with CRCRLF and keep_newlines=True """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\r\r\n' b'+++ modified-file\txxx\r\r\n' b'@@ -1 +1 @@\r\r\n' b'- foo\r\r\n' b'+ bar\r\r\n' )) self.assertEqual(diff_result.diff.tell(), 0) self.assertEqual( list(diff_result.iter_hunk_lines(keep_newlines=True)), [ b'@@ -1 +1 @@\r\n', b'- foo\r\n', b'+ bar\r\n', ]) self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines(keep_newlines=True)), [ b'@@ -1 +1 @@\r\n', b'- foo\r\n', b'+ bar\r\n', ]) self.assertEqual(diff_result.diff.tell(), 74) self.assertEqual(diff_result._line_offset_cache, [ (0, 20), (20, 24), (44, 14), ]) def test_iter_hunk_lines_with_out_of_bounds(self): """Testing DiffFileResult.iter_hunk_lines with out-of-bounds line """ diff_result = DiffFileResult(orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO()) self.assertEqual(list(diff_result.iter_hunk_lines()), []) self.assertEqual(diff_result.diff.tell(), 0) def test_iter_hunk_lines_after_orig_header(self): """Testing DiffFileResult.iter_hunk_lines after orig_file_header """ diff_result = DiffFileResult( orig_path='orig-file', modified_path='modified-file', diff=io.BytesIO( b'--- orig-file\txxx\n' b'+++ modified-file\txxx\n' b'@@ -1 +1 @@\n' b'- foo\n' b'+ bar\n' )) # Start by fetching the first header. self.assertEqual(diff_result.modified_file_header, b'+++ modified-file\txxx\n') self.assertEqual(diff_result.diff.tell(), 40) self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ]) # Since we're seeking, reading, and caching, check again. self.assertEqual( list(diff_result.iter_hunk_lines()), [ b'@@ -1 +1 @@', b'- foo', b'+ bar', ]) self.assertEqual(diff_result.diff.tell(), 64) self.assertEqual(diff_result._line_offset_cache, [ (0, 18), (18, 22), (40, 12), ])
{ "content_hash": "cbb831a7f082b8f1c5d2bc62a960ef5f", "timestamp": "", "source": "github", "line_count": 1052, "max_line_length": 79, "avg_line_length": 33.39923954372624, "alnum_prop": 0.484375, "repo_name": "reviewboard/rbtools", "id": "67dce89edbc82bb5d40ed019fdb0c56c37a9feb1", "size": "35136", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rbtools/diffs/tests/test_diff_file_result.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "11069" }, { "name": "HTML", "bytes": "1000" }, { "name": "Python", "bytes": "2298293" }, { "name": "Shell", "bytes": "5491" } ], "symlink_target": "" }
<?php if (!defined('IDIR')) { die; } /** * jForum API module * * @package ImpEx.jForum * */ class jForum_000 extends ImpExModule { /** * Class version * * This is the version of the source system that is supported * * @var string */ var $_version = '2.1.5'; var $_tier = '2'; /** * Module string * * @var array */ var $_modulestring = 'JForum'; var $_homepage = 'http://www.jforum.net'; /** * Valid Database Tables * * @var array */ var $_valid_tables = array ('attach', 'attach_desc', 'attach_quota', 'banlist', 'banner', 'bookmarks', 'categories', 'config', 'extension_groups', 'extensions', 'forums', 'groups', 'karma', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'quota_limit', 'ranks', 'role_values', 'roles', 'search_results', 'search_topics', 'search_wordmatch', 'search_words', 'sessions', 'smilies', 'themes', 'topics', 'topics_watch', 'user_groups', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words' ); function jForum_000() { } /** * Parses and custom HTML for jForum * * @param string mixed The text to be parse * * @return array */ function jForum_html($text) { return $text; } /** * Returns the user_id => username array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_members_list(&$Db_object, &$databasetype, &$tableprefix, &$start, &$per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $user_list = $Db_object->query("SELECT user_id, username FROM " . $tableprefix . "users ORDER BY user_id LIMIT " . $start . "," . $per_page); while ($user = $Db_object->fetch_array($user_list)) { $return_array["$user[user_id]"] = $user['username']; } return $return_array; } else { return false; } } /** * Returns the attachment_id => attachment array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_attachment_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $sql = " SELECT attach.attach_id, attach.post_id, attach.privmsgs_id, attach.user_id, attach_desc.attach_id, attach_desc.physical_filename, attach_desc.real_filename, attach_desc.download_count, attach_desc.description, attach_desc.filesize, attach_desc.upload_time FROM " . $tableprefix . "attach AS attach LEFT JOIN " .$tableprefix . "attach_desc AS attach_desc ON (attach.attach_id = attach_desc.attach_id) WHERE attach.privmsgs_id = 0 ORDER BY attach.attach_id LIMIT " . $start_at . "," . $per_page; $details_list = $Db_object->query($sql); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[attach_id]"] = $detail; } } else { return false; } return $return_array; } /** * Returns the forum_id => forum array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_forum_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $details_list = $Db_object->query("SELECT * FROM " . $tableprefix . "forums ORDER BY forum_id LIMIT " . $start_at . "," . $per_page); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[forum_id]"] = $detail; } } else { return false; } return $return_array; } function get_jForum_cat_details(&$Db_object, &$databasetype, &$tableprefix) { $return_array = array(); if ($databasetype == 'mysql') { $details_list = $Db_object->query("SELECT * FROM " . $tableprefix . "categories ORDER BY categories_id"); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[categories_id]"] = $detail; } } else { return false; } return $return_array; } /** * Returns the pm_id => pm array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_pm_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $sql = " SELECT privmsgs.privmsgs_id, privmsgs.privmsgs_type, privmsgs.privmsgs_subject, privmsgs.privmsgs_from_userid, privmsgs.privmsgs_to_userid, privmsgs.privmsgs_date, privmsgs.privmsgs_ip, privmsgs.privmsgs_enable_bbcode, privmsgs.privmsgs_enable_html, privmsgs.privmsgs_enable_smilies, privmsgs.privmsgs_attach_sig, privmsgs_text.privmsgs_id, privmsgs_text.privmsgs_text FROM " . $tableprefix . "privmsgs AS privmsgs LEFT JOIN " .$tableprefix . "privmsgs_text AS privmsgs_text ON(privmsgs.privmsgs_id = privmsgs_text.privmsgs_id) ORDER BY privmsgs.privmsgs_id LIMIT " . $start_at . "," . $per_page; $details_list = $Db_object->query($sql); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[privmsgs_id]"] = $detail; } } else { return false; } return $return_array; } /** * Returns the post_id => post array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_post_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $sql = " SELECT posts.post_id, posts.topic_id, posts.forum_id, posts.user_id, posts.post_time, posts.poster_ip, posts.enable_bbcode, posts.enable_html, posts.enable_smilies, posts.enable_sig, posts_text.post_id, posts_text.post_text, posts_text.post_subject FROM " . $tableprefix . "posts AS posts LEFT JOIN " . $tableprefix . "posts_text AS posts_text ON (posts.post_id = posts_text.post_id) ORDER BY posts.post_id LIMIT " . $start_at . "," . $per_page; $details_list = $Db_object->query($sql); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[post_id]"] = $detail; } } else { return false; } return $return_array; } /** * Returns the thread_id => thread array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_thread_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $details_list = $Db_object->query("SELECT * FROM " . $tableprefix . "topics ORDER BY topic_id LIMIT " . $start_at . "," . $per_page); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[topic_id]"] = $detail; } } else { return false; } return $return_array; } /** * Returns the user_id => user array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_user_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $details_list = $Db_object->query("SELECT * FROM " . $tableprefix . "users ORDER BY user_id LIMIT " . $start_at . "," . $per_page); while ($detail = $Db_object->fetch_array($details_list)) { $groups = array(); $jgroups = $Db_object->query("SELECT group_id FROM " . $tableprefix . "user_groups WHERE user_id=" . $detail['user_id'] . " ORDER BY group_id ASC"); while ($group = $Db_object->fetch_array($jgroups)) { $groups[] = $group['group_id']; } $return_array["$detail[user_id]"] = $detail; $return_array["$detail[user_id]"]['usergroups'] = $groups; } } else { return false; } return $return_array; } /** * Returns the usergroup_id => usergroup array * * @param object databaseobject The database object to run the query against * @param string mixed Table database type * @param string mixed The prefix to the table name i.e. 'vb3_' * @param int mixed Start point * @param int mixed End point * * @return array */ function get_jForum_usergroup_details(&$Db_object, &$databasetype, &$tableprefix, $start_at, $per_page) { $return_array = array(); // Check that there is not a empty value if(empty($per_page)) { return $return_array; } if ($databasetype == 'mysql') { $details_list = $Db_object->query("SELECT * FROM " . $tableprefix . "groups ORDER BY group_id LIMIT " . $start_at . "," . $per_page); while ($detail = $Db_object->fetch_array($details_list)) { $return_array["$detail[group_id]"] = $detail; } } else { return false; } return $return_array; } } // Class end # Autogenerated on : February 15, 2006, 6:20 pm # By ImpEx-generator 2.1. /*======================================================================*/ ?>
{ "content_hash": "fda10614bec2b5cfec1ad8b8035ef236", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 182, "avg_line_length": 27.090225563909776, "alnum_prop": 0.6380793782958646, "repo_name": "internetbrands/vbimpex", "id": "28e1d71540eda1db2ad25c0b956e4ab887455a3f", "size": "11386", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "systems/jForum/000.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "11340726" } ], "symlink_target": "" }
using System; using Com.Ericmas001.Windows.Enums; namespace Com.Ericmas001.Windows.Attributes { public class TextLengthAttribute : Attribute { public TextLengthEnum Length { get; private set; } public TextLengthAttribute(TextLengthEnum length) { Length = length; } } }
{ "content_hash": "adfca03adfd022310ee6528afd1b8af1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 58, "avg_line_length": 21.866666666666667, "alnum_prop": 0.6554878048780488, "repo_name": "Com-Ericmas001/Windows", "id": "3631bbfa9740f9f999df60476a2297c8fa047c31", "size": "330", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Com.Ericmas001.Windows/Attributes/TextLengthAttribute.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1091" }, { "name": "C#", "bytes": "251791" }, { "name": "HLSL", "bytes": "2097" }, { "name": "XSLT", "bytes": "13541" } ], "symlink_target": "" }
.headerbox { /* Kmail header box with to and from address in it. */ color: #D6E589 background-color: #2F331E } .Bu { /* Gmail: Email view */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .G3.G2 { /* Gmail: Email view */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #777F4C !important; } .ajz { /* Gmail: Email view */ opacity: 0.2; } .im { /* Gmail: Email quoted area view */ color: #777F4C !important; } .il { /* Gmail: Search highlighted text */ color: #000000 !important; background-color: #BECC7A !important; } .hP { /* Gmail: Title */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .gD { /* Gmail: Adressee */ color: #777F4C !important; } .g2 { /* Gmail: Extra Adressees */ color: #777F4C !important; } .go { /* Gmail: Extra Adressees */ color: #005050 !important; } .hb { /* Gmail: labels */ color: #005050 !important; } .ams { /* Gmail: reply field text (eg Reply, Reply to all, or Forward) */ color: #777F4C !important; } .amn { /* Gmail: reply field text Click here to */ color: #005050 !important; } .J-Ke.n0 { /* Gmail: Folders */ color: #EEFF99 !important; } .J-J5-Ji { /* Gmail: Generic background for buttons and stuff */ opacity: 0.5 !important; } .aC3 { /* Gmail: Uknown big block of white */ background-image: none !important; background-color: #17190F !important; color: #000000 !important; } .azX { /* Gmail: Uknown big block of white */ background-image: none !important; background-color: #17190F !important; color: #000000 !important; } .T-I.J-J5-Ji.T-I-Js-IF.aaq.T-I-ax7.L3 { /* Gmail: Reply button */ opacity: 1 !important; background-image: none !important; background-color: #777F4C !important; color: #000000 !important; border-color: #EEFF99 !important; } .T-I.J-J5-Ji.T-I-Js-Gs.aap.T-I-awG.T-I-ax7.L3 { /* Gmail: Reply button - options */ opacity: 1 !important; background-image: none !important; background-color: #777F4C !important; color: #000000 !important; border-color: #EEFF99 !important; } .T-I.J-J5-Ji.T-I-KE.L3.T-I-JO { /* Gmail: Compose button */ opacity: 1 !important; background-image: none !important; background-color: #777F4C !important; color: #000000 !important; border-color: #EEFF99 !important; } .T-I.J-J5-Ji.T-I-KE.L3.T-I-JO { /* Gmail: Compose button */ background-image: none !important; background-color: #777F4C !important; color: #000000 !important; border-color: #777F4C !important; } .au { /* Gmail: Label/folder */ background-image: none !important; background-color: #777F4C !important; color: #000000 !important; border-color: #777F4C !important; } .av { /* Gmail: Label/folder */ color: #000000 !important; } .akh.J-J5-Ji.J-JN-I.J-JN-I-JO { /* Gmail: "Mail" title */ background-image: none !important; background-color: transparent !important; color: #EEFF99 !important; } .nr { /* Gmail: Text entry. Eg subject */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .Am.aO9.Al.editable.LW-avf { /* Gmail: Composer. Message body. */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .Am.Al.editable.LW-avf { /* Gmail: Inline composer. Message body. */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .wG.J-Z-I.J-J5-Ji.T-I-ax7 { /* Gmail: Toolbar button */ opacity: 1 !important; background-color: #777F4C !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .wG.J-Z-I { /* Gmail: Toolbar button */ background-color: #777F4C !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .aDb.J-Z-I.J-J5-Ji.T-I-ax7 { /* Gmail: Toolbar button. Specifically the + */ background-color: #777F4C !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .gbqfb { /* Gmail: Search button. */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } /* .nH.fY */ .nH.fY { /* Gmail: Tab bar container */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .nH { /* Gmail: Tab bar container */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .f1 { /* Gmail: Available tab */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .fZ { /* Gmail: Current tab */ /* TODO * debug .v.fZ.f0 * debug foreground */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .nH.r4 { /* Gmail: Settings container */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .f2 { /* Gmail: Settings area */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .dt { /* Gmail: Settings area */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .qL { /* Gmail: Settings text area */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .cf { /* Gmail: Toolbar Area */ background-image: none !important; background-color: transparent !important; color: #EEFF99 !important; } .J-Z { /* Gmail: Toolbar */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .e4 { /* Gmail: Toolbar selected item*/ background-color: #EEFF99 !important; color: #EEFF99 !important; } .fN { /* Gmail: Composer area */ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .Ar.Au { /* Gmail: Composer area surround */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .nH { /* Gmail: Inbox container */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .yW { /* Gmail: Inbox from field */ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .pG { /* Gmail: Inbox important field container*/ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .WA.xY { /* Gmail: Inbox important field container*/ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .pH-A7 { /* Gmail: Inbox important field*/ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .pH { /* Gmail: Inbox important field*/ background-color: #000000 !important; color: #EEFF99 !important; } .UW { /* Gmail: Inbox important field stray*/ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } .T-Jo-auh { /* Gmail: Inbox checked field */ background-color: #777F4C !important; color: #EEFF99 !important; } .zA.zE { /* Gmail: Inbox item - unread */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #777F4C !important; } .zA.y0 { /* Gmail: Inbox item - read */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #777F4C !important; } .DVI7hd { /* Gmail: Inbox unread container */ background-image: none !important; background-color: #777F4C !important; color: green !important; } .yP { /* Gmail: Inbox item sender */ background-image: none !important; background-color: black !important; color: #777F4C !important; } .y6 { /* Gmail: Inbox item subject */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .y2 { /* Gmail: Inbox item text preview */ background-image: none !important; background-color: black !important; color: #777F4C !important; } .xY { /* Gmail: Inbox item */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #17190F !important; } .ajn { /* Gmail: Avatar */ /* This is to reduce the glare of unwanted colours. */ opacity: 0.3 !important; } .mqDisabled { /* Gmail: A misc background */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } .T-I.J-J5-Ji.L3.T-I-JW.T-I-ax7.T-I-JO { /* Gmail: Text entry. Eg subject */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .gbqfqw { /* Gmail: Search box */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .ata-asE{ /* Gmail: Notification - new email */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; border-style:solid !important; border-width:1px !important; border-color:#EEFF99 !important; } .gbqfif { /* Gmail: Search box contents */ color: #EEFF99 !important; } .gbes { /* Google top toolbar */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } .gbes { /* Google top toolbar */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } #gbx1 { /* Google search bar container? */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; } #gbgs3 { /* Google share button (g+) */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .ab_button { /* Google button. At least used for settings */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .gbzt { /* Google top toolbar - inactive item */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } .gbgt.gbes { /* Google top toolbar - share (outside) */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } .gbgs3 { /* Google top toolbar - share (inside) */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } .gbg1t { /* Google top toolbar - notifications */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } .gbgt.gbg4p.gbes { /* Google top toolbar - avatar */ background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } #gbqlt { /* Gmail: Company logo */ background-color: none !important; color: #EEFF99 !important; } #gbqlt.tbody.tr { background-color: none !important; } #Email { /* Gmail: Text entry. Eg subject */ background-color: black !important; color: #EEFF99 !important; } #Password { /* Gmail: Text entry. Eg subject */ background-color: black !important; color: #EEFF99 !important; } /* Site: Youtube.com */ .yt-uix-subscription-button.yt-can-buffer.yt-uix-button.yt-uix-button-subscribe-unbranded.yt-uix-button-size-default.yt-uix-button-has-icon { /* youtube: button wrapper */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .yt-uix-subscription-button.yt-can-buffer.yt-uix-button.yt-uix-button-size-default.yt-uix-button-has-icon.yt-is-buffered.yt-uix-button-subscribed-branded.hover-enabled { /* youtube: subscribe button wrapper on the video page */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .yt-uix-subscription-preferences-button.yt-uix-button.yt-uix-button-default.yt-uix-button-size-default.yt-uix-button-has-icon.yt-uix-button-empty { /* youtube: subscribe button gear wrapper on the video page */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .subscribe-label { /* youtube; subscribe button */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .subscribed-label { /* youtube; subscribed button */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .unsubscribe-label { /* youtube; unsubscribe button */ background-image: none !important; background-color: #777F4C !important; color: #EEFF99 !important; } .SQb.MJa { /* youtube: like button */ background-color: #777F4C !important; border-color: #EEFF99 !important; } .RQb.LJa { /* youtube: dislike button */ background-color: #777F4C !important; border-color: #EEFF99 !important; } .Ub.TD { /* youtube: reply comment label */ color: #000000 !important; background-color: #BECC7A !important; border-color: #000000 !important; } /* Site: Google calendar */ .cF { /* Gmail: Email view */ background-image: none !important; background-color: #17190F !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } /* Site: Google forms */ .ss-form-container { /* Google forms: container */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .ss-top-of-page { /* Google forms: form _____??? */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .ss-container { /* Google forms: reciept container */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } .ss-resp-card { /* Google forms: */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .Ya-sc-Mb.ZxHcNb { /* Google hangouts: bottom area */ background-color: none !important; } /* Wikipedia */ .selected { /* Wikipedia: tab */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; } /* TODO There must be a better way than overriding individual IDs on wikipedia! */ #ca-talk { /* Wikipedia: talk tab */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #ca-edit { /* Wikipedia: talk tab */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #ca-history { /* Wikipedia: talk tab */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .markdown-body { /* Github: Markdown background */ background-color: black !important; color: #EEFF99 !important; } .normal-comment-header { background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .clearfix.announce.instapaper_body.md { /* Github: markdown Area */ background-color: #EEFF99 !important; color: black !important; } .name { /* Github: name of an area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .icon { /* Github: content area. Generic? */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .age { /* Github: content area. Generic? */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .message { /* Github: content area. Generic? */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .box-body { /* Guthub: repo list */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .commit-link { /* Github: Highlighted commit link */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .css-truncate.css-truncate-target.branch-link { background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; } .header.header-logged-in.true { background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .container.clearfix { background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .js-selected-navigation-item { /* Github: menubar item */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .modal-backdrop { /* Github: Background shading for when something is in focus */ opacity: 0.7 !important; } .select-menu-header { /* Github: Menu header */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .minibutton.select-menu-button.with-gravatar.js-menu-target { /* Github: Company selector */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .repo-list-item.css-truncate { /* Github: repo list item */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .final-path { /* Github: The last part of the path when viewing the contents of a file. */ color: #000000 !important; background-color: #BECC7A !important; } /* Prelude */ .table_row_even { /* Prelude: output */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .table_row_odd { /* Prelude: output */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .filter_popup { /* Prelude: table heading */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-bottom-style: solid !important; border-color: #EEFF99 !important; border-width:1px !important; } #menu { /* Prelude: menu area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #timeline { /* Prelude: time filtering */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #message_list_nav { /* Prelude: message navigation */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .message_summary { /* Prelude: information table */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } fieldset { /* Prelude: information page */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .menu_item_inactive { /* Prelude: inactive menuitem */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .menu_item_active { /* Prelude: active menuitem */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .topmenu { /* Prelude: top menu area */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .topmenu_item_inactive { /* Prelude: inactive menuitem */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .topmenu_item_active { /* Prelude: active menuitem */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #top_view_header { /* Prelude: Top view */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .popup_menu { /* Prelude: Popup menu*/ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } /*Facebook*/ #leftCol { /* Facebook: content area. Generic? */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } #contentCol { /* Facebook: content area. Generic? */ background-color: #000000 !important; background-image: none !important; color: #EEFF99 !important; } #blueBar { /* Facebook: The top bar with logo and menus */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #pageLogo { /* Facebook: Make the logo fit with the color scheme */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .wrap { /* Facebook: Input box */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; } .item.clearfix { /* Facebook: Menu selected item */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .item.clearfix.sortableItem { /* Facebook: Menu item */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .UFIRow.UFILikeSentence.UFIFirstComponent.UFIUnseenItem { /* Facebook: Likes */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIRow.UFIAddComment.UFILastComponent { /* Facebook: Comment box */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .userContent { /* Facebook: User content */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .shareRedesignText { /* Facebook: User context text which has come in from an external source.*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .clearfix.shareRedesignContainer { /* Facebook: User content - external content.*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .caption { /* Facebook: User content - external content - caption. */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-style: none !important; } .mts.uiAttachmentDesc.translationEligibleUserAttachmentMessage { /* Facebook: User content - external content - external text */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-style: none !important; } .UFIRow { /* Facebook: User content - share.*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIRow.UFILikeSentence.UFIFirstComponent { /* Facebook: Likes */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIRow.UFIPagerRow.UFIFirstCommentComponent { /* Facebook: Hidden comments */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIRow.UFIComment { /* Facebook: First expanded comment */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIReplyList { /* Facebook: Replies*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .UFIRow.UFIReplySocialSentenceRow { /* Facebook: Replies*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } .rhc.photoUfiContainer.pinnedUfi { /* Facebook: Photo view.*/ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .jewelFlyout.fbJewelFlyout.uiToggleFlyout { /* Facebook: dropdown (eg settings) menu surround */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .uiHeader.uiHeaderBottomBorder.jewelHeader { /* Facebook: dropdown (eg notifications) menu header */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .seeMore { /* Facebook: dropdown (eg notifications) menu footer (see all) */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .navigation { /* Facebook: dropdown menu */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .navSubmenu { /* Facebook: dropdown menu item */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #17190F !important; } .menuDivider { /* Facebook: dropdown menu horizontal line */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .messagesContent { /* Facebook: dropdown menu item - eg notifications */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .objectListItem { /* Facebook: dropdown menu item - eg messages */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .uiButton { /* Facebook: Button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .fbChatSidebar.fixed_always { /* Facebook: Chat - maximized */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .fbNubButton { /* Facebook: Chat - minimized */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .clearfix.fbNubFlyoutTitlebar { /* Facebook: Chat - Title */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .clearfix.fbNubFlyoutTitlebar { /* Facebook: Chat - Title text */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .fbNubFlyoutBody.scrollable { /* Facebook: Chat - Friends */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .mhs.mbs.pts.fbChatConvItem._50dw.clearfix.small { /* Facebook: Chat - Typing */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color:#777F4C !important; } .fbNubFlyoutFooter.hasEmoticonsRight { /* Facebook: Chat - Typing Entry */ background-color: black !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } ._510g.typing { /* Facebook: Chat - Typing */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } ._510f { /* Facebook: Chat - Sent ____ ago */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } /* Facebook stuff for viewing pictures */ .spotlight { /* Facebook: The actual image. */ background-color: blue !important; color: #EEFF99 !important; border-color: #777F4C !important; } .stage { /* Facebook: Contains the image and the tags */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; opacity:1 !important; } .fbPhotosPhotoTagboxes.tagContainer { /* Facebook: Tag container. This definitely needs to have no background color. */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; /* Changing the opacity here completely influences the problem, but at the expense of the tags. I've removed the backgrounds of everything I can find that would be influenced by the opacity of this div, but I must have missed something. An interesting side effect is that it dims the photo in a way that could be useful. Considering this isn't a global thing it probably shouldn't be relied on. But it's interesting to think about. */ opacity:0.5 !important; } .tagsWrapper { /* Facebook: Tag ... thing?. This definitely needs to have no background color. */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .fbPhotosPhotoTagboxBase.tagBox { /* Facebook: Tag ... thing?. This definitely needs to have no background color. */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .fbPho-toSnowliftFullScreen.fullScreenSwitch { /* Facebook: Experimentation 1 */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .stageWrapper.lfloat { /* Facebook: Experimentation 1 */ background-color: none !important; color: #EEFF99 !important; border-color: #777F4C !important; opacity:1 !important; } ._n8._3qx.fbPhotoSnowlift.fbxPhoto.uiLayer.fullScreenAvailable._3qw._1qp5.pagingReady { /* Facebook: Full screen container */ background-color: none !important; } ._n9 { /* Facebook: Full screen container */ background-color: none !important; } .page { /* Pagerduty: incident list - container for all the panels */ background-color: black !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .content { /* Pagerduty: incident list - container for the main panels */ background-color: black !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .section { /* Pagerduty: incident list - container for the main panels */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .page-header { /* Pagerduty: incident list - heading area */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .sidebar { /* Pagerduty: incident list - side bar */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .fill { /* Pagerduty: incident list - top menu bar */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .active { /* Pagerduty: incident list - top menu bar */ background-color: #777F4C !important; background-image: none !important; color: #000000 !important; border-color: #777F4C !important; } .incident-nav { /* Pagerduty: incident list - incident area */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .ui-state-default { /* Pagerduty: incident list - table headings */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .condensed-table { /* Pagerduty: incident list - table of incidents */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .ui-toolbar { /* Pagerduty: incident list - table of incidents */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .btn { /* Pagerduty: incident list - button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .paginate_button { /* Pagerduty: incident list - button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .odd { /* Pagerduty: incident list - item - odd */ background-color: black !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .even { /* Pagerduty: incident list - item - even */ background-color: #17190F !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .dataTables_empty { /* Pagerduty: incident list - table of incidents */ background-color: black !important; background-image: none !important; color: #777F4C !important; border-color: #777F4C !important; } .service { /* Pagerduty: incident list - table of incidents - colum*/ background-color: black !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .incident { /* Pagerduty: incident list - table of incidents- colum */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .time { /* Pagerduty: incident list - table of incidents - colum */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .activity { /* Pagerduty: incident list - table of incidents - colum */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; border-color: #777F4C !important; } .pd-item-header { /* Pagerduty: area header */ background-color: #2F331E !important; background-image: none !important; color: #D6E589 !important; border-color: #D6E589 !important; } .pd-escalation-policy-tag { /* Pagerduty: a button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .action { /* Pagerduty: dropdown item */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .dropdown-menu { /* Pagerduty: dropdown menu area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .select2-choice { /* Pagerduty: dropdown intial state */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .numeric { /* Pagerduty: html dropdown */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } /* Zabix */ .hosts { /* Zabbix: Hosts background area */ background-color: #EEFF99 !important; color: black !important; border-color: #777F4C !important; } .box_on { /* Zabbix: Graph overlay */ background-color: none !important; color: #EEFF99 !important; opacity: 0 !important; border-color: #777F4C !important; } .information { /* Zabbix: User feedback */ background-color: #103310 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .warning { /* Zabbix: User feedback */ background-color: #333310 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .average { /* Zabbix: User feedback */ background-color: #331010 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .high { /* Zabbix: User feedback */ background-color: #661010 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .disaster { /* Zabbix: User feedback */ background-color: #771010 !important; color: #EEFF99 !important; border-color: #777F4C !important; } /* Generic */ .highlight_disabled { /* highlighted text */ background-color: #BECC7A !important; background-image: none !important; color: #EEFF99 !important; } .content { /* content area. Generic? */ background-color: #000000 !important; background-image: none !important; color: #EEFF99 !important; } /* Onelogin */ .box_top { /* onelogin: boxed content - top */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .box_background { /* onelogin: boxed content */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .box_bottom { /* onelogin: boxed content - bottom */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .buttonbar { /* onelogin: button bar */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .bodybg { /* onelogin: body background */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .submenu { /* onelogin: submenu bar */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } .current { /* onelogin: selected tab */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; } /* Jira */ .project-item { /* jira: content area. Generic? */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .toolbar-item { /* jira: buttons on the toolbar */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .active { /* jira: selected thing */ border-color: #EEFF99 !important; border-width: 2px; border-style: solid; } .toolbar-trigger { /* jira: toolbar item */ background-color: #2F331E !important; background-image: none !important; color: #D6E589 !important; border-color: #EEFF99 !important; border-style: solid; } .tabs.horizontal { background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; /* TODO Finish this! */ } .tabwrap>.tabs.horizontal>li.active>a,.tabwrap>.tabs.horizontal>li.active>strong{ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .tabwrap { background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #all-tabpanel { /* jira: all button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #comment-tabpanel { /* jira: comment button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #worklog-tabpanel { /* jira: log button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #changehistory-tabpanel { /* jira: history button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #activity-stream-issue-tab { /* jira: acivit button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #transitions-summary-tabpanel { /* jira: transactions button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #dvcs-commits-tabpanel { /* jira: commitsmass --today button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .aui-button { /* jira: comment button on the details area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .ops { /* jira: dropdown thing */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } /* AWS */ #nav-bar { /* navigation bar. At least used in the support center */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } #header { /* TODO work out what this is and if it's needed */ background-color: #777F4C !important; background-image: none !important; color: #D6E589 !important; } .subnav { /* Remove the gray shade under the search box in the support center */ background-color: #17190F !important; background-image: none !important; color: #D6E589 !important; } #nav-search-in-content { /* "AWS product information" dropdown in search bar */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; } #gtl-sign-up { /* Sign up button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .signUpBtn { /* Sign up button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #status { /* Support case status dropdown box */ border-color: #EEFF99 !important; /* TODO Fix this. It should be a more appropriate code. */ } .empty { /* AWS: Table header */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .sortable { /* AWS: Table header */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .nav-elt { /* AWS: Top menu bar */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .nav-menu-separator { /* AWS: Menu bar separator */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } #nav-shortcutBar { /* AWS: Fills the gap in the menu bar */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .tm-both { /* AWS: Container for top menu bar */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .grey { /* AWS: use in button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .blue { /* AWS: use in button */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } /* Zend */ .classname { /* Zend: */ background-color: black !important; background-image: none !important; color: #EEFF99 !important; } /* Pingdom */ #area { /* Pingdom: The main content container */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #fade { /* Pingdom: Fade area on the bottom */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #content { /* Pingdom: The center container */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #page { /* Pingdom: The main content */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } #footer { /* Pingdom: The main content */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .box { /* Pingdom: Boxed winow area */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .left { /* Pingdom: left option */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; border-color: #D6E589 !important; } .right { /* Pingdom: right option */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; border-color: #D6E589 !important; } .checked { /* Pingdom: selected option */ border-color: #D6E589 !important; border-style: solid !important; border-width: 1px !important; } .ui-slider-handle { /* Pingdom: slider */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-color: #000000 !important; border-style: solid !important; border-width: 1px !important; } /* stackoverflow */ .comment-user.owner { /* stackoverflow: comment owner */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; } .post-tag { /* stackoverflow: tag */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #17190F !important; } /* hipchat */ .atTag { /* hipchat: When someone references someone by name */ background-color: #777F4C !important; background-image: none !important; color: #000000 !important; border-color: #17190F !important; } .atTagMe { /* hipchat: When someone references you by name */ background-color: #BECC7A !important; background-image: none !important; color: #000000 !important; border-color: #17190F !important; } .dateDivider { /* hipchat: The gap compacting lots of time */ background-color: #17190F !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .tabs.li { /* hipchat: The context switcher on the left hand side */ background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } .open { /* hipchat: The context switcher on the left hand side */ background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; text-overflow: none; } .alert { /* hipchat: The context switcher on the left hand side */ background-color: #BECC7A !important; background-image: none !important; color: #000000 !important; border-color: #EEFF99 !important; } .top_bar_private { /* hipchat: There is a bar at the top of the page. I don't know what it does. */ background-color: #2F331E !important; background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } /* php.net */ #layout_2 { /* php.net: unclaimed left area */ background-image: none !important; } /* redis.io */ .command { /* redis.io: tile-command */ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .summary { /* redis.io: tile-summary */ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; border-color: #777F4C !important; } /* Generic */ nav { /* navigation bar */ background-image: none !important; background-color: #2F331E !important; color: #D6E589 !important; border-color: #777F4C !important; } header { /* page header */ background-image: none !important; background-color: #2F331E !important; color: #D6E589 !important; border-color: #777F4C !important; } li { /* list item */ background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; border-color: #777F4C !important; } .main-content { /* Misc */ background-color: black !important; color: #EEFF99 !important; } div { /* Div area */ background-color: #000000 !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } pre { /* Pre-formatted text */ background-color: #000000 !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } a { /* Link */ color: #EEFF99 !important; } thead { /* Table Heading */ background-color: #000000 !important; color: #EEFF99 !important; border-color: #777F4C !important; } th { /* Table Heading */ background-color: #000000 !important; color: #EEFF99 !important; border-color: #777F4C !important; } td { /* Table cell */ background-color: #000000 !important; /* TODO reconsider this. It's bound to be breaking stuff. */ color: #EEFF99 !important; border-color: #777F4C !important; } tr { /* Table row */ border-color: #EEFF99 !important; /* TODO Fix this. It should be a more appropriate code. */ } h1 { /* Heading 1 */ background-color: #000000 !important; color: #EEFF99 !important; } h2 { /* Heading 2 */ background-color: #000000 !important; color: #EEFF99 !important; border-color: #EEFF99 !important } h3 { /* Heading 3 */ background-color: #000000 !important; color: #EEFF99 !important; } h4 { /* Heading 4 */ background-color: #000000 !important; color: #EEFF99 !important; } h5 { /* Heading 5 */ background-color: #000000 !important; color: #EEFF99 !important; } h6 { /* Heading 6 */ background-color: #000000 !important; color: #EEFF99 !important; } h7 { /* Heading 7 */ background-color: #000000 !important; color: #EEFF99 !important; } h8 { /* Heading 8 */ background-color: #000000 !important; color: #EEFF99 !important; } h9 { /* Heading 9 */ background-color: #000000 !important; color: #EEFF99 !important; } hr { /* Horizontal line */ background-image: none !important; background-color: #EEFF99 !important; color: #000000 !important; border-color: #EEFF99 !important; } li { background-image: none !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } select { /* Form elements: select box */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } textarea { /* Form elements: textarea */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } input { /* Form elements: textarea */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; border-color: #EEFF99 !important; } body { /* Default stuff. */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } html { /* Default stuff. */ /* This really surprised me, but it's needed for pagerduty, and perhaps other sites. I would have thought that body should have covered this. */ background-image: none !important; background-color: black !important; color: #EEFF99 !important; } p { background-image: none !important; background-color: #000000 !important; color: #EEFF99 !important; } span { color: #EEFF99 !important; } code { background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } blockquote { background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } option { background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } select { background-image: none !important; background-color: #2F331E !important; color: #EEFF99 !important; } tt { /* TODO Look this up. I don't know what it is. It's used by the commit link on github */ background-color: #777F4C !important; background-image: none !important; color: #EEFF99 !important; border-style: none !important; } b { /* TODO See if there is a better way. This is to override the google drop down search results that gray out what you've written. It would be a real shame if this has to stay in. */ color: #EEFF99 !important; } a { /* link */ /* TODO This needs to respect the chosen colour scheme */ color: #3366ff !important; }
{ "content_hash": "c88e3a2d17a4721e444c47b85578b23d", "timestamp": "", "source": "github", "line_count": 2166, "max_line_length": 237, "avg_line_length": 24.238227146814406, "alnum_prop": 0.7101714285714286, "repo_name": "ksandom/colouredWeb", "id": "3cff01a63c603e277417e75ffc90cedc9b1bb105", "size": "53235", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sheets/black3-eeff99.css", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "98" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace WoohooLabs\Zen\Tests\Fixture\DependencyGraph\EntryPoint; class EntryPointC1 { } class EntryPointC2 { }
{ "content_hash": "e4f54e2ff2939a54d6043b1ea4564a4f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 66, "avg_line_length": 10.642857142857142, "alnum_prop": 0.7718120805369127, "repo_name": "woohoolabs/zen", "id": "2501a9f0e5acdf80e35e40e3b104dc513cc13cda", "size": "149", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Fixture/DependencyGraph/EntryPoint/EntryPointC.php", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "1482" }, { "name": "PHP", "bytes": "327163" } ], "symlink_target": "" }
/*global tinymce:true */ tinymce.PluginManager.add('fullscreen', function(editor) { var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler; var containerWidth, containerHeight; if (editor.settings.inline) { return; } function getWindowSize() { var w, h, win = window, doc = document; var body = doc.body; // Old IE if (body.offsetWidth) { w = body.offsetWidth; h = body.offsetHeight; } // Modern browsers if (win.innerWidth && win.innerHeight) { w = win.innerWidth; h = win.innerHeight; } return {w: w, h: h}; } function toggleFullscreen() { var body = document.body, documentElement = document.documentElement, editorContainerStyle; var editorContainer, iframe, iframeStyle; function resize() { DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); } fullscreenState = !fullscreenState; editorContainer = editor.getContainer(); editorContainerStyle = editorContainer.style; iframe = editor.getContentAreaContainer().firstChild; iframeStyle = iframe.style; if (fullscreenState) { iframeWidth = iframeStyle.width; iframeHeight = iframeStyle.height; iframeStyle.width = iframeStyle.height = '100%'; containerWidth = editorContainerStyle.width; containerHeight = editorContainerStyle.height; editorContainerStyle.width = editorContainerStyle.height = ''; DOM.addClass(body, 'mce-fullscreen'); DOM.addClass(documentElement, 'mce-fullscreen'); DOM.addClass(editorContainer, 'mce-fullscreen'); DOM.bind(window, 'resize', resize); resize(); resizeHandler = resize; } else { iframeStyle.width = iframeWidth; iframeStyle.height = iframeHeight; if (containerWidth) { editorContainerStyle.width = containerWidth; } if (containerHeight) { editorContainerStyle.height = containerHeight; } DOM.removeClass(body, 'mce-fullscreen'); DOM.removeClass(documentElement, 'mce-fullscreen'); DOM.removeClass(editorContainer, 'mce-fullscreen'); DOM.unbind(window, 'resize', resizeHandler); } editor.fire('FullscreenStateChanged', {state: fullscreenState}); } editor.on('init', function() { editor.addShortcut('Meta+Alt+F', '', toggleFullscreen); }); editor.on('remove', function() { if (resizeHandler) { DOM.unbind(window, 'resize', resizeHandler); } }); editor.addCommand('mceFullScreen', toggleFullscreen); editor.addMenuItem('fullscreen', { text: 'Fullscreen', shortcut: 'Meta+Alt+F', selectable: true, onClick: toggleFullscreen, onPostRender: function() { var self = this; editor.on('FullscreenStateChanged', function(e) { self.active(e.state); }); }, context: 'view' }); editor.addButton('fullscreen', { tooltip: 'Fullscreen', shortcut: 'Meta+Alt+F', onClick: toggleFullscreen, onPostRender: function() { var self = this; editor.on('FullscreenStateChanged', function(e) { self.active(e.state); }); } }); return { isFullscreen: function() { return fullscreenState; } }; });
{ "content_hash": "258d60a48dc4936a7c8248e252c08c7e", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 108, "avg_line_length": 25.1015625, "alnum_prop": 0.668222844693433, "repo_name": "RAPOS/baron-nt", "id": "2fbfe4be4b08174184265bce6ef5855cc9418402", "size": "3434", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "vendor/tinymce/tinymce/plugins/fullscreen/plugin.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "1184" }, { "name": "Batchfile", "bytes": "535" }, { "name": "CSS", "bytes": "433760" }, { "name": "HTML", "bytes": "197" }, { "name": "JavaScript", "bytes": "180983" }, { "name": "PHP", "bytes": "218712" } ], "symlink_target": "" }
import { Component } from '@angular/core'; import { UserService } from './shared'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { constructor ( private userService: UserService ) {} ngOnInit() { this.userService.populate(); } }
{ "content_hash": "5b46d2eb6cf9a78c8ef78f9fac6aac9f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 42, "avg_line_length": 18.666666666666668, "alnum_prop": 0.6726190476190477, "repo_name": "briankostar/ng2UserDiaries", "id": "e3f4bc080ceade62e0279a4518cd75e601c11ff3", "size": "336", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/app.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3220" }, { "name": "HTML", "bytes": "8559" }, { "name": "JavaScript", "bytes": "1996" }, { "name": "TypeScript", "bytes": "41261" } ], "symlink_target": "" }
package com.coolweather.android.gson; /** * Created by Administrator on 2017/8/31. */ public class AQI { public AQICity city; public class AQICity { public String aqi; public String pm25; } }
{ "content_hash": "1e9ad906e2f4b1347e28dc6cd1b2a85f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 41, "avg_line_length": 15.066666666666666, "alnum_prop": 0.6327433628318584, "repo_name": "zzhuazi/coolweather", "id": "b74c5977a806d3c31500a1d8bbe650a1650c8ae1", "size": "226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/coolweather/android/gson/AQI.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "53522" } ], "symlink_target": "" }
/* eslint-disable global-require */ 'use strict'; const assert = require('assertthat'); const mockery = require('mockery'); const nodeenv = require('nodeenv'); suite('inCloud', () => { setup(async () => { mockery.enable({ useCleanCache: true, warnOnUnregistered: false }); }); teardown(async () => { mockery.deregisterAll(); mockery.disable(); }); test('is a function.', async () => { const inCloud = require('../lib/inCloud'); assert.that(inCloud).is.ofType('function'); }); test('returns false if environment is not set', async () => { const inCloud = require('../lib/inCloud'); assert.that(inCloud()).is.false(); }); test('returns false if environment is set to consul', async () => { const restore = nodeenv('SERVICE_DISCOVERY', 'consul'); const inCloud = require('../lib/inCloud'); assert.that(inCloud()).is.false(); restore(); }); test('returns true if environment is set to cloud', async () => { const restore = nodeenv('SERVICE_DISCOVERY', 'cloud'); const inCloud = require('../lib/inCloud'); assert.that(inCloud()).is.true(); restore(); }); test('throws error if environment has invalid value', async () => { const restore = nodeenv('SERVICE_DISCOVERY', 'buhu'); const inCloud = require('../lib/inCloud'); try { inCloud(); throw new Error('X'); } catch (err) { assert .that(err.message) .is.equalTo('Illegal configuration of SERVICE_DISCOVERY, possible values are "cloud", "consul"'); assert.that(err.code).is.equalTo('IllegalConfiguration'); assert.that(err.metadata.serviceDiscovery).is.equalTo('buhu'); } restore(); }); });
{ "content_hash": "0a2ed6efe0dc17add6fe682a7db75144", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 105, "avg_line_length": 26.12121212121212, "alnum_prop": 0.6102088167053364, "repo_name": "sealsystems/seal-consul", "id": "d14701756517ad9931159fec012f9ea732c6bb30", "size": "1724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/inCloudTest.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "47388" } ], "symlink_target": "" }
**NPM** `npm install function-tree` ## Description Function-tree is the what Cerebral extends to create its signal implementation. You can use this library on the server, or standalone in the client as a replacement for Cerebral. Basically a function-tree allows you to execute a tree of functions. You can use the Cerebral debugger to debug function tree execution in any JS environment. Function-tree is somewhat in the same family as Rxjs and Promises. The main difference is that Rxjs and Promises are based on value transformation. That means only the value returned from the previous function is available in the next. This works when you indeed want to transform values, but events in your application are rarely about value transformation, they are about running side effects and going through one of multiple execution paths. Function tree embraces the fact that most of what we do in application development is running side effects. Rxjs and Promises are also about execution control, but neither of them have declarative conditional execution paths, you have to write an *IF* or *SWITCH* statement or decouple streams. With function tree you are able to diverge the execution down paths just as declaratively as functions. This helps readability. ## Instantiate ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree const ft = new FunctionTree({ // add side effect libraries to context }) ft.run([ // returns a promise function someFunc (context) {}, function someOtherFunc (context) {} ], { foo: 'bar' // optional payload }) .catch((error) => { // Current payload with execution details, // can be passed in to a new execution (will be indicated in debugger) error.payload // A serialized version of the error. Name, message and stack, or custom error serialization error.payload.error }) ``` You can also add multiple custom context providers by using an array: ```js const ft = new FunctionTree([{ // add side effect libraries to context }, SomeCustomProvider() ]) ``` ## errors ### FunctionTreeError (base) ```js import {FunctionTreeError} from 'function-tree' // Node: // const FunctionTreeError = require('function-tree').FunctionTreeError // Error structure { name: 'FunctionTreeError', message: 'Some function-tree error' stack: '...' } ``` ### FunctionTreeExecutionError ```js import {FunctionTreeExecutionError} from 'function-tree' // Node: // const FunctionTreeExecutionError = require('function-tree').FunctionTreeExecutionError // Error structure { name: 'FunctionTreeExecutionError', message: 'Some execution error' execution: {name: 'someName'}, funcDetails: {name: 'someFunction', functionIndex: 5}, payload: {foo: 'bar'}, stack: '...' } ``` ### devtools Download the function tree standalone debugger for [Mac](https://drive.google.com/file/d/0B1pYKovu9Upyb1Bkdm5IbkdBN3c/view?usp=sharing), [Windows](https://drive.google.com/file/d/0B1pYKovu9UpyMGRRbG45dWR6R1k/view?usp=sharing) or [Linux](https://drive.google.com/file/d/0B1pYKovu9UpyMFQ5dEdnSy1aN0E/view?usp=sharing). ```js import FunctionTree from 'function-tree' import Devtools from 'function-tree/devtools' // Node: // const FunctionTree = require('function-tree').FunctionTree // const Devtools = require('function-tree/devtools').Devtools const devtools = new Devtools({ // Set url of remote debugger host: 'localhost:8585', // By default debugger tries to reconnect when it is not active reconnect: true }) const ft = new FunctionTree([]) // Add your function tree to the debugger devtools.add(ft) // If you are not going to use it anymore, remove it devtools.remove(ft) // Remove all function trees from debugger devtools.destroy() ``` You can use it when creating providers to easily wrap their usage: ```js function MyProvider (options = {}) { let cachedProvider = null function createProvider (context) { return { doSomething() {}, doSomethingElse() {} } } return (context) => { context.myProvider = cachedProvider = (cachedProvider || createProvider(context)) if (context.debugger) { context.debugger.wrapProvider('myProvider') } return context } } ``` ### sequence You can use an array literal to define a sequence of functions. ```js function someFunction (context) {} function someOtherFunction (context) {} module.exports = [ someFunction, someOtherFunction ] ``` Or you can be explicit by using the **sequence** function: ```js import {sequence} from 'function-tree' // Node: // const sequence = require('function-tree').sequence function someFunction (context) {} function someOtherFunction (context) {} module.exports = sequence([ someFunction, someOtherFunction ]) ``` The first argument to **sequence** can be a string, which names the sequence. This will be shown in the debugger. If it is the root sequence it will be used as the name of the execution itself. ```js import {sequence} from 'function-tree' // Node: // const sequence = require('function-tree').sequence function someFunction (context) {} function someOtherFunction (context) {} module.exports = sequence('My awesome sequence', [ someFunction, someOtherFunction ]) ``` ### parallel ```js import {parallel} from 'function-tree' // Node: // const sequence = require('function-tree').parallel function someFunction (context) {} function someOtherFunction (context) {} module.exports = parallel([ someFunction, someOtherFunction ]) ``` Even though **someFunction** returns a Promise, **someOtherFunction** will be run immediately. ### context #### props ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree function funcA (context) { context.props.foo // "bar" } const ft = new FunctionTree() const tree = [ funcA ] ft.run(tree, {foo: 'bar'}) ``` #### path The path is only available on the context when the function can diverge the execution down a path. ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree function funcA (context) { context.props.foo // "bar" return context.path.pathA({foo2: 'bar2'}) } function funcB (context) { context.props.foo // "bar" context.props.foo2 // "bar2" return new Promise((resolve) => { setTimeout(() => { resolve({foo3: 'bar3'}) }, 100) }) } function funcC(context) { context.props.foo // "bar" context.props.foo2 // "bar2" context.props.foo3 // "bar3" } const ft = new FunctionTree([]) const tree = [ funcA, { pathA: [ funcB, funcC ], pathB: [] } ] ft.run(tree, {foo: 'bar'}) ``` ### error ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree const ft = new FunctionTree([]) // As an event (async) ft.on('error', function (error, execution, payload) {}) // As callback for single execution // Triggers sync/async depending on where error occurs ft.run(tree, (error) => {}) // As callback (sync) ft.run(tree, (error, execution, payload) => { if (error) { // There is an error } }) ``` ### provider A provider gives you access to the current context and other information about the execution. It is required that you return the context or a mutated version of it. ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree function MyProvider(context, functionDetails, payload) { context // Current context context.props // Input created by the PropsProvider (default) payload // The current payload (Used by PropsProvider) functionDetails.name // Name of the function functionDetails.functionIndex // The index of the function in the tree, like an ID functionDetails.function // A reference to the running function functionDetails.isParallel // If the function is running in parallel with others context.execution.name // Function tree id context.execution.id // Current execution id context.execution.staticTree // The static representation of the tree context.execution.datetime // Time of execution context.execution.functionTree // The function tree instance return context // Always return the changed context } const ft = new FunctionTree([ MyProvider ]) ``` Providers lets us do some pretty amazing things. The debugger for **function-tree** is actually just a provider that sends information to the debugger about execution and exposes an API for other providers to send their own data to the debugger. #### StopExecutionProvider By using a condition you can tell the function tree to stop executions. ```js import {StopExecutionProvider} from 'function-tree' // Node: // const StopExecutionProvider = require('function-tree').StopExecutionProvider const ft = new FunctionTree([ StopExecutionProvider({ nameOfExecution (context) { return context.props.stop } }) ]) ``` If the condition returns true the execution will throw an error and stop. ### events The execute function is also an event emitter. ```js import FunctionTree from 'function-tree' // Node: // const FunctionTree = require('function-tree').FunctionTree const ft = new FunctionTree([]) const tree = [ funcA ] // When an error is thrown, also catches promise errors ft.on('error', (error, execution, payload) => {}) // When a function tree is executed ft.on('start', (execution, payload) => {}) // When a function tree execution has ended ft.on('end', (execution, payload) => {}) // When a function tree goes down a path ft.on('pathStart', (execution, payload) => {}) // When a function tree ends execution of a path ft.on('pathEnd', (execution, payload) => {}) // When a function in a function tree starts executing ft.on('functionStart', (execution, functionDetails, payload) => {}) // When a function in a function tree stops executing ft.on('functionEnd', (execution, functionDetails, payload) => {}) // Triggers when an async function has been run ft.on('asyncFunction', (execution, functionDetails, payload) => {}) // When a parallel execution is about to happen (array in array) ft.on('parallelStart', (execution, payload, functionsToResolveCount) => {}) // When a function in parallel execution is done executing ft.on('parallelProgress', (execution, payload, functionsStillResolvingCount) => {}) // When a parallel execution is done ft.on('parallelEnd', (execution, payload, functionsExecutedCount) => {}) ft.run(tree) ```
{ "content_hash": "5950254455f60073cb5bb73765474d68", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 554, "avg_line_length": 27.219072164948454, "alnum_prop": 0.7241738471735631, "repo_name": "garth/cerebral", "id": "974b60d1b215addfea5373e003d08ba976d7ead2", "size": "10589", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/node_modules/function-tree/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12916" }, { "name": "HTML", "bytes": "2499" }, { "name": "JavaScript", "bytes": "175769" } ], "symlink_target": "" }
%ISROT2 Test if SO(2) rotation matrix % % ISROT2(R) is true (1) if the argument is of dimension 2x2 or 2x2xN, else false (0). % % ISROT2(R, 'valid') as above, but also checks the validity of the rotation % matrix. % % Notes:: % - A valid rotation matrix has determinant of 1. % % See also ISHOMOG2, ISVEC. % Copyright (C) 1993-2014, by Peter I. Corke % % This file is part of The Robotics Toolbox for MATLAB (RTB). % % RTB is free software: you can redistribute it and/or modify % it under the terms of the GNU Lesser General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % % RTB 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 Lesser General Public License for more details. % % You should have received a copy of the GNU Leser General Public License % along with RTB. If not, see <http://www.gnu.org/licenses/>. % % http://www.petercorke.com function h = isrot2(r, dtest) d = size(r); if ndims(r) >= 2 h = all(d(1:2) == [2 2]); if h && nargin > 1 h = abs(det(r) - 1) < eps; end else h = false; end
{ "content_hash": "e0689ff97a4368ed6be3e9d1d2bab823", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 28.88888888888889, "alnum_prop": 0.6707692307692308, "repo_name": "sgabello1/calibration", "id": "c415f0e7a8eb337c14cb65fc5e0dd763269c9b0b", "size": "1300", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "common/isrot2.m", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "144077" }, { "name": "HTML", "bytes": "1502260" }, { "name": "M", "bytes": "129" }, { "name": "Makefile", "bytes": "1997" }, { "name": "Matlab", "bytes": "1501081" }, { "name": "Objective-C", "bytes": "545" }, { "name": "Objective-C++", "bytes": "18721" } ], "symlink_target": "" }
package io.buoyant.router import com.twitter.finagle.{param => _, _} import com.twitter.finagle.buoyant.Dst import com.twitter.finagle.naming.buoyant.DstBindingFactory import com.twitter.finagle.tracing.Trace import com.twitter.logging.HasLogLevel import com.twitter.util.{Future, Return, Throw, Time} import scala.util.control.NoStackTrace object RoutingFactory { val role = Stack.Role("RoutingFactory") val description = "Performs per-request name binding" /** * An Identifier determines a [[com.twitter.finagle.buoyant.Dst * destination]] for `Req`-typed requests. */ type Identifier[Req] = Req => Future[RequestIdentification[Req]] object Identifier { def compose[Req](hd: Identifier[Req], tl: Identifier[Req]*): Identifier[Req] = (req: Req) => fold(req, hd, tl) /** * Apply each identifier in order until the request is identified. * * Identifier list must not be empty. */ def compose[Req](all: Seq[Identifier[Req]]): Identifier[Req] = all match { case Nil => throw new IllegalArgumentException("empty identifier list") case Seq(identifier) => identifier case Seq(hd, tl@_*) => (req: Req) => fold(req, hd, tl) } /** * Apply each identifier to the request in order until the request * is identified or identifiers are exhausted. */ private[this] def fold[Req]( req: Req, hd: Identifier[Req], tl: Seq[Identifier[Req]] ): Future[RequestIdentification[Req]] = tl match { case Nil => hd(req) case Seq(nextHd, nextTl@_*) => hd(req).flatMap { case id: IdentifiedRequest[Req] => Future.value(id) case _: UnidentifiedRequest[Req] => fold(req, nextHd, nextTl) } } } abstract class ResponseException extends NoStackTrace with HasLogLevel /** The result of attempting to identify a request. */ sealed trait RequestIdentification[Req] /** * This indicates that a destination was successfully assigned. The attached * request should be sent to the destination. * @param dst The destination of the request. * @param request The request to send to the destination. This allows * identifiers to effectively mutate requests that they * identify. */ class IdentifiedRequest[Req](val dst: Dst.Path, val request: Req) extends RequestIdentification[Req] object IdentifiedRequest { def unapply[Req](identified: IdentifiedRequest[Req]): Option[(Dst.Path, Req)] = Some((identified.dst, identified.request)) } /** * This indicates that the identifier could not assign a destination to the * request. */ class UnidentifiedRequest[Req](val reason: String) extends RequestIdentification[Req] /** Indicates that no destination could be found for a request. */ case class UnknownDst[Req](request: Req, reason: String) extends Exception(s"Unknown destination: $request / $reason") with NoStackTrace /** * A prefix to be assigned to [[com.twitter.finagle.buoyant.Dst * destinations]] (i.e. by an [[Identifier]]). */ case class DstPrefix(path: Path) implicit object DstPrefix extends Stack.Param[DstPrefix] { val default = DstPrefix(Path.Utf8("svc")) } /** * The base `Dtab` to be used when evaluating a * [[com.twitter.finagle.buoyant.Dst destination]]. */ case class BaseDtab(dtab: () => Dtab) implicit object BaseDtab extends Stack.Param[BaseDtab] { val default = BaseDtab(() => Dtab.base) } private[buoyant] object Annotations { sealed abstract class Failure(val name: String) { override def toString = name val record: Any => Unit = (_: Any) => Trace.recordBinary(Failure.key, name) } object Failure { val key = "io.buoyant.router.Failure" case object Identification extends Failure("Identification") case object ClientAcquisition extends Failure("ClientAcquisition") case object Service extends Failure("Service") def unapply(f: Failure): Option[String] = Some(f.name) } } } /** * A RoutingFactory is a ServiceFactory that, for each request, * determines a routable name for the request, resolves it to a * client, and dispatches the request to a downstream service. * * `getDst` is responsible for determining the name (Path) of each * request. * * A DstBindingFactory is used to obtain a client that serves each * destination. */ class RoutingFactory[Req, Rsp]( getDst: RoutingFactory.Identifier[Req], clientFactory: DstBindingFactory[Req, Rsp], label: String ) extends ServiceFactory[Req, Rsp] { import RoutingFactory._ override def close(deadline: Time): Future[Unit] = clientFactory.close(deadline) override def status: Status = clientFactory.status def apply(conn: ClientConnection): Future[Service[Req, Rsp]] = service /** * The router doesn't actually need a reference to the client * connection, so we can use a nil client connection (as would be * the case when manually constructing a Finagle Client * ServiceFactory). This has a notable impact on performance, * especially in the face of server connection churn. */ private val service = Future.value(new RoutingService(ClientConnection.nil)) // TODO move trace recording into a separate stack module? private class RoutingService(conn: ClientConnection) extends Service[Req, Rsp] { override def close(d: Time) = conn.close(d) def apply(req0: Req): Future[Rsp] = { if (Trace.isActivelyTracing) { Trace.recordBinary("router.label", label) } for { IdentifiedRequest(dst, req1) <- getDst(req0).transform { case Return(identified: IdentifiedRequest[Req]) => Future.value(identified) case Return(unidentified: UnidentifiedRequest[Req]) => Annotations.Failure.Identification.record(unidentified.reason) Future.exception(UnknownDst(req0, unidentified.reason)) case Throw(e) => Annotations.Failure.Identification.record(e.getMessage) e match { case e: ResponseException => Future.exception(e) case _ => Future.exception(UnknownDst(req0, e.getMessage)) } } // Client acquisition failures are recorded within the // clientFactory's path stack. service <- clientFactory(dst, conn).onFailure(Annotations.Failure.ClientAcquisition.record) // Service failures are recorded within the clientFactory's // path stack, too. rsp <- service(req1).ensure { val _ = service.close() } } yield rsp } } }
{ "content_hash": "629ec635a67477ac3065dc6902742042", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 102, "avg_line_length": 35.04736842105263, "alnum_prop": 0.6757771437152725, "repo_name": "linkerd/linkerd", "id": "1ab353a46db953c2e7fd64a55937bdc7044c6d35", "size": "6659", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "router/core/src/main/scala/io/buoyant/router/RoutingFactory.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9549" }, { "name": "Handlebars", "bytes": "13931" }, { "name": "Java", "bytes": "13396" }, { "name": "JavaScript", "bytes": "331633" }, { "name": "Scala", "bytes": "2611265" }, { "name": "Shell", "bytes": "15407" }, { "name": "Thrift", "bytes": "3593" } ], "symlink_target": "" }
module AzureMediaService class Config UPLOAD_LIMIT_SIZE = 4194304 # 4MB READ_BUFFER_SIZE = 4000000 API_VERSION = "2.9" end end
{ "content_hash": "d2f07417a45fc608c55855014391db4c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 37, "avg_line_length": 18.75, "alnum_prop": 0.6533333333333333, "repo_name": "murayama/azure_media_service_ruby", "id": "146c90c5508e5447ba6ce99596e6a067aab820b2", "size": "150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/azure_media_service/config.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "29801" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Phoria - Dev test page 3</title> <script src="scripts/gl-matrix.js"></script> <script src="scripts/phoria-util.js"></script> <script src="scripts/phoria-entity.js"></script> <script src="scripts/phoria-scene.js"></script> <script src="scripts/phoria-renderer.js"></script> <script src='scripts/dat.gui.min.js'></script> <script> var requestAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function(c) {window.setTimeout(c, 15)}; /** Phoria pho·ri·a (fôr-) n. The relative directions of the eyes during binocular fixation on a given object */ // bind to window onload event window.addEventListener('load', onloadHandler, false); function onloadHandler() { // get the canvas DOM element and the 2D drawing context var canvas = document.getElementById('canvas'); // create the scene and setup camera, perspective and viewport var scene = new Phoria.Scene(); scene.camera.position = {x:0.0, y:5.0, z:-15.0}; scene.perspective.aspect = canvas.width / canvas.height; scene.viewport.width = canvas.width; scene.viewport.height = canvas.height; // create a canvas renderer var renderer = new Phoria.CanvasRenderer(canvas); // GENERATE TEST ENTITIES // add a grid to help visualise camera position etc. var plane = Phoria.Util.generateTesselatedPlane(8,8,0,20); scene.graph.push(Phoria.Entity.create({ points: plane.points, edges: plane.edges, polygons: plane.polygons, style: { drawmode: "wireframe", shademode: "plain", linewidth: 0.5, objectsortmode: "unsorted" } })); var s = Phoria.Util.generateSphere(1, 24, 48); var sphere = Phoria.Entity.create({ points: s.points, edges: s.edges, polygons: s.polygons, style: { diffuse: 1, specular: 128 } }); sphere.scaleN(3); scene.graph.push(sphere); // add a light scene.graph.push(Phoria.DistantLight.create({ color: [0.5,0.5,1.0], intensity: 0.25, direction: {x:0, y:-1, z:1} })); var visibleLightObj = Phoria.Entity.create({ points: [{x:-3, y:4, z:-5}], style: { color: [255,255,255], drawmode: "point", shademode: "plain", linewidth: 5, linescale: 2 } }); scene.graph.push(visibleLightObj); var light = Phoria.PointLight.create({ color: [1, 0.4, 0], position: {x:-3, y:4, z:-5}, intensity: 0.75, attenuation: 0.05 }); visibleLightObj.children.push(light); var pause = false; var fnAnimate = function() { if (!pause) { // rotate local matrix of an object sphere.rotateY(0.5*Phoria.RADIANS); // the light position is edited directly via the GUI - update the visible indicator visibleLightObj.points[0].x = light.position.x; visibleLightObj.points[0].y = light.position.y; visibleLightObj.points[0].z = light.position.z; // execute the model view 3D pipeline scene.modelView(); // and render the scene renderer.render(scene); } requestAnimFrame(fnAnimate); }; // add GUI controls var gui = new dat.GUI(); var f = gui.addFolder('Perspective'); f.add(scene.perspective, "fov").min(5).max(175); f.add(scene.perspective, "near").min(1).max(100); f.add(scene.perspective, "far").min(1).max(1000); //f.open(); f = gui.addFolder('Camera LookAt'); f.add(scene.camera.lookat, "x").min(-100).max(100); f.add(scene.camera.lookat, "y").min(-100).max(100); f.add(scene.camera.lookat, "z").min(-100).max(100); f.open(); f = gui.addFolder('Camera Position'); f.add(scene.camera.position, "x").min(-100).max(100); f.add(scene.camera.position, "y").min(-100).max(100); f.add(scene.camera.position, "z").min(-100).max(100); f.open(); f = gui.addFolder('Camera Up'); f.add(scene.camera.up, "x").min(-10).max(10).step(0.1); f.add(scene.camera.up, "y").min(-10).max(10).step(0.1); f.add(scene.camera.up, "z").min(-10).max(10).step(0.1); f = gui.addFolder('Rendering'); f.add(sphere.style, "drawmode", ["point", "wireframe", "solid"]); f.add(sphere.style, "shademode", ["plain", "lightsource"]); f.add(sphere.style, "fillmode", ["fill", "filltwice", "inflate", "fillstroke", "hiddenline"]); f.add(sphere.style, "doublesided"); f.open(); f = gui.addFolder('Light'); f.add(light.position, "x").min(-25).max(25).step(0.1); f.add(light.position, "y").min(-25).max(25).step(0.1); f.add(light.position, "z").min(-25).max(25).step(0.1); f.add(light.color, "0").min(0).max(1).step(0.1).name("red"); f.add(light.color, "1").min(0).max(1).step(0.1).name("green"); f.add(light.color, "2").min(0).max(1).step(0.1).name("blue"); f.add(light, "intensity").min(0).max(1).step(0.1); f.add(light, "attenuation").min(0.01).max(0.25).step(0.01); f.open(); // key binding document.addEventListener('keydown', function(e) { switch (e.keyCode) { case 27: { pause = !pause; break; } } }, false); // start animation requestAnimFrame(fnAnimate); } </script> </head> <body style="background-color: #bfbfbf"> <canvas id="canvas" width="768" height="512" style="background-color: #eee"></canvas> <div><a style="color:#225588;text-decoration:none;" href="./index.html">&lt;&lt; Phoria demos</a></div> </body> </html>
{ "content_hash": "731f10c0ccfc8a735e8143c2e645e31a", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 109, "avg_line_length": 34.346820809248555, "alnum_prop": 0.5828004039044092, "repo_name": "kevinroast/phoria.js", "id": "64bad386950f33f74175fec1744688cfc01304ed", "size": "5945", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test3.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "254495" }, { "name": "JavaScript", "bytes": "262799" } ], "symlink_target": "" }
package com.amazonaws.services.simpleworkflow.model; import java.io.Serializable; /** * <p> * Provides details of the <code>ChildWorkflowExecutionFailed</code> * event. * </p> */ public class ChildWorkflowExecutionFailedEventAttributes implements Serializable, Cloneable { /** * The child workflow execution that failed. */ private WorkflowExecution workflowExecution; /** * The type of the child workflow execution. */ private WorkflowType workflowType; /** * The reason for the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 256<br/> */ private String reason; /** * The details of the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 32768<br/> */ private String details; /** * The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ private Long initiatedEventId; /** * The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ private Long startedEventId; /** * The child workflow execution that failed. * * @return The child workflow execution that failed. */ public WorkflowExecution getWorkflowExecution() { return workflowExecution; } /** * The child workflow execution that failed. * * @param workflowExecution The child workflow execution that failed. */ public void setWorkflowExecution(WorkflowExecution workflowExecution) { this.workflowExecution = workflowExecution; } /** * The child workflow execution that failed. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param workflowExecution The child workflow execution that failed. * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withWorkflowExecution(WorkflowExecution workflowExecution) { this.workflowExecution = workflowExecution; return this; } /** * The type of the child workflow execution. * * @return The type of the child workflow execution. */ public WorkflowType getWorkflowType() { return workflowType; } /** * The type of the child workflow execution. * * @param workflowType The type of the child workflow execution. */ public void setWorkflowType(WorkflowType workflowType) { this.workflowType = workflowType; } /** * The type of the child workflow execution. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param workflowType The type of the child workflow execution. * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withWorkflowType(WorkflowType workflowType) { this.workflowType = workflowType; return this; } /** * The reason for the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 256<br/> * * @return The reason for the failure (if provided). */ public String getReason() { return reason; } /** * The reason for the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 256<br/> * * @param reason The reason for the failure (if provided). */ public void setReason(String reason) { this.reason = reason; } /** * The reason for the failure (if provided). * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 256<br/> * * @param reason The reason for the failure (if provided). * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withReason(String reason) { this.reason = reason; return this; } /** * The details of the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 32768<br/> * * @return The details of the failure (if provided). */ public String getDetails() { return details; } /** * The details of the failure (if provided). * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 32768<br/> * * @param details The details of the failure (if provided). */ public void setDetails(String details) { this.details = details; } /** * The details of the failure (if provided). * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>0 - 32768<br/> * * @param details The details of the failure (if provided). * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withDetails(String details) { this.details = details; return this; } /** * The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @return The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ public Long getInitiatedEventId() { return initiatedEventId; } /** * The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @param initiatedEventId The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ public void setInitiatedEventId(Long initiatedEventId) { this.initiatedEventId = initiatedEventId; } /** * The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param initiatedEventId The id of the <code>StartChildWorkflowExecutionInitiated</code> event * corresponding to the <code>StartChildWorkflowExecution</code> * <a>Decision</a> to start this child workflow execution. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withInitiatedEventId(Long initiatedEventId) { this.initiatedEventId = initiatedEventId; return this; } /** * The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @return The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ public Long getStartedEventId() { return startedEventId; } /** * The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @param startedEventId The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. */ public void setStartedEventId(Long startedEventId) { this.startedEventId = startedEventId; } /** * The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param startedEventId The Id of the <code>ChildWorkflowExecutionStarted</code> event * recorded when this child workflow execution was started. This * information can be useful for diagnosing problems by tracing back the * chain of events leading up to this event. * * @return A reference to this updated object so that method calls can be chained * together. */ public ChildWorkflowExecutionFailedEventAttributes withStartedEventId(Long startedEventId) { this.startedEventId = startedEventId; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getWorkflowExecution() != null) sb.append("WorkflowExecution: " + getWorkflowExecution() + ","); if (getWorkflowType() != null) sb.append("WorkflowType: " + getWorkflowType() + ","); if (getReason() != null) sb.append("Reason: " + getReason() + ","); if (getDetails() != null) sb.append("Details: " + getDetails() + ","); if (getInitiatedEventId() != null) sb.append("InitiatedEventId: " + getInitiatedEventId() + ","); if (getStartedEventId() != null) sb.append("StartedEventId: " + getStartedEventId() ); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getWorkflowExecution() == null) ? 0 : getWorkflowExecution().hashCode()); hashCode = prime * hashCode + ((getWorkflowType() == null) ? 0 : getWorkflowType().hashCode()); hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode()); hashCode = prime * hashCode + ((getDetails() == null) ? 0 : getDetails().hashCode()); hashCode = prime * hashCode + ((getInitiatedEventId() == null) ? 0 : getInitiatedEventId().hashCode()); hashCode = prime * hashCode + ((getStartedEventId() == null) ? 0 : getStartedEventId().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChildWorkflowExecutionFailedEventAttributes == false) return false; ChildWorkflowExecutionFailedEventAttributes other = (ChildWorkflowExecutionFailedEventAttributes)obj; if (other.getWorkflowExecution() == null ^ this.getWorkflowExecution() == null) return false; if (other.getWorkflowExecution() != null && other.getWorkflowExecution().equals(this.getWorkflowExecution()) == false) return false; if (other.getWorkflowType() == null ^ this.getWorkflowType() == null) return false; if (other.getWorkflowType() != null && other.getWorkflowType().equals(this.getWorkflowType()) == false) return false; if (other.getReason() == null ^ this.getReason() == null) return false; if (other.getReason() != null && other.getReason().equals(this.getReason()) == false) return false; if (other.getDetails() == null ^ this.getDetails() == null) return false; if (other.getDetails() != null && other.getDetails().equals(this.getDetails()) == false) return false; if (other.getInitiatedEventId() == null ^ this.getInitiatedEventId() == null) return false; if (other.getInitiatedEventId() != null && other.getInitiatedEventId().equals(this.getInitiatedEventId()) == false) return false; if (other.getStartedEventId() == null ^ this.getStartedEventId() == null) return false; if (other.getStartedEventId() != null && other.getStartedEventId().equals(this.getStartedEventId()) == false) return false; return true; } @Override public ChildWorkflowExecutionFailedEventAttributes clone() { try { return (ChildWorkflowExecutionFailedEventAttributes) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
{ "content_hash": "941914eb785a319b963a80fe8006f84d", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 141, "avg_line_length": 38.66323907455013, "alnum_prop": 0.6397606382978723, "repo_name": "galaxynut/aws-sdk-java", "id": "f14ef2870c72181d56da69a81ac2684a799e4b45", "size": "15627", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/ChildWorkflowExecutionFailedEventAttributes.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "84475571" }, { "name": "Scilab", "bytes": "2260" } ], "symlink_target": "" }
package com.amazonaws.services.gamelift.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.gamelift.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * PlayerSessionMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class PlayerSessionMarshaller { private static final MarshallingInfo<String> PLAYERSESSIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PlayerSessionId").build(); private static final MarshallingInfo<String> PLAYERID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("PlayerId").build(); private static final MarshallingInfo<String> GAMESESSIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionId").build(); private static final MarshallingInfo<String> FLEETID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("FleetId").build(); private static final MarshallingInfo<java.util.Date> CREATIONTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreationTime").timestampFormat("unixTimestamp").build(); private static final MarshallingInfo<java.util.Date> TERMINATIONTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TerminationTime").timestampFormat("unixTimestamp").build(); private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Status").build(); private static final MarshallingInfo<String> IPADDRESS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("IpAddress").build(); private static final MarshallingInfo<Integer> PORT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Port").build(); private static final MarshallingInfo<String> PLAYERDATA_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PlayerData").build(); private static final PlayerSessionMarshaller instance = new PlayerSessionMarshaller(); public static PlayerSessionMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(PlayerSession playerSession, ProtocolMarshaller protocolMarshaller) { if (playerSession == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(playerSession.getPlayerSessionId(), PLAYERSESSIONID_BINDING); protocolMarshaller.marshall(playerSession.getPlayerId(), PLAYERID_BINDING); protocolMarshaller.marshall(playerSession.getGameSessionId(), GAMESESSIONID_BINDING); protocolMarshaller.marshall(playerSession.getFleetId(), FLEETID_BINDING); protocolMarshaller.marshall(playerSession.getCreationTime(), CREATIONTIME_BINDING); protocolMarshaller.marshall(playerSession.getTerminationTime(), TERMINATIONTIME_BINDING); protocolMarshaller.marshall(playerSession.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(playerSession.getIpAddress(), IPADDRESS_BINDING); protocolMarshaller.marshall(playerSession.getPort(), PORT_BINDING); protocolMarshaller.marshall(playerSession.getPlayerData(), PLAYERDATA_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "91a6adce6288a4c9520f52486135ae39", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 159, "avg_line_length": 59.57746478873239, "alnum_prop": 0.7626477541371158, "repo_name": "jentfoo/aws-sdk-java", "id": "7ca81fc30fca18919ece992a698548f300969e15", "size": "4810", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/transform/PlayerSessionMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "270" }, { "name": "FreeMarker", "bytes": "173637" }, { "name": "Gherkin", "bytes": "25063" }, { "name": "Java", "bytes": "356214839" }, { "name": "Scilab", "bytes": "3924" }, { "name": "Shell", "bytes": "295" } ], "symlink_target": "" }
import os import sys if __name__ == "__main__": os.environ.setdefault( "DJANGO_SETTINGS_MODULE", "config.settings.development") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "12ab43368bb2c3ea18322bea21af5c6e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 64, "avg_line_length": 23.272727272727273, "alnum_prop": 0.671875, "repo_name": "Alexx-G/django-project-template", "id": "1881c3618b81330318e2b1e8f840a01d656b2cf9", "size": "278", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/manage.py", "mode": "33261", "license": "mit", "language": [ { "name": "HTML", "bytes": "81" }, { "name": "Python", "bytes": "5061" } ], "symlink_target": "" }
<?php // +------------------------------------------------------------------------- // | Copyright (C) 2016 Yunify, Inc. // +------------------------------------------------------------------------- // | Licensed under the Apache License, Version 2.0 (the "License"); // | you may not use this work except in compliance with the License. // | You may obtain a copy of the License in the LICENSE file, or 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 QingStor\SDK\Exception; use Exception; class ParameterRequiredException extends Exception { public function __construct($parameter_name, $parent_name, $code = 0, Exception $previous = null) { $message = $parameter_name.' is required in '.$parent_name.'.'; parent::__construct($message, $code, $previous); } public function __toString() { return __CLASS__.": [{$this->code}]: {$this->message}\n"; } }
{ "content_hash": "f05bce9903747f1373c52f0573260e00", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 101, "avg_line_length": 39.3235294117647, "alnum_prop": 0.5602094240837696, "repo_name": "yunify/qingstor-sdk-php", "id": "4815b9181510443aa5c5bcc8750382e5cc302cbc", "size": "1337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Exception/ParameterRequiredException.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "1290" }, { "name": "PHP", "bytes": "223431" } ], "symlink_target": "" }
const axios = require('../libs/ajax'); const _ = require('lodash'); /** * API for local config */ var Api = { getRecords: function(url, startPosition, maxRecords, filter) { return new Promise((resolve) => { require.ensure(['../utils/ogc/CSW', '../utils/ogc/Filter'], () => { const {CSW, marshaller, unmarshaller} = require('../utils/ogc/CSW'); let body = marshaller.marshalString({ name: "csw:GetRecords", value: CSW.getRecords(startPosition, maxRecords, filter) }); resolve(axios.post(url, body, { headers: { 'Content-Type': 'application/xml' }}).then( (response) => { if (response ) { let json = unmarshaller.unmarshalString(response.data); if (json && json.name && json.name.localPart === "GetRecordsResponse" && json.value && json.value.searchResults) { let rawResult = json.value; let rawRecords = rawResult.searchResults.abstractRecord || rawResult.searchResults.any; let result = { numberOfRecordsMatched: rawResult.searchResults.numberOfRecordsMatched, numberOfRecordsReturned: rawResult.searchResults.numberOfRecordsReturned, nextRecord: rawResult.searchResults.nextRecord // searchStatus: rawResult.searchStatus }; let records = []; if (rawRecords) { for (let i = 0; i < rawRecords.length; i++) { let rawRec = rawRecords[i].value; let obj = { dateStamp: rawRec.dateStamp && rawRec.dateStamp.date, fileIdentifier: rawRec.fileIdentifier && rawRec.fileIdentifier.characterString && rawRec.fileIdentifier.characterString.value, identificationInfo: rawRec.abstractMDIdentification && rawRec.abstractMDIdentification.value }; if (rawRec.boundingBox) { let bbox; let crs; let el; if (Array.isArray(rawRec.boundingBox)) { el = _.head(rawRec.boundingBox); } else { el = rawRec.boundingBox; } if (el && el.value) { let lc = el.value.lowerCorner; let uc = el.value.upperCorner; bbox = [lc[1], lc[0], uc[1], uc[0]]; // TODO parse the extent's crs let crsCode = el.value.crs.split(":::")[1]; if (crsCode === "WGS 1984") { crs = "EPSG:4326"; } else if (crsCode) { // TODO check is valid EPSG code crs = "EPSG:" + crsCode; } else { crs = "EPSG:4326"; } } obj.boundingBox = { extent: bbox, crs: crs }; } let dcElement = rawRec.dcElement; if (dcElement) { let dc = { references: [] }; for (let j = 0; j < dcElement.length; j++) { let dcel = dcElement[j]; let elName = dcel.name.localPart; let finalEl = {}; /* Some services (e.g. GeoServer ) support http://schemas.opengis.net/csw/2.0.2/record.xsd only * Usually they publish the WMS URL at dct:"references" with scheme=OGC:WMS * So we place references as they are. */ if (elName === "references" && dcel.value) { let urlString = dcel.value.content && dcel.value.content[0] || dcel.value.content || dcel.value; finalEl = { value: urlString, scheme: dcel.value.scheme }; } else { finalEl = dcel.value.content && dcel.value.content[0] || dcel.value.content || dcel.value; } if (dc[elName] && Array.isArray(dc[elName])) { dc[elName].push(finalEl); } else if (dc[elName]) { dc[elName] = [dc[elName], finalEl]; } else { dc[elName] = finalEl; } } obj.dc = dc; } records.push(obj); } } result.records = records; return result; } } return null; })); }); }); }, textSearch: function(url, startPosition, maxRecords, text) { return new Promise((resolve) => { require.ensure(['../utils/ogc/CSW', '../utils/ogc/Filter'], () => { const {Filter} = require('../utils/ogc/Filter'); // creates a request like this: // <ogc:PropertyName>apiso:AnyText</ogc:PropertyName><ogc:Literal>%a%</ogc:Literal></ogc:PropertyIsLike> let filter = null; if (text) { let ops = Filter.propertyIsLike("csw:AnyText", "%" + text + "%"); filter = Filter.filter(ops); } resolve(Api.getRecords(url, startPosition, maxRecords, filter)); }); }); } }; module.exports = Api;
{ "content_hash": "fb2eca608c3c4241f957534107adf07e", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 170, "avg_line_length": 59.7593984962406, "alnum_prop": 0.3223452440865627, "repo_name": "nmco/MapStore2", "id": "c6f6c1b76d06b61c6627d12eb679d72be69ea246", "size": "8151", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/client/api/CSW.js", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "56949" }, { "name": "HTML", "bytes": "30271" }, { "name": "JavaScript", "bytes": "1993294" }, { "name": "Shell", "bytes": "71" } ], "symlink_target": "" }
namespace ROCKSDB_NAMESPACE { // The helper function to assert the move from dynamic_cast<> to // static_cast<> is correct. This function is to deal with legacy code. // It is not recommanded to add new code to issue class casting. The preferred // solution is to implement the functionality without a need of casting. template <class DestClass, class SrcClass> inline DestClass* static_cast_with_check(SrcClass* x) { DestClass* ret = static_cast<DestClass*>(x); #ifdef ROCKSDB_USE_RTTI assert(ret == dynamic_cast<DestClass*>(x)); #endif return ret; } } // namespace ROCKSDB_NAMESPACE
{ "content_hash": "86d7e7fe0f11f1736570dab0fb7fc232", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 42.285714285714285, "alnum_prop": 0.75, "repo_name": "graetzer/arangodb", "id": "d7d9a9e9c2dcbe7eb1d60a77800b098b5f91d83c", "size": "869", "binary": false, "copies": "4", "ref": "refs/heads/devel", "path": "3rdParty/rocksdb/6.8/util/cast_util.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "391227" }, { "name": "Awk", "bytes": "4272" }, { "name": "Batchfile", "bytes": "63025" }, { "name": "C", "bytes": "7952921" }, { "name": "C#", "bytes": "96431" }, { "name": "C++", "bytes": "274543069" }, { "name": "CMake", "bytes": "646773" }, { "name": "CSS", "bytes": "1054160" }, { "name": "Cuda", "bytes": "52444" }, { "name": "DIGITAL Command Language", "bytes": "259402" }, { "name": "Emacs Lisp", "bytes": "14637" }, { "name": "Fortran", "bytes": "1856" }, { "name": "Groovy", "bytes": "131" }, { "name": "HTML", "bytes": "2215528" }, { "name": "Java", "bytes": "922156" }, { "name": "JavaScript", "bytes": "53300241" }, { "name": "LLVM", "bytes": "24129" }, { "name": "Lex", "bytes": "1231" }, { "name": "Lua", "bytes": "17899" }, { "name": "M4", "bytes": "575204" }, { "name": "Makefile", "bytes": "492694" }, { "name": "Max", "bytes": "36857" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "28404" }, { "name": "Objective-C", "bytes": "18435" }, { "name": "Objective-C++", "bytes": "2503" }, { "name": "PHP", "bytes": "107274" }, { "name": "Pascal", "bytes": "150599" }, { "name": "Perl", "bytes": "564374" }, { "name": "Perl6", "bytes": "9918" }, { "name": "Python", "bytes": "4527647" }, { "name": "QMake", "bytes": "16692" }, { "name": "R", "bytes": "5123" }, { "name": "Rebol", "bytes": "354" }, { "name": "Roff", "bytes": "1007604" }, { "name": "Ruby", "bytes": "929950" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "424800" }, { "name": "Swift", "bytes": "116" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "32117" }, { "name": "Visual Basic", "bytes": "11568" }, { "name": "XSLT", "bytes": "551977" }, { "name": "Yacc", "bytes": "53072" } ], "symlink_target": "" }
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team on github. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
{ "content_hash": "cc435888de0d56a5db6a0aaaf1e95c9a", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 87, "avg_line_length": 45.114285714285714, "alnum_prop": 0.8214059531348955, "repo_name": "jlusthaus/applican-", "id": "7f8d618df261728ce7dde88943c76f27230987e5", "size": "3213", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CODE_OF_CONDUCT.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "61689" }, { "name": "HTML", "bytes": "251" }, { "name": "JavaScript", "bytes": "68367" } ], "symlink_target": "" }
$packageName = 'sandboxie.beta' $installerType = 'EXE' $url = 'http://www.sandboxie.com/SandboxieInstall32-413-3.exe' $url64 = 'http://www.sandboxie.com/SandboxieInstall64-413-3.exe' $silentArgs = '/install /S /D=C:\Program Files\Sandboxie' Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64"
{ "content_hash": "bca3e2bdad4eb1a53f33cbd75b49df23", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 87, "avg_line_length": 47.285714285714285, "alnum_prop": 0.7341389728096677, "repo_name": "dtgm/chocolatey-packages", "id": "a841bab669c63b0dadc008c9aa6894f964a4c0d2", "size": "333", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "automatic/_output/sandboxie.beta/4.13.3/tools/chocolateyInstall.ps1", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AutoHotkey", "bytes": "347616" }, { "name": "AutoIt", "bytes": "13530" }, { "name": "Batchfile", "bytes": "1404" }, { "name": "C#", "bytes": "8134" }, { "name": "HTML", "bytes": "80818" }, { "name": "PowerShell", "bytes": "13124493" } ], "symlink_target": "" }
package com.ctrip.xpipe.redis.keeper.handler.keeper; import com.ctrip.xpipe.redis.core.protocal.CAPA; import com.ctrip.xpipe.redis.core.protocal.cmd.DefaultPsync; import com.ctrip.xpipe.redis.core.protocal.protocal.SimpleStringParser; import com.ctrip.xpipe.redis.core.store.ReplicationStore; import com.ctrip.xpipe.redis.keeper.KeeperRepl; import com.ctrip.xpipe.redis.keeper.RedisClient; import com.ctrip.xpipe.redis.keeper.RedisKeeperServer; import com.ctrip.xpipe.redis.keeper.RedisSlave; import com.ctrip.xpipe.redis.keeper.config.KeeperConfig; import com.ctrip.xpipe.redis.core.store.OffsetReplicationProgress; import com.ctrip.xpipe.redis.keeper.handler.keeper.AbstractSyncCommandHandler; import java.io.IOException; import static com.ctrip.xpipe.redis.core.protocal.Psync.KEEPER_PARTIAL_SYNC_OFFSET; /** * @author wenchao.meng * * 2016年4月22日 上午11:49:02 */ public class PsyncHandler extends AbstractSyncCommandHandler { public static final int WAIT_OFFSET_TIME_MILLI = 60 * 1000; @Override protected RedisSlave becomeSlave(RedisClient<?> redisClient) { return redisClient.becomeSlave(); } protected void innerDoHandle(final String[] args, final RedisSlave redisSlave, RedisKeeperServer redisKeeperServer) { KeeperConfig keeperConfig = redisKeeperServer.getKeeperConfig(); KeeperRepl keeperRepl = redisKeeperServer.getKeeperRepl(); Long offsetRequest = Long.valueOf(args[1]); String replIdRequest = args[0]; if(replIdRequest.equals("?")){ if (redisSlave.isKeeper() && offsetRequest.equals(KEEPER_PARTIAL_SYNC_OFFSET) && null != keeperRepl.replId()) { logger.info("[innerDoHandler][keeper psync]"); long continueOffset = keeperRepl.getEndOffset() + 1; // continue from next byte doKeeperPartialSync(redisSlave, keeperRepl.replId(), continueOffset); } else { doFullSync(redisSlave); } }else if(replIdRequest.equals(keeperRepl.replId()) || (replIdRequest.equals(keeperRepl.replId2()) && offsetRequest <= keeperRepl.secondReplIdOffset())){ Long beginOffset = keeperRepl.getBeginOffset(); Long endOffset = keeperRepl.getEndOffset(); if(offsetRequest < beginOffset){ logger.info("[innerDoHandle][offset < beginOffset][begin, end, request]{}, {}, {}" , beginOffset , endOffset, offsetRequest); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increatePartialSyncError(); doFullSync(redisSlave); }else if(offsetRequest > endOffset +1){ logger.info("[innerDoHandle][wait for offset]{}, {} > {} + 1", redisSlave, offsetRequest, endOffset); waitForoffset(args, redisSlave, keeperRepl.replId(), offsetRequest); }else{ if(endOffset - offsetRequest < keeperConfig.getReplicationStoreMaxCommandsToTransferBeforeCreateRdb()) { logger.info("[innerDoHandle][do partial sync]{}, {} - {} < {}", redisSlave, endOffset, offsetRequest, keeperConfig.getReplicationStoreMaxCommandsToTransferBeforeCreateRdb()); doPartialSync(redisSlave, keeperRepl.replId(), offsetRequest); } else { logger.info("[innerDoHandle][too much commands to transfer]{} - {} < {}", endOffset, offsetRequest, keeperConfig.getReplicationStoreMaxCommandsToTransferBeforeCreateRdb()); redisSlave.getRedisServer().getKeeperMonitor().getKeeperStats().increatePartialSyncError(); doFullSync(redisSlave); } } }else{ logger.info("current repl info: {}", keeperRepl); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increatePartialSyncError(); doFullSync(redisSlave); } } protected void waitForoffset(final String[] args, final RedisSlave redisSlave, String replId, final Long offsetRequest) { try { ReplicationStore replicationStore = ((RedisKeeperServer)redisSlave.getRedisServer()).getReplicationStore(); logger.info("[waitForoffset][begin wait]{}", redisSlave); boolean result = replicationStore.awaitCommandsOffset(offsetRequest - replicationStore.beginOffsetWhenCreated() - 1, WAIT_OFFSET_TIME_MILLI); if(result){ logger.info("[waitForoffset][wait succeed]{}", redisSlave); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increaseWaitOffsetSucceed(); doPartialSync(redisSlave, replId, offsetRequest); return; } } catch (InterruptedException e) { logger.error("[waitForoffset]" + redisSlave, e); }catch(Exception e){ logger.error("[waitForoffset][failed]", e); try { redisSlave.close(); } catch (IOException e1) { logger.error("[waitForoffset][close slave]" + redisSlave, e); } return; } logger.info("[run][offset wait failed]{}", redisSlave); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increasWaitOffsetFail(); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increatePartialSyncError(); doFullSync(redisSlave); } protected void doPartialSync(RedisSlave redisSlave, String replId, Long offset) { if(logger.isInfoEnabled()){ logger.info("[doPartialSync]" + redisSlave); } SimpleStringParser simpleStringParser = null; if(!redisSlave.capaOf(CAPA.PSYNC2)){ simpleStringParser = new SimpleStringParser(DefaultPsync.PARTIAL_SYNC); }else{ simpleStringParser = new SimpleStringParser(String.format("%s %s", DefaultPsync.PARTIAL_SYNC, replId)); } redisSlave.sendMessage(simpleStringParser.format()); redisSlave.markPsyncProcessed(); redisSlave.beginWriteCommands(new OffsetReplicationProgress(offset)); redisSlave.partialSync(); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increatePartialSync(); } protected void doKeeperPartialSync(RedisSlave redisSlave, String replId, long continueOffset) { SimpleStringParser simpleStringParser = new SimpleStringParser(String.format("%s %s %d", DefaultPsync.PARTIAL_SYNC, replId, continueOffset)); redisSlave.sendMessage(simpleStringParser.format()); redisSlave.markPsyncProcessed(); redisSlave.beginWriteCommands(new OffsetReplicationProgress(continueOffset)); redisSlave.partialSync(); ((RedisKeeperServer)redisSlave.getRedisServer()).getKeeperMonitor().getKeeperStats().increatePartialSync(); } @Override public String[] getCommands() { return new String[]{"psync"}; } }
{ "content_hash": "67a43ea365e3db8e21fd6efc476f39e0", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 179, "avg_line_length": 42.62837837837838, "alnum_prop": 0.7574893009985735, "repo_name": "ctripcorp/x-pipe", "id": "268d1062e3ead41ca21e835023e231fa4785cc5b", "size": "6319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "redis/redis-keeper/src/main/java/com/ctrip/xpipe/redis/keeper/handler/keeper/PsyncHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1933" }, { "name": "Dockerfile", "bytes": "1061" }, { "name": "HTML", "bytes": "182469" }, { "name": "Java", "bytes": "9045838" }, { "name": "JavaScript", "bytes": "1615" }, { "name": "Python", "bytes": "10427" }, { "name": "Shell", "bytes": "73728" }, { "name": "TypeScript", "bytes": "235225" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Web; namespace Pinata { public static class StringExtension { private static readonly Regex WebUrlExpression = new Regex(@"(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", RegexOptions.Singleline | RegexOptions.Compiled); private static readonly Regex EmailExpression = new Regex(@"^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", RegexOptions.Singleline | RegexOptions.Compiled); private static readonly Regex StripHTMLExpression = new Regex("<\\S[^><]*>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled); private static readonly char[] IllegalUrlCharacters = new[] { ';', '/', '\\', '?', ':', '@', '&', '=', '+', '$', ',', '<', '>', '#', '%', '.', '!', '*', '\'', '"', '(', ')', '[', ']', '{', '}', '|', '^', '`', '~', '–', '‘', '’', '“', '”', '»', '«' }; [DebuggerStepThrough] public static bool IsWebUrl(this string target) { return !string.IsNullOrEmpty(target) && WebUrlExpression.IsMatch(target); } [DebuggerStepThrough] public static bool IsEmail(this string target) { return !string.IsNullOrEmpty(target) && EmailExpression.IsMatch(target); } [DebuggerStepThrough] public static string NullSafe(this string target) { return (target ?? string.Empty).Trim(); } [DebuggerStepThrough] public static string FormatWith(this string target, params object[] args) { Check.Argument.IsNotEmpty(target, "target"); return string.Format(Constants.CurrentCulture, target, args); } [DebuggerStepThrough] public static string FormatWith(this string target, IFormatProvider formatProvider, params object[] args) { Check.Argument.IsNotEmpty(target, "target"); return string.Format(formatProvider, target, args); } [DebuggerStepThrough] public static string Hash(this string target) { Check.Argument.IsNotEmpty(target, "target"); using (MD5 md5 = MD5.Create()) { byte[] data = Encoding.Unicode.GetBytes(target); byte[] hash = md5.ComputeHash(data); var sb = new StringBuilder(); for (int i = 0; i < hash.Length; i++) { sb.Append(hash[i].ToString("x2")); } return sb.ToString(); } } [DebuggerStepThrough] public static string Hash(this string target, bool base64) { if (!base64) return target.Hash(); Check.Argument.IsNotEmpty(target, "target"); using (MD5 md5 = MD5.Create()) { byte[] data = Encoding.Unicode.GetBytes(target); byte[] hash = md5.ComputeHash(data); return Convert.ToBase64String(hash); } } [DebuggerStepThrough] public static string WrapAt(this string target, int index) { const int DotCount = 3; Check.Argument.IsNotEmpty(target, "target"); Check.Argument.IsNotNegativeOrZero(index, "index"); return (target.Length <= index) ? target : string.Concat(target.Substring(0, index - DotCount), new string('.', DotCount)); } [DebuggerStepThrough] public static string StripHtml(this string target) { return StripHTMLExpression.Replace(target, string.Empty); } [DebuggerStepThrough] public static Guid ToGuid(this string target) { Guid result = Guid.Empty; if ((!string.IsNullOrEmpty(target)) && (target.Trim().Length == 22)) { string encoded = string.Concat(target.Trim().Replace("-", "+").Replace("_", "/"), "=="); try { byte[] base64 = Convert.FromBase64String(encoded); result = new Guid(base64); } catch (FormatException) { } } return result; } [DebuggerStepThrough] public static T ToEnum<T>(this string target, T defaultValue) where T : IComparable, IFormattable { T convertedValue = defaultValue; if (!string.IsNullOrEmpty(target)) { try { convertedValue = (T)Enum.Parse(typeof(T), target.Trim(), true); } catch (ArgumentException) { } } return convertedValue; } [DebuggerStepThrough] public static string RemoveDiacritics(this string target) { string strFormD = target.Normalize(NormalizationForm.FormD); StringBuilder sb = new StringBuilder(); for (int ich = 0; ich < strFormD.Length; ich++) { UnicodeCategory uc = CharUnicodeInfo.GetUnicodeCategory(strFormD[ich]); if (uc != UnicodeCategory.NonSpacingMark) { sb.Append(strFormD[ich]); } } return sb.ToString().Normalize(NormalizationForm.FormC); } [DebuggerStepThrough] public static string StringNormalized(this string target) { if (string.IsNullOrEmpty(target)) { return target; } target = target.Trim().ToLower().RemoveDiacritics(); if (target.IndexOfAny(IllegalUrlCharacters) > -1) { foreach (char character in IllegalUrlCharacters) { target = target.Replace(character.ToString(Constants.CurrentCulture), string.Empty); } } target = target.Replace(" ", "-"); while (target.Contains("--")) { target = target.Replace("--", "-"); } return target; } [DebuggerStepThrough] public static string UrlEncode(this string target) { return HttpUtility.UrlEncode(target); } [DebuggerStepThrough] public static string UrlDecode(this string target) { return HttpUtility.UrlDecode(target); } [DebuggerStepThrough] public static string AttributeEncode(this string target) { return HttpUtility.HtmlAttributeEncode(target); } [DebuggerStepThrough] public static string HtmlEncode(this string target) { return HttpUtility.HtmlEncode(target); } [DebuggerStepThrough] public static string HtmlDecode(this string target) { return HttpUtility.HtmlDecode(target); } [DebuggerStepThrough] public static string Replace(this string target, ICollection<string> oldValues, string newValue) { oldValues.ForEach(oldValue => target = target.Replace(oldValue, newValue)); return target; } [DebuggerStepThrough] public static string TitleCase(this string text) { CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; return textInfo.ToTitleCase(text); } [DebuggerStepThrough] public static bool IsCPF(this string cpf) { if (cpf == null) return false; cpf = cpf.Replace(".", String.Empty).Replace("-", String.Empty).Trim(); if (cpf.Length != 11) return false; switch (cpf) { case "00000000000": case "11111111111": case "22222222222": case "33333333333": case "44444444444": case "55555555555": case "66666666666": case "77777777777": case "88888888888": case "99999999999": return false; } int soma = 0; for (int i = 0, j = 10, d; i < 9; i++, j--) { if (!Int32.TryParse(cpf[i].ToString(), out d)) return false; soma += d * j; } int resto = soma % 11; string digito = (resto < 2 ? 0 : 11 - resto).ToString(); string prefixo = cpf.Substring(0, 9) + digito; soma = 0; for (int i = 0, j = 11; i < 10; i++, j--) soma += Int32.Parse(prefixo[i].ToString()) * j; resto = soma % 11; digito += (resto < 2 ? 0 : 11 - resto).ToString(); return cpf.EndsWith(digito, StringComparison.CurrentCulture); } [DebuggerStepThrough] public static int DigitoVerificador(this string target) { int multiplicador = 2; int somaResultados = 0; for (int i = target.Length - 1; i >= 0; i--) { somaResultados += int.Parse(target[i].ToString()) * multiplicador++; if (multiplicador == 10) multiplicador = 2; } int restoDivisao = somaResultados % 11; int dv = 11 - restoDivisao; return (dv > 9) ? 0 : dv; } [DebuggerStepThrough] public static int LevenshteinDistance(this string target, string text) { int n = target.Length; int m = text.Length; int[,] d = new int[n + 1, m + 1]; // Step 1 if (n == 0) { return m; } if (m == 0) { return n; } // Step 2 for (int i = 0; i <= n; d[i, 0] = i++) { } for (int j = 0; j <= m; d[0, j] = j++) { } // Step 3 for (int i = 1; i <= n; i++) { //Step 4 for (int j = 1; j <= m; j++) { // Step 5 int cost = (text[j - 1] == target[i - 1]) ? 0 : 1; // Step 6 d[i, j] = System.Math.Min(System.Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), d[i - 1, j - 1] + cost); } } // Step 7 return d[n, m]; } [DebuggerStepThrough] public static string RemoveAllSpaces(this string target) { return Regex.Replace(target, @"\s+", string.Empty).ToLower(); } [DebuggerStepThrough] public static string RemoveSpecialCharacters(this string target) { target = target.Normalize(NormalizationForm.FormD); StringBuilder sb = new StringBuilder(); foreach (char c in target.ToCharArray()) { if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) { sb.Append(c); } } return sb.ToString(); } } }
{ "content_hash": "e30e630c195219b27cc93abdef98b8fc", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 258, "avg_line_length": 30.70418848167539, "alnum_prop": 0.4971438315286896, "repo_name": "rmattos/Pinata", "id": "468336e27d3765bf1563d23403dc9280eeb1f31e", "size": "11743", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Pinata.Core/Extension/StringExtension.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "96500" }, { "name": "PowerShell", "bytes": "14896" } ], "symlink_target": "" }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-m-rel-xr-w32-bld/build/embedding/browser/webBrowser/nsITooltipListener.idl */ #ifndef __gen_nsITooltipListener_h__ #define __gen_nsITooltipListener_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsITooltipListener */ #define NS_ITOOLTIPLISTENER_IID_STR "44b78386-1dd2-11b2-9ad2-e4eee2ca1916" #define NS_ITOOLTIPLISTENER_IID \ {0x44b78386, 0x1dd2, 0x11b2, \ { 0x9a, 0xd2, 0xe4, 0xee, 0xe2, 0xca, 0x19, 0x16 }} class NS_NO_VTABLE NS_SCRIPTABLE nsITooltipListener : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITOOLTIPLISTENER_IID) /* void onShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */ NS_SCRIPTABLE NS_IMETHOD OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar * aTipText) = 0; /* void onHideTooltip (); */ NS_SCRIPTABLE NS_IMETHOD OnHideTooltip(void) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsITooltipListener, NS_ITOOLTIPLISTENER_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSITOOLTIPLISTENER \ NS_SCRIPTABLE NS_IMETHOD OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar * aTipText); \ NS_SCRIPTABLE NS_IMETHOD OnHideTooltip(void); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSITOOLTIPLISTENER(_to) \ NS_SCRIPTABLE NS_IMETHOD OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar * aTipText) { return _to OnShowTooltip(aXCoords, aYCoords, aTipText); } \ NS_SCRIPTABLE NS_IMETHOD OnHideTooltip(void) { return _to OnHideTooltip(); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSITOOLTIPLISTENER(_to) \ NS_SCRIPTABLE NS_IMETHOD OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar * aTipText) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnShowTooltip(aXCoords, aYCoords, aTipText); } \ NS_SCRIPTABLE NS_IMETHOD OnHideTooltip(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHideTooltip(); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsTooltipListener : public nsITooltipListener { public: NS_DECL_ISUPPORTS NS_DECL_NSITOOLTIPLISTENER nsTooltipListener(); private: ~nsTooltipListener(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsTooltipListener, nsITooltipListener) nsTooltipListener::nsTooltipListener() { /* member initializers and constructor code */ } nsTooltipListener::~nsTooltipListener() { /* destructor code */ } /* void onShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */ NS_IMETHODIMP nsTooltipListener::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar * aTipText) { return NS_ERROR_NOT_IMPLEMENTED; } /* void onHideTooltip (); */ NS_IMETHODIMP nsTooltipListener::OnHideTooltip() { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsITooltipListener_h__ */
{ "content_hash": "109e295269fd052fabd73793771e3bac", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 198, "avg_line_length": 32.36893203883495, "alnum_prop": 0.7489502099580084, "repo_name": "bwp/SeleniumWebDriver", "id": "477f3383e9b4f0e9fc2e3c437635a1f9d617aff8", "size": "3334", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "third_party/gecko-10/win32/include/nsITooltipListener.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "22162" }, { "name": "C", "bytes": "302788" }, { "name": "C#", "bytes": "2090580" }, { "name": "C++", "bytes": "771128" }, { "name": "Java", "bytes": "7874195" }, { "name": "JavaScript", "bytes": "14218193" }, { "name": "Objective-C", "bytes": "368823" }, { "name": "Python", "bytes": "634315" }, { "name": "Ruby", "bytes": "757466" }, { "name": "Shell", "bytes": "6429" } ], "symlink_target": "" }
package org.algo.matrix.task.iterative; import static org.algo.constant.PrimitiveMath.*; import java.util.List; import org.algo.RecoverableCondition; import org.algo.access.Access2D; import org.algo.access.Structure1D; import org.algo.function.PrimitiveFunction; import org.algo.matrix.store.MatrixStore; import org.algo.matrix.store.PhysicalStore; import org.algo.matrix.store.PrimitiveDenseStore; import org.algo.type.context.NumberContext; /** * A (Jacobi) preconditioned conjugate gradient solver. * * @author apete */ public final class ConjugateGradientSolver extends KrylovSubspaceSolver implements IterativeSolverTask.SparseDelegate { private transient PrimitiveDenseStore myDirection = null; private transient PrimitiveDenseStore myPreconditioned = null; private transient PrimitiveDenseStore myResidual = null; private transient PrimitiveDenseStore myVector = null; public ConjugateGradientSolver() { super(); } public double resolve(final List<Equation> equations, final PhysicalStore<Double> solution) { final int tmpCountRows = equations.size(); double tmpNormErr = POSITIVE_INFINITY; double tmpNormRHS = ONE; final PrimitiveDenseStore tmpResidual = this.residual(solution); final PrimitiveDenseStore tmpDirection = this.direction(solution); final PrimitiveDenseStore tmpPreconditioned = this.preconditioned(solution); final PrimitiveDenseStore tmpVector = this.vector(solution); double tmpStepLength; double tmpGradientCorrectionFactor; double zr0 = 1; double zr1 = 1; double pAp0 = 0; for (int r = 0; r < tmpCountRows; r++) { final Equation tmpRow = equations.get(r); double tmpVal = tmpRow.getRHS(); tmpNormRHS = PrimitiveFunction.HYPOT.invoke(tmpNormRHS, tmpVal); tmpVal -= tmpRow.dot(solution); tmpResidual.set(tmpRow.index, tmpVal); tmpPreconditioned.set(tmpRow.index, tmpVal / tmpRow.getPivot()); // precondition } tmpDirection.fillMatching(tmpPreconditioned); // tmpPreconditioned.supplyNonZerosTo(tmpDirection); int tmpIterations = 0; final int tmpLimit = this.getIterationsLimit(); final NumberContext tmpCntxt = this.getAccuracyContext(); // zr1 = tmpPreconditioned.transpose().multiply(tmpResidual).doubleValue(0L); zr1 = tmpPreconditioned.dot(tmpResidual); do { zr0 = zr1; for (int i = 0; i < tmpCountRows; i++) { final Equation tmpRow = equations.get(i); final double tmpVal = tmpRow.dot(tmpDirection); tmpVector.set(tmpRow.index, tmpVal); } // pAp0 = tmpVector.multiplyLeft(tmpDirection.transpose()).get().doubleValue(0L); pAp0 = tmpDirection.dot(tmpVector); tmpStepLength = zr0 / pAp0; if (!Double.isNaN(tmpStepLength)) { // solution.maxpy(tmpStepLength, tmpDirection); tmpDirection.axpy(tmpStepLength, solution); // tmpResidual.maxpy(-tmpStepLength, tmpVector); tmpVector.axpy(-tmpStepLength, tmpResidual); } tmpNormErr = ZERO; for (int r = 0; r < tmpCountRows; r++) { final Equation tmpRow = equations.get(r); final double tmpValue = tmpResidual.doubleValue(tmpRow.index); tmpNormErr = PrimitiveFunction.HYPOT.invoke(tmpNormErr, tmpValue); tmpPreconditioned.set(tmpRow.index, tmpValue / tmpRow.getPivot()); } zr1 = tmpPreconditioned.dot(tmpResidual); tmpGradientCorrectionFactor = zr1 / zr0; tmpDirection.modifyAll(PrimitiveFunction.MULTIPLY.second(tmpGradientCorrectionFactor)); tmpDirection.modifyMatching(PrimitiveFunction.ADD, tmpPreconditioned); tmpIterations++; if (this.isDebugPrinterSet()) { this.debug(tmpIterations, solution); } } while ((tmpIterations < tmpLimit) && !Double.isNaN(tmpNormErr) && !tmpCntxt.isSmall(tmpNormRHS, tmpNormErr)); // BasicLogger.debug("Done in {} iterations on problem size {}", tmpIterations, current.count()); return tmpNormErr / tmpNormRHS; } public MatrixStore<Double> solve(final Access2D<?> body, final Access2D<?> rhs, final PhysicalStore<Double> preallocated) throws RecoverableCondition { final List<Equation> tmpRows = IterativeSolverTask.toListOfRows(body, rhs); this.resolve(tmpRows, preallocated); return preallocated; } private PrimitiveDenseStore direction(final Structure1D structure) { if ((myDirection == null) || (myDirection.count() != structure.count())) { myDirection = PrimitiveDenseStore.FACTORY.makeZero(structure.count(), 1L); } else { myDirection.fillAll(ZERO); } return myDirection; } private PrimitiveDenseStore preconditioned(final Structure1D structure) { if ((myPreconditioned == null) || (myPreconditioned.count() != structure.count())) { myPreconditioned = PrimitiveDenseStore.FACTORY.makeZero(structure.count(), 1L); } else { myPreconditioned.fillAll(ZERO); } return myPreconditioned; } private PrimitiveDenseStore residual(final Structure1D structure) { if ((myResidual == null) || (myResidual.count() != structure.count())) { myResidual = PrimitiveDenseStore.FACTORY.makeZero(structure.count(), 1L); } else { myResidual.fillAll(ZERO); } return myResidual; } private PrimitiveDenseStore vector(final Structure1D structure) { if ((myVector == null) || (myVector.count() != structure.count())) { myVector = PrimitiveDenseStore.FACTORY.makeZero(structure.count(), 1L); } else { myVector.fillAll(ZERO); } return myVector; } }
{ "content_hash": "cb55b0d5022fc2ea897033c1172e20f4", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 155, "avg_line_length": 36.365269461077844, "alnum_prop": 0.6515725341676272, "repo_name": "saurabhse/hybo", "id": "858dcba75c332140fcdf6399d951d8a30363fab8", "size": "7208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/algo/matrix/task/iterative/ConjugateGradientSolver.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "6304" }, { "name": "CSS", "bytes": "123" }, { "name": "HTML", "bytes": "48560" }, { "name": "Java", "bytes": "3280303" }, { "name": "JavaScript", "bytes": "988381" }, { "name": "Ruby", "bytes": "161" }, { "name": "Shell", "bytes": "7909" } ], "symlink_target": "" }
package io.opencensus.contrib.http.util; import io.opencensus.trace.propagation.TextFormat; /** * Utility class to get all supported {@link TextFormat}. * * @since 0.11.0 */ public class HttpPropagationUtil { private HttpPropagationUtil() {} /** * Returns the Stack Driver format implementation. The header specification for this format is * "X-Cloud-Trace-Context: &lt;TRACE_ID&gt;/&lt;SPAN_ID&gt;[;o=&lt;TRACE_TRUE&gt;]". See this <a * href="https://cloud.google.com/trace/docs/support">page</a> for more information. * * @since 0.11.0 * @return the Stack Driver format. */ public static TextFormat getCloudTraceFormat() { return new CloudTraceFormat(); } }
{ "content_hash": "a2aade36daf286e5a220294821de0b1b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 98, "avg_line_length": 26.037037037037038, "alnum_prop": 0.6941678520625889, "repo_name": "sebright/opencensus-java", "id": "779be8d84f998d40c5f5c1531b43c6dcf095cfb8", "size": "1305", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "contrib/http_util/src/main/java/io/opencensus/contrib/http/util/HttpPropagationUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "649" }, { "name": "Java", "bytes": "2936255" }, { "name": "Python", "bytes": "1726" }, { "name": "Shell", "bytes": "4366" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <sem:triples xmlns:sem="http://marklogic.com/semantics"> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</sem:predicate> <sem:object datatype="sem:iri">http://www.w3.org/2004/02/skos/core#Concept</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate> <sem:object xml:lang="eng" datatype="xsd:string">United Order</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.lds.org/core#partOfSpeech</sem:predicate> <sem:object xml:lang="eng" datatype="xsd:string">noun</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.lds.org/core#entityType</sem:predicate> <sem:object datatype="sem:iri">http://www.schema.org/Organization</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.lds.org/core#instanceOf</sem:predicate> <sem:object datatype="xsd:anyURI">http://www.lds.org/scriptures/triple-index/united-order?lang=eng</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.lds.org/core#instanceOf</sem:predicate> <sem:object datatype="xsd:anyURI">http://www.lds.org/scriptures/gs/united-order</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#definition</sem:predicate> <sem:object xml:lang="eng" datatype="xsd:string">An organization through which the Saints in the early days of the restored Church sought to live the law of consecration. Individuals shared property, goods, and profits, receiving these things according to their wants and needs (; ; ).</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#related</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept/gs/consecrate</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/guide-to-the-scriptures</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/concept/gs/united-order</sem:subject> <sem:predicate>http://www.lds.org/core#relCount</sem:predicate> <sem:object datatype="xsd:integer">1</sem:object> </sem:triple> </sem:triples>
{ "content_hash": "517296c4385cc98d1e2b757c42abd18b", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 302, "avg_line_length": 56.716981132075475, "alnum_prop": 0.7105788423153693, "repo_name": "freshie/ml-taxonomies", "id": "0175f66bcfee01b7ed4f9b63bcf02bb5fb7018e8", "size": "3006", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/taxonomies/doctrine/gs/united-order.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4422" }, { "name": "CSS", "bytes": "38665" }, { "name": "HTML", "bytes": "356" }, { "name": "JavaScript", "bytes": "411651" }, { "name": "Ruby", "bytes": "259121" }, { "name": "Shell", "bytes": "7329" }, { "name": "XQuery", "bytes": "857170" }, { "name": "XSLT", "bytes": "13753" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <link href="bootstrap/css/bootstrap.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="css/calendar.css" /> <link href="css/nonzeroday.css" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <title>Non Zero Day</title> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-47004170-1', 'nonzeroday.herokuapp.com'); ga('send', 'pageview'); </script> </head> <body > <nav class="navbar navbar-default navbar-static-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">Non Zero Day</a> </div> <div class="collapse navbar-collapse" id="nav-collapse"> <ul class="nav navbar-nav"> <li><a href="/about">About</a></li> </ul> </div> </nav> <div class="container"> <h3> How to follow Non Zero Day </h3> <ol> <li>No More Zero Days <ul> <li>Promise yourself that you will do one thing every day that takes you one step closer to your goal(s)</li> </ul> </li> <li>Be Grateful to the Three "You"s <ul> <li>Past Self: Thank your past self for the favours they did for you</li> <li>Present Self: Do your future self a favour - they deserve it!</li> <li>Future Self: Your absolute best friend, and a great person.</li> </ul> </li> <li>Forgive Yourself <ul> <li>It's okay to mess up. Forgive your past self, and be a better friend for your future self.</li> </ul> </li> </li> <li>Exercise and Books <ul> <li>Get your heart rate up and try to read when you can. Also the easiest way to avoid a Zero Day! </li> </ul> </li> </ol> </div> </body> <script src="js/jquery.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> </html>
{ "content_hash": "4af78619cb54490b00abbb52756e34a5", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 120, "avg_line_length": 35.94285714285714, "alnum_prop": 0.6021462639109698, "repo_name": "wyegelwel/nonzeroday", "id": "7d4ce49678915f967b000e242364004a5cb6dcf5", "size": "2516", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "views/about.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6894" }, { "name": "JavaScript", "bytes": "18292" } ], "symlink_target": "" }
package org.mifos.application.servicefacade; import java.math.BigDecimal; import org.mifos.accounts.util.helpers.AccountState; import org.mifos.framework.util.helpers.Constants; /** * */ public class CollectionSheetCustomerLoanDto { private Integer customerId; private Integer accountId; private Short accountStateId; private String productShortName; private Short productId; private Short currencyId; private BigDecimal principalDue = BigDecimal.ZERO; private BigDecimal principalPaid = BigDecimal.ZERO; private BigDecimal interestDue = BigDecimal.ZERO; private BigDecimal interestPaid = BigDecimal.ZERO; private BigDecimal penaltyDue = BigDecimal.ZERO; private BigDecimal penaltyPaid = BigDecimal.ZERO; private BigDecimal miscFeesDue = BigDecimal.ZERO; private BigDecimal miscFeesPaid = BigDecimal.ZERO; private BigDecimal miscPenaltyDue = BigDecimal.ZERO; private BigDecimal miscPenaltyPaid = BigDecimal.ZERO; private Double totalAccountFees = Double.valueOf("0.0"); // disbursement specific private BigDecimal disbursementAmount = BigDecimal.ZERO; private Short payInterestAtDisbursement = Constants.NO; private Double amountDueAtDisbursement = Double.valueOf("0.0"); public CollectionSheetCustomerLoanDto() { // default constructor for hibernate } public Integer getCustomerId() { return this.customerId; } public void setCustomerId(final Integer customerId) { this.customerId = customerId; } public Integer getAccountId() { return this.accountId; } public void setAccountId(final Integer accountId) { this.accountId = accountId; } public String getProductShortName() { return this.productShortName; } public void setProductShortName(final String productShortName) { this.productShortName = productShortName; } public Short getCurrencyId() { return this.currencyId; } public void setCurrencyId(final Short currencyId) { this.currencyId = currencyId; } public void setPrincipalDue(final BigDecimal principalDue) { if (principalDue != null) { this.principalDue = principalDue; } } public void setPrincipalPaid(final BigDecimal principalPaid) { if (principalPaid != null) { this.principalPaid = principalPaid; } } public void setInterestDue(final BigDecimal interestDue) { if (interestDue != null) { this.interestDue = interestDue; } } public void setInterestPaid(final BigDecimal interestPaid) { if (interestPaid != null) { this.interestPaid = interestPaid; } } public void setMiscFeesDue(final BigDecimal miscFeesDue) { if (miscFeesDue != null) { this.miscFeesDue = miscFeesDue; } } public void setMiscFeesPaid(final BigDecimal miscFeesPaid) { if (miscFeesPaid != null) { this.miscFeesPaid = miscFeesPaid; } } public void setMiscPenaltyDue(final BigDecimal miscPenaltyDue) { if (miscPenaltyDue != null) { this.miscPenaltyDue = miscPenaltyDue; } } public void setMiscPenaltyPaid(final BigDecimal miscPenaltyPaid) { if (miscPenaltyPaid != null) { this.miscPenaltyPaid = miscPenaltyPaid; } } public void setPenaltyDue(final BigDecimal penaltyDue) { if (penaltyDue != null) { this.penaltyDue = penaltyDue; } } public void setPenaltyPaid(final BigDecimal penaltyPaid) { if (penaltyPaid != null) { this.penaltyPaid = penaltyPaid; } } public void setTotalAccountFees(final Double totalAccountFees) { if (totalAccountFees != null) { this.totalAccountFees = totalAccountFees; } } public void setDisbursementAmount(final BigDecimal disbursementAmount) { this.disbursementAmount = disbursementAmount; } public Short getPayInterestAtDisbursement() { return this.payInterestAtDisbursement; } public void setPayInterestAtDisbursement(final Short payInterestAtDisbursement) { this.payInterestAtDisbursement = payInterestAtDisbursement; } public Short getAccountStateId() { return this.accountStateId; } public void setAccountStateId(final Short accountStateId) { this.accountStateId = accountStateId; } public Short getProductId() { return this.productId; } public void setProductId(final Short productId) { this.productId = productId; } public Double getAmountDueAtDisbursement() { return this.amountDueAtDisbursement; } public void setAmountDueAtDisbursement(final Double amountDueAtDisbursement) { this.amountDueAtDisbursement = amountDueAtDisbursement; } public Double getTotalRepaymentDue() { return principalDue.doubleValue() + interestDue.doubleValue() + penaltyDue.doubleValue() + miscFeesDue.doubleValue() + miscPenaltyDue.doubleValue() - (principalPaid.doubleValue() + interestPaid.doubleValue() + penaltyPaid.doubleValue() + miscFeesPaid.doubleValue() + miscPenaltyPaid.doubleValue()) + this.totalAccountFees; } public Double getTotalDisbursement() { return disbursementAmount.doubleValue(); } public boolean isDisbursalAccount() { return getAccountStateId().equals(AccountState.LOAN_APPROVED.getValue()) || getAccountStateId().equals(AccountState.LOAN_DISBURSED_TO_LOAN_OFFICER.getValue()); } }
{ "content_hash": "02b32c91158d70cc0ad891c8f5950d28", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 110, "avg_line_length": 29.61025641025641, "alnum_prop": 0.6723242119847592, "repo_name": "vorburger/mifos-head", "id": "46e6e071cc6136fda8fc9c97d3641a2f1d163b1f", "size": "6535", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "application/src/main/java/org/mifos/application/servicefacade/CollectionSheetCustomerLoanDto.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "16482762" }, { "name": "JavaScript", "bytes": "535771" }, { "name": "Python", "bytes": "27237" }, { "name": "Shell", "bytes": "42182" } ], "symlink_target": "" }
module.exports = function() { StructureLink.prototype.transfer = function() { if (this.is_export() && this.energy > 0 && this.cooldown == 0) { var targets = this.room.find(FIND_STRUCTURES, { filter: (structure) => structure.is_link() && structure.is_import() }); if (targets.length > 0) { this.transferEnergy(targets[0]); } } } };
{ "content_hash": "aff43326b25f7ef1bd269617234dea26", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 131, "avg_line_length": 34.083333333333336, "alnum_prop": 0.5427872860635696, "repo_name": "rwampler/screeps", "id": "3da1bf7156f5f78a081f7c3c5ce44ee1c8f11ea3", "size": "410", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/raptor_empire/prototype.structure_link.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "64204" } ], "symlink_target": "" }
package main import ( "errors" "flag" "fmt" "go/build" "os" "os/exec" "path/filepath" "strings" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/mssql" //nolint:staticcheck "gopkg.in/reform.v1/dialects/mysql" "gopkg.in/reform.v1/dialects/postgresql" "gopkg.in/reform.v1/dialects/sqlite3" "gopkg.in/reform.v1/dialects/sqlserver" "gopkg.in/reform.v1/parse" ) var ( initFlags = flag.NewFlagSet("init", flag.ExitOnError) gofmtF = initFlags.Bool("gofmt", true, "Format with gofmt") ) func init() { initFlags.Usage = func() { fmt.Fprintf(os.Stderr, "`init` generates Go model files for existing database schema.\n\n") fmt.Fprintf(os.Stderr, "Usage:\n") fmt.Fprintf(os.Stderr, " %s [global flags] init [init flags] [directory]\n\n", os.Args[0]) fmt.Fprintf(os.Stderr, "Global flags:\n") flag.PrintDefaults() fmt.Fprintf(os.Stderr, "\nInit flags:\n") initFlags.PrintDefaults() fmt.Fprintf(os.Stderr, ` It uses information_schema or similar RDBMS mechanism to inspect database structure. For each table, it generates a single file with single struct type definition with fields, types, and tags. Generated code then should be checked and edited manually. `) } } func gofmt(path string) { if *gofmtF { cmd := exec.Command("gofmt", "-s", "-w", path) logger.Debugf(strings.Join(cmd.Args, " ")) b, err := cmd.CombinedOutput() if err != nil { logger.Fatalf("gofmt error: %s", err) } logger.Debugf("gofmt output: %s", b) } } type typeFunc func(sqlType string, nullable bool) (typ string, pack string, comment string) // maybePointer returns *typ if nullable, typ otherwise. func maybePointer(typ string, nullable bool) string { if nullable { return "*" + typ } return typ } // convertName converts snake_case name of table or column to CamelCase name of type or field. // It also handles "_id" to "ID" conversion as a typical special case. func convertName(sqlName string) string { fields := strings.Fields(strings.ReplaceAll(sqlName, "_", " ")) res := make([]string, len(fields)) for i, f := range fields { if f == "id" { res[i] = "ID" } else { res[i] = strings.Title(f) } } return strings.Join(res, "") } // getPrimaryKeyColumn returns single primary key column for given table, or nil. func getPrimaryKeyColumn(db *reform.DB, catalog, schema, tableName string) *keyColumnUsage { using := []string{ "table_catalog", "table_schema", "table_name", "constraint_catalog", "constraint_schema", "constraint_name", } if db.Dialect == mysql.Dialect { // MySQL doesn't have table_catalog in table_constraints using = using[1:] } for i, u := range using { using[i] = fmt.Sprintf("key_column_usage.%s = table_constraints.%s", u, u) } q := fmt.Sprintf( `SELECT column_name, ordinal_position FROM information_schema.key_column_usage INNER JOIN information_schema.table_constraints ON %s WHERE key_column_usage.table_catalog = %s AND key_column_usage.table_schema = %s AND key_column_usage.table_name = %s AND constraint_type = 'PRIMARY KEY' ORDER BY ordinal_position DESC`, strings.Join(using, " AND "), db.Placeholder(1), db.Placeholder(2), db.Placeholder(3), ) // get only the first row (with the maximum ordinal_position) row := db.QueryRow(q, catalog, schema, tableName) var key keyColumnUsage if err := row.Scan(key.Pointers()...); err != nil { if errors.Is(err, reform.ErrNoRows) { return nil } logger.Fatalf("%s", err) } if key.OrdinalPosition > 1 { logger.Printf( "Composite primary keys are not supported (found %d columns), skipping it for table %s.", key.OrdinalPosition, tableName, ) return nil } return &key } // initModelsInformationSchema returns structs from database with information_schema. func initModelsInformationSchema(db *reform.DB, tablesTail string, typeFunc typeFunc) (structs []StructData) { tables, err := db.SelectAllFrom(tableView, tablesTail) if err != nil { logger.Fatalf("%s", err) } for _, t := range tables { imports := make(map[string]struct{}) table := t.(*table) str := parse.StructInfo{ Type: convertName(table.TableName), SQLName: table.TableName, PKFieldIndex: -1, } var comments []string key := getPrimaryKeyColumn(db, table.TableCatalog, table.TableSchema, table.TableName) tail := fmt.Sprintf( `WHERE table_catalog = %s AND table_schema = %s AND table_name = %s ORDER BY ordinal_position`, db.Placeholder(1), db.Placeholder(2), db.Placeholder(3), ) columns, err := db.SelectAllFrom(columnView, tail, table.TableCatalog, table.TableSchema, table.TableName) if err != nil { logger.Fatalf("%s", err) } for i, c := range columns { column := c.(*column) typ, pack, comment := typeFunc(column.Type, bool(column.IsNullable)) if pack != "" { imports[pack] = struct{}{} } comments = append(comments, comment) str.Fields = append(str.Fields, parse.FieldInfo{ Name: convertName(column.Name), Type: typ, Column: column.Name, }) if key != nil && key.ColumnName == column.Name { str.PKFieldIndex = i } } structs = append(structs, StructData{ Imports: imports, StructInfo: str, FieldComments: comments, }) } return } // cmdInit implements init command. func cmdInit(db *reform.DB, dir string) { var structs []StructData switch db.Dialect { case postgresql.Dialect: // catalog is a currently selected database (reform-database, postgres, template0, etc.) // schema is a PostgreSQL schema (public, pg_catalog, information_schema, etc.) structs = initModelsInformationSchema(db, `WHERE table_schema = current_schema()`, goTypePostgres) case mysql.Dialect: // catalog is always "def" // schema is a database name (reform-database, information_schema, performance_schema, mysql, sys, etc.) structs = initModelsInformationSchema(db, `WHERE table_schema = DATABASE()`, goTypeMySQL) case sqlite3.Dialect: // SQLite is special structs = initModelsSQLite3(db) case mssql.Dialect: //nolint:staticcheck fallthrough case sqlserver.Dialect: // catalog is a currently selected database (reform-database, master, etc.) // schema is MS SQL schema (dbo, guest, sys, information_schema, etc.) structs = initModelsInformationSchema(db, `WHERE table_schema = SCHEMA_NAME()`, goTypeMSSQL) default: logger.Fatalf("unhandled dialect %s", db.Dialect) } // detect package name by importing package or from directory name var packageName string pack, err := build.ImportDir(dir, 0) if err == nil { packageName = pack.Name } else { s := strings.Split(filepath.Base(dir), ".")[0] packageName = strings.ReplaceAll(s, "-", "_") } for _, s := range structs { logger.Debugf("%#v", s) f, err := os.Create(filepath.Join(dir, strings.ToLower(s.SQLName)+".go")) if err != nil { logger.Fatalf("%s", err) } logger.Debugf("Writing %s ...", f.Name()) if _, err = f.WriteString("package " + packageName + "\n"); err != nil { logger.Fatalf("%s", err) } if err = prologTemplate.Execute(f, s); err != nil { logger.Fatalf("%s", err) } if err = structTemplate.Execute(f, s); err != nil { logger.Fatalf("%s", err) } if err = f.Close(); err != nil { logger.Fatalf("%s", err) } } gofmt(dir) }
{ "content_hash": "63ea1f40e194f6919cdf02485d0384ad", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 110, "avg_line_length": 29.97107438016529, "alnum_prop": 0.6810974769061078, "repo_name": "go-reform/reform", "id": "c20853dfcfbc5e9432b4373b90d624661fde3917", "size": "7253", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "reform-db/cmd_init.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "176660" }, { "name": "Makefile", "bytes": "9594" }, { "name": "PowerShell", "bytes": "646" } ], "symlink_target": "" }
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; define(["require", "exports", './decorators'], function (require, exports, decorators_1) { "use strict"; var nextThemeId = 0; function getNextDynamicThemeId() { return 'DynamicTheme' + (++nextThemeId); } function createDynamicStyleModule(styleUrl) { var DynamicTheme = (function () { function DynamicTheme() { } DynamicTheme = __decorate([ decorators_1.styles(), decorators_1.useStyles(styleUrl) ], DynamicTheme); return DynamicTheme; }()); return (_a = {}, _a[getNextDynamicThemeId()] = DynamicTheme, _a ); var _a; } exports.createDynamicStyleModule = createDynamicStyleModule; });
{ "content_hash": "b6aa0bd05e4c812c515390d406c28dc1", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 150, "avg_line_length": 44.9, "alnum_prop": 0.570898292501856, "repo_name": "verbedr/ux", "id": "bd6a873f6d73fc952bfe07c35e7a27a2c400962e", "size": "1347", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dist/amd/styles/dynamic-styles.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8087" }, { "name": "HTML", "bytes": "1191" }, { "name": "JavaScript", "bytes": "2013" }, { "name": "TypeScript", "bytes": "71253" } ], "symlink_target": "" }
using System; using Android.App; using Android.Content.PM; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; using Xamarin.Forms.Platform.Android; namespace BoxViewClock.Droid { [Activity(Label = "BoxViewClock", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : FormsApplicationActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Forms.Forms.Init(this, bundle); LoadApplication (new App()); } } }
{ "content_hash": "d928330433722704f8e03afa70fee2e7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 136, "avg_line_length": 22.925925925925927, "alnum_prop": 0.7092084006462036, "repo_name": "conceptdev/xamarin-forms-windows-preview", "id": "72bbb889fc1f82b43d7b79ae5b57a0bae25837fe", "size": "621", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "BoxViewClock/BoxViewClock/BoxViewClock.Android/MainActivity.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1543027" } ], "symlink_target": "" }
from test_framework import MonetaTestFramework from monetarpc.authproxy import AuthServiceProxy, JSONRPCException from util import * def get_sub_array_from_array(object_array, to_match): ''' Finds and returns a sub array from an array of arrays. to_match should be a unique idetifier of a sub array ''' num_matched = 0 for item in object_array: all_match = True for key,value in to_match.items(): if item[key] != value: all_match = False if not all_match: continue return item return [] def check_array_result(object_array, to_match, expected, should_not_find = False): """ Pass in array of JSON objects, a dictionary with key/value pairs to match against, and another dictionary with expected key/value pairs. If the should_not_find flag is true, to_match should not be found in object_array """ if should_not_find == True: expected = { } num_matched = 0 for item in object_array: all_match = True for key,value in to_match.items(): if item[key] != value: all_match = False if not all_match: continue for key,value in expected.items(): if item[key] != value: raise AssertionError("%s : expected %s=%s"%(str(item), str(key), str(value))) num_matched = num_matched+1 if num_matched == 0 and should_not_find != True: raise AssertionError("No objects matched %s"%(str(to_match))) if num_matched > 0 and should_not_find == True: raise AssertionError("Objects was matched %s"%(str(to_match))) class ReceivedByTest(MonetaTestFramework): def run_test(self): ''' listreceivedbyaddress Test ''' # Send from node 0 to 1 addr = self.nodes[1].getnewaddress() txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() #Check not listed in listreceivedbyaddress because has 0 confirmations check_array_result(self.nodes[1].listreceivedbyaddress(), {"address":addr}, { }, True) #Bury Tx under 10 block so it will be returned by listreceivedbyaddress self.nodes[1].setgenerate(True, 10) self.sync_all() check_array_result(self.nodes[1].listreceivedbyaddress(), {"address":addr}, {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) #With min confidence < 10 check_array_result(self.nodes[1].listreceivedbyaddress(5), {"address":addr}, {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) #With min confidence > 10, should not find Tx check_array_result(self.nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) #Empty Tx addr = self.nodes[1].getnewaddress() check_array_result(self.nodes[1].listreceivedbyaddress(0,True), {"address":addr}, {"address":addr, "account":"", "amount":0, "confirmations":0, "txids":[]}) ''' getreceivedbyaddress Test ''' # Send from node 0 to 1 addr = self.nodes[1].getnewaddress() txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() #Check balance is 0 because of 0 confirmations balance = self.nodes[1].getreceivedbyaddress(addr) if balance != Decimal("0.0"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) #Check balance is 0.1 balance = self.nodes[1].getreceivedbyaddress(addr,0) if balance != Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) #Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress self.nodes[1].setgenerate(True, 10) self.sync_all() balance = self.nodes[1].getreceivedbyaddress(addr) if balance != Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) ''' listreceivedbyaccount + getreceivedbyaccount Test ''' #set pre-state addrArr = self.nodes[1].getnewaddress() account = self.nodes[1].getaccount(addrArr) received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(),{"account":account}) if len(received_by_account_json) == 0: raise AssertionError("No accounts found in node") balance_by_account = rec_by_accountArr = self.nodes[1].getreceivedbyaccount(account) txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() # listreceivedbyaccount should return received_by_account_json because of 0 confirmations check_array_result(self.nodes[1].listreceivedbyaccount(), {"account":account}, received_by_account_json) # getreceivedbyaddress should return same balance because of 0 confirmations balance = self.nodes[1].getreceivedbyaccount(account) if balance != balance_by_account: raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) self.nodes[1].setgenerate(True, 10) self.sync_all() # listreceivedbyaccount should return updated account balance check_array_result(self.nodes[1].listreceivedbyaccount(), {"account":account}, {"account":received_by_account_json["account"], "amount":(received_by_account_json["amount"] + Decimal("0.1"))}) # getreceivedbyaddress should return updates balance balance = self.nodes[1].getreceivedbyaccount(account) if balance != balance_by_account + Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) #Create a new account named "mynewaccount" that has a 0 balance self.nodes[1].getaccountaddress("mynewaccount") received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) if len(received_by_account_json) == 0: raise AssertionError("No accounts found in node") # Test includeempty of listreceivedbyaccount if received_by_account_json["amount"] != Decimal("0.0"): raise AssertionError("Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json["amount"])) # Test getreceivedbyaccount for 0 amount accounts balance = self.nodes[1].getreceivedbyaccount("mynewaccount") if balance != Decimal("0.0"): raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) if __name__ == '__main__': ReceivedByTest().main()
{ "content_hash": "a4f8de15890769217d0aed97151bf60c", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 139, "avg_line_length": 44.71875, "alnum_prop": 0.610062893081761, "repo_name": "habibmasuro/moneta-0.10.0", "id": "7e4a6002c3e9c3d86e40aa60ef5e897cad08f959", "size": "7407", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "qa/rpc-tests/receivedby.py", "mode": "33261", "license": "mit", "language": [ { "name": "Assembly", "bytes": "7639" }, { "name": "Batchfile", "bytes": "570" }, { "name": "C", "bytes": "344750" }, { "name": "C++", "bytes": "3685223" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "17983" }, { "name": "HTML", "bytes": "50621" }, { "name": "Java", "bytes": "2099" }, { "name": "Makefile", "bytes": "61678" }, { "name": "Objective-C", "bytes": "2020" }, { "name": "Objective-C++", "bytes": "7244" }, { "name": "Protocol Buffer", "bytes": "2304" }, { "name": "Python", "bytes": "211715" }, { "name": "QMake", "bytes": "2018" }, { "name": "Shell", "bytes": "42211" } ], "symlink_target": "" }
JS learning place, especially for jQuery. ## 学习 js 之技术路径 - Introduction to javascript - jQuery learning center - ExtJS - Node.js __代码示例__ ```javascript var str = "Hello, 好啊。"; alert(str); ``` --- * END *
{ "content_hash": "1884dae6cb3006e0ebf071584294c145", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 41, "avg_line_length": 14.4, "alnum_prop": 0.6296296296296297, "repo_name": "lampjian/front_endjs", "id": "f165d9c92c8bc56ce4cc20ba7cd18a692721b744", "size": "258", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "729" }, { "name": "JavaScript", "bytes": "549" } ], "symlink_target": "" }
#import <AppKit/AppKit.h> @interface NSComboBoxView : NSView { NSSize _cellSize; NSArray *_objects; NSFont *_font; int _selectedIndex; int _keyboardUIState; } -initWithFrame:(NSRect)frame; -(void)setObjectArray:(NSArray *)objects; -(void)setFont:(NSFont *)font; -(NSSize)sizeForContents; -(int)runTrackingWithEvent:(NSEvent *)event; @end
{ "content_hash": "093e72e4e6e9ce8c80485a45af749003", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 44, "avg_line_length": 17, "alnum_prop": 0.6844919786096256, "repo_name": "uptime-services/development-arts", "id": "de670a5a3dc40deee3110d62cbc1800a7e346d3e", "size": "1451", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "AppKit/NSComboBoxView.h", "mode": "33261", "license": "mit", "language": [ { "name": "Assembly", "bytes": "11083" }, { "name": "C", "bytes": "438477" }, { "name": "C++", "bytes": "159739" }, { "name": "Matlab", "bytes": "8590" }, { "name": "Objective-C", "bytes": "7946784" }, { "name": "Objective-C++", "bytes": "112167" }, { "name": "Shell", "bytes": "301" } ], "symlink_target": "" }
package de.naoth.rc.dialogsFx.multiagentconfiguration.components; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javafx.collections.ListChangeListener; import javafx.scene.control.CheckBoxTreeItem; import javafx.scene.control.TreeItem; /** * @author Philipp Strobel <philippstrobel@posteo.de> * @param <T> */ public class TreeNode<T extends Object> extends CheckBoxTreeItem<T> { private final HashMap<T, TreeNode> children = new HashMap<>(); public TreeNode() { this(null); } public TreeNode(T name) { super(name); getChildren().addListener((ListChangeListener.Change<? extends TreeItem<T>> c) -> { while (c.next()) { if (c.wasAdded()) { // add the names of the added nodes c.getAddedSubList().forEach((a) -> { children.put(a.getValue(), (TreeNode) a); }); } else if(c.wasRemoved()) { // remove the names of the removed nodes c.getRemoved().forEach((r) -> { children.remove(r.getValue()); }); } } }); } public TreeNode getChildren(T name) { return children.get(name); } public boolean hasChildren(T name) { return children.containsKey(name); } /** * Creates a list of expanded nodes starting from this node. * The nodes are separated by a '/'. * * @return a list of expanded nodes */ public List<String> getExpandedNodes() { return getExpandedNodes(this, ""); } /** * Creates a list of expanded nodes * * @param t the starting tree node * @param parent the path to the starting tree node * @return a list of expanded nodes, starting from node t */ private List<String> getExpandedNodes(TreeItem<T> t, String parent) { List<String> expanded = new ArrayList<>(); if(t.isExpanded()) { String path = parent + (parent.isEmpty()?"":"/") + t.getValue(); expanded.add(path); if(!t.isLeaf()) { t.getChildren().forEach((child) -> { expanded.addAll(getExpandedNodes(child, path)); }); } } return expanded; } /** * Expands all nodes on the path starting from the this node. * * @param paths the paths, which should be expended */ public void expandNodes(List<String> paths) { paths.forEach((p) -> { String root = String.valueOf(this.getValue()); if(p.startsWith(root)) { String[] parts = p.replaceFirst(root+"/?", "").split("/"); TreeNode current_root = this; current_root.setExpanded(true); for (String part : parts) { if(current_root.hasChildren(part)) { current_root = current_root.getChildren(part); current_root.setExpanded(true); } else { break; // got an unknown node } } } }); } }
{ "content_hash": "adb0ffd0bad3792608ee79b72732a6f7", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 102, "avg_line_length": 31.529411764705884, "alnum_prop": 0.5360696517412935, "repo_name": "BerlinUnited/NaoTH", "id": "b7a0a25ca5310934b94ac132c746f78021c5635a", "size": "3216", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "RobotControl/src/de/naoth/rc/dialogsFx/multiagentconfiguration/components/TreeNode.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "319" }, { "name": "C", "bytes": "16295" }, { "name": "C++", "bytes": "3831321" }, { "name": "CSS", "bytes": "8839" }, { "name": "HTML", "bytes": "21148" }, { "name": "Java", "bytes": "1816793" }, { "name": "Jupyter Notebook", "bytes": "8092" }, { "name": "Lua", "bytes": "73794" }, { "name": "MATLAB", "bytes": "141780" }, { "name": "Python", "bytes": "1337382" }, { "name": "Shell", "bytes": "60599" } ], "symlink_target": "" }
package org.apache.spark.sql.execution.window import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.expressions.aggregate.AggregateExpression import org.apache.spark.sql.execution.UnaryExecNode import org.apache.spark.sql.types.{CalendarIntervalType, DateType, DayTimeIntervalType, IntegerType, TimestampType, YearMonthIntervalType} trait WindowExecBase extends UnaryExecNode { def windowExpression: Seq[NamedExpression] def partitionSpec: Seq[Expression] def orderSpec: Seq[SortOrder] /** * Create the resulting projection. * * This method uses Code Generation. It can only be used on the executor side. * * @param expressions unbound ordered function expressions. * @return the final resulting projection. */ protected def createResultProjection(expressions: Seq[Expression]): UnsafeProjection = { val references = expressions.zipWithIndex.map { case (e, i) => // Results of window expressions will be on the right side of child's output BoundReference(child.output.size + i, e.dataType, e.nullable) } val unboundToRefMap = expressions.zip(references).toMap val patchedWindowExpression = windowExpression.map(_.transform(unboundToRefMap)) UnsafeProjection.create( child.output ++ patchedWindowExpression, child.output) } /** * Create a bound ordering object for a given frame type and offset. A bound ordering object is * used to determine which input row lies within the frame boundaries of an output row. * * This method uses Code Generation. It can only be used on the executor side. * * @param frame to evaluate. This can either be a Row or Range frame. * @param bound with respect to the row. * @param timeZone the session local timezone for time related calculations. * @return a bound ordering object. */ private def createBoundOrdering( frame: FrameType, bound: Expression, timeZone: String): BoundOrdering = { (frame, bound) match { case (RowFrame, CurrentRow) => RowBoundOrdering(0) case (RowFrame, IntegerLiteral(offset)) => RowBoundOrdering(offset) case (RowFrame, _) => sys.error(s"Unhandled bound in windows expressions: $bound") case (RangeFrame, CurrentRow) => val ordering = RowOrdering.create(orderSpec, child.output) RangeBoundOrdering(ordering, IdentityProjection, IdentityProjection) case (RangeFrame, offset: Expression) if orderSpec.size == 1 => // Use only the first order expression when the offset is non-null. val sortExpr = orderSpec.head val expr = sortExpr.child // Create the projection which returns the current 'value'. val current = MutableProjection.create(expr :: Nil, child.output) // Flip the sign of the offset when processing the order is descending val boundOffset = sortExpr.direction match { case Descending => UnaryMinus(offset) case Ascending => offset } // Create the projection which returns the current 'value' modified by adding the offset. val boundExpr = (expr.dataType, boundOffset.dataType) match { case (DateType, IntegerType) => DateAdd(expr, boundOffset) case (DateType, _: YearMonthIntervalType) => DateAddYMInterval(expr, boundOffset) case (TimestampType, CalendarIntervalType) => TimeAdd(expr, boundOffset, Some(timeZone)) case (TimestampType, _: YearMonthIntervalType) => TimestampAddYMInterval(expr, boundOffset, Some(timeZone)) case (TimestampType, _: DayTimeIntervalType) => TimeAdd(expr, boundOffset, Some(timeZone)) case (a, b) if a == b => Add(expr, boundOffset) } val bound = MutableProjection.create(boundExpr :: Nil, child.output) // Construct the ordering. This is used to compare the result of current value projection // to the result of bound value projection. This is done manually because we want to use // Code Generation (if it is enabled). val boundSortExprs = sortExpr.copy(BoundReference(0, expr.dataType, expr.nullable)) :: Nil val ordering = RowOrdering.create(boundSortExprs, Nil) RangeBoundOrdering(ordering, current, bound) case (RangeFrame, _) => sys.error("Non-Zero range offsets are not supported for windows " + "with multiple order expressions.") } } /** * Collection containing an entry for each window frame to process. Each entry contains a frame's * [[WindowExpression]]s and factory function for the [[WindowFunctionFrame]]. */ protected lazy val windowFrameExpressionFactoryPairs = { type FrameKey = (String, FrameType, Expression, Expression, Seq[Expression]) type ExpressionBuffer = mutable.Buffer[Expression] val framedFunctions = mutable.Map.empty[FrameKey, (ExpressionBuffer, ExpressionBuffer)] // Add a function and its function to the map for a given frame. def collect(tpe: String, fr: SpecifiedWindowFrame, e: Expression, fn: Expression): Unit = { val key = fn match { // This branch is used for Lead/Lag to support ignoring null and optimize the performance // for NthValue ignoring null. // All window frames move in rows. If there are multiple Leads, Lags or NthValues acting on // a row and operating on different input expressions, they should not be moved uniformly // by row. Therefore, we put these functions in different window frames. case f: OffsetWindowFunction if f.ignoreNulls => (tpe, fr.frameType, fr.lower, fr.upper, f.children.map(_.canonicalized)) case _ => (tpe, fr.frameType, fr.lower, fr.upper, Nil) } val (es, fns) = framedFunctions.getOrElseUpdate( key, (ArrayBuffer.empty[Expression], ArrayBuffer.empty[Expression])) es += e fns += fn } // Collect all valid window functions and group them by their frame. windowExpression.foreach { x => x.foreach { case e @ WindowExpression(function, spec) => val frame = spec.frameSpecification.asInstanceOf[SpecifiedWindowFrame] function match { case AggregateExpression(f, _, _, _, _) => collect("AGGREGATE", frame, e, f) case f: FrameLessOffsetWindowFunction => collect("FRAME_LESS_OFFSET", f.fakeFrame, e, f) case f: OffsetWindowFunction if frame.frameType == RowFrame && frame.lower == UnboundedPreceding => frame.upper match { case UnboundedFollowing => collect("UNBOUNDED_OFFSET", f.fakeFrame, e, f) case CurrentRow => collect("UNBOUNDED_PRECEDING_OFFSET", f.fakeFrame, e, f) case _ => collect("AGGREGATE", frame, e, f) } case f: AggregateWindowFunction => collect("AGGREGATE", frame, e, f) case f: PythonUDF => collect("AGGREGATE", frame, e, f) case f => sys.error(s"Unsupported window function: $f") } case _ => } } // Map the groups to a (unbound) expression and frame factory pair. var numExpressions = 0 val timeZone = conf.sessionLocalTimeZone framedFunctions.toSeq.map { case (key, (expressions, functionSeq)) => val ordinal = numExpressions val functions = functionSeq.toArray // Construct an aggregate processor if we need one. // Currently we don't allow mixing of Pandas UDF and SQL aggregation functions // in a single Window physical node. Therefore, we can assume no SQL aggregation // functions if Pandas UDF exists. In the future, we might mix Pandas UDF and SQL // aggregation function in a single physical node. def processor = if (functions.exists(_.isInstanceOf[PythonUDF])) { null } else { AggregateProcessor( functions, ordinal, child.output, (expressions, schema) => MutableProjection.create(expressions, schema)) } // Create the factory to produce WindowFunctionFrame. val factory = key match { // Frameless offset Frame case ("FRAME_LESS_OFFSET", _, IntegerLiteral(offset), _, expr) => target: InternalRow => new FrameLessOffsetWindowFunctionFrame( target, ordinal, // OFFSET frame functions are guaranteed be OffsetWindowFunction. functions.map(_.asInstanceOf[OffsetWindowFunction]), child.output, (expressions, schema) => MutableProjection.create(expressions, schema), offset, expr.nonEmpty) case ("UNBOUNDED_OFFSET", _, IntegerLiteral(offset), _, expr) => target: InternalRow => { new UnboundedOffsetWindowFunctionFrame( target, ordinal, // OFFSET frame functions are guaranteed be OffsetWindowFunction. functions.map(_.asInstanceOf[OffsetWindowFunction]), child.output, (expressions, schema) => MutableProjection.create(expressions, schema), offset, expr.nonEmpty) } case ("UNBOUNDED_PRECEDING_OFFSET", _, IntegerLiteral(offset), _, expr) => target: InternalRow => { new UnboundedPrecedingOffsetWindowFunctionFrame( target, ordinal, // OFFSET frame functions are guaranteed be OffsetWindowFunction. functions.map(_.asInstanceOf[OffsetWindowFunction]), child.output, (expressions, schema) => MutableProjection.create(expressions, schema), offset, expr.nonEmpty) } // Entire Partition Frame. case ("AGGREGATE", _, UnboundedPreceding, UnboundedFollowing, _) => target: InternalRow => { new UnboundedWindowFunctionFrame(target, processor) } // Growing Frame. case ("AGGREGATE", frameType, UnboundedPreceding, upper, _) => target: InternalRow => { new UnboundedPrecedingWindowFunctionFrame( target, processor, createBoundOrdering(frameType, upper, timeZone)) } // Shrinking Frame. case ("AGGREGATE", frameType, lower, UnboundedFollowing, _) => target: InternalRow => { new UnboundedFollowingWindowFunctionFrame( target, processor, createBoundOrdering(frameType, lower, timeZone)) } // Moving Frame. case ("AGGREGATE", frameType, lower, upper, _) => target: InternalRow => { new SlidingWindowFunctionFrame( target, processor, createBoundOrdering(frameType, lower, timeZone), createBoundOrdering(frameType, upper, timeZone)) } case _ => sys.error(s"Unsupported factory: $key") } // Keep track of the number of expressions. This is a side-effect in a map... numExpressions += expressions.size // Create the Window Expression - Frame Factory pair. (expressions, factory) } } }
{ "content_hash": "fd94e3d23db1fc8a527599e678334abd", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 138, "avg_line_length": 43.61048689138577, "alnum_prop": 0.6334592923394022, "repo_name": "wangmiao1981/spark", "id": "2aa0b02974e2313ec5bead244b4fc76e5d7c5a10", "size": "12444", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowExecBase.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "50024" }, { "name": "Batchfile", "bytes": "31352" }, { "name": "C", "bytes": "1493" }, { "name": "CSS", "bytes": "26836" }, { "name": "Dockerfile", "bytes": "9014" }, { "name": "HTML", "bytes": "41387" }, { "name": "HiveQL", "bytes": "1890736" }, { "name": "Java", "bytes": "4123699" }, { "name": "JavaScript", "bytes": "203741" }, { "name": "Makefile", "bytes": "7776" }, { "name": "PLpgSQL", "bytes": "380540" }, { "name": "PowerShell", "bytes": "3865" }, { "name": "Python", "bytes": "3130521" }, { "name": "R", "bytes": "1186948" }, { "name": "Roff", "bytes": "21950" }, { "name": "SQLPL", "bytes": "9325" }, { "name": "Scala", "bytes": "31710454" }, { "name": "Shell", "bytes": "203944" }, { "name": "TSQL", "bytes": "466993" }, { "name": "Thrift", "bytes": "67584" }, { "name": "q", "bytes": "79845" } ], "symlink_target": "" }
package com.hazelcast.simulator.worker; import com.hazelcast.core.Cluster; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.Member; import com.hazelcast.simulator.common.messaging.DummyRunnableMessage; import com.hazelcast.simulator.common.messaging.Message; import com.hazelcast.simulator.common.messaging.MessageAddress; import com.hazelcast.simulator.test.TestContext; import com.hazelcast.simulator.utils.AssertTask; import org.junit.Before; import org.junit.Test; import org.mockito.exceptions.verification.WantedButNotInvoked; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import static com.hazelcast.simulator.utils.TestUtils.TIMEOUT; import static com.hazelcast.simulator.utils.TestUtils.assertTrueEventually; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; public class WorkerMessageProcessorTest { private WorkerMessageProcessor workerMessageProcessor; private TestContainer<TestContext> testContainerMock1; private TestContainer<TestContext> testContainerMock2; @Before @SuppressWarnings("unchecked") public void setUp() { testContainerMock1 = mock(TestContainer.class); testContainerMock2 = mock(TestContainer.class); ConcurrentMap<String, TestContainer<TestContext>> tests = new ConcurrentHashMap<String, TestContainer<TestContext>>(); tests.put("mockTest1", testContainerMock1); tests.put("mockTest2", testContainerMock2); workerMessageProcessor = new WorkerMessageProcessor(tests); } @Test public void testSubmit_local() { MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().build(); final DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { assertTrue(message.isExecuted()); } }); } @Test public void testSubmit_toAllTests() throws Exception { MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().toAllTests().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); assertFalse(message.isExecuted()); verify(testContainerMock1, timeout(TIMEOUT)).sendMessage(message); verify(testContainerMock2, timeout(TIMEOUT)).sendMessage(message); } @Test public void testSubmit_toRandomAgent() throws Exception { MessageAddress messageAddress = MessageAddress.builder().toRandomAgent().toAllWorkers().toAllTests().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); verifyMessageSentToEitherOr(testContainerMock1, testContainerMock2, message); } @Test public void testSubmit_toRandomWorker() throws Exception { MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toRandomWorker().toAllTests().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); verifyMessageSentToEitherOr(testContainerMock1, testContainerMock2, message); } @Test public void testSubmit_toRandomTest() throws Exception { MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().toRandomTest().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); verifyMessageSentToEitherOr(testContainerMock1, testContainerMock2, message); } @Test public void testSubmit_toOldestMember() throws Exception { workerMessageProcessor.setHazelcastServerInstance(createMockHazelcastInstance(true)); MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toOldestMember().toAllTests().build(); final DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { verifyMessageSentToEitherOr(testContainerMock1, testContainerMock2, message); } }); } @Test public void testSubmit_toRandomTest_withHazelcastClient() throws Exception { workerMessageProcessor.setHazelcastClientInstance(createMockHazelcastInstance(true)); MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().toRandomTest().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); verifyMessageSentToEitherOr(testContainerMock1, testContainerMock2, message); } @Test public void testSubmit_noTestContainers() { workerMessageProcessor = new WorkerMessageProcessor(new ConcurrentHashMap<String, TestContainer<TestContext>>()); MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().toRandomTest().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); verifyZeroInteractions(testContainerMock1); verifyZeroInteractions(testContainerMock2); assertFalse(message.isExecuted()); } @Test() public void testSubmit_noRunnable() { MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().build(); Message noRunnableMessage = mock(Message.class); when(noRunnableMessage.getMessageAddress()).thenReturn(messageAddress); workerMessageProcessor.submit(noRunnableMessage); } @Test public void testSubmit_withException() throws Exception { doThrow(new IllegalArgumentException()).when(testContainerMock1).sendMessage(any(Message.class)); ConcurrentMap<String, TestContainer<TestContext>> tests = new ConcurrentHashMap<String, TestContainer<TestContext>>(); tests.put("mockTest", testContainerMock1); workerMessageProcessor = new WorkerMessageProcessor(tests); MessageAddress messageAddress = MessageAddress.builder().toAllAgents().toAllWorkers().toRandomTest().build(); DummyRunnableMessage message = new DummyRunnableMessage(messageAddress); workerMessageProcessor.submit(message); } private void verifyMessageSentToEitherOr(TestContainer<?> container1, TestContainer<?> container2, Message message) throws Exception { try { verify(container1, timeout(TIMEOUT)).sendMessage(message); } catch (WantedButNotInvoked e) { // the message was not deliver to container1, so it should go to container2 verify(container2).sendMessage(message); } } private HazelcastInstance createMockHazelcastInstance(boolean returnMember) { Member member = mock(Member.class); Set<Member> memberSet = new HashSet<Member>(); memberSet.add(member); Cluster cluster = mock(Cluster.class); when(cluster.getMembers()).thenReturn(memberSet); HazelcastInstance hazelcastInstance = mock(HazelcastInstance.class); when(hazelcastInstance.getLocalEndpoint()).thenReturn(returnMember ? member : null); when(hazelcastInstance.getCluster()).thenReturn(cluster); return hazelcastInstance; } }
{ "content_hash": "1a84a1777dc1871052b29474dad772c3", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 126, "avg_line_length": 41.66321243523316, "alnum_prop": 0.7405795299092153, "repo_name": "eminn/hazelcast-simulator", "id": "fece8b12259d0c6d6fb8b505beac2f589dd5adfa", "size": "8041", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "simulator/src/test/java/com/hazelcast/simulator/worker/WorkerMessageProcessorTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1396750" }, { "name": "Shell", "bytes": "26417" } ], "symlink_target": "" }
var Loader = (function () { function Loader(scene) { this.assetManager = new BABYLON.AssetsManager(scene); this.namesToMeshes = {}; this.namesToSounds = {}; this.namesToMeshTasks = {}; this.namesToSoundTasks = {}; } Loader.prototype.addSound = function (pathFile) { var results = /(.*[\/\\])?([A-Za-z0-9\-_]*)/g.exec(pathFile); if (!results) { throw "Invalid path \"" + pathFile + "\" for sound ! Don't set extension (loader choose between ogg or wav)"; } var extension; var audio = new Audio(); if (audio.canPlayType("audio/ogg") != "") { extension = ".ogg"; } else if (audio.canPlayType("audio/wav") != "") { extension = ".wav"; } else if (audio.canPlayType("audio/mpeg") != "") { extension = ".mp3"; } var folderName = (results.length == 3) ? results[1] : "./"; var soundName = results[results.length - 1]; var taskName = soundName + "Task"; var fileName = soundName + extension; this.namesToSoundTasks[soundName] = this.assetManager.addBinaryFileTask(taskName, folderName + fileName); }; Loader.prototype.addMesh = function (pathFile) { var results = /(.*[\/\\])?(.*).babylon/g.exec(pathFile); if (!results) { throw "PathFile \"" + pathFile + "\" is not valid to add Mesh. (it accepts only \".babylon\" file)"; } var folderName = (results.length == 3) ? results[1] : "./"; var meshName = results[results.length - 1]; var taskName = meshName + "Task"; var fileName = meshName + ".babylon"; this.namesToMeshTasks[meshName] = this.assetManager.addMeshTask(taskName, meshName, folderName, fileName); }; Loader.prototype.getTaskAmount = function () { return this.getSoundTaskAmount() + this.getMeshTaskAmount(); }; Loader.prototype.getSoundTaskAmount = function () { return Object.keys(this.namesToSoundTasks).length; }; Loader.prototype.getMeshTaskAmount = function () { return Object.keys(this.namesToMeshTasks).length; }; Loader.prototype.load = function (onComplete, onProgressRatio, onError) { var meshTask; var soundTask; var taskAmount = this.getTaskAmount(); var that = this; var onLoadError = function (error, task) { if (onError) { onError(error, task); } else { throw error; } }; var onTaskLoaded = function () { var currentTaskAmount = that.getTaskAmount(); if (onProgressRatio) { onProgressRatio(Math.min((taskAmount - currentTaskAmount) / taskAmount, 1)); } if (currentTaskAmount == 0) { onComplete(); } }; for (var name in this.namesToMeshTasks) { meshTask = this.namesToMeshTasks[name]; meshTask.onSuccess = function (task) { that.onMeshTaskLoaded(this, task); onTaskLoaded(); }.bind(name); meshTask.onError = function (task) { onLoadError("Error on loading mesh " + this + ", corresponding file : \"" + task.rootUrl + task.sceneFilename + "\"", task); }.bind(name); } for (var soundName in this.namesToSoundTasks) { soundTask = this.namesToSoundTasks[soundName]; soundTask.onSuccess = function (task) { that.onSoundTaskLoaded(this, task); onTaskLoaded(); }.bind(soundName); soundTask.onError = function (task) { onLoadError("Error on loading sound " + this + ", corresponding file : \"" + task.url + "/" + this + ".wav\"", task); }.bind(soundName); } this.assetManager.load(); onProgressRatio(0); }; Loader.prototype.onSoundTaskLoaded = function (soundName, soundTask) { var sound = new BABYLON.Sound(soundName, soundTask.data, Services.scene, null, {}); this.namesToSounds[soundName] = sound; delete this.namesToSoundTasks[soundName]; }; Loader.prototype.onMeshTaskLoaded = function (meshName, meshTask) { var mesh = new BABYLON.Mesh(meshName, Services.scene); var abstractMesh; if (meshTask.loadedMeshes.length == 0) { throw "Mesh \"" + mesh + "\" not found on file \"" + meshTask.rootUrl + meshName + ".babylon\""; } for (var index in meshTask.loadedMeshes) { abstractMesh = meshTask.loadedMeshes[index]; if (abstractMesh.parent == null) { abstractMesh.parent = mesh; } } mesh.setEnabled(false); this.namesToMeshes[meshName] = mesh; delete this.namesToMeshTasks[meshName]; }; Loader.prototype.getMesh = function (meshName) { var referenceMesh = this.namesToMeshes[meshName]; if (!referenceMesh) { throw "No mesh loaded with name \"" + meshName + "\""; } var mesh = referenceMesh.clone(meshName + "_clone"); mesh.setEnabled(true); return mesh; }; Loader.prototype.getSound = function (soundName) { var referenceSound = this.namesToSounds[soundName]; if (!referenceSound) { throw "No sound loaded with name \"" + soundName + "\""; } return referenceSound.clone(); }; return Loader; }()); //# sourceMappingURL=Loader.js.map
{ "content_hash": "c58e31e2a236f7f4647f7f346cf951d7", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 140, "avg_line_length": 41.56296296296296, "alnum_prop": 0.5638923543040456, "repo_name": "BabylonJS/Samples", "id": "129a6778129ca21cda6831ec61ad529099472c50", "size": "5611", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/Scenes/prosecution/js/utils/Loader.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "96" }, { "name": "C#", "bytes": "1349" }, { "name": "CSS", "bytes": "244386" }, { "name": "HLSL", "bytes": "28923" }, { "name": "HTML", "bytes": "434824" }, { "name": "JavaScript", "bytes": "19466685" }, { "name": "TypeScript", "bytes": "189573" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_03) on Fri Jun 10 16:39:30 GMT+05:00 2011 --> <TITLE> Uses of Interface com.google.code.linkedinapi.schema.Patents </TITLE> <META NAME="date" CONTENT="2011-06-10"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface com.google.code.linkedinapi.schema.Patents"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/google/code/linkedinapi/schema/\class-usePatents.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Patents.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>com.google.code.linkedinapi.schema.Patents</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.google.code.linkedinapi.schema"><B>com.google.code.linkedinapi.schema</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.google.code.linkedinapi.schema.impl"><B>com.google.code.linkedinapi.schema.impl</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.google.code.linkedinapi.schema.xpp"><B>com.google.code.linkedinapi.schema.xpp</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.google.code.linkedinapi.schema"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A> in <A HREF="../../../../../../com/google/code/linkedinapi/schema/package-summary.html">com.google.code.linkedinapi.schema</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/package-summary.html">com.google.code.linkedinapi.schema</A> that return <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>SchemaElementFactory.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/SchemaElementFactory.html#createPatents()">createPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an instance of <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema"><CODE>Patents</CODE></A></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>ObjectFactory.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/ObjectFactory.html#createPatents()">createPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an instance of <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema"><CODE>Patents</CODE></A></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>Person.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/Person.html#getPatents()">getPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the value of the patents property.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/package-summary.html">com.google.code.linkedinapi.schema</A> with parameters of type <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>Person.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/Person.html#setPatents(com.google.code.linkedinapi.schema.Patents)">setPatents</A></B>(<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A>&nbsp;value)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the value of the patents property.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.google.code.linkedinapi.schema.impl"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A> in <A HREF="../../../../../../com/google/code/linkedinapi/schema/impl/package-summary.html">com.google.code.linkedinapi.schema.impl</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/impl/package-summary.html">com.google.code.linkedinapi.schema.impl</A> that return <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>PersonImpl.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/impl/PersonImpl.html#getPatents()">getPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/impl/package-summary.html">com.google.code.linkedinapi.schema.impl</A> with parameters of type <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>PersonImpl.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/impl/PersonImpl.html#setPatents(com.google.code.linkedinapi.schema.Patents)">setPatents</A></B>(<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A>&nbsp;value)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.google.code.linkedinapi.schema.xpp"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A> in <A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/package-summary.html">com.google.code.linkedinapi.schema.xpp</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/package-summary.html">com.google.code.linkedinapi.schema.xpp</A> that implement <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/PatentsImpl.html" title="class in com.google.code.linkedinapi.schema.xpp">PatentsImpl</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/package-summary.html">com.google.code.linkedinapi.schema.xpp</A> that return <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>XppElementFactory.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/XppElementFactory.html#createPatents()">createPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></CODE></FONT></TD> <TD><CODE><B>PersonImpl.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/PersonImpl.html#getPatents()">getPatents</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/package-summary.html">com.google.code.linkedinapi.schema.xpp</A> with parameters of type <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>PersonImpl.</B><B><A HREF="../../../../../../com/google/code/linkedinapi/schema/xpp/PersonImpl.html#setPatents(com.google.code.linkedinapi.schema.Patents)">setPatents</A></B>(<A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema">Patents</A>&nbsp;value)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/google/code/linkedinapi/schema/Patents.html" title="interface in com.google.code.linkedinapi.schema"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/google/code/linkedinapi/schema/\class-usePatents.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Patents.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "content_hash": "5d2579f6b18c99625f1a35d383f98ee4", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 352, "avg_line_length": 55.331288343558285, "alnum_prop": 0.6376538418893447, "repo_name": "shisoft/LinkedIn-J", "id": "161145af439695397981a9c1d2cbbff751547b80", "size": "18038", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/com/google/code/linkedinapi/schema/class-use/Patents.html", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace IncrementalLoading.PCL.Models { public class User { public int id { get; set; } public string username { get; set; } public string firstname { get; set; } public string lastname { get; set; } public string city { get; set; } public string country { get; set; } public string fullname { get; set; } public string userpic_url { get; set; } public int upgrade_status { get; set; } public int followers_count { get; set; } public int affection { get; set; } } }
{ "content_hash": "42a2c4f68c7843563c81db49a9650091", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 48, "avg_line_length": 33.411764705882355, "alnum_prop": 0.579225352112676, "repo_name": "KevinHu-au/Blog", "id": "836375e65cf78cfd6b1653516f5662c40860ea8a", "size": "570", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "IncrementalLoading/IncrementalLoading.PCL/Models/User.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "99" }, { "name": "Batchfile", "bytes": "14399" }, { "name": "C#", "bytes": "676729" }, { "name": "CSS", "bytes": "423005" }, { "name": "HTML", "bytes": "21713" }, { "name": "Java", "bytes": "733237" }, { "name": "JavaScript", "bytes": "1658631" } ], "symlink_target": "" }
package camelinaction; import org.apache.camel.builder.RouteBuilder; public class OrderRoute extends RouteBuilder { @Override public void configure() throws Exception { from("restlet:http://0.0.0.0:8080/orders?restletMethods=POST") .bean("orderService", "createOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=GET") .bean("orderService", "getOrder(${header.id})"); from("restlet:http://0.0.0.0:8080/orders?restletMethods=PUT") .bean("orderService", "updateOrder"); from("restlet:http://0.0.0.0:8080/orders/{id}?restletMethods=DELETE") .bean("orderService", "cancelOrder(${header.id})"); } }
{ "content_hash": "540717d9a2473cb20f9319a083ff0873", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 33.80952380952381, "alnum_prop": 0.6394366197183099, "repo_name": "camelinaction/camelinaction2", "id": "0e589aabd130f4825fec5865b26606c5712fd264", "size": "710", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter10/restlet/src/main/java/camelinaction/OrderRoute.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "15238" }, { "name": "Java", "bytes": "1127533" }, { "name": "JavaScript", "bytes": "17390" }, { "name": "Shell", "bytes": "109" } ], "symlink_target": "" }
package gex.newsml.nitf; import lombok.ToString; import java.util.HashMap; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; /** * <p> * Java class for anonymous complex type. * * <p> * The following schema fragment specifies the expected content contained within * this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attGroup ref="{http://iptc.org/std/NITF/2006-10-18/}globalNITFAttributes"/> * &lt;attribute name="tobject.subject.ipr" type="{http://www.w3.org/2001/XMLSchema}string" default="IPTC" /> * &lt;attribute name="tobject.subject.refnum" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="tobject.subject.code" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tobject.subject.type" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tobject.subject.matter" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tobject.subject.detail" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;anyAttribute processContents='lax' namespace='##other'/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "tobject.subject") @ToString public class TobjectSubject { @XmlAttribute(name = "tobject.subject.ipr") protected String tobjectSubjectIpr; @XmlAttribute(name = "tobject.subject.refnum", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String tobjectSubjectRefnum; @XmlAttribute(name = "tobject.subject.code") protected String tobjectSubjectCode; @XmlAttribute(name = "tobject.subject.type") protected String tobjectSubjectType; @XmlAttribute(name = "tobject.subject.matter") protected String tobjectSubjectMatter; @XmlAttribute(name = "tobject.subject.detail") protected String tobjectSubjectDetail; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Gets the value of the tobjectSubjectIpr property. * * @return possible object is {@link String } * */ public String getTobjectSubjectIpr() { if (tobjectSubjectIpr == null) { return "IPTC"; } else { return tobjectSubjectIpr; } } /** * Sets the value of the tobjectSubjectIpr property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectIpr(String value) { this.tobjectSubjectIpr = value; } /** * Gets the value of the tobjectSubjectRefnum property. * * @return possible object is {@link String } * */ public String getTobjectSubjectRefnum() { return tobjectSubjectRefnum; } /** * Sets the value of the tobjectSubjectRefnum property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectRefnum(String value) { this.tobjectSubjectRefnum = value; } /** * Gets the value of the tobjectSubjectCode property. * * @return possible object is {@link String } * */ public String getTobjectSubjectCode() { return tobjectSubjectCode; } /** * Sets the value of the tobjectSubjectCode property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectCode(String value) { this.tobjectSubjectCode = value; } /** * Gets the value of the tobjectSubjectType property. * * @return possible object is {@link String } * */ public String getTobjectSubjectType() { return tobjectSubjectType; } /** * Sets the value of the tobjectSubjectType property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectType(String value) { this.tobjectSubjectType = value; } /** * Gets the value of the tobjectSubjectMatter property. * * @return possible object is {@link String } * */ public String getTobjectSubjectMatter() { return tobjectSubjectMatter; } /** * Sets the value of the tobjectSubjectMatter property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectMatter(String value) { this.tobjectSubjectMatter = value; } /** * Gets the value of the tobjectSubjectDetail property. * * @return possible object is {@link String } * */ public String getTobjectSubjectDetail() { return tobjectSubjectDetail; } /** * Sets the value of the tobjectSubjectDetail property. * * @param value * allowed object is {@link String } * */ public void setTobjectSubjectDetail(String value) { this.tobjectSubjectDetail = value; } /** * Gets the value of the id property. * * @return possible object is {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets a map that contains attributes that aren't bound to any typed * property on this class. * * <p> * the map is keyed by the name of the attribute and the value is the string * value of the attribute. * * the map returned by this method is live, and you can add new attribute by * updating the map directly. Because of this design, there's no setter. * * * @return always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } }
{ "content_hash": "18be16ae297441a4c71808cffe17d861", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 119, "avg_line_length": 25.885245901639344, "alnum_prop": 0.6899936668777708, "repo_name": "gextech/iptc-newsml", "id": "25827f348eb756e8b1a6be59769b7b9708a35d96", "size": "6316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/gex/newsml/nitf/TobjectSubject.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "2452" }, { "name": "Java", "bytes": "3049331" } ], "symlink_target": "" }
import { IParticles } from "../../../Interfaces/Options/Particles/IParticles"; import { IParticlesColor } from "../../../Interfaces/Options/Particles/IParticlesColor"; import { ILineLinked } from "../../../Interfaces/Options/Particles/ILineLinked"; import { IMove } from "../../../Interfaces/Options/Particles/IMove"; import { IParticlesNumber } from "../../../Interfaces/Options/Particles/IParticlesNumber"; import { IOpacity } from "../../../Interfaces/Options/Particles/IOpacity"; import { IShape } from "../../../Interfaces/Options/Particles/Shape/IShape"; import { ISize } from "../../../Interfaces/Options/Particles/ISize"; import { IRotate } from "../../../Interfaces/Options/Particles/IRotate"; import { RecursivePartial } from "../../../Types/RecursivePartial"; export declare class Particles implements IParticles { /** * * @deprecated this property is obsolete, please use the new lineLinked */ get line_linked(): ILineLinked; /** * * @deprecated this property is obsolete, please use the new lineLinked * @param value */ set line_linked(value: ILineLinked); color: IParticlesColor; lineLinked: ILineLinked; move: IMove; number: IParticlesNumber; opacity: IOpacity; rotate: IRotate; shape: IShape; size: ISize; constructor(); load(data?: RecursivePartial<IParticles>): void; }
{ "content_hash": "737e63eabf72b423a5bb7acea527ef45", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 90, "avg_line_length": 41.78787878787879, "alnum_prop": 0.678027556200145, "repo_name": "cdnjs/cdnjs", "id": "39f51f9d0d341278882145dea4ed03d18b23bf50", "size": "1379", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "ajax/libs/tsparticles/1.10.4/Classes/Options/Particles/Particles.d.ts", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package com.redshape.io.net.adapters.socket; import java.io.IOException; import java.net.Socket; import com.redshape.io.net.adapters.socket.client.ISocketAdapter; import com.redshape.io.net.adapters.socket.client.SocketAdapter; import com.redshape.io.net.adapters.socket.server.IServerSocketAdapter; import com.redshape.io.net.adapters.socket.server.SSLServerSocketAdapter; import com.redshape.io.net.adapters.socket.server.ServerSocketAdapter; /** * Created by IntelliJ IDEA. * User: nikelin * Date: Feb 7, 2010 * Time: 11:58:52 PM * To change this template use File | Settings | File Templates. */ public class DefaultSocketAdapterFactory extends SocketAdapterFactory { public IServerSocketAdapter createServerSocketAdapter( String host, int port ) throws IOException { return new ServerSocketAdapter( host, port ); } public IServerSocketAdapter createSSLServerSocketAdapter( String host, int port ) throws IOException { return new SSLServerSocketAdapter( host, port ); } public ISocketAdapter createSocketAdapter( Socket socket ) { return new SocketAdapter( socket ); } }
{ "content_hash": "0e8a3d3dc2cf71a252f71ebdb320eec5", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 106, "avg_line_length": 34.44117647058823, "alnum_prop": 0.7455166524338173, "repo_name": "nikelin/Redshape-AS", "id": "a12b029449e12eb9cf999a16a03d21fdf4344088", "size": "1790", "binary": false, "copies": "1", "ref": "refs/heads/3.1.6", "path": "io/src/main/java/com/redshape/io/net/adapters/socket/DefaultSocketAdapterFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2232259" }, { "name": "Shell", "bytes": "769" } ], "symlink_target": "" }
var assert = require('assert'); var nodeEditorial = require('../lib/index.js').NodeEditorial(); describe('node-editorial', function () { //var arr; beforeEach(function () { //arr = [1, 2, 3]; }); describe('config', function () { //console.log("the nodeEditorial:" + nodeEditorial); it('should check that config exist', function () { assert(nodeEditorial.config != null, 'conf exist'); }); }) });
{ "content_hash": "eb0575901c50d5a50348c7ef965e315b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 63, "avg_line_length": 23.3, "alnum_prop": 0.5622317596566524, "repo_name": "aofry/node-editorial", "id": "6a229a0fb9af4900607e44f3cb39fde7ca4d0da9", "size": "466", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/config.test.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "14962" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.lacv.marketplatform.controllers.view; import com.lacv.marketplatform.dtos.MailDto; import com.lacv.marketplatform.mappers.MailMapper; import com.lacv.marketplatform.services.MailService; import com.dot.gcpbasedot.controller.ExtEntityController; import com.dot.gcpbasedot.components.MenuComponent; import com.dot.gcpbasedot.dto.MenuItem; import com.dot.gcpbasedot.dto.config.EntityConfig; import com.lacv.marketplatform.services.security.SecurityService; import java.util.List; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * * @author lacastrillov */ @Controller @RequestMapping(value="/vista/mail") public class MailViewController extends ExtEntityController { @Autowired MailService mailService; @Autowired MenuComponent menuComponent; @Autowired MailMapper mailMapper; @Autowired SecurityService securityService; @PostConstruct public void init(){ EntityConfig view= new EntityConfig("mail", "id", mailService, MailDto.class); view.setSingularEntityTitle("Correo"); view.setPluralEntityTitle("Correos"); view.setEditableForm(false); view.setEditableGrid(false); super.addControlMapping(view); MenuItem menuItem= new MenuItem("Correos", "mail", "Gestionar Correos"); menuComponent.addItemMenu(menuItem); super.addMenuComponent(menuComponent); } @Override public List<MenuItem> configureVisibilityMenu(List<MenuItem> menuData){ return securityService.configureVisibilityMenu(menuData); } }
{ "content_hash": "e7b9de03ed0efed1acb3d9f2d3a725c2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 86, "avg_line_length": 31.984126984126984, "alnum_prop": 0.7215880893300248, "repo_name": "lacastrillov/marketplatform", "id": "835776afb7ab6e2efe9abca19509ee4de31367b3", "size": "2015", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/lacv/marketplatform/controllers/view/MailViewController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "395923" }, { "name": "HTML", "bytes": "53" }, { "name": "Java", "bytes": "880599" }, { "name": "JavaScript", "bytes": "101854" } ], "symlink_target": "" }
package constant
{ "content_hash": "8576f40798a916679a055dc0b886ccb9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 16, "avg_line_length": 17, "alnum_prop": 0.8823529411764706, "repo_name": "orange-cloudfoundry/terraform-provider-cloudfoundry", "id": "fd0648153c5f206c72bcf48721ef214644993a9a", "size": "555", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "vendor/code.cloudfoundry.org/cli/api/uaa/constant/package.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "261939" }, { "name": "Shell", "bytes": "3779" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>ProgressIndicator - sap.m</title> <script src="shared-config.js"></script> <script src="../../../resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-libs="sap.m"> </script> <script> var app = new sap.m.App("myApp", {initialPage:"page1"}); var label1 = new sap.m.Label({ text : "Progress Indicator with 50% neutral" }); // create progressIndicator var oProgInd1 = new sap.m.ProgressIndicator("pi1", { width:"100%", percentValue:50, displayValue:"50%", showValue:true }); var oInput = new sap.m.Input("input", { placeholder : "Number", width:"10%" }); var label2 = new sap.m.Label({ text : "Progress Indicator with 75% negative without text (suggested normal size)" }); // create progressIndicator var oProgInd2 = new sap.m.ProgressIndicator("pi2", { width:"100%", percentValue:75, state: sap.ui.core.ValueState.Error }); var label3 = new sap.m.Label({ text : "Progress Indicator with 99% positive (suggested small size)" }); // create progressIndicator var oProgInd3 = new sap.m.ProgressIndicator("pi3", { width:"100%", height: "1.375rem", percentValue:88, displayValue:"0.88GB of 1GB", showValue:true, state: sap.ui.core.ValueState.Success }); var label4 = new sap.m.Label({ text : "Progress Indicator with 25% critical, 50% width, disabled" }); // create progressIndicator var oProgInd4 = new sap.m.ProgressIndicator("pi4", { width:"50%", percentValue:25, displayValue:"25%", showValue:true, enabled:false, state: sap.ui.core.ValueState.Warning }); var label5 = new sap.m.Label({ text : "Invisible Progress Indicator" }); var oProgInd5 = new sap.m.ProgressIndicator("pi5", { width:"50%", percentValue:99, displayValue:"99%", showValue:false, visible:false }); var label6 = new sap.m.Label({ text : "Progress Indicator with 65% negative" }); // create progressIndicator var oProgInd6 = new sap.m.ProgressIndicator("pi6", { width:"80%", percentValue:65, displayValue:"65%", enabled: false, state: sap.ui.core.ValueState.Error }); var label7 = new sap.m.Label({ text : "Progress Indicator with 45% critical" }); // create progressIndicator var oProgInd7 = new sap.m.ProgressIndicator("pi7", { width:"80%", percentValue:45, displayValue:"45%", state: sap.ui.core.ValueState.Warning }); var label8 = new sap.m.Label({ text : "Progress Indicator with 49% success" }); // create progressIndicator var oProgInd8 = new sap.m.ProgressIndicator("pi8", { width:"10%", percentValue:49, displayValue:"49%", state: sap.ui.core.ValueState.Success }); var oButton = new sap.m.Button("button", { text:"ChangePI", press: function(){ var sPercent = sap.ui.getCore().byId("input").getValue(); oProgInd8.setPercentValue(parseFloat(sPercent)); oProgInd8.setDisplayValue(sPercent + "%"); } }); var oButton2 = new sap.m.Button("change_pi", { text:"Change PI to 40%", press: function(){ oProgInd8.setPercentValue(40); oProgInd8.setDisplayValue("40%"); } }); var oButton3 = new sap.m.Button("small_pi", { text:"Set PI to small size", press: function(){ oProgInd8.setHeight("1.375rem"); } }); var oButton4 = new sap.m.Button("disable_pi", { text:"Set PI to disable", press: function(){ oProgInd8.setEnabled(false); } }); var oButton5 = new sap.m.Button("state_pi", { text:"Set state", press: function(){ oProgInd8.setState(sap.ui.core.ValueState.Neutral); } }); var oButton6 = new sap.m.Button("change_pi_empty", { text:"Change PI to -20%", press: function(){ oProgInd8.setPercentValue(-20); oProgInd8.setDisplayValue("-20%"); } }); var oButton7 = new sap.m.Button("change_pi_full", { text:"Change PI to 120%", press: function(){ oProgInd8.setPercentValue(120); oProgInd8.setDisplayValue("120%"); } }); // create page var page1 = new sap.m.Page("page1", { title:"Progress Indicator", content: [ label2, oProgInd2, label3, oProgInd3, label4, oProgInd4, //label5, oProgInd5, label1, oProgInd1, label6, oProgInd6, label7, oProgInd7, label8, oProgInd8, oInput, oButton, oButton2, oButton3, oButton4, oButton5, oButton6, oButton7 ] }); app.addPage(page1); app.placeAt("body"); </script> </head> <body id="body" class="sapUiBody" role="application"> </body> </html>
{ "content_hash": "f2ce0dce2d578272bb1cf27597507cb1", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 86, "avg_line_length": 22.483720930232558, "alnum_prop": 0.6086057095573024, "repo_name": "nzamani/openui5", "id": "ea8389affe9544bb9433256f8fa2c7944644ab64", "size": "4834", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/sap.m/test/sap/m/ProgressIndicator.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2853775" }, { "name": "Gherkin", "bytes": "17351" }, { "name": "HTML", "bytes": "17332110" }, { "name": "Java", "bytes": "83480" }, { "name": "JavaScript", "bytes": "44924427" } ], "symlink_target": "" }
.profile-compare-header, .profile-compare-monsters-ajax { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; } .ph-10{ padding-left: 10px; padding-right: 10px; } .comparison-winner-cell{ background-color: lightgreen; } .comparison-table td{ text-align: left; } .comparison-winner::before{ color: green; } .comparison-loser::before{ color: red; } .comparison-tie::before{ color: orange; } .float-right{ float: right; } .mr-15{ margin-right: 15px; } .w-monster-box{ width: 102px; } .comparison-difference-minus{ color: red; } .comparison-difference-plus{ color: green; } .comparison-table th:first-child{ width: 25%; } .comparison-table-category{ text-align: center; } @media only screen and (max-width: 768px) { .grid-item.col-xs-12 { padding-left: 0!important; padding-right: 0!important; } }
{ "content_hash": "e1962451705bb6f147954186ce24407c", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 43, "avg_line_length": 13.478260869565217, "alnum_prop": 0.6387096774193548, "repo_name": "PeteAndersen/swarfarm", "id": "5b189180228a18ab4afc87b732e4ec54ea149422", "size": "930", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "herders/static/herders/css/compare.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "31891" }, { "name": "HTML", "bytes": "352588" }, { "name": "JavaScript", "bytes": "79075" }, { "name": "Python", "bytes": "982216" }, { "name": "Shell", "bytes": "3403" } ], "symlink_target": "" }
<?php class Becklyn_Sniffs_NamingConventions_ValidClassNameSniff implements PHP_CodeSniffer_Sniff { /** * A list of tokenizers this sniff supports. * * @var array */ public $supportedTokenizers = array( 'PHP', ); /** * Returns an array of tokens this test wants to listen for. * * @return array */ public function register() { return array( T_INTERFACE, T_TRAIT, T_EXTENDS, T_ABSTRACT ); } /** * Processes this test, when one of its tokens is encountered. * * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document. * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * * @return void */ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $line = $tokens[$stackPtr]['line']; while ($tokens[$stackPtr]['line'] == $line) { /* * Suffix interfaces with Interface; */ if ('T_INTERFACE' == $tokens[$stackPtr]['type']) { $name = $phpcsFile->findNext(T_STRING, $stackPtr); if ($name && substr($tokens[$name]['content'], -9) != 'Interface') { $phpcsFile->addError( 'Interface name is not suffixed with "Interface"', $stackPtr, 'InvalidInterfaceName' ); } break; } /* * Suffix traits with Trait; */ if ('T_TRAIT' == $tokens[$stackPtr]['type']) { $name = $phpcsFile->findNext(T_STRING, $stackPtr); if ($name && substr($tokens[$name]['content'], -5) != 'Trait') { $phpcsFile->addError( 'Trait name is not suffixed with "Trait"', $stackPtr, 'InvalidTraitName' ); } break; } /* * Suffix exceptions with Exception; */ if ('T_EXTENDS' == $tokens[$stackPtr]['type']) { $extend = $phpcsFile->findNext(T_STRING, $stackPtr); if ($extend && substr($tokens[$extend]['content'], -9) == 'Exception') { $class = $phpcsFile->findPrevious(T_CLASS, $stackPtr); $name = $phpcsFile->findNext(T_STRING, $class); if ($name && substr($tokens[$name]['content'], -9) != 'Exception') { $phpcsFile->addError( 'Exception name is not suffixed with "Exception"', $stackPtr, 'InvalidExceptionName' ); } } break; } /* * Prefix abstract classes with Abstract. */ if ('T_ABSTRACT' == $tokens[$stackPtr]['type']) { $name = $phpcsFile->findNext(T_STRING, $stackPtr); $function = $phpcsFile->findNext(T_FUNCTION, $stackPtr); // making sure we're not dealing with an abstract function if ($name && (is_null($function) || $name < $function) && substr($tokens[$name]['content'], 0, 8) != 'Abstract') { $phpcsFile->addError( 'Abstract class name is not prefixed with "Abstract"', $stackPtr, 'InvalidAbstractName' ); } break; } $stackPtr++; } return; } }
{ "content_hash": "eae88bb6d6952abe5c4601a79bae7573", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 130, "avg_line_length": 32.586776859504134, "alnum_prop": 0.4346943951306112, "repo_name": "Becklyn/PHP_CodeSniffer_Extensions", "id": "e28cbafb4c758aad1896b7281d65bab7169707c7", "size": "3943", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Becklyn/Sniffs/NamingConventions/ValidClassNameSniff.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "36262" } ], "symlink_target": "" }
using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Common.Logging; using HealthMonitoring.SelfHost.Handlers; using Moq; using Xunit; namespace HealthMonitoring.Api.UnitTests.Handlers { public class MessageLoggingHandlerTests { private const string ResponseContent = "my content"; class TestableMessageLoggingHandler : MessageLoggingHandler { public TestableMessageLoggingHandler(ILog logger) : base(logger) { } } private readonly TestableMessageLoggingHandler _handler; private readonly Mock<ILog> _logger; public MessageLoggingHandlerTests() { _logger = new Mock<ILog>(); _handler = new TestableMessageLoggingHandler(_logger.Object); } [Theory] [InlineData("text/html")] [InlineData("text/css")] [InlineData("image/png")] [InlineData("image/x-icon")] [InlineData("image/svg+xml")] [InlineData("image/jpeg")] [InlineData("image/gif")] public async Task HandleResponse_should_log_response_without_content_of_the_response_if_content_type_is_not_allowed(string mimeType) { var response = CreateResponse(HttpStatusCode.BadRequest, mimeType); var correlationId = Guid.NewGuid(); await _handler.HandleResponse(response, correlationId); _logger.Verify(l => l.Info($"ID: {correlationId} | status: [{(int)response.StatusCode} {response.ReasonPhrase}]")); } [Theory] [InlineData("text/plain")] [InlineData("application/json")] [InlineData("text/xml")] [InlineData("application/xml")] public async Task HandleResponse_should_return_response_content_if_content_type_is_allowed_and_status_code_is_400_or_higher(string mimeType) { var response = CreateResponse(HttpStatusCode.BadRequest, mimeType); var correlationId = Guid.NewGuid(); await _handler.HandleResponse(response, correlationId); _logger.Verify(l => l.Info($"ID: {correlationId} | status: [{(int)response.StatusCode} {response.ReasonPhrase}] | content: {ResponseContent}")); } [Theory] [InlineData(HttpStatusCode.Continue)] [InlineData(HttpStatusCode.SwitchingProtocols)] [InlineData(HttpStatusCode.OK)] [InlineData(HttpStatusCode.Created)] [InlineData(HttpStatusCode.Ambiguous)] [InlineData(HttpStatusCode.TemporaryRedirect)] public async Task HandleResponse_should_log_response_without_content_if_status_code_is_100_200_or_300(HttpStatusCode statusCode) { var response = CreateResponse(statusCode, "text/plain"); var correlationId = Guid.NewGuid(); await _handler.HandleResponse(response, correlationId); _logger.Verify(l => l.Info($"ID: {correlationId} | status: [{(int)statusCode} {response.ReasonPhrase}]")); } [Theory] [InlineData(HttpStatusCode.BadRequest)] [InlineData(HttpStatusCode.Unauthorized)] [InlineData(HttpStatusCode.InternalServerError)] [InlineData(HttpStatusCode.ServiceUnavailable)] public async Task HandleResponse_should_log_response_with_content_if_status_code_is_400_or_higher(HttpStatusCode statusCode) { var response = CreateResponse(statusCode, "text/plain"); var correlationId = Guid.NewGuid(); await _handler.HandleResponse(response, correlationId); _logger.Verify(l => l.Info($"ID: {correlationId} | status: [{(int)statusCode} {response.ReasonPhrase}] | content: {ResponseContent}")); } [Fact] public async Task HandleRequest_should_log_request() { var request = new HttpRequestMessage { Method = HttpMethod.Put, RequestUri = new Uri("http://localhost/abc?def") }; var correlationId = await _handler.HandleRequest(request); _logger.Verify(l => l.Info($"ID: {request.GetCorrelationId()} | {request.Method}: [{request.RequestUri}]")); Assert.Equal(request.GetCorrelationId(), correlationId); } private static HttpResponseMessage CreateResponse(HttpStatusCode statusCode, string mimeType) { return new HttpResponseMessage(statusCode) { Content = new StringContent(ResponseContent) { Headers = { ContentType = new MediaTypeHeaderValue(mimeType) } } }; } } }
{ "content_hash": "e27816ce472f671a0f581728ad9214cf", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 156, "avg_line_length": 36.93846153846154, "alnum_prop": 0.6207830070803831, "repo_name": "andronz/HealthMonitoring", "id": "bd617771fda1c57e4081de471621111c475cc718", "size": "4804", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "HealthMonitoring.Api.UnitTests/Handlers/MessageLoggingHandlerTests.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "556421" }, { "name": "CSS", "bytes": "8932" }, { "name": "HTML", "bytes": "36582" }, { "name": "JavaScript", "bytes": "33319" }, { "name": "PowerShell", "bytes": "3070" } ], "symlink_target": "" }
#ifndef _LINUX_NET_H_ #define _LINUX_NET_H_ #include <sys/protosw.h> #include <sys/socket.h> #include <sys/socketvar.h> static inline int sock_create_kern(int family, int type, int proto, struct socket **res) { return -socreate(family, res, type, proto, curthread->td_ucred, curthread); } static inline int sock_getname(struct socket *so, struct sockaddr *addr, int *sockaddr_len, int peer) { struct sockaddr **nam; int error; nam = NULL; if (peer) { if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) return (-ENOTCONN); error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, nam); } else error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, nam); if (error) return (-error); *addr = **nam; *sockaddr_len = addr->sa_len; free(*nam, M_SONAME); return (0); } static inline void sock_release(struct socket *so) { soclose(so); } #endif /* _LINUX_NET_H_ */
{ "content_hash": "ba0e58c6503b7adcf84912e242cb9ada", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 73, "avg_line_length": 19.23404255319149, "alnum_prop": 0.6548672566371682, "repo_name": "dcui/FreeBSD-9.3_kernel", "id": "f47acf938fe70afb9690bdcf547d35dcca69ea92", "size": "2321", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "sys/ofed/include/linux/net.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "1740660" }, { "name": "Awk", "bytes": "135150" }, { "name": "Batchfile", "bytes": "158" }, { "name": "C", "bytes": "189969174" }, { "name": "C++", "bytes": "2113755" }, { "name": "DTrace", "bytes": "19810" }, { "name": "Forth", "bytes": "188128" }, { "name": "Groff", "bytes": "147703" }, { "name": "Lex", "bytes": "65561" }, { "name": "Logos", "bytes": "6310" }, { "name": "Makefile", "bytes": "594606" }, { "name": "Mathematica", "bytes": "9538" }, { "name": "Objective-C", "bytes": "527964" }, { "name": "PHP", "bytes": "2404" }, { "name": "Perl", "bytes": "3348" }, { "name": "Python", "bytes": "7091" }, { "name": "Shell", "bytes": "43402" }, { "name": "SourcePawn", "bytes": "253" }, { "name": "Yacc", "bytes": "160534" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.0 (/usr/local/bin/python3.3m)" project-jdk-type="Python SDK" /> </project>
{ "content_hash": "8911ceb94cb734cc6fe7122f8f6b3164", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 143, "avg_line_length": 43.4, "alnum_prop": 0.695852534562212, "repo_name": "LookThisCode/DeveloperBus", "id": "ecd7172c52457e8616612e4cf76fb522a21351cf", "size": "217", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Season 2013/Brazil/Projects/TaskKilla-master/.idea/misc.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "18934" }, { "name": "Awk", "bytes": "2730" }, { "name": "CSS", "bytes": "1871324" }, { "name": "CoffeeScript", "bytes": "55523" }, { "name": "Erlang", "bytes": "130" }, { "name": "Groovy", "bytes": "1701" }, { "name": "Java", "bytes": "1556000" }, { "name": "JavaScript", "bytes": "3660166" }, { "name": "PHP", "bytes": "4646799" }, { "name": "Perl", "bytes": "111832" }, { "name": "Python", "bytes": "459108" }, { "name": "Racket", "bytes": "3992" }, { "name": "Ruby", "bytes": "209226" }, { "name": "Shell", "bytes": "15969" } ], "symlink_target": "" }
JNIEXPORT jlong JNICALL Java_org_dmlc_mxnet_Predictor_createPredictor (JNIEnv *env, jclass, jbyteArray jsymbol, jbyteArray jparams, jint devType, jint devId, jobjectArray jkeys, jobjectArray jshapes) { jbyte* symbol = env->GetByteArrayElements(jsymbol, 0); jbyte* params = env->GetByteArrayElements(jparams, 0); jsize params_len = env->GetArrayLength(jparams); std::vector<std::pair<jstring, const char *>> track; std::vector<const char *> keys; for (int i=0; i<env->GetArrayLength(jkeys); i++) { jstring js = (jstring) env->GetObjectArrayElement(jkeys, i); const char *s = env->GetStringUTFChars(js, 0); keys.emplace_back(s); track.emplace_back(js, s); } std::vector<mx_uint> index; std::vector<mx_uint> shapes; mx_uint prev = 0; index.emplace_back(prev); for (int i=0; i<env->GetArrayLength(jshapes); i++) { jintArray jshape = (jintArray) env->GetObjectArrayElement(jshapes, i); jsize shape_len = env->GetArrayLength(jshape); jint *shape = env->GetIntArrayElements(jshape, 0); prev += shape_len; index.emplace_back(prev); for (int j=0; j<shape_len; ++j) shapes.emplace_back((mx_uint)shape[j]); env->ReleaseIntArrayElements(jshape, shape, 0); } PredictorHandle handle = 0; if (MXPredCreate((const char *)symbol, (const char *)params, params_len, devType, devId, (mx_uint)keys.size(), &(keys[0]), &(index[0]), &(shapes[0]), &handle) < 0) { jclass MxnetException = env->FindClass("org/dmlc/mxnet/MxnetException"); env->ThrowNew(MxnetException, MXGetLastError()); } env->ReleaseByteArrayElements(jsymbol, symbol, 0); env->ReleaseByteArrayElements(jparams, params, 0); for (auto& t: track) { env->ReleaseStringUTFChars(t.first, t.second); } return (jlong)handle; } JNIEXPORT void JNICALL Java_org_dmlc_mxnet_Predictor_nativeFree (JNIEnv *, jclass, jlong h) { PredictorHandle handle = (PredictorHandle)h; MXPredFree(handle); } JNIEXPORT jfloatArray JNICALL Java_org_dmlc_mxnet_Predictor_nativeGetOutput (JNIEnv *env, jclass, jlong h, jint index) { PredictorHandle handle = (PredictorHandle)h; mx_uint *shape = 0; mx_uint shape_len; if (MXPredGetOutputShape(handle, index, &shape, &shape_len) < 0) { jclass MxnetException = env->FindClass("org/dmlc/mxnet/MxnetException"); env->ThrowNew(MxnetException, MXGetLastError()); } size_t size = 1; for (mx_uint i=0; i<shape_len; ++i) size *= shape[i]; std::vector<float> data(size); if (MXPredGetOutput(handle, index, &(data[0]), size) < 0) { jclass MxnetException = env->FindClass("org/dmlc/mxnet/MxnetException"); env->ThrowNew(MxnetException, MXGetLastError()); } jfloatArray joutput = env->NewFloatArray(size); jfloat *out = env->GetFloatArrayElements(joutput, NULL); for (int i=0; i<size; i++) out[i] = data[i]; env->ReleaseFloatArrayElements(joutput, out, 0); return joutput; } JNIEXPORT void JNICALL Java_org_dmlc_mxnet_Predictor_nativeForward (JNIEnv *env, jclass, jlong h, jstring jkey, jfloatArray jinput) { PredictorHandle handle = (PredictorHandle)h; const char *key = env->GetStringUTFChars(jkey, 0); jfloat* input = env->GetFloatArrayElements(jinput, 0); jsize input_len = env->GetArrayLength(jinput); if (MXPredSetInput(handle, key, input, input_len) < 0) { jclass MxnetException = env->FindClass("org/dmlc/mxnet/MxnetException"); env->ThrowNew(MxnetException, MXGetLastError()); } env->ReleaseStringUTFChars(jkey, key); env->ReleaseFloatArrayElements(jinput, input, 0); if (MXPredForward(handle) < 0) { jclass MxnetException = env->FindClass("org/dmlc/mxnet/MxnetException"); env->ThrowNew(MxnetException, MXGetLastError()); } }
{ "content_hash": "795ae3c38ec8faa2b0482013591bc0ce", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 169, "avg_line_length": 36.93333333333333, "alnum_prop": 0.667354306343476, "repo_name": "hesseltuinhof/mxnet", "id": "b6cc9370b1f9cd048e65b26487c8934f75c787e6", "size": "3970", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "amalgamation/jni/predictor.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "10619" }, { "name": "C", "bytes": "87061" }, { "name": "C++", "bytes": "3237483" }, { "name": "CMake", "bytes": "48546" }, { "name": "Cuda", "bytes": "567360" }, { "name": "Groovy", "bytes": "217" }, { "name": "Java", "bytes": "16368" }, { "name": "Jupyter Notebook", "bytes": "1229390" }, { "name": "Makefile", "bytes": "40158" }, { "name": "Matlab", "bytes": "30187" }, { "name": "Perl", "bytes": "611248" }, { "name": "Perl 6", "bytes": "21993" }, { "name": "Protocol Buffer", "bytes": "77256" }, { "name": "Python", "bytes": "3257431" }, { "name": "R", "bytes": "317736" }, { "name": "Scala", "bytes": "883096" }, { "name": "Shell", "bytes": "118634" } ], "symlink_target": "" }
package rocks.xmpp.core.stream.model.errors; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * The implementation of the {@code <unsupported-version/>} stream error. * <blockquote> * <p><cite><a href="http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions-unsupported-version">4.9.3.25. unsupported-version</a></cite></p> * <p>The 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server.</p> * </blockquote> * This class is a singleton. * * @see #UNSUPPORTED_VERSION */ @XmlRootElement(name = "unsupported-version") @XmlType(factoryMethod = "create") final class UnsupportedVersion extends Condition { UnsupportedVersion() { } private static UnsupportedVersion create() { return (UnsupportedVersion) UNSUPPORTED_VERSION; } }
{ "content_hash": "edf845a118dbe5d40a3fcf53290de8a9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 153, "avg_line_length": 33.035714285714285, "alnum_prop": 0.7113513513513513, "repo_name": "jeozey/XmppServerTester", "id": "930a99b526bec6d06e96861efddbca6cdb139740", "size": "2100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xmpp-core/src/main/java/rocks/xmpp/core/stream/model/errors/UnsupportedVersion.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3433" }, { "name": "Java", "bytes": "4408957" } ], "symlink_target": "" }
@interface NewsCell : UITableViewCell @property (strong, nonatomic) IBOutlet UIImageView *newsImage; @property (strong, nonatomic) IBOutlet UILabel *titleLabel; @property (strong, nonatomic) IBOutlet UILabel *commentLabel; @property (nonatomic, retain) NewsHeadline *news; @end
{ "content_hash": "ca5905c1a94463c009cba0e1091cc3d3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 62, "avg_line_length": 39.857142857142854, "alnum_prop": 0.7992831541218638, "repo_name": "YvanSwen/ProjectA_MyNews", "id": "5fd76cf8c58569509c461b71077f1890ea2bd1e7", "size": "448", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MyNews/MyNews/Classes/Scenes/Views/NewsCell.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "64272" }, { "name": "Ruby", "bytes": "81" } ], "symlink_target": "" }
var App = angular.module('app', ['ngRoute', 'monospaced.qrcode']) .config(['$routeProvider', '$locationProvider', ($routeProvider, $locationProvider: ng.ILocationProvider) => { $locationProvider.html5Mode({ enabled: true, requireBase: false }); $routeProvider .when('/', { templateUrl: '/app/Views/Landing/Landing.html' }) .when('/player/:gameId', { templateUrl: '/app/Views/Player/Player.html' }) .when('/:gameId', { templateUrl: '/app/Views/CodeMaster/CodeMaster.html' }) .otherwise({ redirectTo: '/' }); }]); export = App;
{ "content_hash": "2af222aa62353c568414c661b3b9d740", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 35.78260869565217, "alnum_prop": 0.44471445929526127, "repo_name": "epernice/guesswork-game", "id": "2244d23c48931c3176dc85a83c924ac67ed16297", "size": "824", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/app/App.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1025" }, { "name": "HTML", "bytes": "11082" }, { "name": "JavaScript", "bytes": "327392" }, { "name": "TypeScript", "bytes": "31055" } ], "symlink_target": "" }
<?php namespace ChrisKonnertz\StringCalc\Symbols\Concrete\Functions; use ChrisKonnertz\StringCalc\Exceptions\NumberOfArgumentsException; use ChrisKonnertz\StringCalc\Symbols\AbstractFunction; /** * PHP ceil() function aka round fractions up. * Expects one parameter. * @see http://php.net/manual/en/ref.math.php */ class CeilFunction extends AbstractFunction { /** * @inheritdoc */ protected $identifiers = ['ceil']; /** * @inheritdoc */ public function execute(array $arguments) { if (sizeof($arguments) != 1) { throw new NumberOfArgumentsException('Error: Expected one argument, got '.sizeof($arguments)); } $number = $arguments[0]; return ceil($number); } }
{ "content_hash": "5e3ee5aa9f84bff1afc197da1c636428", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 106, "avg_line_length": 21.714285714285715, "alnum_prop": 0.656578947368421, "repo_name": "chriskonnertz/string-calc", "id": "efda36248255cc777e1464450298807b4fc50207", "size": "760", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/ChrisKonnertz/StringCalc/Symbols/Concrete/Functions/CeilFunction.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "169203" } ], "symlink_target": "" }
package org.kie.server.client; import java.util.List; import org.kie.server.api.model.instance.DocumentInstance; public interface DocumentServicesClient { String getDocumentLink(String identifier); DocumentInstance getDocument(String identifier); String createDocument(DocumentInstance documentInstance); void updateDocument(DocumentInstance documentInstance); void deleteDocument(String identifier); List<DocumentInstance> listDocuments(Integer page, Integer pageSize); }
{ "content_hash": "496d8180cf4244245b318d2aaf177e43", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 73, "avg_line_length": 23.09090909090909, "alnum_prop": 0.797244094488189, "repo_name": "ibek/droolsjbpm-integration", "id": "5d1d54aa5752b4b5f89d32c8f0e7eb49164c4434", "size": "1084", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/DocumentServicesClient.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2569" }, { "name": "CSS", "bytes": "7748" }, { "name": "HTML", "bytes": "2654" }, { "name": "Java", "bytes": "6223954" }, { "name": "JavaScript", "bytes": "32051" }, { "name": "Shell", "bytes": "3525" }, { "name": "XSLT", "bytes": "2865" } ], "symlink_target": "" }
package com.boundary.plugin.sdk; public interface PluginConfiguration { public static final String PLUGIN_PARAMETER_FILENAME = "param.json"; }
{ "content_hash": "492d40ac3649a6190103f916d24e9a09", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 21, "alnum_prop": 0.7891156462585034, "repo_name": "jdgwartney/meter-plugin-sdk-java", "id": "9d812d134b22da07bf2668feeef95aed0f5a3fa9", "size": "744", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/main/java/com/boundary/plugin/sdk/PluginConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1860" }, { "name": "Java", "bytes": "140399" }, { "name": "Shell", "bytes": "320" } ], "symlink_target": "" }
<!doctype html> <!-- Copyright (c) 2014, Jari Hämäläinen, Carita Kiili and Julie Coiro All rights reserved. See LICENSE for full license text. @author Jari Hämäläinen --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href="OnlineInquiryTool.css"> <title>Online Inquiry Tool</title> <script type="text/javascript" language="javascript" src="onlineinquirytool/onlineinquirytool.nocache.js"></script> </head> <body class="mbody"> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <div id="content" class="clear-wrap page-wrap"> </div> <div id="copyright" class="copyright"> </div> <div id="appinfo" class="app-info"> </div> </body> </html>
{ "content_hash": "a05d03134583fb8d69749ec01970494c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 177, "avg_line_length": 29.17142857142857, "alnum_prop": 0.693437806072478, "repo_name": "jhama/onlineinquirytool", "id": "3a435396e6751eab1782d0a9f77408cd6b9d3dbe", "size": "1027", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "war/OnlineInquiryTool.html", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "20813" }, { "name": "Java", "bytes": "149073" } ], "symlink_target": "" }
<?php ///////////////////////////////////////////////////////////////////////////////////// // xbtit - Bittorrent tracker/frontend // // Copyright (C) 2004 - 2015 Btiteam // // This file is part of xbtit. // // 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. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. // //////////////////////////////////////////////////////////////////////////////////// require(dirname(__FILE__).'/settings.php'); // cache interval for cfg read again (it's mysql based now, we don't want overload only for cfg read!) $reload_cfg_interval=60; function get_cached_config($qrystr, $cachetime=0) { global $dbhost, $dbuser, $dbpass, $database, $num_queries, $cached_querys; $cache_file = realpath(dirname(__FILE__).'/..').'/cache/'.md5($qrystr).'.txt'; $num_queries++; if ($cachetime > 0) if (file_exists($cache_file) && (time()-$cachetime) < filemtime($cache_file)) { $cached_querys++; return unserialize(file_get_contents($cache_file)); } ($GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass)) or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))); ((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE $database")) or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))); $mr = mysqli_query($GLOBALS["___mysqli_ston"], $qrystr." -- ".$mySecret) or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))); while ($mz = mysqli_fetch_assoc($mr)) { if ($mz['value']=='true') $return[$mz['key']]= true; elseif ($mz['value']=='false') $return[$mz['key']]= false; elseif (is_numeric($mz['value'])) $return[$mz['key']] = max(0,$mz['value']); else $return[$mz['key']] = StripSlashes($mz['value']); } unset($mz); ((mysqli_free_result($mr) || (is_object($mr) && (get_class($mr) == "mysqli_result"))) ? true : false); ((is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res); if ($cachetime > 0) { $fp = fopen($cache_file,'w'); fputs($fp,serialize($return)); fclose($fp); } return $return; } // default settings function apply_default_settings() { global $btit_settings; if (!array_key_exists('max_announce',$btit_settings)) $btit_settings['max_announce']=1800; if (!array_key_exists('min_announce',$btit_settings)) $btit_settings['min_announce']=300; if (!array_key_exists('max_peers_per_announce',$btit_settings)) $btit_settings['max_peers_per_announce']=50; if (!array_key_exists('dynamic',$btit_settings)) $btit_settings['dynamic']=false; if (!array_key_exists('nat',$btit_settings)) $btit_settings['nat']=false; if (!array_key_exists('persist',$btit_settings)) $btit_settings['persist']=false; if (!array_key_exists('allow_override_ip',$btit_settings)) $btit_settings['allow_override_ip']=false; if (!array_key_exists('countbyte',$btit_settings)) $btit_settings['countbyte']=true; if (!array_key_exists('peercaching',$btit_settings)) $btit_settings['peercaching']=true; if (!array_key_exists('maxpid_seeds',$btit_settings)) $btit_settings['maxpid_seeds']=3; if (!array_key_exists('maxpid_leech',$btit_settings)) $btit_settings['maxpid_leech']=2; if (!array_key_exists('name',$btit_settings)) $btit_settings['name']='CyByd` Test Site'; if (!array_key_exists('url',$btit_settings)) $btit_settings['url']='http://localhost'; if (!array_key_exists('announce',$btit_settings)) $btit_settings['announce']=serialize(array('http://localhost/announce.php')); if (!array_key_exists('email',$btit_settings)) $btit_settings['email']='tracker@localhost'; if (!array_key_exists('torrentdir',$btit_settings)) $btit_settings['torrentdir']='torrents'; if (!array_key_exists('validation',$btit_settings)) $btit_settings['validation']='user'; if (!array_key_exists('imagecode',$btit_settings)) $btit_settings['imagecode']=true; if (!array_key_exists('sanity_update',$btit_settings)) $btit_settings['sanity_update']=300; if (!array_key_exists('external_update',$btit_settings)) $btit_settings['external_update']=0; if (!array_key_exists('forum',$btit_settings)) $btit_settings['forum']=''; if (!array_key_exists('external',$btit_settings)) $btit_settings['external']=true; if (!array_key_exists('gzip',$btit_settings)) $btit_settings['gzip']=true; if (!array_key_exists('debug',$btit_settings)) $btit_settings['debug']=true; if (!array_key_exists('disable_dht',$btit_settings)) $btit_settings['disable_dht']=false; if (!array_key_exists('livestat',$btit_settings)) $btit_settings['livestat']=true; if (!array_key_exists('logactive',$btit_settings)) $btit_settings['logactive']=true; if (!array_key_exists('loghistory',$btit_settings)) $btit_settings['loghistory']=false; if (!array_key_exists('default_language',$btit_settings)) $btit_settings['default_language']=1; if (!array_key_exists('default_charset',$btit_settings)) $btit_settings['default_charset']='ISO-8859-1'; if (!array_key_exists('default_style',$btit_settings)) $btit_settings['default_style']=1; if (!array_key_exists('max_users',$btit_settings)) $btit_settings['max_users']=0; if (!array_key_exists('max_torrents_per_page',$btit_settings)) $btit_settings['max_torrents_per_page']=15; if (!array_key_exists('p_announce',$btit_settings)) $btit_settings['p_announce']=true; if (!array_key_exists('p_scrape',$btit_settings)) $btit_settings['p_scrape']=false; if (!array_key_exists('show_uploader',$btit_settings)) $btit_settings['show_uploader']=true; if (!array_key_exists('newslimit',$btit_settings)) $btit_settings['newslimit']=3; if (!array_key_exists('forumlimit',$btit_settings)) $btit_settings['forumlimit']=5; if (!array_key_exists('last10limit',$btit_settings)) $btit_settings['last10limit']=5; if (!array_key_exists('mostpoplimit',$btit_settings)) $btit_settings['mostpoplimit']=5; if (!array_key_exists('clocktype',$btit_settings)) $btit_settings['clocktype']=true; if (!array_key_exists('usepopup',$btit_settings)) $btit_settings['usepopup']=false; if (!array_key_exists('xbtt_use',$btit_settings)) $btit_settings['xbtt_use']=false; if (!array_key_exists('xbtt_url',$btit_settings)) $btit_settings['xbtt_url']=''; if (!array_key_exists('cache_duration',$btit_settings)) $btit_settings['cache_duration']=0; if (!array_key_exists('mail_type',$btit_settings)) $btit_settings['mail_type']='php'; if (!array_key_exists('ajax_poller',$btit_settings)) $btit_settings['ajax_poller']=true; } $btit_settings = get_cached_config('SELECT `key`,`value` FROM '.$TABLE_PREFIX.'settings', $reload_cfg_interval); apply_default_settings(); /* Tracker Configuration * * This file provides configuration informatino for * the tracker. The user-editable variables are at the top. It is * recommended that you do not change the database settings * unless you know what you are doing. */ // Maximum reannounce interval. $GLOBALS['report_interval'] = $btit_settings['max_announce']; // Minimum reannounce interval. Optional. $GLOBALS['min_interval'] = $btit_settings['min_announce']; // Number of peers to send in one request. $GLOBALS['maxpeers'] = $btit_settings['max_peers_per_announce']; // If set to true, then the tracker will accept any and all // torrents given to it. Not recommended, but available if you need it. $GLOBALS['dynamic_torrents'] = $btit_settings['dynamic']; // If set to true, NAT checking will be performed. // This may cause trouble with some providers, so it's // off by default. $GLOBALS['NAT'] = $btit_settings['nat']; // Persistent connections: true or false. // Check with your webmaster to see if you're allowed to use these. // not recommended, only if you get very higher loads, but use at you own risk. $GLOBALS['persist'] = $btit_settings['persist']; // Allow users to override ip= ? // Enable this if you know people have a legit reason to use // this function. Leave disabled otherwise. $GLOBALS['ip_override'] = $btit_settings['allow_override_ip']; // For heavily loaded trackers, set this to false. It will stop count the number // of downloaded bytes and the speed of the torrent, but will significantly reduce // the load. $GLOBALS['countbytes'] = $btit_settings['countbyte']; // Table caches! // Lowers the load on all systems, but takes up more disk space. // You win some, you lose some. But since the load is the big problem, // grab this. // // Warning! Enable this BEFORE making torrents, or else run makecache.php // immediately, or else you'll be in deep trouble. The tables will lose // sync and the database will be in a somewhat 'stale' state. $GLOBALS['peercaching'] = $btit_settings['peercaching']; // Max num. of seeders with same PID. $GLOBALS['maxseeds'] = $btit_settings['maxpid_seeds']; // Max num. of leechers with same PID. $GLOBALS['maxleech'] = $btit_settings['maxpid_leech']; /////////// End of User Configuration /////////// // Tracker's name $SITENAME = $btit_settings['name']; // Tracker's Base URL $BASEURL = $btit_settings['url']; // Tracker's announce urls, can be more than one $TRACKER_ANNOUNCE_URL = array(); $TRACKER_ANNOUNCEURLS = array(); $TRACKER_ANNOUNCE_URL = unserialize($btit_settings['announce']); for($i=0,$count=count($TRACKER_ANNOUNCE_URL); $i<$count; $i++) { if (trim($TRACKER_ANNOUNCE_URL[$i])!='') $TRACKER_ANNOUNCEURLS[]=trim($TRACKER_ANNOUNCE_URL[$i]); } // Tracker's email (owner email) $SITEEMAIL = $btit_settings['email']; // Torrent's DIR $TORRENTSDIR = $btit_settings['torrentdir']; // validation type (must be none, user or admin // none=validate immediatly, user=validate by email, admin=manually validate $VALIDATION = $btit_settings['validation']; // Use or not the image code for new users' registration $USE_IMAGECODE = $btit_settings['imagecode']; // interval for sanity check (good = 10 minutes) $clean_interval = $btit_settings['sanity_update']; // interval for updating external torrents (depending of how many external torrents) $update_interval = $btit_settings['external_update']; // forum link or internal (empty = internal) or none $FORUMLINK = $btit_settings['forum']; // If you want to allow users to upload external torrents values true/false $EXTERNAL_TORRENTS = $btit_settings['external']; // Enable/disable GZIP compression, can save a lot of bandwidth $GZIP_ENABLED = $btit_settings['gzip']; // Show/Hide bottom page information on script's generation time and gzip $PRINT_DEBUG = $btit_settings['debug']; // Enable/disable DHT network, add private flag to 'info' in torrent $DHT_PRIVATE = $btit_settings['disable_dht']; // Enable/disable Live Stats (up/down updated every announce) WARNING CAN DO HIGH SERVER LOAD! $LIVESTATS = $btit_settings['livestat']; // Enable/disable Site log $LOG_ACTIVE = $btit_settings['logactive']; // Enable Basic History (torrents/users) $LOG_HISTORY = $btit_settings['loghistory']; $CAPTCHA_FOLDER = 'access_code'; // Default language (used for guest) $DEFAULT_LANGUAGE = $btit_settings['default_language']; // Default charset (used for guest) $GLOBALS['charset'] = $btit_settings['default_charset']; // Default style (used for guest) $DEFAULT_STYLE = $btit_settings['default_style']; // Maximum number of users (0 = no limits) $MAX_USERS = $btit_settings['max_users']; // torrents per page $ntorrents = $btit_settings['max_torrents_per_page']; // private announce (true/false), if set to true don't allow non register user to download $PRIVATE_ANNOUNCE = $btit_settings['p_announce']; // private scrape (true/false), if set to true don't allow non register user to scrape (for stats) $PRIVATE_SCRAPE = $btit_settings['p_scrape']; // Show uploaders nick on torrent listing $SHOW_UPLOADER = $btit_settings['show_uploader']; $GLOBALS['block_newslimit'] = $btit_settings['newslimit']; $GLOBALS['block_forumlimit'] = $btit_settings['forumlimit']; $GLOBALS['block_last10limit'] = $btit_settings['last10limit']; $GLOBALS['block_mostpoplimit'] =$btit_settings['mostpoplimit']; $GLOBALS['clocktype'] = $btit_settings['clocktype']; $GLOBALS['usepopup'] = $btit_settings['usepopup']; // Is xbtt used as backend? $XBTT_USE = $btit_settings['xbtt_use']; // If used as backend, then we should have the 'xbt url' $XBTT_URL = $btit_settings['xbtt_url']; // this is the interval between which the cache must be updated (if 0 cache is disable) $CACHE_DURATION = $btit_settings['cache_duration']; // ajax polling system hack // if set to false then the default btit polling system will be used $GLOBALS['ajax_poller']=true; // if set to true the script will perform an IP check to see if the IP has already voted $GLOBALS['ipcheck_poller']=false; // number of votes per page listed in admincp $votesppage = 25; // Bonus system by Real_ptr 1.3 (2.3.0) - upgraded to rev 743 by cybernet2u / start $GLOBALS["bonus"] = $btit_settings["bonus"]; $GLOBALS["price_vip"] = $btit_settings["price_vip"]; $GLOBALS["price_ct"] = $btit_settings["price_ct"]; $GLOBALS["price_name"] = $btit_settings["price_name"]; // Bonus system by Real_ptr 1.3 (2.3.0) - upgraded to rev 743 by cybernet2u / end // Torrent Image Upload by Real_ptr / start $GLOBALS["imageon"] = $btit_settings["imageon"]; $GLOBALS["screenon"] = $btit_settings["screenon"]; $GLOBALS["uploaddir"] = $btit_settings["uploaddir"]; $GLOBALS["file_limit"] = $btit_settings["file_limit"]; // Torrent Image Upload by Real_ptr / end // inits $cached_querys = 0; $num_querys = 0; ?>
{ "content_hash": "aa04fb4ae215780fefb72ac37db4a3b8", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 241, "avg_line_length": 55.07553956834533, "alnum_prop": 0.6744170857553393, "repo_name": "cybyd/cybyd", "id": "f49e6c05f20605f82d3d7d9fb09de1f6eb395e83", "size": "15311", "binary": false, "copies": "1", "ref": "refs/heads/MySQLi", "path": "include/config.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "116" }, { "name": "CSS", "bytes": "205535" }, { "name": "HTML", "bytes": "16744" }, { "name": "JavaScript", "bytes": "141321" }, { "name": "PHP", "bytes": "3559778" }, { "name": "Shell", "bytes": "4442" }, { "name": "Smarty", "bytes": "229960" } ], "symlink_target": "" }