text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
.mblDomButtonBlueMinus, .mblDomButtonBluePlus, .mblDomButtonDarkBlueMinus, .mblDomButtonDarkBluePlus, .mblDomButtonRedMinus, .mblDomButtonRedPlus { position: relative; width: 29px; height: 29px; } .mblDomButtonBlueMinus > div, .mblDomButtonBluePlus > div, .mblDomButtonDarkBlueMinus > div, .mblDomButtonDarkBluePlus > div, .mblDomButtonRedMinus > div, .mblDomButtonRedPlus > div { position: relative; top: 4px; left: 3px; width: 22px; height: 18px; border-width: 1px 1px 1px 0px; border-style: outset; color: white; border-radius: 3px; } .mblDomButtonBlueMinus > div, .mblDomButtonBluePlus > div { border-color: #6d89c7; background-color: #366edf; background: -webkit-gradient(linear, left top, left bottom, from(#7a9de9), to(#2362dd), color-stop(0.5, #366edf), color-stop(0.5, #215fdc)); } .mblDomButtonDarkBlueMinus > div, .mblDomButtonDarkBluePlus > div { border-color: #6d89c7; background-color: #5877a2; background: -webkit-gradient(linear, left top, left bottom, from(#8ea4c1), to(#4a6c9b), color-stop(0.5, #5877a2), color-stop(0.5, #476999)); } .mblDomButtonRedMinus > div, .mblDomButtonRedPlus > div { border-color: #cc1122; background-color: #c9404b; background: -webkit-gradient(linear, left top, left bottom, from(#d3656d), to(#bc1320), color-stop(0.5, #c9404b), color-stop(0.5, #bc1421)); } .mblDomButtonBlueMinus > div > div, .mblDomButtonBluePlus > div > div, .mblDomButtonDarkBlueMinus > div > div, .mblDomButtonDarkBluePlus > div > div, .mblDomButtonRedMinus > div > div, .mblDomButtonRedPlus > div > div { position: absolute; top: 7px; left: 7px; width: 8px; height: 2px; margin: 0px; font-size: 1px; border-style: none; background: white; border-top: 1px solid #4a5a71; } .mblDomButtonBluePlus > div > div > div, .mblDomButtonDarkBluePlus > div > div > div, .mblDomButtonRedPlus > div > div > div { position: absolute; top: -3px; left: 3px; width: 2px; height: 8px; margin: 0px; font-size: 1px; background-color: white; } .mblDomButtonBlackCircleCross { position: relative; width: 29px; height: 29px; } .mblDomButtonBlackCircleCross > div { position: relative; top: 3px; left: 3px; width: 23px; height: 23px; background-color: white; border-radius: 12px; -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5); } .mblDomButtonBlackCircleCross > div > div { position: relative; top: 2px; left: 2px; width: 19px; height: 19px; background-color: black; border-radius: 10px; } .mblDomButtonBlackCircleCross > div > div > div { position: absolute; top: 8px; left: 3px; width: 13px; height: 3px; margin: 0px; font-size: 1px; border-style: none; background-color: white; -webkit-transform: rotate(45deg); border-radius: 1px; } .mblDomButtonBlackCircleCross > div > div > div > div { position: absolute; top: -5px; left: 5px; width: 3px; height: 13px; margin: 0px; font-size: 1px; background-color: white; border-radius: 1px; } @-webkit-keyframes mblVibrate{ 0%{ -webkit-transform: rotate(-2deg); bottom: -1px; left: -1px; } 25% { -webkit-transform: rotate(1deg); bottom: 2px; left: 1px; } 50% { -webkit-transform: rotate(-1deg); bottom: -2px; left: -1px; } 75% { -webkit-transform: rotate(2deg); bottom: 2px; left: 1px; } 100% { -webkit-transform: rotate(-2deg); bottom: -1px; left: -1px; } } @-webkit-keyframes mblShrink{ from { -webkit-transform: scale(1); } to { -webkit-transform: scale(0.01); } } @-webkit-keyframes mblShrink0{ from { -webkit-transform: scale(1); } to { -webkit-transform: translate(-40%,-70%) scale(0.01); } } @-webkit-keyframes mblShrink1{ from { -webkit-transform: scale(1); } to { -webkit-transform: translate(-14%,-70%) scale(0.01); } } @-webkit-keyframes mblShrink2{ from { -webkit-transform: scale(1); } to { -webkit-transform: translate(14%,-70%) scale(0.01); } } @-webkit-keyframes mblShrink3{ from { -webkit-transform: scale(1); } to { -webkit-transform: translate(40%,-70%) scale(0.01); } } .mblIconContainer { margin: 20px 10px; padding: 0; } .mblIconItem { position: relative; overflow: hidden; list-style-type: none; float: left; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); } .mblIconItemTerminator { list-style-type: none; clear: both; } .mblIconItemPane { list-style-type: none; background-color: white; color: black; } .mblIconArea { position: relative; height: 78px; font-family: Helvetica; font-size: 12px; text-align: center; margin-top: 5px; margin-bottom: 5px; width: 74px; color: white; } .mblIconArea img { vertical-align: middle; } .mblIconAreaInner { position: relative; height: 65px; line-height: 65px; text-align: center; } .mblIconItemDeleteIcon { position: absolute; top: -4px; left: -2px; } .mblIconItemSpriteIcon { position: absolute; } .mblContent { clear: both; padding-bottom: 20px; } table.mblClose { clear: both; cursor: pointer; } .mblVibrate { position: relative; -webkit-animation-duration: .5s; -webkit-animation-timing-function: ease-in-out; -webkit-animation-iteration-count: infinite; -webkit-animation-name: mblVibrate; -webkit-transform: rotate(0deg); } .mblCloseContent { -webkit-animation-duration: .3s; -webkit-animation-timing-function: ease-in-out; -webkit-animation-name: mblShrink; -webkit-transform: scale(0.01); } .mblCloseContent.mblShrink0 { -webkit-animation-name: mblShrink0; } .mblCloseContent.mblShrink1 { -webkit-animation-name: mblShrink1; } .mblCloseContent.mblShrink2 { -webkit-animation-name: mblShrink2; } .mblCloseContent.mblShrink3 { -webkit-animation-name: mblShrink3; } .mblIconItemPaneHeading { position: relative; clear: both; overflow: hidden; margin-top: 0px; padding-left: 40px; height: 25px; border-top: 1px solid #f1f3f4; border-bottom: 1px solid #717d85; background-image: -webkit-gradient(linear, left top, left bottom, from(#e0e4e7), to(#b4bec6), color-stop(0.5, #c4ccd2), color-stop(0.5, #bfc8ce)); font-family: Helvetica; font-size: 14px; color: white; line-height: 26px; text-shadow: rgba(0, 0, 0, 0.6) 0px -1px 0px; text-overflow: ellipsis; white-space: nowrap; } .mblIconItemPaneIcon { position: absolute; top: -2px; left: 1px; }
{'content_hash': '7a6089b6c7db545f25c2428f6fefb5d1', 'timestamp': '', 'source': 'github', 'line_count': 254, 'max_line_length': 219, 'avg_line_length': 24.480314960629922, 'alnum_prop': 0.6986169186233515, 'repo_name': 'Osirisxxl/TestFrameworksMobile', 'id': '483df1cdfa5fd1d05756c4ea0ffea466695497a2', 'size': '6219', 'binary': False, 'copies': '13', 'ref': 'refs/heads/master', 'path': 'dojox/mobile/themes/android/IconContainer.css', 'mode': '33188', 'license': 'mit', 'language': []}
package org.kiji.common.flags; /** Thrown when a flag is repeated while flag override is not allowed. */ public class IllegalFlagOverrideException extends IllegalArgumentException { private static final long serialVersionUID = 5646254360048371459L; /** * Creates a new <code>IllegalFlagValueException</code> instance. * * @param message Human-readable message detailing the invalid flag. */ public IllegalFlagOverrideException(String message) { super(message); } }
{'content_hash': 'bae6623ddc8a432d5d77100d7c42bb49', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 76, 'avg_line_length': 29.0, 'alnum_prop': 0.7565922920892495, 'repo_name': 'kijiproject/kiji-common-flags', 'id': 'baec41fcb65174e7547b147ac761a4c40f0c6e25', 'size': '1282', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/kiji/common/flags/IllegalFlagOverrideException.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '103128'}]}
 #pragma once #include <aws/pinpoint/Pinpoint_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/pinpoint/model/MessageConfiguration.h> #include <aws/pinpoint/model/Schedule.h> #include <aws/pinpoint/model/CampaignState.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Pinpoint { namespace Model { /** * Treatment resource */ class AWS_PINPOINT_API TreatmentResource { public: TreatmentResource(); TreatmentResource(const Aws::Utils::Json::JsonValue& jsonValue); TreatmentResource& operator=(const Aws::Utils::Json::JsonValue& jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * The unique treatment ID. */ inline const Aws::String& GetId() const{ return m_id; } /** * The unique treatment ID. */ inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; } /** * The unique treatment ID. */ inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); } /** * The unique treatment ID. */ inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); } /** * The unique treatment ID. */ inline TreatmentResource& WithId(const Aws::String& value) { SetId(value); return *this;} /** * The unique treatment ID. */ inline TreatmentResource& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;} /** * The unique treatment ID. */ inline TreatmentResource& WithId(const char* value) { SetId(value); return *this;} /** * The message configuration settings. */ inline const MessageConfiguration& GetMessageConfiguration() const{ return m_messageConfiguration; } /** * The message configuration settings. */ inline void SetMessageConfiguration(const MessageConfiguration& value) { m_messageConfigurationHasBeenSet = true; m_messageConfiguration = value; } /** * The message configuration settings. */ inline void SetMessageConfiguration(MessageConfiguration&& value) { m_messageConfigurationHasBeenSet = true; m_messageConfiguration = std::move(value); } /** * The message configuration settings. */ inline TreatmentResource& WithMessageConfiguration(const MessageConfiguration& value) { SetMessageConfiguration(value); return *this;} /** * The message configuration settings. */ inline TreatmentResource& WithMessageConfiguration(MessageConfiguration&& value) { SetMessageConfiguration(std::move(value)); return *this;} /** * The campaign schedule. */ inline const Schedule& GetSchedule() const{ return m_schedule; } /** * The campaign schedule. */ inline void SetSchedule(const Schedule& value) { m_scheduleHasBeenSet = true; m_schedule = value; } /** * The campaign schedule. */ inline void SetSchedule(Schedule&& value) { m_scheduleHasBeenSet = true; m_schedule = std::move(value); } /** * The campaign schedule. */ inline TreatmentResource& WithSchedule(const Schedule& value) { SetSchedule(value); return *this;} /** * The campaign schedule. */ inline TreatmentResource& WithSchedule(Schedule&& value) { SetSchedule(std::move(value)); return *this;} /** * The allocated percentage of users for this treatment. */ inline int GetSizePercent() const{ return m_sizePercent; } /** * The allocated percentage of users for this treatment. */ inline void SetSizePercent(int value) { m_sizePercentHasBeenSet = true; m_sizePercent = value; } /** * The allocated percentage of users for this treatment. */ inline TreatmentResource& WithSizePercent(int value) { SetSizePercent(value); return *this;} /** * The treatment status. */ inline const CampaignState& GetState() const{ return m_state; } /** * The treatment status. */ inline void SetState(const CampaignState& value) { m_stateHasBeenSet = true; m_state = value; } /** * The treatment status. */ inline void SetState(CampaignState&& value) { m_stateHasBeenSet = true; m_state = std::move(value); } /** * The treatment status. */ inline TreatmentResource& WithState(const CampaignState& value) { SetState(value); return *this;} /** * The treatment status. */ inline TreatmentResource& WithState(CampaignState&& value) { SetState(std::move(value)); return *this;} /** * A custom description for the treatment. */ inline const Aws::String& GetTreatmentDescription() const{ return m_treatmentDescription; } /** * A custom description for the treatment. */ inline void SetTreatmentDescription(const Aws::String& value) { m_treatmentDescriptionHasBeenSet = true; m_treatmentDescription = value; } /** * A custom description for the treatment. */ inline void SetTreatmentDescription(Aws::String&& value) { m_treatmentDescriptionHasBeenSet = true; m_treatmentDescription = std::move(value); } /** * A custom description for the treatment. */ inline void SetTreatmentDescription(const char* value) { m_treatmentDescriptionHasBeenSet = true; m_treatmentDescription.assign(value); } /** * A custom description for the treatment. */ inline TreatmentResource& WithTreatmentDescription(const Aws::String& value) { SetTreatmentDescription(value); return *this;} /** * A custom description for the treatment. */ inline TreatmentResource& WithTreatmentDescription(Aws::String&& value) { SetTreatmentDescription(std::move(value)); return *this;} /** * A custom description for the treatment. */ inline TreatmentResource& WithTreatmentDescription(const char* value) { SetTreatmentDescription(value); return *this;} /** * The custom name of a variation of the campaign used for A/B testing. */ inline const Aws::String& GetTreatmentName() const{ return m_treatmentName; } /** * The custom name of a variation of the campaign used for A/B testing. */ inline void SetTreatmentName(const Aws::String& value) { m_treatmentNameHasBeenSet = true; m_treatmentName = value; } /** * The custom name of a variation of the campaign used for A/B testing. */ inline void SetTreatmentName(Aws::String&& value) { m_treatmentNameHasBeenSet = true; m_treatmentName = std::move(value); } /** * The custom name of a variation of the campaign used for A/B testing. */ inline void SetTreatmentName(const char* value) { m_treatmentNameHasBeenSet = true; m_treatmentName.assign(value); } /** * The custom name of a variation of the campaign used for A/B testing. */ inline TreatmentResource& WithTreatmentName(const Aws::String& value) { SetTreatmentName(value); return *this;} /** * The custom name of a variation of the campaign used for A/B testing. */ inline TreatmentResource& WithTreatmentName(Aws::String&& value) { SetTreatmentName(std::move(value)); return *this;} /** * The custom name of a variation of the campaign used for A/B testing. */ inline TreatmentResource& WithTreatmentName(const char* value) { SetTreatmentName(value); return *this;} private: Aws::String m_id; bool m_idHasBeenSet; MessageConfiguration m_messageConfiguration; bool m_messageConfigurationHasBeenSet; Schedule m_schedule; bool m_scheduleHasBeenSet; int m_sizePercent; bool m_sizePercentHasBeenSet; CampaignState m_state; bool m_stateHasBeenSet; Aws::String m_treatmentDescription; bool m_treatmentDescriptionHasBeenSet; Aws::String m_treatmentName; bool m_treatmentNameHasBeenSet; }; } // namespace Model } // namespace Pinpoint } // namespace Aws
{'content_hash': '28c642d4c02d79326fff5a3714d097d7', 'timestamp': '', 'source': 'github', 'line_count': 250, 'max_line_length': 157, 'avg_line_length': 31.952, 'alnum_prop': 0.6747621432148222, 'repo_name': 'svagionitis/aws-sdk-cpp', 'id': '0a0070b09579920023b2b4e5a679fbc8d865384f', 'size': '8561', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'aws-cpp-sdk-pinpoint/include/aws/pinpoint/model/TreatmentResource.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '2313'}, {'name': 'C++', 'bytes': '104799778'}, {'name': 'CMake', 'bytes': '455533'}, {'name': 'HTML', 'bytes': '4471'}, {'name': 'Java', 'bytes': '243075'}, {'name': 'Python', 'bytes': '72896'}, {'name': 'Shell', 'bytes': '2803'}]}
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Mania.Mods { public class ManiaModPerfect : ModPerfect { } }
{'content_hash': 'fcd3d3c0743f7fd4da656881507e86b9', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 92, 'avg_line_length': 25.818181818181817, 'alnum_prop': 0.721830985915493, 'repo_name': 'Nabile-Rahmani/osu', 'id': 'abada804fbdc539db00be4141c9237daaf98bcfd', 'size': '286', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '3142587'}]}
drop table s_web_page; create table s_web_page as (select WP_WEB_PAGE_ID WPAG_WEB_PAGE_ID ,d1.d_date WPAG_CREATE_DATE ,d2.d_date WPAG_ACCESS_DATE ,WP_AUTOGEN_FLAG WPAG_AUTOGEN_FLAG ,WP_URL WPAG_URL ,WP_TYPE WPAG_TYPE ,WP_CHAR_COUNT WPAG_CHAR_COUNT ,WP_LINK_COUNT WPAG_LINK_COUNT ,WP_IMAGE_COUNT WPAG_IMAGE_COUNT ,WP_MAX_AD_COUNT WPAG_MAX_AD_COUNT from web_page left outer join date_dim d1 on wp_creation_date_sk = d1.d_date_sk left outer join date_dim d2 on wp_access_date_sk = d2.d_date_sk where wp_rec_end_date is null -- need this to eliminate duplicates and rownum < 10 );
{'content_hash': 'fedb5fc03651af19a57d7b469828091e', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 79, 'avg_line_length': 38.705882352941174, 'alnum_prop': 0.6595744680851063, 'repo_name': 'vitesse-ftian/dgtools', 'id': '787379c166c27a86bbd93ab85c15d5e2ce08c8f9', 'size': '658', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'tpcds/tpcds_tools/tests/webv_up.sql', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '1107533'}, {'name': 'C++', 'bytes': '7109'}, {'name': 'Go', 'bytes': '263389'}, {'name': 'HTML', 'bytes': '44224'}, {'name': 'Java', 'bytes': '18527'}, {'name': 'Lex', 'bytes': '6742'}, {'name': 'Makefile', 'bytes': '48184'}, {'name': 'Objective-C', 'bytes': '13654'}, {'name': 'PLSQL', 'bytes': '5951'}, {'name': 'PLpgSQL', 'bytes': '1492'}, {'name': 'Perl', 'bytes': '6209'}, {'name': 'Python', 'bytes': '25061'}, {'name': 'SQLPL', 'bytes': '5725'}, {'name': 'Shell', 'bytes': '27695'}, {'name': 'Smarty', 'bytes': '421916'}, {'name': 'TSQL', 'bytes': '69232'}, {'name': 'Yacc', 'bytes': '14186'}]}
namespace peloton { namespace test { //===--------------------------------------------------------------------===// // Catalog Tests //===--------------------------------------------------------------------===// class CatalogTests : public PelotonTest {}; TEST_F(CatalogTests, BootstrappingCatalog) { auto catalog = catalog::Catalog::GetInstance(); catalog->Bootstrap(); EXPECT_EQ(1, storage::StorageManager::GetInstance()->GetDatabaseCount()); auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); storage::Database *database = catalog->GetDatabaseWithName(CATALOG_DATABASE_NAME, txn); // Check database metric table storage::DataTable *db_metric_table = catalog->GetTableWithName(CATALOG_DATABASE_NAME, CATALOG_SCHEMA_NAME, DATABASE_METRICS_CATALOG_NAME, txn); txn_manager.CommitTransaction(txn); EXPECT_NE(nullptr, database); EXPECT_NE(nullptr, db_metric_table); } // TEST_F(CatalogTests, CreatingDatabase) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); catalog::Catalog::GetInstance()->CreateDatabase("emp_db", txn); EXPECT_EQ("emp_db", catalog::Catalog::GetInstance() ->GetDatabaseWithName("emp_db", txn) ->GetDBName()); txn_manager.CommitTransaction(txn); } TEST_F(CatalogTests, CreatingTable) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); auto id_column = catalog::Column( type::TypeId::INTEGER, type::Type::GetTypeSize(type::TypeId::INTEGER), "id", true); id_column.AddConstraint( catalog::Constraint(ConstraintType::PRIMARY, "primary_key")); auto name_column = catalog::Column(type::TypeId::VARCHAR, 32, "name", true); std::unique_ptr<catalog::Schema> table_schema( new catalog::Schema({id_column, name_column})); std::unique_ptr<catalog::Schema> table_schema_2( new catalog::Schema({id_column, name_column})); std::unique_ptr<catalog::Schema> table_schema_3( new catalog::Schema({id_column, name_column})); catalog::Catalog::GetInstance()->CreateTable( "emp_db", DEFUALT_SCHEMA_NAME, "emp_table", std::move(table_schema), txn); catalog::Catalog::GetInstance()->CreateTable("emp_db", DEFUALT_SCHEMA_NAME, "department_table", std::move(table_schema_2), txn); catalog::Catalog::GetInstance()->CreateTable("emp_db", DEFUALT_SCHEMA_NAME, "salary_table", std::move(table_schema_3), txn); // insert random tuple into DATABASE_METRICS_CATALOG and check std::unique_ptr<type::AbstractPool> pool(new type::EphemeralPool()); catalog::DatabaseMetricsCatalog::GetInstance()->InsertDatabaseMetrics( 2, 3, 4, 5, pool.get(), txn); // inset meaningless tuple into QUERY_METRICS_CATALOG and check stats::QueryMetric::QueryParamBuf param; param.len = 1; param.buf = (unsigned char *)pool->Allocate(1); *param.buf = 'a'; auto database_object = catalog::Catalog::GetInstance()->GetDatabaseObject("emp_db", txn); catalog::Catalog::GetInstance() ->GetSystemCatalogs(database_object->GetDatabaseOid()) ->GetQueryMetricsCatalog() ->InsertQueryMetrics("a query", database_object->GetDatabaseOid(), 1, param, param, param, 1, 1, 1, 1, 1, 1, 1, pool.get(), txn); auto param1 = catalog::Catalog::GetInstance() ->GetSystemCatalogs(database_object->GetDatabaseOid()) ->GetQueryMetricsCatalog() ->GetParamTypes("a query", txn); EXPECT_EQ(1, param1.len); EXPECT_EQ('a', *param1.buf); // check colum object EXPECT_EQ("name", catalog::Catalog::GetInstance() ->GetTableObject("emp_db", DEFUALT_SCHEMA_NAME, "department_table", txn) ->GetColumnObject(1) ->GetColumnName()); txn_manager.CommitTransaction(txn); } TEST_F(CatalogTests, TableObject) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); auto table_object = catalog::Catalog::GetInstance()->GetTableObject( "emp_db", DEFUALT_SCHEMA_NAME, "department_table", txn); auto index_objects = table_object->GetIndexObjects(); auto column_objects = table_object->GetColumnObjects(); EXPECT_EQ(1, index_objects.size()); EXPECT_EQ(2, column_objects.size()); EXPECT_EQ(table_object->GetTableOid(), column_objects[0]->GetTableOid()); EXPECT_EQ("id", column_objects[0]->GetColumnName()); EXPECT_EQ(0, column_objects[0]->GetColumnId()); EXPECT_EQ(0, column_objects[0]->GetColumnOffset()); EXPECT_EQ(type::TypeId::INTEGER, column_objects[0]->GetColumnType()); EXPECT_TRUE(column_objects[0]->IsInlined()); EXPECT_TRUE(column_objects[0]->IsPrimary()); EXPECT_FALSE(column_objects[0]->IsNotNull()); EXPECT_EQ(table_object->GetTableOid(), column_objects[1]->GetTableOid()); EXPECT_EQ("name", column_objects[1]->GetColumnName()); EXPECT_EQ(1, column_objects[1]->GetColumnId()); EXPECT_EQ(4, column_objects[1]->GetColumnOffset()); EXPECT_EQ(type::TypeId::VARCHAR, column_objects[1]->GetColumnType()); EXPECT_TRUE(column_objects[1]->IsInlined()); EXPECT_FALSE(column_objects[1]->IsPrimary()); EXPECT_FALSE(column_objects[1]->IsNotNull()); // update pg_table SET version_oid = 1 where table_name = department_table oid_t department_table_oid = table_object->GetTableOid(); auto pg_table = catalog::Catalog::GetInstance() ->GetSystemCatalogs(table_object->GetDatabaseOid()) ->GetTableCatalog(); bool update_result = pg_table->UpdateVersionId(1, department_table_oid, txn); // get version id after update, invalidate old cache table_object = catalog::Catalog::GetInstance()->GetTableObject( "emp_db", DEFUALT_SCHEMA_NAME, "department_table", txn); uint32_t version_oid = table_object->GetVersionId(); EXPECT_NE(department_table_oid, INVALID_OID); EXPECT_EQ(update_result, true); EXPECT_EQ(version_oid, 1); txn_manager.CommitTransaction(txn); } TEST_F(CatalogTests, TestingNamespace) { EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("begin;")); // create namespaces emp_ns0 and emp_ns1 EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "create database default_database;")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("create schema emp_ns0;")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("create schema emp_ns1;")); // create emp_table0 and emp_table1 in namespaces EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "create table emp_ns0.emp_table0 (a int, b varchar);")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "create table emp_ns0.emp_table1 (a int, b varchar);")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "create table emp_ns1.emp_table0 (a int, b varchar);")); EXPECT_EQ(ResultType::FAILURE, TestingSQLUtil::ExecuteSQLQuery( "create table emp_ns1.emp_table0 (a int, b varchar);")); // insert values into emp_table0 EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "insert into emp_ns0.emp_table0 values (1, 'abc');")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "insert into emp_ns0.emp_table0 values (2, 'abc');")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery( "insert into emp_ns1.emp_table0 values (1, 'abc');")); // select values from emp_table0 and emp_table1 TestingSQLUtil::ExecuteSQLQueryAndCheckResult( "select * from emp_ns0.emp_table1;", {}); TestingSQLUtil::ExecuteSQLQueryAndCheckResult( "select * from emp_ns0.emp_table0;", {"1|abc", "2|abc"}); TestingSQLUtil::ExecuteSQLQueryAndCheckResult( "select * from emp_ns1.emp_table0;", {"1|abc"}); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("commit;")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("begin;")); EXPECT_EQ(ResultType::FAILURE, TestingSQLUtil::ExecuteSQLQuery( "select * from emp_ns1.emp_table1;")); EXPECT_EQ(ResultType::ABORTED, TestingSQLUtil::ExecuteSQLQuery("commit;")); // drop namespace emp_ns0 and emp_ns1 EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("begin;")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("drop schema emp_ns0;")); TestingSQLUtil::ExecuteSQLQueryAndCheckResult( "select * from emp_ns1.emp_table0;", {"1|abc"}); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("commit;")); EXPECT_EQ(ResultType::SUCCESS, TestingSQLUtil::ExecuteSQLQuery("begin;")); EXPECT_EQ(ResultType::FAILURE, TestingSQLUtil::ExecuteSQLQuery("drop schema emp_ns0;")); EXPECT_EQ(ResultType::FAILURE, TestingSQLUtil::ExecuteSQLQuery( "select * from emp_ns0.emp_table1;")); EXPECT_EQ(ResultType::ABORTED, TestingSQLUtil::ExecuteSQLQuery("commit;")); } TEST_F(CatalogTests, DroppingTable) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); auto catalog = catalog::Catalog::GetInstance(); // NOTE: everytime we create a database, there will be 8 catalog tables inside EXPECT_EQ( 11, (int)catalog->GetDatabaseObject("emp_db", txn)->GetTableObjects().size()); auto database_object = catalog::Catalog::GetInstance()->GetDatabaseObject("emp_db", txn); EXPECT_NE(nullptr, database_object); catalog::Catalog::GetInstance()->DropTable("emp_db", DEFUALT_SCHEMA_NAME, "department_table", txn); database_object = catalog::Catalog::GetInstance()->GetDatabaseObject("emp_db", txn); EXPECT_NE(nullptr, database_object); auto department_table_object = database_object->GetTableObject("department_table", DEFUALT_SCHEMA_NAME); EXPECT_EQ( 10, (int)catalog->GetDatabaseObject("emp_db", txn)->GetTableObjects().size()); txn_manager.CommitTransaction(txn); EXPECT_EQ(nullptr, department_table_object); // Try to drop again txn = txn_manager.BeginTransaction(); EXPECT_THROW(catalog::Catalog::GetInstance()->DropTable( "emp_db", DEFUALT_SCHEMA_NAME, "department_table", txn), CatalogException); // EXPECT_EQ( 10, (int)catalog->GetDatabaseObject("emp_db", txn)->GetTableObjects().size()); txn_manager.CommitTransaction(txn); // Drop a table that does not exist txn = txn_manager.BeginTransaction(); EXPECT_THROW(catalog::Catalog::GetInstance()->DropTable( "emp_db", DEFUALT_SCHEMA_NAME, "void_table", txn), CatalogException); EXPECT_EQ( 10, (int)catalog->GetDatabaseObject("emp_db", txn)->GetTableObjects().size()); txn_manager.CommitTransaction(txn); // Drop the other table txn = txn_manager.BeginTransaction(); catalog::Catalog::GetInstance()->DropTable("emp_db", DEFUALT_SCHEMA_NAME, "emp_table", txn); EXPECT_EQ( 9, (int)catalog->GetDatabaseObject("emp_db", txn)->GetTableObjects().size()); txn_manager.CommitTransaction(txn); } TEST_F(CatalogTests, DroppingDatabase) { auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance(); auto txn = txn_manager.BeginTransaction(); catalog::Catalog::GetInstance()->DropDatabaseWithName("emp_db", txn); EXPECT_THROW( catalog::Catalog::GetInstance()->GetDatabaseWithName("emp_db", txn), CatalogException); txn_manager.CommitTransaction(txn); } TEST_F(CatalogTests, DroppingCatalog) { auto catalog = catalog::Catalog::GetInstance(); EXPECT_NE(nullptr, catalog); } } // namespace test } // namespace peloton
{'content_hash': 'a907d0a52e7d20f0024e48fcaefd4bfc', 'timestamp': '', 'source': 'github', 'line_count': 280, 'max_line_length': 80, 'avg_line_length': 44.392857142857146, 'alnum_prop': 0.6505229283990346, 'repo_name': 'yingjunwu/peloton', 'id': '3e6b5e158728e584b2f0e6ee6e4b6e125c7aab58', 'size': '13292', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/catalog/catalog_test.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '47425'}, {'name': 'C++', 'bytes': '6842983'}, {'name': 'CMake', 'bytes': '136686'}, {'name': "Cap'n Proto", 'bytes': '362'}, {'name': 'Java', 'bytes': '76998'}, {'name': 'PLpgSQL', 'bytes': '5855'}, {'name': 'Python', 'bytes': '105836'}, {'name': 'Ruby', 'bytes': '1278'}, {'name': 'Shell', 'bytes': '25136'}]}
// Template Source: BaseEntityCollectionResponse.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.requests; import com.microsoft.graph.models.EducationAssignmentResource; import com.microsoft.graph.http.BaseCollectionResponse; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The class for the Education Assignment Resource Collection Response. */ public class EducationAssignmentResourceCollectionResponse extends BaseCollectionResponse<EducationAssignmentResource> { }
{'content_hash': '5af72e73c8f326dab42c9a99a06cf9ce', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 152, 'avg_line_length': 45.666666666666664, 'alnum_prop': 0.6532846715328468, 'repo_name': 'microsoftgraph/msgraph-sdk-java', 'id': '45dc25ef7870d117d97179b4111363de7ff46b13', 'size': '822', 'binary': False, 'copies': '1', 'ref': 'refs/heads/dev', 'path': 'src/main/java/com/microsoft/graph/requests/EducationAssignmentResourceCollectionResponse.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '27286837'}, {'name': 'PowerShell', 'bytes': '5635'}]}
""" Stores version information such that it can be read by setuptools. """ ########################################################################## ## Imports ########################################################################## __version_info__ = { 'major': 0, 'minor': 3, 'micro': 3, 'releaselevel': 'final', 'serial': 0, } def get_version(short=False): """ Computes a string representation of the version from __version_info__. """ assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final') vers = ["%(major)i.%(minor)i" % __version_info__, ] if __version_info__['micro']: vers.append(".%(micro)i" % __version_info__) if __version_info__['releaselevel'] != 'final' and not short: vers.append('%s%i' % (__version_info__['releaselevel'][0], __version_info__['serial'])) return ''.join(vers)
{'content_hash': 'b4115a5e1b7194fbcfd10ff9b2b91c9e', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 74, 'avg_line_length': 31.448275862068964, 'alnum_prop': 0.4594298245614035, 'repo_name': 'bbengfort/baleen', 'id': 'd38e085fbfb61e842d11a61c9b48e3991a26aae0', 'size': '1230', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'baleen/version.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '750'}, {'name': 'HTML', 'bytes': '15284'}, {'name': 'Makefile', 'bytes': '675'}, {'name': 'Python', 'bytes': '138541'}]}
package org.apereo.portal.url; import static org.junit.Assert.assertEquals; import com.google.common.collect.Sets; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; /** Some Testing on CasLoginRefUrlEncoder class. */ public class CasLoginRefUrlEncoderTest { CasLoginRefUrlEncoder encoder; MockHttpServletRequest request; @Before public void setUp() throws UnsupportedEncodingException { encoder = new CasLoginRefUrlEncoder(); encoder.setCasLoginUrl( "https://cas:80/cas/login?service=_CURRENT_SERVER_NAME_/uPortal/Login"); UrlMultiServerNameCustomizer urlCustomizer = new UrlMultiServerNameCustomizer(); urlCustomizer.setAllServerNames(Sets.newHashSet("myhost:8080", "theirhost:8443")); List<IAuthUrlCustomizer> customizers = new ArrayList<>(); customizers.add(urlCustomizer); UrlAuthCustomizerRegistry registry = new UrlAuthCustomizerRegistry(); registry.setRegistry(customizers); encoder.setUrlCustomizer(registry); request = new MockHttpServletRequest("GET", "http://myhost:8080/uPortal/p/fname"); request.setCharacterEncoding("UTF-8"); request.setServerName("myhost"); request.setServerPort(8080); request.addHeader("Host", "myhost:8080"); } @Test public void testSimpleDestination() throws Exception { assertEquals( "https://cas:80/cas/login?service=myhost:8080/uPortal/Login%3FrefUrl%3Dhttp%3A%2F%2Fmyhost%3A8080%2FuPortal%2Fp%2Ffname", encoder.encodeLoginAndRefUrl(request)); } @Test public void testWithParam() throws Exception { request = new MockHttpServletRequest("GET", "http://myhost:8080/uPortal/p/fname"); request.setQueryString("pP_announcementId=1834"); request.setCharacterEncoding("UTF-8"); assertEquals( "https://cas:80/cas/login?service=myhost:8080/uPortal/Login%3FrefUrl%3Dhttp%3A%2F%2Fmyhost%3A8080%2FuPortal%2Fp%2Ffname%253FpP_announcementId%253D1834", encoder.encodeLoginAndRefUrl(request)); } @Test public void testWithTwoParams() throws Exception { request = new MockHttpServletRequest("GET", "http://myhost:8080/uPortal/p/fname"); request.setQueryString("pP_action=displayFullAnnouncement&pP_announcementId=1834"); request.setCharacterEncoding("UTF-8"); assertEquals( "https://cas:80/cas/login?service=myhost:8080/uPortal/Login%3FrefUrl%3Dhttp%3A%2F%2Fmyhost%3A8080%2FuPortal%2Fp%2Ffname%253FpP_action%253DdisplayFullAnnouncement%2526pP_announcementId%253D1834", encoder.encodeLoginAndRefUrl(request)); } }
{'content_hash': '2ce53a62f3cb4573921273bdf2241a23', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 210, 'avg_line_length': 43.84615384615385, 'alnum_prop': 0.712280701754386, 'repo_name': 'groybal/uPortal', 'id': '44a0a2403b7254407a200daf4851ef011e05858d', 'size': '3639', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'uPortal-security/uPortal-security-mvc/src/test/java/org/apereo/portal/url/CasLoginRefUrlEncoderTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '239184'}, {'name': 'Groovy', 'bytes': '56524'}, {'name': 'HTML', 'bytes': '223563'}, {'name': 'Java', 'bytes': '10059678'}, {'name': 'JavaScript', 'bytes': '530749'}, {'name': 'Perl', 'bytes': '1769'}, {'name': 'Shell', 'bytes': '3135'}, {'name': 'XSLT', 'bytes': '263109'}]}
require 'test_helper' class HelloControllerTest < ActionDispatch::IntegrationTest test "should get index" do get hello_index_url assert_response :success end end
{'content_hash': '491d5f0ba8badb76309bcee8b57026ef', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 59, 'avg_line_length': 19.555555555555557, 'alnum_prop': 0.7556818181818182, 'repo_name': 'IanKapelke/linwoodTerraceWebsite', 'id': 'd8c9e9e0482db143ee0b1be3a277a4ef5510a522', 'size': '176', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'linwoodWeb/test/controllers/hello_controller_test.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '885'}, {'name': 'CoffeeScript', 'bytes': '211'}, {'name': 'HTML', 'bytes': '5650'}, {'name': 'JavaScript', 'bytes': '1156'}, {'name': 'Ruby', 'bytes': '25846'}]}
/* Includes ------------------------------------------------------------------*/ #include "stm32f0xx_hal.h" /** @addtogroup STM32F0xx_HAL_Driver * @{ */ /** @addtogroup EXTI * @{ */ /** MISRA C:2012 deviation rule has been granted for following rule: * Rule-18.1_b - Medium: Array `EXTICR' 1st subscript interval [0,7] may be out * of bounds [0,3] in following API : * HAL_EXTI_SetConfigLine * HAL_EXTI_GetConfigLine * HAL_EXTI_ClearConfigLine */ #ifdef HAL_EXTI_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ /* Private defines -----------------------------------------------------------*/ /** @defgroup EXTI_Private_Constants EXTI Private Constants * @{ */ /** * @} */ /* Private macros ------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup EXTI_Exported_Functions * @{ */ /** @addtogroup EXTI_Exported_Functions_Group1 * @brief Configuration functions * @verbatim =============================================================================== ##### Configuration functions ##### =============================================================================== @endverbatim * @{ */ /** * @brief Set configuration of a dedicated Exti line. * @param hexti Exti handle. * @param pExtiConfig Pointer on EXTI configuration to be set. * @retval HAL Status. */ HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig) { uint32_t regval; uint32_t linepos; uint32_t maskline; /* Check null pointer */ if ((hexti == NULL) || (pExtiConfig == NULL)) { return HAL_ERROR; } /* Check parameters */ assert_param(IS_EXTI_LINE(pExtiConfig->Line)); assert_param(IS_EXTI_MODE(pExtiConfig->Mode)); /* Assign line number to handle */ hexti->Line = pExtiConfig->Line; /* Compute line mask */ linepos = (pExtiConfig->Line & EXTI_PIN_MASK); maskline = (1uL << linepos); /* Configure triggers for configurable lines */ if ((pExtiConfig->Line & EXTI_CONFIG) != 0x00u) { assert_param(IS_EXTI_TRIGGER(pExtiConfig->Trigger)); /* Configure rising trigger */ /* Mask or set line */ if ((pExtiConfig->Trigger & EXTI_TRIGGER_RISING) != 0x00u) { EXTI->RTSR |= maskline; } else { EXTI->RTSR &= ~maskline; } /* Configure falling trigger */ /* Mask or set line */ if ((pExtiConfig->Trigger & EXTI_TRIGGER_FALLING) != 0x00u) { EXTI->FTSR |= maskline; } else { EXTI->FTSR &= ~maskline; } /* Configure gpio port selection in case of gpio exti line */ if ((pExtiConfig->Line & EXTI_GPIO) == EXTI_GPIO) { assert_param(IS_EXTI_GPIO_PORT(pExtiConfig->GPIOSel)); assert_param(IS_EXTI_GPIO_PIN(linepos)); regval = SYSCFG->EXTICR[linepos >> 2u]; regval &= ~(SYSCFG_EXTICR1_EXTI0 << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); regval |= (pExtiConfig->GPIOSel << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); SYSCFG->EXTICR[linepos >> 2u] = regval; } } /* Configure interrupt mode : read current mode */ /* Mask or set line */ if ((pExtiConfig->Mode & EXTI_MODE_INTERRUPT) != 0x00u) { EXTI->IMR |= maskline; } else { EXTI->IMR &= ~maskline; } /* Configure event mode : read current mode */ /* Mask or set line */ if ((pExtiConfig->Mode & EXTI_MODE_EVENT) != 0x00u) { EXTI->EMR |= maskline; } else { EXTI->EMR &= ~maskline; } return HAL_OK; } /** * @brief Get configuration of a dedicated Exti line. * @param hexti Exti handle. * @param pExtiConfig Pointer on structure to store Exti configuration. * @retval HAL Status. */ HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig) { uint32_t regval; uint32_t linepos; uint32_t maskline; /* Check null pointer */ if ((hexti == NULL) || (pExtiConfig == NULL)) { return HAL_ERROR; } /* Check the parameter */ assert_param(IS_EXTI_LINE(hexti->Line)); /* Store handle line number to configuration structure */ pExtiConfig->Line = hexti->Line; /* Compute line mask */ linepos = (pExtiConfig->Line & EXTI_PIN_MASK); maskline = (1uL << linepos); /* 1] Get core mode : interrupt */ /* Check if selected line is enable */ if ((EXTI->IMR & maskline) != 0x00u) { pExtiConfig->Mode = EXTI_MODE_INTERRUPT; } else { pExtiConfig->Mode = EXTI_MODE_NONE; } /* Get event mode */ /* Check if selected line is enable */ if ((EXTI->EMR & maskline) != 0x00u) { pExtiConfig->Mode |= EXTI_MODE_EVENT; } /* Get default Trigger and GPIOSel configuration */ pExtiConfig->Trigger = EXTI_TRIGGER_NONE; pExtiConfig->GPIOSel = 0x00u; /* 2] Get trigger for configurable lines : rising */ if ((pExtiConfig->Line & EXTI_CONFIG) != 0x00u) { /* Check if configuration of selected line is enable */ if ((EXTI->RTSR & maskline) != 0x00u) { pExtiConfig->Trigger = EXTI_TRIGGER_RISING; } /* Get falling configuration */ /* Check if configuration of selected line is enable */ if ((EXTI->FTSR & maskline) != 0x00u) { pExtiConfig->Trigger |= EXTI_TRIGGER_FALLING; } /* Get Gpio port selection for gpio lines */ if ((pExtiConfig->Line & EXTI_GPIO) == EXTI_GPIO) { assert_param(IS_EXTI_GPIO_PIN(linepos)); regval = SYSCFG->EXTICR[linepos >> 2u]; pExtiConfig->GPIOSel = ((regval << (SYSCFG_EXTICR1_EXTI1_Pos * (3uL - (linepos & 0x03u)))) >> 24); } } return HAL_OK; } /** * @brief Clear whole configuration of a dedicated Exti line. * @param hexti Exti handle. * @retval HAL Status. */ HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti) { uint32_t regval; uint32_t linepos; uint32_t maskline; /* Check null pointer */ if (hexti == NULL) { return HAL_ERROR; } /* Check the parameter */ assert_param(IS_EXTI_LINE(hexti->Line)); /* compute line mask */ linepos = (hexti->Line & EXTI_PIN_MASK); maskline = (1uL << linepos); /* 1] Clear interrupt mode */ EXTI->IMR = (EXTI->IMR & ~maskline); /* 2] Clear event mode */ EXTI->EMR = (EXTI->EMR & ~maskline); /* 3] Clear triggers in case of configurable lines */ if ((hexti->Line & EXTI_CONFIG) != 0x00u) { EXTI->RTSR = (EXTI->RTSR & ~maskline); EXTI->FTSR = (EXTI->FTSR & ~maskline); /* Get Gpio port selection for gpio lines */ if ((hexti->Line & EXTI_GPIO) == EXTI_GPIO) { assert_param(IS_EXTI_GPIO_PIN(linepos)); regval = SYSCFG->EXTICR[linepos >> 2u]; regval &= ~(SYSCFG_EXTICR1_EXTI0 << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); SYSCFG->EXTICR[linepos >> 2u] = regval; } } return HAL_OK; } /** * @brief Register callback for a dedicated Exti line. * @param hexti Exti handle. * @param CallbackID User callback identifier. * This parameter can be one of @arg @ref EXTI_CallbackIDTypeDef values. * @param pPendingCbfn function pointer to be stored as callback. * @retval HAL Status. */ HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void)) { HAL_StatusTypeDef status = HAL_OK; switch (CallbackID) { case HAL_EXTI_COMMON_CB_ID: hexti->PendingCallback = pPendingCbfn; break; default: status = HAL_ERROR; break; } return status; } /** * @brief Store line number as handle private field. * @param hexti Exti handle. * @param ExtiLine Exti line number. * This parameter can be from 0 to @ref EXTI_LINE_NB. * @retval HAL Status. */ HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine) { /* Check the parameters */ assert_param(IS_EXTI_LINE(ExtiLine)); /* Check null pointer */ if (hexti == NULL) { return HAL_ERROR; } else { /* Store line number as handle private field */ hexti->Line = ExtiLine; return HAL_OK; } } /** * @} */ /** @addtogroup EXTI_Exported_Functions_Group2 * @brief EXTI IO functions. * @verbatim =============================================================================== ##### IO operation functions ##### =============================================================================== @endverbatim * @{ */ /** * @brief Handle EXTI interrupt request. * @param hexti Exti handle. * @retval none. */ void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti) { uint32_t regval; uint32_t maskline; /* Compute line mask */ maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); /* Get pending bit */ regval = (EXTI->PR & maskline); if (regval != 0x00u) { /* Clear pending bit */ EXTI->PR = maskline; /* Call callback */ if (hexti->PendingCallback != NULL) { hexti->PendingCallback(); } } } /** * @brief Get interrupt pending bit of a dedicated line. * @param hexti Exti handle. * @param Edge Specify which pending edge as to be checked. * This parameter can be one of the following values: * @arg @ref EXTI_TRIGGER_RISING_FALLING * This parameter is kept for compatibility with other series. * @retval 1 if interrupt is pending else 0. */ uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) { uint32_t regval; uint32_t linepos; uint32_t maskline; /* Check parameters */ assert_param(IS_EXTI_LINE(hexti->Line)); assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); assert_param(IS_EXTI_PENDING_EDGE(Edge)); /* Compute line mask */ linepos = (hexti->Line & EXTI_PIN_MASK); maskline = (1uL << linepos); /* return 1 if bit is set else 0 */ regval = ((EXTI->PR & maskline) >> linepos); return regval; } /** * @brief Clear interrupt pending bit of a dedicated line. * @param hexti Exti handle. * @param Edge Specify which pending edge as to be clear. * This parameter can be one of the following values: * @arg @ref EXTI_TRIGGER_RISING_FALLING * This parameter is kept for compatibility with other series. * @retval None. */ void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) { uint32_t maskline; /* Check parameters */ assert_param(IS_EXTI_LINE(hexti->Line)); assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); assert_param(IS_EXTI_PENDING_EDGE(Edge)); /* Compute line mask */ maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); /* Clear Pending bit */ EXTI->PR = maskline; } /** * @brief Generate a software interrupt for a dedicated line. * @param hexti Exti handle. * @retval None. */ void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti) { uint32_t maskline; /* Check parameters */ assert_param(IS_EXTI_LINE(hexti->Line)); assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); /* Compute line mask */ maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); /* Generate Software interrupt */ EXTI->SWIER = maskline; } /** * @} */ /** * @} */ #endif /* HAL_EXTI_MODULE_ENABLED */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{'content_hash': 'aa7d8a3711e6d89906ec89dbb8307a67', 'timestamp': '', 'source': 'github', 'line_count': 466, 'max_line_length': 133, 'avg_line_length': 24.7274678111588, 'alnum_prop': 0.5847435563655298, 'repo_name': 'nongxiaoming/rt-thread', 'id': 'c5d1fb5901125edfafd643e97c336b3a4c65fffb', 'size': '15093', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'bsp/stm32/libraries/STM32F0xx_HAL/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '17092924'}, {'name': 'Batchfile', 'bytes': '188371'}, {'name': 'C', 'bytes': '941229651'}, {'name': 'C++', 'bytes': '754131'}, {'name': 'CMake', 'bytes': '250384'}, {'name': 'CSS', 'bytes': '138218'}, {'name': 'GDB', 'bytes': '11796'}, {'name': 'HTML', 'bytes': '4763477'}, {'name': 'JavaScript', 'bytes': '637'}, {'name': 'LLVM', 'bytes': '10344'}, {'name': 'Lex', 'bytes': '7026'}, {'name': 'Logos', 'bytes': '7238'}, {'name': 'M4', 'bytes': '17515'}, {'name': 'Makefile', 'bytes': '444829'}, {'name': 'Pawn', 'bytes': '1250'}, {'name': 'Perl', 'bytes': '16728'}, {'name': 'Python', 'bytes': '2665973'}, {'name': 'RPC', 'bytes': '14162'}, {'name': 'Shell', 'bytes': '416898'}, {'name': 'Tcl', 'bytes': '179'}, {'name': 'Yacc', 'bytes': '30555'}]}
 CKEDITOR.plugins.setLang( 'pastetext', 'en-ca', { button: 'Paste as plain text', title: 'Paste as Plain Text' });
{'content_hash': '5ec9679a0ba90821ed166ad2ab0f3ddd', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 49, 'avg_line_length': 24.6, 'alnum_prop': 0.6341463414634146, 'repo_name': 'bkahlert/com.bkahlert.nebula', 'id': '857d63eae3cf9b0a3ea4ed5128655ad0004b5ba1', 'size': '272', 'binary': False, 'copies': '9', 'ref': 'refs/heads/master', 'path': 'src/com/bkahlert/nebula/widgets/composer/html/plugins/pastetext/lang/en-ca.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '509981'}, {'name': 'Java', 'bytes': '3235793'}, {'name': 'JavaScript', 'bytes': '4263220'}, {'name': 'PHP', 'bytes': '2219'}, {'name': 'Ruby', 'bytes': '578'}, {'name': 'Shell', 'bytes': '26'}]}
package org.apache.pulsar.broker.lookup; import static com.google.common.base.Preconditions.checkNotNull; import static org.apache.pulsar.common.api.Commands.newLookupErrorResponse; import static org.apache.pulsar.common.api.Commands.newLookupResponse; import java.net.URI; import java.net.URISyntaxException; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import javax.ws.rs.DefaultValue; import javax.ws.rs.Encoded; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.container.AsyncResponse; import javax.ws.rs.container.Suspended; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.apache.pulsar.broker.PulsarService; import org.apache.pulsar.broker.authentication.AuthenticationDataSource; import org.apache.pulsar.broker.web.NoSwaggerDocumentation; import org.apache.pulsar.broker.web.PulsarWebResource; import org.apache.pulsar.broker.web.RestException; import org.apache.pulsar.common.api.proto.PulsarApi.CommandLookupTopicResponse.LookupType; import org.apache.pulsar.common.api.proto.PulsarApi.ServerError; import org.apache.pulsar.common.lookup.data.LookupData; import org.apache.pulsar.common.naming.NamespaceBundle; import org.apache.pulsar.common.naming.TopicDomain; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.util.Codec; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import dlshade.org.apache.commons.lang3.StringUtils; import io.netty.buffer.ByteBuf; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; @Path("/v2/destination/") @NoSwaggerDocumentation public class TopicLookup extends PulsarWebResource { @GET @Path("{topic-domain}/{property}/{cluster}/{namespace}/{topic}") @Produces(MediaType.APPLICATION_JSON) public void lookupTopicAsync(@PathParam("topic-domain") String topicDomain, @PathParam("property") String property, @PathParam("cluster") String cluster, @PathParam("namespace") String namespace, @PathParam("topic") @Encoded String encodedTopic, @QueryParam("authoritative") @DefaultValue("false") boolean authoritative, @Suspended AsyncResponse asyncResponse) { String topicName = Codec.decode(encodedTopic); TopicDomain domain = null; try { domain = TopicDomain.getEnum(topicDomain); } catch (IllegalArgumentException e) { log.error("[{}] Invalid topic-domain {}", clientAppId(), topicDomain, e); throw new RestException(Status.METHOD_NOT_ALLOWED, "Unsupported topic domain " + topicDomain); } TopicName topic = TopicName.get(domain.value(), property, cluster, namespace, topicName); if (!pulsar().getBrokerService().getLookupRequestSemaphore().tryAcquire()) { log.warn("No broker was found available for topic {}", topic); asyncResponse.resume(new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE)); return; } try { validateClusterOwnership(topic.getCluster()); checkConnect(topic); validateGlobalNamespaceOwnership(topic.getNamespaceObject()); } catch (WebApplicationException we) { // Validation checks failed log.error("Validation check failed: {}", we.getMessage()); completeLookupResponseExceptionally(asyncResponse, we); return; } catch (Throwable t) { // Validation checks failed with unknown error log.error("Validation check failed: {}", t.getMessage(), t); completeLookupResponseExceptionally(asyncResponse, new RestException(t)); return; } CompletableFuture<Optional<LookupResult>> lookupFuture = pulsar().getNamespaceService().getBrokerServiceUrlAsync(topic, authoritative); lookupFuture.thenAccept(optionalResult -> { if (optionalResult == null || !optionalResult.isPresent()) { log.warn("No broker was found available for topic {}", topic); completeLookupResponseExceptionally(asyncResponse, new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE)); return; } LookupResult result = optionalResult.get(); // We have found either a broker that owns the topic, or a broker to which we should redirect the client to if (result.isRedirect()) { boolean newAuthoritative = this.isLeaderBroker(); URI redirect; try { String redirectUrl = isRequestHttps() ? result.getLookupData().getHttpUrlTls() : result.getLookupData().getHttpUrl(); checkNotNull(redirectUrl, "Redirected cluster's service url is not configured"); redirect = new URI(String.format("%s%s%s?authoritative=%s", redirectUrl, "/lookup/v2/destination/", topic.getLookupName(), newAuthoritative)); } catch (URISyntaxException | NullPointerException e) { log.error("Error in preparing redirect url for {}: {}", topic, e.getMessage(), e); completeLookupResponseExceptionally(asyncResponse, e); return; } if (log.isDebugEnabled()) { log.debug("Redirect lookup for topic {} to {}", topic, redirect); } completeLookupResponseExceptionally(asyncResponse, new WebApplicationException(Response.temporaryRedirect(redirect).build())); } else { // Found broker owning the topic if (log.isDebugEnabled()) { log.debug("Lookup succeeded for topic {} -- broker: {}", topic, result.getLookupData()); } completeLookupResponseSuccessfully(asyncResponse, result.getLookupData()); } }).exceptionally(exception -> { log.warn("Failed to lookup broker for topic {}: {}", topic, exception.getMessage(), exception); completeLookupResponseExceptionally(asyncResponse, exception); return null; }); } @GET @Path("{topic-domain}/{property}/{cluster}/{namespace}/{topic}/bundle") @Produces(MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"), @ApiResponse(code = 405, message = "Invalid topic domain type") }) public String getNamespaceBundle(@PathParam("topic-domain") String topicDomain, @PathParam("property") String property, @PathParam("cluster") String cluster, @PathParam("namespace") String namespace, @PathParam("topic") @Encoded String topicName) { topicName = Codec.decode(topicName); TopicDomain domain = null; try { domain = TopicDomain.getEnum(topicDomain); } catch (IllegalArgumentException e) { log.error("[{}] Invalid topic-domain {}", clientAppId(), topicDomain, e); throw new RestException(Status.METHOD_NOT_ALLOWED, "Bundle lookup can not be done on topic domain " + topicDomain); } TopicName topic = TopicName.get(domain.value(), property, cluster, namespace, topicName); validateSuperUserAccess(); try { NamespaceBundle bundle = pulsar().getNamespaceService().getBundle(topic); return bundle.getBundleRange(); } catch (Exception e) { log.error("[{}] Failed to get namespace bundle for {}", clientAppId(), topic, e); throw new RestException(e); } } /** * * Lookup broker-service address for a given namespace-bundle which contains given topic. * * a. Returns broker-address if namespace-bundle is already owned by any broker * b. If current-broker receives lookup-request and if it's not a leader * then current broker redirects request to leader by returning leader-service address. * c. If current-broker is leader then it finds out least-loaded broker to own namespace bundle and * redirects request by returning least-loaded broker. * d. If current-broker receives request to own the namespace-bundle then it owns a bundle and returns * success(connect) response to client. * * @param pulsarService * @param topicName * @param authoritative * @param clientAppId * @param requestId * @return */ public static CompletableFuture<ByteBuf> lookupTopicAsync(PulsarService pulsarService, TopicName topicName, boolean authoritative, String clientAppId, AuthenticationDataSource authenticationData, long requestId) { final CompletableFuture<ByteBuf> validationFuture = new CompletableFuture<>(); final CompletableFuture<ByteBuf> lookupfuture = new CompletableFuture<>(); final String cluster = topicName.getCluster(); // (1) validate cluster getClusterDataIfDifferentCluster(pulsarService, cluster, clientAppId).thenAccept(differentClusterData -> { if (differentClusterData != null) { if (log.isDebugEnabled()) { log.debug("[{}] Redirecting the lookup call to {}/{} cluster={}", clientAppId, differentClusterData.getBrokerServiceUrl(), differentClusterData.getBrokerServiceUrlTls(), cluster); } validationFuture.complete(newLookupResponse(differentClusterData.getBrokerServiceUrl(), differentClusterData.getBrokerServiceUrlTls(), true, LookupType.Redirect, requestId, false)); } else { // (2) authorize client try { checkAuthorization(pulsarService, topicName, clientAppId, authenticationData); } catch (RestException authException) { log.warn("Failed to authorized {} on cluster {}", clientAppId, topicName.toString()); validationFuture.complete( newLookupErrorResponse(ServerError.AuthorizationError, authException.getMessage(), requestId)); return; } catch (Exception e) { log.warn("Unknown error while authorizing {} on cluster {}", clientAppId, topicName.toString()); validationFuture.completeExceptionally(e); return; } // (3) validate global namespace checkLocalOrGetPeerReplicationCluster(pulsarService, topicName.getNamespaceObject()) .thenAccept(peerClusterData -> { if (peerClusterData == null) { // (4) all validation passed: initiate lookup validationFuture.complete(null); return; } // if peer-cluster-data is present it means namespace is owned by that peer-cluster and // request should be redirect to the peer-cluster if (StringUtils.isBlank(peerClusterData.getBrokerServiceUrl()) && StringUtils.isBlank(peerClusterData.getBrokerServiceUrl())) { validationFuture.complete( newLookupErrorResponse(ServerError.MetadataError, "Redirected cluster's brokerService url is not configured", requestId)); return; } validationFuture.complete(newLookupResponse(peerClusterData.getBrokerServiceUrl(), peerClusterData.getBrokerServiceUrlTls(), true, LookupType.Redirect, requestId, false)); }).exceptionally(ex -> { validationFuture .complete(newLookupErrorResponse(ServerError.MetadataError, ex.getMessage(), requestId)); return null; }); } }).exceptionally(ex -> { validationFuture.completeExceptionally(ex); return null; }); // Initiate lookup once validation completes validationFuture.thenAccept(validaitonFailureResponse -> { if (validaitonFailureResponse != null) { lookupfuture.complete(validaitonFailureResponse); } else { pulsarService.getNamespaceService().getBrokerServiceUrlAsync(topicName, authoritative) .thenAccept(lookupResult -> { if (log.isDebugEnabled()) { log.debug("[{}] Lookup result {}", topicName.toString(), lookupResult); } if (!lookupResult.isPresent()) { lookupfuture.complete(newLookupErrorResponse(ServerError.ServiceNotReady, "No broker was available to own " + topicName, requestId)); return; } LookupData lookupData = lookupResult.get().getLookupData(); if (lookupResult.get().isRedirect()) { boolean newAuthoritative = isLeaderBroker(pulsarService); lookupfuture.complete( newLookupResponse(lookupData.getBrokerUrl(), lookupData.getBrokerUrlTls(), newAuthoritative, LookupType.Redirect, requestId, false)); } else { // When running in standalone mode we want to redirect the client through the service // url, so that the advertised address configuration is not relevant anymore. boolean redirectThroughServiceUrl = pulsarService.getConfiguration() .isRunningStandalone(); lookupfuture.complete( newLookupResponse(lookupData.getBrokerUrl(), lookupData.getBrokerUrlTls(), true /* authoritative */, LookupType.Connect, requestId, redirectThroughServiceUrl)); } }).exceptionally(ex -> { if (ex instanceof CompletionException && ex.getCause() instanceof IllegalStateException) { log.info("Failed to lookup {} for topic {} with error {}", clientAppId, topicName.toString(), ex.getCause().getMessage()); } else { log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, topicName.toString(), ex.getMessage(), ex); } lookupfuture.complete( newLookupErrorResponse(ServerError.ServiceNotReady, ex.getMessage(), requestId)); return null; }); } }).exceptionally(ex -> { if (ex instanceof CompletionException && ex.getCause() instanceof IllegalStateException) { log.info("Failed to lookup {} for topic {} with error {}", clientAppId, topicName.toString(), ex.getCause().getMessage()); } else { log.warn("Failed to lookup {} for topic {} with error {}", clientAppId, topicName.toString(), ex.getMessage(), ex); } lookupfuture.complete(newLookupErrorResponse(ServerError.ServiceNotReady, ex.getMessage(), requestId)); return null; }); return lookupfuture; } private void completeLookupResponseExceptionally(AsyncResponse asyncResponse, Throwable t) { pulsar().getBrokerService().getLookupRequestSemaphore().release(); asyncResponse.resume(t); } private void completeLookupResponseSuccessfully(AsyncResponse asyncResponse, LookupData lookupData) { pulsar().getBrokerService().getLookupRequestSemaphore().release(); asyncResponse.resume(lookupData); } private static final Logger log = LoggerFactory.getLogger(TopicLookup.class); }
{'content_hash': '0785060c9a9f92a4ac9005037ed31e60', 'timestamp': '', 'source': 'github', 'line_count': 324, 'max_line_length': 162, 'avg_line_length': 52.45987654320987, 'alnum_prop': 0.6021650879566982, 'repo_name': 'sschepens/pulsar', 'id': 'f08530a74b7e8a9e9dd4c5ad1cde8eae283325ae', 'size': '17805', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookup.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '78182'}, {'name': 'C++', 'bytes': '978407'}, {'name': 'CMake', 'bytes': '20054'}, {'name': 'CSS', 'bytes': '29074'}, {'name': 'Groovy', 'bytes': '20837'}, {'name': 'HCL', 'bytes': '11887'}, {'name': 'HTML', 'bytes': '98559'}, {'name': 'Java', 'bytes': '8337326'}, {'name': 'JavaScript', 'bytes': '3803'}, {'name': 'Makefile', 'bytes': '2365'}, {'name': 'Python', 'bytes': '237158'}, {'name': 'Ruby', 'bytes': '7575'}, {'name': 'Shell', 'bytes': '95109'}]}
<?xml version="1.0" encoding="UTF-8"?> <checkstyle version="5.6"> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DelimiterBasedFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/AsciiHeadersEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DefaultTextHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/EmptyBinaryHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/EmptyConvertibleHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/PrematureChannelClosureException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DecoderResult.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/TextHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/AsciiString.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ObjectDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ReferenceMap.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/CachingClassResolver.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/CompactObjectInputStream.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ClassLoaderClassResolver.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ObjectDecoderInputStream.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolver.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/SoftReferenceMap.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ObjectEncoderOutputStream.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ClassResolvers.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/CompactObjectOutputStream.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/CompatibleObjectEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/WeakReferenceMap.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/serialization/ObjectEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageToMessageEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/ReplayingDecoderBuffer.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageToByteEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/ByteToMessageCodec.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageToMessageCodec.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/ReplayingDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/bytes/ByteArrayEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/bytes/ByteArrayDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/bytes/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/base64/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/base64/Base64Decoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/base64/Base64.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/base64/Base64Encoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/base64/Base64Dialect.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DecoderException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/Headers.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/CodecUtil.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DecoderResultProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/TooLongFrameException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/protobuf/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/EmptyTextHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Lz4Constants.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Lz4FrameEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Crc32.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/ZlibUtil.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2Decoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/LzfEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/LzmaFrameEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockDecompressor.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BitWriter.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Crc32c.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/ZlibEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/FastLz.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/DecompressionException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2Encoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2MoveToFrontTable.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Lz4FrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/LzfDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/JZlibEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2MTFAndRLE2StageEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/ZlibDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/CompressionException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/FastLzFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/FastLzFrameEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2Rand.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2Constants.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/ZlibCodecFactory.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BitReader.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/JZlibDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/compression/ZlibWrapper.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/EmptyHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/ConvertibleHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageAggregationException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/BinaryHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/xml/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/xml/XmlFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DefaultBinaryHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/DefaultConvertibleHeaders.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/UnsupportedMessageTypeException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/CorruptedFrameException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/Delimiters.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/json/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/json/JsonObjectDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/LengthFieldPrepender.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/string/StringEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/string/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/string/StringDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/FixedLengthFrameDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/ThreadLocalMarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/DefaultMarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/UnmarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/ThreadLocalUnmarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/ContextBoundUnmarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/ChannelBufferByteOutput.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/DefaultUnmarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/MarshallingEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingEncoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/LimitingByteInput.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/MarshallerProvider.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/ChannelBufferByteInput.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/marshalling/MarshallingDecoder.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/CodecException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/MessageAggregator.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/main/java/io/netty/handler/codec/EncoderException.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/ReplayingDecoderBufferTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/ByteToMessageCodecTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/serialization/CompactObjectSerializationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/frame/package-info.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/frame/LengthFieldPrependerTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/frame/LengthFieldBasedFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/frame/DelimiterBasedFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/bytes/ByteArrayDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/bytes/ByteArrayEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/DefaultBinaryHeadersTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/ZlibTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/SnappyIntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Lz4FrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Bzip2IntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/LzfEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/ZlibCrossTest2.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Bzip2DecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/LzfIntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/LzmaFrameEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/LzfDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/FastLzIntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Lz4FrameEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/IntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/Lz4FrameIntegrationTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/SnappyTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/ZlibCrossTest1.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/compression/JZlibTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/LineBasedFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/DefaultTextHeadersTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/xml/XmlFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/MessageToMessageEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/LengthFieldBasedFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/DelimiterBasedFrameDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/json/JsonObjectDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/string/StringEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialContextBoundCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverThreadLocalCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverCompatibleMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialThreadLocalMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialThreadLocalCompatibleMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverThreadLocalMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverThreadLocalMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverContextBoundCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverThreadLocalCompatibleMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialThreadLocalMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/AbstractCompatibleMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/RiverContextBoundMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/AbstractCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialContextBoundMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialCompatibleMarshallingEncoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/marshalling/SerialThreadLocalCompatibleMarshallingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/AsciiStringTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/ReplayingDecoderTest.java"> </file> <file name="/home/ubuntu/grpc-java/lib/netty/codec/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java"> </file> </checkstyle>
{'content_hash': '4bb7b8a026eea134bd9c25153292538b', 'timestamp': '', 'source': 'github', 'line_count': 401, 'max_line_length': 157, 'avg_line_length': 66.07730673316708, 'alnum_prop': 0.7902404045741027, 'repo_name': 'Sandyarathi/Lab2gRPC', 'id': '057736bf6f84ecdd68280253dba334ee41a83ab5', 'size': '26497', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/netty/codec/target/checkstyle-result.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '68226'}, {'name': 'C++', 'bytes': '27373'}, {'name': 'CSS', 'bytes': '49'}, {'name': 'HTML', 'bytes': '1466'}, {'name': 'Java', 'bytes': '10489915'}, {'name': 'Protocol Buffer', 'bytes': '22065'}, {'name': 'Shell', 'bytes': '4975'}]}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.6"/> <title>Open SCAP Library: Todo List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Open SCAP Library </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.6 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">Todo List </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><dl class="reflist"> <dt><a class="anchor" id="_todo000001"></a>Group <a class="el" href="group__CVSS.html#amgrp25c1d4ac920219f2cc20ffd61cc88639">Vector values</a> </dt> <dd><p class="startdd">Getters/setters for the "approximated" flag</p> <p class="enddd"></p> </dd> <dt><a class="anchor" id="_todo000001"></a>Group <a class="el" href="group__CVSS.html#amgrp25c1d4ac920219f2cc20ffd61cc88639">Vector values</a> </dt> <dd><p class="startdd">Getters/setters for the "approximated" flag</p> <p class="enddd"></p> </dd> </dl> </div></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
{'content_hash': 'c5f41e08dbdc12e3ba471290d0e03493', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 149, 'avg_line_length': 38.87096774193548, 'alnum_prop': 0.6481327800829876, 'repo_name': 'rprevette/clip', 'id': '15d2c3f6483f2bb8a9b1ca8cc2d5be6e8cba81be', 'size': '2410', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'packages/openscap/openscap-1.2.1/docs/html/todo.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Awk', 'bytes': '209'}, {'name': 'C', 'bytes': '13809'}, {'name': 'Groff', 'bytes': '294054'}, {'name': 'HTML', 'bytes': '1333'}, {'name': 'Makefile', 'bytes': '88510'}, {'name': 'Python', 'bytes': '95048'}, {'name': 'Shell', 'bytes': '17539'}]}
using System; using System.Collections.Generic; namespace Rainbow.Model { public interface IItemData : IItemMetadata { string DatabaseName { get; set; } string Name { get; } Guid BranchId { get; } IEnumerable<IItemFieldValue> SharedFields { get; } IEnumerable<IItemVersion> Versions { get; } IEnumerable<IItemData> GetChildren(); } }
{'content_hash': 'eb235594aa2581b288310b2cc659c637', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 52, 'avg_line_length': 22.0, 'alnum_prop': 0.7272727272727273, 'repo_name': 'PetersonDave/Rainbow', 'id': 'fa01c34be4b5d004867c11a3898e2aa6864537c4', 'size': '354', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/Rainbow/Model/IItemData.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '117'}, {'name': 'C#', 'bytes': '255917'}, {'name': 'PowerShell', 'bytes': '942'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': '9e248859687909ec655ff563837230a2', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '7096a7a476380ffb6d8cb7b6137d9a735759725c', 'size': '175', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Holcus/Sorgum hirtiflorum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<!-- WULF (http://networks.nokia.com/) Copyright (C) 2015 Nokia Solutions and Networks. All rights Reserved. --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link href="../wulfdist/css/wulf.basic.min.css" rel="stylesheet"/> <link href="../wulfdist/css/wulf.panel.min.css" rel="stylesheet"/> <link href="../wulfdist/css/wulf.buttons.min.css" rel="stylesheet"/> <link href="../assets/css/demo.css" rel="stylesheet"> </head> <body class="demo-body-content"> <h1 class="component-header" id="nokia_panel">Panel <a href="../demo-dev-react.html"> <img class="react-logo" align="right" alt="react usage" height="30" width="30" src="../assets/images/react-logo.svg"></a></h1> <hr> <div class="col-md-12"> <div class="row"> <div id="panel-shadow-demo" class="col-md-5"> <div class="panel panel-shadow panel-blue-cap" id="TA-panel-basic"> <div class="panel-heading"> <h1>Available Operations</h1> </div> <div class="panel-body"> <div class="panel-section"> <h2>Title of section</h2> <div class="dummy-picture"></div> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor.</span> </div> <div class="panel-section"> <h2>Title of section</h2> <div class="dummy-picture"></div> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor.</span> </div> <div class="panel-single-row"> <h2>Title or label</h2> </div> <div class="panel-section"> <h2>Title of section</h2> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. dolor</span> <button class="btn btn-standard" id="TA-panel-basic-button">Add to My favorites</button> </div> </div> </div> </div> <div id="panel-shadow-description" class="col-md-7"> JS & CSS dependency: <pre> For Panel components, it will be ok to import following css file: &lt;link href="../wulfdist/css/wulf.basic.min.css" rel="stylesheet"/&gt; &lt;link href="../wulfdist/css/wulf.panel.min.css" rel="stylesheet"&gt; </pre> <p> You can create a basic panel container by creating a div container with class <code>panel</code>. The panel consists of the panel container, a container for the panel header, as well as a container for the panel content, each with their own class: </p> <pre> <code> &lt;div class="panel panel-shadow panel-blue-cap"&gt; &lt;div class="panel-heading"&gt; &lt;h1&gt;Available Operations&lt;/h1&gt; &lt;/div&gt; &lt;div class="panel-body"&gt; ... &lt;/div&gt; &lt;/div&gt;</code> </pre> <p> The panel component also provides a couple of predefined classes for changing the visual appearance of the panel. You can use <code>panel-shadow</code> class to add a drop shadow, as well as <code>panel-blue-cap</code> class to add a blue cap on top of the panel. </p> <p> You can also use predefined sections and single rows to split your panel into distinct parts: </p> <pre> <code> &lt;div class="panel-body"&gt; &lt;div class="panel-section"&gt; &lt;h2&gt;Title of section&lt;/h2&gt; ... &lt;/div&gt; &lt;div class="panel-single-row"&gt; &lt;h2&gt;Title or label&lt;/h2&gt; &lt;/div&gt; &lt;div class="panel-section"&gt; &lt;h2&gt;Title of section&lt;/h2&gt; ... &lt;/div&gt; &lt;/div&gt;</code> </pre> </div> </div> <div class="row"> <div class="col-md-12"> <h2>Panel variations</h2> </div> <div class="col-md-5"> <div class="panel" id="TA-panel-noShadow"> <div class="panel-heading"> <h1>Available Operations</h1> </div> <div class="panel-body"> <div class="panel-section"> <h2>Title of section</h2> <div class="dummy-picture"></div> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor.</span> </div> <div class="panel-section"> <h2>Title of section</h2> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. dolor</span> <button class="btn btn-standard" id="TA-panel-noShadow-button">Add to My favorites</button> </div> </div> </div> </div> <div class="col-md-7"> <p> If you wish to use a more streamlined look for a panel, you can create a panel without <code>panel-blue-cap</code> or <code>panel-shadow</code> classes. The "Available Operations" panel shows what a streamlined panel without the drop shadow and the blue cap looks like. </p> </div> </div> <div class="row"> <div id="borderless-panel-container" class="col-md-5"> <div class="panel panel-shadow panel-blue-cap" id="TA-panel-headTransparent"> <div class="panel-heading panel-heading-transparent"> <h1>Performance <span class="brand-color">Management</span></h1> </div> <div class="panel-body"> <div class="panel-section"> <h2>Title of section</h2> <div class="dummy-picture"></div> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor.</span> </div> </div> </div> </div> <div id="borderless-panel-description" class="col-md-7"> <p> You can also make the header borderless or transparent by adding <code>panel-heading-transparent</code> to the header. The "Performance Management" panel is an example of such a panel. </p> </div> </div> <div class="row"> <div id="simple-shadow-panel-container" class="col-md-5"> <div class="panel panel-simple-shadow panel-blue-cap" id="TA-panel-simpleShadow"> <div class="panel-heading"> <h1>Preferences</h1> </div> <div class="panel-body"> <div class="panel-section"> <h2>Title of section</h2> <div class="dummy-picture"></div> <span>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor.</span> </div> </div> </div> </div> <div id="simple-shadow-panel-description" class="col-md-7"> <p> You can also use a simpler type of shadow for the panel by substituting <code>panel-shadow</code> with <code>panel-simple-shadow</code>. This is mostly provided as a workaround, as the regular shadow can cause visual glitches when used with <em>very</em> tall panels. </p> </div> </div> </div> </body> </html>
{'content_hash': '3fb78cc09fcb6d52718403349607c3a0', 'timestamp': '', 'source': 'github', 'line_count': 186, 'max_line_length': 145, 'avg_line_length': 37.435483870967744, 'alnum_prop': 0.6062042223179664, 'repo_name': 'ejcontado/uicAIunit-1478853861560', 'id': '209fb77a862e196728aa3cdd80f26b62f274d603', 'size': '6963', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/main/webapp/wulflib/wulffulldist/components/panels.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '3078044'}, {'name': 'HTML', 'bytes': '6079206'}, {'name': 'Java', 'bytes': '12580'}, {'name': 'JavaScript', 'bytes': '3183489'}]}
package openblocks.enchantments.flimflams; import java.util.Collections; import java.util.List; import java.util.Random; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import openblocks.api.IFlimFlamAction; import com.google.common.collect.Lists; public class EffectFlimFlam implements IFlimFlamAction { private static final Random RANDOM = new Random(); private final List<EffectMeta> EFFECTS = Lists.newArrayList(); { EFFECTS.add(new EffectMeta(Potion.blindness, 1, 1, seconds(15), seconds(60))); EFFECTS.add(new EffectMeta(Potion.confusion, 1, 1, seconds(15), seconds(60))); EFFECTS.add(new EffectMeta(Potion.digSlowdown, 50, 100, seconds(15), seconds(60))); EFFECTS.add(new EffectMeta(Potion.jump, 30, 50, seconds(5), seconds(15))); EFFECTS.add(new EffectMeta(Potion.moveSpeed, 50, 100, seconds(5), seconds(15))); EFFECTS.add(new EffectMeta(Potion.moveSlowdown, 4, 7, seconds(5), seconds(15))); } private static int seconds(int s) { return s * 20; } private static class EffectMeta { public final int potionId; public final int levelMin; public final int levelRange; public final int durationMin; public final int durationRange; public EffectMeta(Potion potion, int levelMin, int levelMax, int durationMin, int durationMax) { this.potionId = potion.id; this.levelMin = levelMin; this.levelRange = levelMax - levelMin + 1; this.durationMin = durationMin; this.durationRange = durationMax - durationMin + 1; } } @Override public boolean execute(EntityPlayerMP target) { Collections.shuffle(EFFECTS); for (int i = 0; i < 2; i++) { EffectMeta selected = EFFECTS.get(i); int duration = selected.durationMin + RANDOM.nextInt(selected.durationRange); int level = selected.levelMin + RANDOM.nextInt(selected.levelRange); target.addPotionEffect(new PotionEffect(selected.potionId, duration, level)); } return true; } }
{'content_hash': '3fdb8ceae3d77b21f1544c6d9808aef6', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 98, 'avg_line_length': 31.49206349206349, 'alnum_prop': 0.7439516129032258, 'repo_name': 'PrinceOfAmber/OpenBlocks', 'id': 'ceefdb00170424ad07fbbd57d491985f4463b611', 'size': '1984', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'src/main/java/openblocks/enchantments/flimflams/EffectFlimFlam.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'GLSL', 'bytes': '711'}, {'name': 'Java', 'bytes': '1003418'}]}
import Backbone from 'backbone'; import WidgetModel from '../models/WidgetModel'; var WidgetCollection = Backbone.Collection.extend({ model: WidgetModel, /** * Get an object containing all of the current parameter values as * modelId -> value */ values: function () { var params = {}; this.each(function (m) { // apply special handling for certain parameter types // https://github.com/DigitalSlideArchive/slicer/blob/9e5112ab3444ad8c699d70452a5fe4a74ebbc778/server/__init__.py#L44-L46 switch (m.get('type')) { case 'file': params[m.id + '_girderItemId'] = m.value().id; break; case 'new-file': params[m.id + '_girderFolderId'] = m.value().get('folderId'); params[m.id + '_name'] = m.value().get('name'); break; case 'new-folder': params[m.id + '_girderFolderId'] = m.value().get('folderId'); params[m.id + '_name'] = m.value().get('name'); break; case 'image': params[m.id + '_girderFileId'] = m.value().id; break; default: params[m.id] = JSON.stringify(m.value()); } }); return params; } }); export default WidgetCollection;
{'content_hash': '42c9ea63a4060a99a39df211246136f4', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 133, 'avg_line_length': 36.1, 'alnum_prop': 0.49445983379501385, 'repo_name': 'adsorensen/girder', 'id': '1e5255ba1ed84c214c5560aaee71461349ea3d59', 'size': '1444', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'plugins/item_tasks/web_client/collections/WidgetCollection.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CMake', 'bytes': '46894'}, {'name': 'CSS', 'bytes': '53110'}, {'name': 'HTML', 'bytes': '151777'}, {'name': 'JavaScript', 'bytes': '1215426'}, {'name': 'Mako', 'bytes': '8228'}, {'name': 'Python', 'bytes': '2119660'}, {'name': 'Roff', 'bytes': '17'}, {'name': 'Ruby', 'bytes': '10593'}, {'name': 'Shell', 'bytes': '9063'}]}
package org.orekit.utils; import java.util.Collection; import java.util.stream.Stream; import org.hipparchus.CalculusFieldElement; import org.hipparchus.analysis.differentiation.FieldDerivative; import org.hipparchus.analysis.differentiation.FieldDerivativeStructure; import org.hipparchus.analysis.interpolation.FieldHermiteInterpolator; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.orekit.annotation.DefaultDataContext; import org.orekit.data.DataContext; import org.orekit.errors.OrekitInternalError; import org.orekit.time.AbsoluteDate; import org.orekit.time.FieldAbsoluteDate; import org.orekit.time.FieldTimeStamped; import org.orekit.time.TimeScale; import org.orekit.time.TimeStamped; /** {@link TimeStamped time-stamped} version of {@link FieldPVCoordinates}. * <p>Instances of this class are guaranteed to be immutable.</p> * @param <T> the type of the field elements * @author Luc Maisonobe * @since 7.0 */ public class TimeStampedFieldPVCoordinates<T extends CalculusFieldElement<T>> extends FieldPVCoordinates<T> implements FieldTimeStamped<T> { /** The date. */ private final FieldAbsoluteDate<T> date; /** Builds a PVCoordinates pair. * @param date coordinates date * @param position the position vector (m) * @param velocity the velocity vector (m/s) * @param acceleration the acceleration vector (m/s²) */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final FieldVector3D<T> position, final FieldVector3D<T> velocity, final FieldVector3D<T> acceleration) { this(new FieldAbsoluteDate<>(position.getX().getField(), date), position, velocity, acceleration); } /** Builds a PVCoordinates pair. * @param date coordinates date * @param position the position vector (m) * @param velocity the velocity vector (m/s) * @param acceleration the acceleration vector (m/s²) */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final FieldVector3D<T> position, final FieldVector3D<T> velocity, final FieldVector3D<T> acceleration) { super(position, velocity, acceleration); this.date = date; } /** Basic constructor. * <p>Build a PVCoordinates from another one at a given date</p> * <p>The PVCoordinates built will be pv</p> * @param date date of the built coordinates * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final FieldPVCoordinates<T> pv) { this(new FieldAbsoluteDate<>(pv.getPosition().getX().getField(), date), pv); } /** Basic constructor. * <p>Build a PVCoordinates from another one at a given date</p> * <p>The PVCoordinates built will be pv</p> * @param date date of the built coordinates * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final FieldPVCoordinates<T> pv) { super(pv.getPosition(), pv.getVelocity(), pv.getAcceleration()); this.date = date; } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final double a, final FieldPVCoordinates<T> pv) { this(new FieldAbsoluteDate<>(pv.getPosition().getX().getField(), date), a, pv); } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final double a, final FieldPVCoordinates<T> pv) { super(new FieldVector3D<>(a, pv.getPosition()), new FieldVector3D<>(a, pv.getVelocity()), new FieldVector3D<>(a, pv.getAcceleration())); this.date = date; } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a, final FieldPVCoordinates<T> pv) { this(new FieldAbsoluteDate<>(a.getField(), date), a, pv); } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a, final FieldPVCoordinates<T> pv) { super(new FieldVector3D<>(a, pv.getPosition()), new FieldVector3D<>(a, pv.getVelocity()), new FieldVector3D<>(a, pv.getAcceleration())); this.date = date; } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a, final PVCoordinates pv) { this(new FieldAbsoluteDate<>(a.getField(), date), a, pv); } /** Multiplicative constructor * <p>Build a PVCoordinates from another one and a scale factor.</p> * <p>The PVCoordinates built will be a * pv</p> * @param date date of the built coordinates * @param a scale factor * @param pv base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a, final PVCoordinates pv) { super(new FieldVector3D<>(a, pv.getPosition()), new FieldVector3D<>(a, pv.getVelocity()), new FieldVector3D<>(a, pv.getAcceleration())); this.date = date; } /** Subtractive constructor * <p>Build a relative PVCoordinates from a start and an end position.</p> * <p>The PVCoordinates built will be end - start.</p> * @param date date of the built coordinates * @param start Starting PVCoordinates * @param end ending PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final FieldPVCoordinates<T> start, final FieldPVCoordinates<T> end) { this(new FieldAbsoluteDate<>(start.getPosition().getX().getField(), date), start, end); } /** Subtractive constructor * <p>Build a relative PVCoordinates from a start and an end position.</p> * <p>The PVCoordinates built will be end - start.</p> * @param date date of the built coordinates * @param start Starting PVCoordinates * @param end ending PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final FieldPVCoordinates<T> start, final FieldPVCoordinates<T> end) { super(end.getPosition().subtract(start.getPosition()), end.getVelocity().subtract(start.getVelocity()), end.getAcceleration().subtract(start.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2) { this(new FieldAbsoluteDate<>(pv1.getPosition().getX().getField(), date), a1, pv1, a2, pv2); } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2); } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2); } /** Linear constructor * <p>Build a PVCoordinates from two other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2, final double a3, final FieldPVCoordinates<T> pv3) { this(new FieldAbsoluteDate<>(pv1.getPosition().getX().getField(), date), a1, pv1, a2, pv2, a3, pv3); } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2, final double a3, final FieldPVCoordinates<T> pv3) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2, final T a3, final FieldPVCoordinates<T> pv3) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2, a3, pv3); } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2, final T a3, final FieldPVCoordinates<T> pv3) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2, final T a3, final PVCoordinates pv3) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2, a3, pv3); } /** Linear constructor * <p>Build a PVCoordinates from three other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2, final T a3, final PVCoordinates pv3) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2, final double a3, final FieldPVCoordinates<T> pv3, final double a4, final FieldPVCoordinates<T> pv4) { this(new FieldAbsoluteDate<>(pv1.getPosition().getX().getField(), date), a1, pv1, a2, pv2, a3, pv3, a4, pv4); } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final double a1, final FieldPVCoordinates<T> pv1, final double a2, final FieldPVCoordinates<T> pv2, final double a3, final FieldPVCoordinates<T> pv3, final double a4, final FieldPVCoordinates<T> pv4) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition(), a4, pv4.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity(), a4, pv4.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration(), a4, pv4.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2, final T a3, final FieldPVCoordinates<T> pv3, final T a4, final FieldPVCoordinates<T> pv4) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2, a3, pv3, a4, pv4); } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final FieldPVCoordinates<T> pv1, final T a2, final FieldPVCoordinates<T> pv2, final T a3, final FieldPVCoordinates<T> pv3, final T a4, final FieldPVCoordinates<T> pv4) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition(), a4, pv4.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity(), a4, pv4.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration(), a4, pv4.getAcceleration())); this.date = date; } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final AbsoluteDate date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2, final T a3, final PVCoordinates pv3, final T a4, final PVCoordinates pv4) { this(new FieldAbsoluteDate<>(a1.getField(), date), a1, pv1, a2, pv2, a3, pv3, a4, pv4); } /** Linear constructor * <p>Build a PVCoordinates from four other ones and corresponding scale factors.</p> * <p>The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4</p> * @param date date of the built coordinates * @param a1 first scale factor * @param pv1 first base (unscaled) PVCoordinates * @param a2 second scale factor * @param pv2 second base (unscaled) PVCoordinates * @param a3 third scale factor * @param pv3 third base (unscaled) PVCoordinates * @param a4 fourth scale factor * @param pv4 fourth base (unscaled) PVCoordinates */ public TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final T a1, final PVCoordinates pv1, final T a2, final PVCoordinates pv2, final T a3, final PVCoordinates pv3, final T a4, final PVCoordinates pv4) { super(new FieldVector3D<>(a1, pv1.getPosition(), a2, pv2.getPosition(), a3, pv3.getPosition(), a4, pv4.getPosition()), new FieldVector3D<>(a1, pv1.getVelocity(), a2, pv2.getVelocity(), a3, pv3.getVelocity(), a4, pv4.getVelocity()), new FieldVector3D<>(a1, pv1.getAcceleration(), a2, pv2.getAcceleration(), a3, pv3.getAcceleration(), a4, pv4.getAcceleration())); this.date = date; } /** Builds a TimeStampedFieldPVCoordinates triplet from a {@link FieldVector3D}&lt;{@link FieldDerivativeStructure}&gt;. * <p> * The vector components must have time as their only derivation parameter and * have consistent derivation orders. * </p> * @param date date of the built coordinates * @param <U> type of the derivative * @param p vector with time-derivatives embedded within the coordinates */ public <U extends FieldDerivative<T, U>> TimeStampedFieldPVCoordinates(final FieldAbsoluteDate<T> date, final FieldVector3D<U> p) { super(p); this.date = date; } /** {@inheritDoc} */ @Override public FieldAbsoluteDate<T> getDate() { return date; } /** Get a time-shifted state. * <p> * The state can be slightly shifted to close dates. This shift is based on * a simple linear model. It is <em>not</em> intended as a replacement for * proper orbit propagation (it is not even Keplerian!) but should be sufficient * for either small time shifts or coarse accuracy. * </p> * @param dt time shift in seconds * @return a new state, shifted with respect to the instance (which is immutable) */ public TimeStampedFieldPVCoordinates<T> shiftedBy(final double dt) { final FieldPVCoordinates<T> spv = super.shiftedBy(dt); return new TimeStampedFieldPVCoordinates<>(date.shiftedBy(dt), spv.getPosition(), spv.getVelocity(), spv.getAcceleration()); } /** Get a time-shifted state. * <p> * The state can be slightly shifted to close dates. This shift is based on * a simple linear model. It is <em>not</em> intended as a replacement for * proper orbit propagation (it is not even Keplerian!) but should be sufficient * for either small time shifts or coarse accuracy. * </p> * @param dt time shift in seconds * @return a new state, shifted with respect to the instance (which is immutable) */ public TimeStampedFieldPVCoordinates<T> shiftedBy(final T dt) { final FieldPVCoordinates<T> spv = super.shiftedBy(dt); return new TimeStampedFieldPVCoordinates<>(date.shiftedBy(dt), spv.getPosition(), spv.getVelocity(), spv.getAcceleration()); } /** Interpolate position-velocity. * <p> * The interpolated instance is created by polynomial Hermite interpolation * ensuring velocity remains the exact derivative of position. * </p> * <p> * Note that even if first time derivatives (velocities) * from sample can be ignored, the interpolated instance always includes * interpolated derivatives. This feature can be used explicitly to * compute these derivatives when it would be too complex to compute them * from an analytical formula: just compute a few sample points from the * explicit formula and set the derivatives to zero in these sample points, * then use interpolation to add derivatives consistent with the positions. * </p> * @param date interpolation date * @param filter filter for derivatives from the sample to use in interpolation * @param sample sample points on which interpolation should be done * @param <T> the type of the field elements * @return a new position-velocity, interpolated at specified date */ public static <T extends CalculusFieldElement<T>> TimeStampedFieldPVCoordinates<T> interpolate(final FieldAbsoluteDate<T> date, final CartesianDerivativesFilter filter, final Collection<TimeStampedFieldPVCoordinates<T>> sample) { return interpolate(date, filter, sample.stream()); } /** Interpolate position-velocity. * <p> * The interpolated instance is created by polynomial Hermite interpolation * ensuring velocity remains the exact derivative of position. * </p> * <p> * Note that even if first time derivatives (velocities) * from sample can be ignored, the interpolated instance always includes * interpolated derivatives. This feature can be used explicitly to * compute these derivatives when it would be too complex to compute them * from an analytical formula: just compute a few sample points from the * explicit formula and set the derivatives to zero in these sample points, * then use interpolation to add derivatives consistent with the positions. * </p> * @param date interpolation date * @param filter filter for derivatives from the sample to use in interpolation * @param sample sample points on which interpolation should be done * @param <T> the type of the field elements * @return a new position-velocity, interpolated at specified date */ public static <T extends CalculusFieldElement<T>> TimeStampedFieldPVCoordinates<T> interpolate(final FieldAbsoluteDate<T> date, final CartesianDerivativesFilter filter, final Stream<TimeStampedFieldPVCoordinates<T>> sample) { // set up an interpolator taking derivatives into account final FieldHermiteInterpolator<T> interpolator = new FieldHermiteInterpolator<>(); // add sample points switch (filter) { case USE_P : // populate sample with position data, ignoring velocity sample.forEach(pv -> { final FieldVector3D<T> position = pv.getPosition(); interpolator.addSamplePoint(pv.getDate().durationFrom(date), position.toArray()); }); break; case USE_PV : // populate sample with position and velocity data sample.forEach(pv -> { final FieldVector3D<T> position = pv.getPosition(); final FieldVector3D<T> velocity = pv.getVelocity(); interpolator.addSamplePoint(pv.getDate().durationFrom(date), position.toArray(), velocity.toArray()); }); break; case USE_PVA : // populate sample with position, velocity and acceleration data sample.forEach(pv -> { final FieldVector3D<T> position = pv.getPosition(); final FieldVector3D<T> velocity = pv.getVelocity(); final FieldVector3D<T> acceleration = pv.getAcceleration(); interpolator.addSamplePoint(pv.getDate().durationFrom(date), position.toArray(), velocity.toArray(), acceleration.toArray()); }); break; default : // this should never happen throw new OrekitInternalError(null); } // interpolate final T[][] p = interpolator.derivatives(date.getField().getZero(), 2); // build a new interpolated instance return new TimeStampedFieldPVCoordinates<>(date, new FieldVector3D<>(p[0]), new FieldVector3D<>(p[1]), new FieldVector3D<>(p[2])); } /** Convert to a constant position-velocity. * @return a constant position-velocity * @since 9.0 */ public TimeStampedPVCoordinates toTimeStampedPVCoordinates() { return new TimeStampedPVCoordinates(date.toAbsoluteDate(), getPosition().toVector3D(), getVelocity().toVector3D(), getAcceleration().toVector3D()); } /** Return a string representation of this date, position, velocity, and acceleration. * * <p>This method uses the {@link DataContext#getDefault() default data context}. * * @return string representation of this. */ @Override @DefaultDataContext public String toString() { return toTimeStampedPVCoordinates().toString(); } /** * Return a string representation of this date, position, velocity, and acceleration. * * @param utc time scale used to print the date. * @return string representation of this. */ public String toString(final TimeScale utc) { return toTimeStampedPVCoordinates().toString(utc); } }
{'content_hash': '6fc0c8d8b9a6c635018326f8a727a4ee', 'timestamp': '', 'source': 'github', 'line_count': 748, 'max_line_length': 125, 'avg_line_length': 49.51470588235294, 'alnum_prop': 0.6002646002646003, 'repo_name': 'CS-SI/Orekit', 'id': '23f32ea4d01121699ad201e99633eb6f3b481ab2', 'size': '37839', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/main/java/org/orekit/utils/TimeStampedFieldPVCoordinates.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Fortran', 'bytes': '7408'}, {'name': 'HTML', 'bytes': '19673'}, {'name': 'Java', 'bytes': '25367949'}, {'name': 'Roff', 'bytes': '31072'}, {'name': 'XSLT', 'bytes': '734'}]}
<footer class="site-footer"> <div class="offsite-links"> {% if site.footer.has_social %} {% include social.html %} {% endif %} </div><!-- .offsite-links --> <div class="footer-bottom"> <div class="site-info"> {{ site.footer.content | markdownify }} </div><!-- .site-info --> <a href="#page" id="back-to-top" class="back-to-top"><span class="screen-reader-text">Back to the top </span>&#8593;</a> </div><!-- .footer-bottom --> </footer><!-- .site-footer -->
{'content_hash': 'aa45507a37bcd44365bd07749d50aa37', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 124, 'avg_line_length': 38.23076923076923, 'alnum_prop': 0.5734406438631791, 'repo_name': 'tbarabosch/tbarabosch.github.io', 'id': '968858181a67b3762056c338aeca4888a2ab1653', 'size': '497', 'binary': False, 'copies': '4', 'ref': 'refs/heads/main', 'path': '_includes/footer.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '10872'}, {'name': 'JavaScript', 'bytes': '504'}, {'name': 'SCSS', 'bytes': '25049'}]}
<?php use Symfony\Component\Translation\MessageCatalogue; $catalogue = new MessageCatalogue('no', array ( 'validators' => array ( 'This value should be false.' => 'Verdien skulle ha vore tom/nei.', 'This value should be true.' => 'Verdien skulla ha vore satt/ja.', 'This value should be of type {{ type }}.' => 'Verdien må vere av typen {{ type }}.', 'This value should be blank.' => 'Verdien skal vere blank.', 'The value you selected is not a valid choice.' => 'Verdien du valgte er ikkje gyldig.', 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.' => 'Du må velge minst {{ limit }} valg.', 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.' => 'Du kan maksimalt gjere {{ limit }} valg.', 'One or more of the given values is invalid.' => 'Ein eller fleire av dei opplyste verdiane er ugyldige.', 'This field was not expected.' => 'Dette feltet var ikke forventet.', 'This field is missing.' => 'Dette feltet mangler.', 'This value is not a valid date.' => 'Verdien er ikkje ein gyldig dato.', 'This value is not a valid datetime.' => 'Verdien er ikkje ein gyldig dato og tid.', 'This value is not a valid email address.' => 'Verdien er ikkje ei gyldig e-postadresse.', 'The file could not be found.' => 'Fila kunne ikkje finnes.', 'The file is not readable.' => 'Fila kan ikkje lesast.', 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.' => 'Fila er for stor ({{ size }} {{ suffix }}). Tillatt maksimal størrelse er {{ limit }} {{ suffix }}.', 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.' => 'Mime-typen av fila er ugyldig ({{ type }}). Tillatte mime-typar er {{ types }}.', 'This value should be {{ limit }} or less.' => 'Verdien må vere {{ limit }} eller mindre.', 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.' => 'Verdien er for lang. Den må vere {{ limit }} bokstavar eller mindre.', 'This value should be {{ limit }} or more.' => 'Verdien må vere {{ limit }} eller meir.', 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.' => 'Verdien er for kort. Den må ha {{ limit }} teikn eller fleire.', 'This value should not be blank.' => 'Verdien må ikkje vere blank.', 'This value should not be null.' => 'Verdien må ikkje vere tom (null).', 'This value should be null.' => 'Verdien må vere tom (null).', 'This value is not valid.' => 'Verdien er ikkje gyldig.', 'This value is not a valid time.' => 'Verdien er ikkje gyldig tidseining.', 'This value is not a valid URL.' => 'Verdien er ikkje ein gyldig URL.', 'The two values should be equal.' => 'Dei to verdiane må vere like.', 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.' => 'Fila er for stor. Den maksimale storleik er {{ limit }} {{ suffix }}.', 'The file is too large.' => 'Fila er for stor.', 'The file could not be uploaded.' => 'Fila kunne ikkje bli lasta opp.', 'This value should be a valid number.' => 'Verdien må vere eit gyldig tal.', 'This file is not a valid image.' => 'Fila er ikkje eit gyldig bilete.', 'This is not a valid IP address.' => 'Dette er ikkje ei gyldig IP-adresse.', 'This value is not a valid language.' => 'Verdien er ikkje eit gyldig språk.', 'This value is not a valid locale.' => 'Verdien er ikkje ein gyldig lokalitet (språk/region).', 'This value is not a valid country.' => 'Verdien er ikkje eit gyldig land.', 'This value is already used.' => 'Verdien er allereie i bruk.', 'The size of the image could not be detected.' => 'Storleiken på biletet kunne ikkje oppdagast.', 'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.' => 'Biletbreidda er for stor, ({{ width }} pikslar). Tillatt maksimumsbreidde er {{ max_width }} pikslar.', 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.' => 'Biletbreidda er for liten, ({{ width }} pikslar). Forventa minimumsbreidde er {{ min_width }} pikslar.', 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.' => 'Bilethøgda er for stor, ({{ height }} pikslar). Tillatt maksimumshøgde er {{ max_height }} pikslar.', 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.' => 'Billethøgda er for låg, ({{ height }} pikslar). Forventa minimumshøgde er {{ min_height }} pikslar.', 'This value should be the user\'s current password.' => 'Verdien må vere brukaren sitt noverande passord.', 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.' => 'Verdien må vere nøyaktig {{ limit }} teikn.', 'The file was only partially uploaded.' => 'Fila vart kun delvis opplasta.', 'No file was uploaded.' => 'Inga fil vart lasta opp.', 'No temporary folder was configured in php.ini.' => 'Førebels mappe (tmp) er ikkje konfigurert i php.ini.', 'Cannot write temporary file to disk.' => 'Kan ikkje skrive førebels fil til disk.', 'A PHP extension caused the upload to fail.' => 'Ei PHP-udviding forårsaka feil under opplasting.', 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.' => 'Denne samlinga må innehalde {{ limit }} element eller meir.|Denne samlinga må innehalde {{ limit }} element eller meir.', 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.' => 'Denne samlinga må innehalde {{ limit }} element eller færre.|Denne samlinga må innehalde {{ limit }} element eller færre.', 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.' => 'Denne samlinga må innehalde nøyaktig {{ limit }} element.|Denne samlinga må innehalde nøyaktig {{ limit }} element.', 'Invalid card number.' => 'Ugyldig kortnummer.', 'Unsupported card type or invalid card number.' => 'Korttypen er ikkje støtta eller ugyldig kortnummer.', ), 'security' => array ( 'An authentication exception occurred.' => 'En autentiserings feil har skjedd.', 'Authentication credentials could not be found.' => 'Påloggingsinformasjonen kunne ikke bli funnet.', 'Authentication request could not be processed due to a system problem.' => 'Autentiserings forespørselen kunne ikke bli prosessert grunnet en system feil.', 'Invalid credentials.' => 'Ugyldig påloggingsinformasjonen.', 'Cookie has already been used by someone else.' => 'Cookie har allerede blitt brukt av noen andre.', 'Not privileged to request the resource.' => 'Ingen tilgang til å be om gitt kilde.', 'Invalid CSRF token.' => 'Ugyldig CSRF token.', 'Digest nonce has expired.' => 'Digest nonce er utløpt.', 'No authentication provider found to support the authentication token.' => 'Ingen autentiserings tilbyder funnet som støtter gitt autentiserings token.', 'No session available, it either timed out or cookies are not enabled.' => 'Ingen sesjon tilgjengelig, sesjonen er enten utløpt eller cookies ikke skrudd på.', 'No token could be found.' => 'Ingen token kunne bli funnet.', 'Username could not be found.' => 'Brukernavn kunne ikke bli funnet.', 'Account has expired.' => 'Brukerkonto har utgått.', 'Credentials have expired.' => 'Påloggingsinformasjon har utløpt.', 'Account is disabled.' => 'Brukerkonto er deaktivert.', 'Account is locked.' => 'Brukerkonto er sperret.', ), )); $catalogueEn = new MessageCatalogue('en', array ( 'validators' => array ( 'This value should be false.' => 'This value should be false.', 'This value should be true.' => 'This value should be true.', 'This value should be of type {{ type }}.' => 'This value should be of type {{ type }}.', 'This value should be blank.' => 'This value should be blank.', 'The value you selected is not a valid choice.' => 'The value you selected is not a valid choice.', 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.' => 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.', 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.' => 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.', 'One or more of the given values is invalid.' => 'One or more of the given values is invalid.', 'This field was not expected.' => 'This field was not expected.', 'This field is missing.' => 'This field is missing.', 'This value is not a valid date.' => 'This value is not a valid date.', 'This value is not a valid datetime.' => 'This value is not a valid datetime.', 'This value is not a valid email address.' => 'This value is not a valid email address.', 'The file could not be found.' => 'The file could not be found.', 'The file is not readable.' => 'The file is not readable.', 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.' => 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.', 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.' => 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.', 'This value should be {{ limit }} or less.' => 'This value should be {{ limit }} or less.', 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.' => 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.', 'This value should be {{ limit }} or more.' => 'This value should be {{ limit }} or more.', 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.' => 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.', 'This value should not be blank.' => 'This value should not be blank.', 'This value should not be null.' => 'This value should not be null.', 'This value should be null.' => 'This value should be null.', 'This value is not valid.' => 'This value is not valid.', 'This value is not a valid time.' => 'This value is not a valid time.', 'This value is not a valid URL.' => 'This value is not a valid URL.', 'The two values should be equal.' => 'The two values should be equal.', 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.' => 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.', 'The file is too large.' => 'The file is too large.', 'The file could not be uploaded.' => 'The file could not be uploaded.', 'This value should be a valid number.' => 'This value should be a valid number.', 'This file is not a valid image.' => 'This file is not a valid image.', 'This is not a valid IP address.' => 'This is not a valid IP address.', 'This value is not a valid language.' => 'This value is not a valid language.', 'This value is not a valid locale.' => 'This value is not a valid locale.', 'This value is not a valid country.' => 'This value is not a valid country.', 'This value is already used.' => 'This value is already used.', 'The size of the image could not be detected.' => 'The size of the image could not be detected.', 'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.' => 'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.', 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.' => 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.', 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.' => 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.', 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.' => 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.', 'This value should be the user\'s current password.' => 'This value should be the user\'s current password.', 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.' => 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.', 'The file was only partially uploaded.' => 'The file was only partially uploaded.', 'No file was uploaded.' => 'No file was uploaded.', 'No temporary folder was configured in php.ini.' => 'No temporary folder was configured in php.ini.', 'Cannot write temporary file to disk.' => 'Cannot write temporary file to disk.', 'A PHP extension caused the upload to fail.' => 'A PHP extension caused the upload to fail.', 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.' => 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.', 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.' => 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.', 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.' => 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.', 'Invalid card number.' => 'Invalid card number.', 'Unsupported card type or invalid card number.' => 'Unsupported card type or invalid card number.', 'This is not a valid International Bank Account Number (IBAN).' => 'This is not a valid International Bank Account Number (IBAN).', 'This value is not a valid ISBN-10.' => 'This value is not a valid ISBN-10.', 'This value is not a valid ISBN-13.' => 'This value is not a valid ISBN-13.', 'This value is neither a valid ISBN-10 nor a valid ISBN-13.' => 'This value is neither a valid ISBN-10 nor a valid ISBN-13.', 'This value is not a valid ISSN.' => 'This value is not a valid ISSN.', 'This value is not a valid currency.' => 'This value is not a valid currency.', 'This value should be equal to {{ compared_value }}.' => 'This value should be equal to {{ compared_value }}.', 'This value should be greater than {{ compared_value }}.' => 'This value should be greater than {{ compared_value }}.', 'This value should be greater than or equal to {{ compared_value }}.' => 'This value should be greater than or equal to {{ compared_value }}.', 'This value should be identical to {{ compared_value_type }} {{ compared_value }}.' => 'This value should be identical to {{ compared_value_type }} {{ compared_value }}.', 'This value should be less than {{ compared_value }}.' => 'This value should be less than {{ compared_value }}.', 'This value should be less than or equal to {{ compared_value }}.' => 'This value should be less than or equal to {{ compared_value }}.', 'This value should not be equal to {{ compared_value }}.' => 'This value should not be equal to {{ compared_value }}.', 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.' => 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.', 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.' => 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.', 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.' => 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.', 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.' => 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.', 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.' => 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.', 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.' => 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.', 'An empty file is not allowed.' => 'An empty file is not allowed.', 'The host could not be resolved.' => 'The host could not be resolved.', 'This value does not match the expected {{ charset }} charset.' => 'This value does not match the expected {{ charset }} charset.', 'This form should not contain extra fields.' => 'This form should not contain extra fields.', 'The uploaded file was too large. Please try to upload a smaller file.' => 'The uploaded file was too large. Please try to upload a smaller file.', 'The CSRF token is invalid. Please try to resubmit the form.' => 'The CSRF token is invalid. Please try to resubmit the form.', 'fos_user.username.already_used' => 'The username is already used', 'fos_user.username.blank' => 'Please enter a username', 'fos_user.username.short' => '[-Inf,Inf]The username is too short', 'fos_user.username.long' => '[-Inf,Inf]The username is too long', 'fos_user.email.already_used' => 'The email is already used', 'fos_user.email.blank' => 'Please enter an email', 'fos_user.email.short' => '[-Inf,Inf]The email is too short', 'fos_user.email.long' => '[-Inf,Inf]The email is too long', 'fos_user.email.invalid' => 'The email is not valid', 'fos_user.password.blank' => 'Please enter a password', 'fos_user.password.short' => '[-Inf,Inf]The password is too short', 'fos_user.password.mismatch' => 'The entered passwords don\'t match', 'fos_user.new_password.blank' => 'Please enter a new password', 'fos_user.new_password.short' => '[-Inf,Inf]The new password is too short', 'fos_user.current_password.invalid' => 'The entered password is invalid', 'fos_user.group.blank' => 'Please enter a name', 'fos_user.group.short' => '[-Inf,Inf]The name is too short', 'fos_user.group.long' => '[-Inf,Inf]The name is too long', ), 'security' => array ( 'An authentication exception occurred.' => 'An authentication exception occurred.', 'Authentication credentials could not be found.' => 'Authentication credentials could not be found.', 'Authentication request could not be processed due to a system problem.' => 'Authentication request could not be processed due to a system problem.', 'Invalid credentials.' => 'Invalid credentials.', 'Cookie has already been used by someone else.' => 'Cookie has already been used by someone else.', 'Not privileged to request the resource.' => 'Not privileged to request the resource.', 'Invalid CSRF token.' => 'Invalid CSRF token.', 'Digest nonce has expired.' => 'Digest nonce has expired.', 'No authentication provider found to support the authentication token.' => 'No authentication provider found to support the authentication token.', 'No session available, it either timed out or cookies are not enabled.' => 'No session available, it either timed out or cookies are not enabled.', 'No token could be found.' => 'No token could be found.', 'Username could not be found.' => 'Username could not be found.', 'Account has expired.' => 'Account has expired.', 'Credentials have expired.' => 'Credentials have expired.', 'Account is disabled.' => 'Account is disabled.', 'Account is locked.' => 'Account is locked.', ), 'CmfRoutingBundle' => array ( 'dashboard.cmf' => 'Symfony CMF', 'dashboard.label_routing' => 'Route', 'dashboard.label_redirect_routing' => 'Redirect Route', 'breadcrumb.link_route_list' => 'Routes', 'breadcrumb.link_route_create' => 'Create', 'breadcrumb.link_route_edit' => 'Edit', 'breadcrumb.link_route_delete' => 'Delete', 'breadcrumb.link_redirect_route_list' => 'Redirect Routes', 'breadcrumb.link_redirect_route_create' => 'Create', 'breadcrumb.link_redirect_route_edit' => 'Edit', 'breadcrumb.link_redirect_route_delete' => 'Delete', 'filter.label_name' => 'Name', 'list.label_path' => 'URL', 'form.group_general' => 'General', 'form.group_advanced' => 'Advanced', 'form.label_parent' => 'Parent', 'form.label_name' => 'Last URL part', 'form.label_variable_pattern' => 'Variable pattern', 'form.help_variable_pattern' => 'A pattern in the format {variable}/{more}... The fields are passed to the controller if it declares them as arguments.', 'form.label_content' => 'Content', 'form.label_defaults' => 'Defaults', 'form.label_options' => 'Options', 'form.label_route_name' => 'Name', 'form.label_uri' => 'URI', 'form.label_route_target' => 'Route target', 'form.group_routes' => 'Routes', 'form.label_routes' => 'Routes', 'form.label_add_locale_pattern' => 'Add locale pattern', 'form.label_add_format_pattern' => 'Add format pattern', 'form.label_add_trailing_slash' => 'Add trailing slash', 'form.help_options' => ' Locale: Prepend locale to route like /{locale}/your/route<br/> Format: Append format to route like /your/route.{format}. Default format is \'html\'<br/> Slash: Append a trailing slash to route like /your/route/ ', 'admin.menu_frontend_link_caption' => 'Frontend', 'admin.menu_frontend_link_title' => 'Open frontend view in new tab', ), 'SonataCoreBundle' => array ( 'link_add' => 'Add new', 'label_type_yes' => 'yes', 'label_type_no' => 'no', 'sonata_core_template_box_file_found_in' => 'This file can be found in', 'label_type_equals' => 'is equal to', 'label_type_not_equals' => 'is not equal to', 'date_range_start' => 'From', 'date_range_end' => 'To', ), 'SonataAdminBundle' => array ( 'sonata_administration' => 'Administration', 'action_delete' => 'Delete', 'btn_batch' => 'OK', 'btn_create' => 'Create', 'btn_create_and_edit_again' => 'Create', 'btn_create_and_create_a_new_one' => 'Create and add another', 'btn_create_and_return_to_list' => 'Create and return to list', 'btn_filter' => 'Filter', 'btn_update' => 'Update', 'btn_update_and_edit_again' => 'Update', 'btn_update_and_return_to_list' => 'Update and close', 'link_delete' => 'Delete', 'link_action_create' => 'Add new', 'link_action_list' => 'Return to list', 'link_action_show' => 'Show', 'link_action_edit' => 'Edit', 'link_add' => 'Add new', 'link_list' => 'List', 'link_reset_filter' => 'Reset', 'title_create' => 'Create', 'title_dashboard' => 'Dashboard', 'title_edit' => 'Edit "%name%"', 'title_list' => 'List', 'link_next_pager' => 'Next', 'link_previous_pager' => 'Previous', 'link_first_pager' => 'First', 'link_last_pager' => 'Last', 'Admin' => 'Admin', 'link_expand' => 'expand/collapse', 'no_result' => 'No result', 'confirm_msg' => 'Are you sure ?', 'action_edit' => 'Edit', 'action_show' => 'Show', 'all_elements' => 'All elements', 'flash_batch_empty' => 'Action aborted. No items were selected.', 'flash_create_success' => 'Item "%name%" has been successfully created.', 'flash_create_error' => 'An error has occurred during the creation of item "%name%".', 'flash_edit_success' => 'Item "%name%" has been successfully updated.', 'flash_edit_error' => 'An error has occurred during update of item "%name%".', 'flash_batch_delete_success' => 'Selected items have been successfully deleted.', 'flash_batch_delete_error' => 'An Error has occurred during selected items deletion.', 'flash_delete_error' => 'An Error has occurred during deletion of item "%name%".', 'flash_delete_success' => 'Item "%name%" has been deleted successfully.', 'breadcrumb.link_dashboard' => '<i class="fa fa-home"></i>', 'title_delete' => 'Confirm deletion', 'message_delete_confirmation' => 'Are you sure you want to delete the selected "%object%" element?', 'btn_delete' => 'Yes, delete', 'title_batch_confirmation' => 'Confirm batch action \'%action%\'', 'message_batch_confirmation' => 'Are you sure you want to confirm this action and execute it for the selected element?|Are you sure you want to confirm this action and execute it for the %count% selected elements?', 'message_batch_all_confirmation' => 'Are you sure you want to confirm this action and execute it for all the elements?', 'btn_execute_batch_action' => 'Yes, execute', 'label_type_yes' => 'yes', 'label_type_no' => 'no', 'label_type_contains' => 'contains', 'label_type_not_contains' => 'does not contain', 'label_type_equals' => 'is equal to', 'label_type_not_equals' => 'is not equal to', 'label_type_equal' => '=', 'label_type_greater_equal' => '>=', 'label_type_greater_than' => '>', 'label_type_less_equal' => '<=', 'label_type_less_than' => '<', 'label_date_type_equal' => '=', 'label_date_type_greater_equal' => '>=', 'label_date_type_greater_than' => '>', 'label_date_type_less_equal' => '<=', 'label_date_type_less_than' => '<', 'label_date_type_null' => 'is empty', 'label_date_type_not_null' => 'is not empty', 'label_date_type_between' => 'between', 'label_date_type_not_between' => 'not between', 'label_filters' => 'Filters', 'delete_or' => 'or', 'link_action_history' => 'Revisions', 'td_action' => 'Action', 'td_compare' => 'Compare', 'td_revision' => 'Revisions', 'td_timestamp' => 'Date', 'td_username' => 'Author', 'label_view_revision' => 'View Revision', 'label_compare_revision' => 'Compare revision', 'list_results_count' => '1 result|%count% results', 'label_export_download' => 'Download', 'loading_information' => 'Loading information…', 'btn_preview' => 'Preview', 'btn_preview_approve' => 'Approve', 'btn_preview_decline' => 'Decline', 'label_per_page' => 'Per page', 'list_select' => 'Select', 'confirm_exit' => 'You have unsaved changes.', 'link_edit_acl' => 'Edit ACL', 'btn_update_acl' => 'Update ACL', 'flash_acl_edit_success' => 'ACL has been successfuly updated.', 'link_action_acl' => 'ACL', 'short_object_description_placeholder' => 'No selection', 'title_search_results' => 'Search results: %query%', 'search_placeholder' => 'Search', 'no_results_found' => 'no result found', 'add_new_entry' => 'add new entry', 'link_actions' => 'Actions', 'noscript_warning' => 'Javascript is disabled in your web browser. Some features will not work properly.', 'message_form_group_empty' => 'No fields available.', ), 'SonataDoctrinePHPCRAdmin' => array ( 'content_tree' => 'Content', 'reset_tree' => 'Reset', 'create_item' => 'Create', 'delete_item' => 'Delete', 'confirm_move_node' => 'Really move that node?', 'list_results_count_prefix' => 'at least', 'not_editable' => '(not editable)', 'label_type_contains_words' => 'contains words', ), 'FOSUserBundle' => array ( 'Bad credentials' => 'Invalid username or password', 'group.edit.submit' => 'Update group', 'group.show.name' => 'Group name', 'group.new.submit' => 'Create group', 'group.flash.updated' => 'The group has been updated', 'group.flash.created' => 'The group has been created', 'group.flash.deleted' => 'The group has been deleted', 'security.login.username' => 'Username:', 'security.login.password' => 'Password:', 'security.login.remember_me' => 'Remember me', 'security.login.submit' => 'Login', 'profile.show.username' => 'Username', 'profile.show.email' => 'Email', 'profile.edit.submit' => 'Update', 'profile.flash.updated' => 'The profile has been updated', 'change_password.submit' => 'Change password', 'change_password.flash.success' => 'The password has been changed', 'registration.check_email' => 'An email has been sent to %email%. It contains an activation link you must click to activate your account.', 'registration.confirmed' => 'Congrats %username%, your account is now activated.', 'registration.back' => 'Back to the originating page.', 'registration.submit' => 'Register', 'registration.flash.user_created' => 'The user has been created successfully', 'registration.email.subject' => 'Welcome %username%!', 'registration.email.message' => 'Hello %username%! To finish activating your account - please visit %confirmationUrl% Regards, the Team. ', 'resetting.password_already_requested' => 'The password for this user has already been requested within the last 24 hours.', 'resetting.check_email' => 'An email has been sent to %email%. It contains a link you must click to reset your password.', 'resetting.request.invalid_username' => 'The username or email address "%username%" does not exist.', 'resetting.request.username' => 'Username or email address:', 'resetting.request.submit' => 'Reset password', 'resetting.reset.submit' => 'Change password', 'resetting.flash.success' => 'The password has been reset successfully', 'resetting.email.subject' => 'Reset Password', 'resetting.email.message' => 'Hello %username%! To reset your password - please visit %confirmationUrl% Regards, the Team. ', 'layout.logout' => 'Logout', 'layout.login' => 'Login', 'layout.register' => 'Register', 'layout.logged_in_as' => 'Logged in as %username%', 'form.group_name' => 'Group name:', 'form.username' => 'Username:', 'form.email' => 'Email:', 'form.current_password' => 'Current password:', 'form.password' => 'Password:', 'form.password_confirmation' => 'Repeat password:', 'form.new_password' => 'New password:', 'form.new_password_confirmation' => 'Repeat new password:', ), 'SonataUserBundle' => array ( 'title_user_registration' => 'Register', 'title_user_account' => 'User Profile', 'title_user_edit_profile' => 'Edit', 'title_user_authentication' => 'Authentication', 'sonata_user_submit' => 'Submit', 'breadcrumb.link_user_list' => 'Users', 'breadcrumb.link_user_create' => 'Create', 'breadcrumb.link_user_edit' => 'Edit', 'breadcrumb.link_user_delete' => 'Delete', 'breadcrumb.link_group_list' => 'Groups', 'breadcrumb.link_group_create' => 'Create', 'breadcrumb.link_group_edit' => 'Edit', 'users' => 'Users', 'groups' => 'Groups', 'switch_user_exit' => 'Exit impersonating mode', 'switch_user' => 'Impersonate User', 'user_block_logout' => 'Logout', 'form.label_username' => 'Username', 'form.label_email' => 'E-Mail-Address', 'form.label_plain_password' => 'Plain password', 'form.label_groups' => 'Groups', 'form.label_roles' => 'Roles', 'form.label_locked' => 'Locked', 'form.label_expired' => 'Expired', 'form.label_enabled' => 'Enabled', 'form.label_credentials_expired' => 'Credentials expired', 'form.label_created_at' => 'Created at', 'form.label_last_login' => 'Last login', 'form.label_name' => 'Name', 'filter.label_username' => 'Username', 'filter.label_name' => 'Name', 'filter.label_email' => 'E-Mail-Address', 'filter.label_locked' => 'Locked', 'filter.label_id' => 'ID', 'filter.label_groups' => 'Groups', 'filter.label_created_at' => 'Created at', 'filter.label_last_login' => 'Last login', 'filter.label_firstname' => 'Firstname', 'filter.label_lastname' => 'Lastname', 'list.label_username' => 'Username', 'list.label_name' => 'Name', 'list.label_email' => 'E-Mail-Address', 'list.label_groups' => 'Groups', 'list.label_locked' => 'Locked', 'list.label_enabled' => 'Enabled', 'list.label_created_at' => 'Created at', 'list.label_last_login' => 'Last login', 'list.label_impersonating' => 'Impersonate User', 'list.label_roles' => 'Roles', 'list.label_firstname' => 'Firstname', 'list.label_lastname' => 'Lastname', 'label_two_step_code' => 'Two-step verification', 'message_two_step_code_help' => 'Enter the verification code generated by your mobile application.', 'label_two_step_code_error' => 'The verification code is not valid', 'sonata_user' => 'Users', 'General' => 'General', 'Groups' => 'Groups', 'Management' => 'Management', 'field.label_roles_editable' => 'Roles', 'form.label_date_of_birth' => 'Date of birth', 'form.label_firstname' => 'Firstname', 'form.label_lastname' => 'Lastname', 'form.label_website' => 'Website', 'form.label_biography' => 'Biography', 'form.label_gender' => 'Gender', 'form.label_locale' => 'Locale', 'form.label_timezone' => 'Timezone', 'form.label_phone' => 'Phone', 'form.label_facebook_uid' => 'Facebook Uid', 'form.label_facebook_name' => 'Facebook Name', 'form.label_twitter_uid' => 'Twitter Uid', 'form.label_twitter_name' => 'Twitter Name', 'form.label_gplus_uid' => 'Google+ Uid', 'form.label_gplus_name' => 'Google+ Name', 'form.label_token' => 'Token', 'form.label_two_step_verification_code' => 'Two Step Verification Code', 'show.label_username' => 'Username', 'show.label_email' => 'Email', 'show.label_groups' => 'Groups', 'show.label_date_of_birth' => 'Date of birth', 'show.label_firstname' => 'Firstname', 'show.label_lastname' => 'Lastname', 'show.label_website' => 'Website', 'show.label_biography' => 'Biography', 'show.label_gender' => 'Gender', 'show.label_locale' => 'Locale', 'show.label_timezone' => 'Timezone', 'show.label_phone' => 'Phone', 'show.label_facebook_uid' => 'Facebook Uid', 'show.label_facebook_name' => 'Facebook Name', 'show.label_twitter_uid' => 'Twitter Uid', 'show.label_twitter_name' => 'Twitter Name', 'show.label_gplus_uid' => 'Google+ Uid', 'show.label_gplus_name' => 'Google+ Name', 'show.label_token' => 'Token', 'show.label_two_step_verification_code' => 'Two Step Verification Code', 'show.label_created_at' => 'Created at', 'show.label_last_login' => 'Last login', 'breadcrumb.link_user_show' => 'Show', 'gender_unknown' => 'unknown', 'gender_female' => 'female', 'gender_male' => 'male', 'sonata_profile_title' => 'Dashboard', 'link_show_profile' => 'Dashboard', 'link_edit_profile' => 'Profile', 'title_user_edit_authentication' => 'Authentication', 'link_edit_authentication' => 'Authentication', 'label_profile_gender' => 'Gender', 'label_profile_firstname' => 'Firstname', 'label_profile_lastname' => 'Lastname', 'label_profile_website' => 'Website', 'label_profile_dob' => 'Date of birth', 'label_profile_biography' => 'Biography', 'label_profile_locale' => 'Locale', 'label_profile_timezone' => 'Timezone', 'label_profile_phone' => 'Phone', 'profile.flash.updated' => 'Your profile has been updated.', 'sonata_change_password_link' => 'Change your password', 'link_register' => 'Register', 'link_login' => 'Log In', 'link_logout' => 'Log out', 'registration.flash.user_created' => 'Your account has been created successfully!', 'forgotten_password' => 'Forgotten password?', 'sonata_user_profile_breadcrumb_index' => 'Dashboard', 'sonata_user_profile_breadcrumb_edit' => 'Edit profile', 'sonata_user_already_authenticated' => 'You are already logged in', ), 'CmfCoreBundle' => array ( 'form.group_publish_workflow' => 'Publish Workflow', 'form.label_publishable' => 'Publishable', 'form.label_publish_start_date' => 'Publish from', 'form.label_publish_end_date' => 'Publish until', 'form.label_locale' => 'Locale', 'form.help_publish_start_date' => 'Only publish on or after this date, leave empty to immediately publish', 'form.help_publish_end_date' => 'Only publish before this date, leave empty to not end publishing', 'list.label_locales' => 'Locales', ), 'CmfMenuBundle' => array ( 'dashboard.cmf' => 'Symfony CMF', 'dashboard.label_menu' => 'Menus', 'dashboard.label_menu_node' => 'Menu node', 'breadcrumb.link_menu_list' => 'Menus', 'breadcrumb.link_menu_create' => 'Create', 'breadcrumb.link_menu_edit' => 'Edit', 'breadcrumb.link_menu_delete' => 'Delete', 'breadcrumb.link_menu_node_list' => 'Menu nodes', 'breadcrumb.link_menu_node_create' => 'Create', 'breadcrumb.link_menu_node_edit' => 'Edit', 'breadcrumb.link_menu_node_delete' => 'Delete', 'list.label_id' => 'Id', 'list.label_name' => 'Name', 'list.label_label' => 'Label', 'list.label_uri' => 'URI', 'list.label_route' => 'Route', 'form.group_general' => 'General', 'form.group_items' => 'Items', 'form.label_children' => 'Items', 'form.label_parent' => 'Parent', 'form.label_name' => 'Name', 'form.label_label' => 'Label', 'form.label_uri' => 'URI', 'form.label_route' => 'Route', 'form.label_parameters' => 'Route parameters', 'form.label_content' => 'Content', 'form.label_link_type' => 'Link type', 'form.label_weak' => 'Weak association', 'help.items_help' => 'Click on item to edit, right click to create new items.', 'form.group_menus' => 'Menu', 'form.label_menu_nodes' => 'Menu', 'form.group_menu_options' => 'Menu Options', 'form.label_display' => 'Display', 'form.help_display' => 'A menu entry is only displayed if the label is not empty.', 'form.label_display_children' => 'Display Children', 'form.help_display_children' => 'Children are only displayed if the menu entry itself is displayed.', 'form.label_attributes' => 'Menu attributes', 'form.label_label_attributes' => 'Label attributes', 'form.label_children_attributes' => 'Children attributes', 'form.label_link_attributes' => 'Link attributes', ), )); $catalogue->addFallbackCatalogue($catalogueEn); return $catalogue;
{'content_hash': '475c2c542d4c82be1a2035174880f346', 'timestamp': '', 'source': 'github', 'line_count': 621, 'max_line_length': 297, 'avg_line_length': 62.79549114331723, 'alnum_prop': 0.6460406195507231, 'repo_name': 'viral810/ngSimpleCMS', 'id': '6c22640d4f56935bff1454ce67c46a131b92c9a4', 'size': '39046', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/cache/dev/translations/catalogue.no.1cd7e874b24ab41081c7781e4161053bf515fc91.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3606'}, {'name': 'CSS', 'bytes': '380387'}, {'name': 'HTML', 'bytes': '15140977'}, {'name': 'JavaScript', 'bytes': '3143485'}, {'name': 'PHP', 'bytes': '69377'}, {'name': 'Ruby', 'bytes': '1784'}]}
<!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.5.0_08) on Wed Jan 10 16:02:59 PST 2007 --> <TITLE> Uses of Class org.apache.hadoop.io.MD5Hash (Hadoop 0.10.1 API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Class org.apache.hadoop.io.MD5Hash (Hadoop 0.10.1 API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/io//class-useMD5Hash.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MD5Hash.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.io.MD5Hash</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.io"><B>org.apache.hadoop.io</B></A></TD> <TD>Generic i/o code for use when reading and writing data to the network, to databases, and to files.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.io"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A> in <A HREF="../../../../../org/apache/hadoop/io/package-summary.html">org.apache.hadoop.io</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/io/package-summary.html">org.apache.hadoop.io</A> that return <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></CODE></FONT></TD> <TD><CODE><B>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#digest(byte[])">digest</A></B>(byte[]&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a hash value for a byte array.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></CODE></FONT></TD> <TD><CODE><B>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#digest(byte[], int, int)">digest</A></B>(byte[]&nbsp;data, int&nbsp;start, int&nbsp;len)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a hash value for a byte array.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></CODE></FONT></TD> <TD><CODE><B>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#digest(java.lang.String)">digest</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;string)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a hash value for a String.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></CODE></FONT></TD> <TD><CODE><B>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#digest(org.apache.hadoop.io.UTF8)">digest</A></B>(<A HREF="../../../../../org/apache/hadoop/io/UTF8.html" title="class in org.apache.hadoop.io">UTF8</A>&nbsp;utf8)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a hash value for a String.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A></CODE></FONT></TD> <TD><CODE><B>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#read(java.io.DataInput)">read</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/DataInput.html" title="class or interface in java.io">DataInput</A>&nbsp;in)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs, reads and returns an instance.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/io/package-summary.html">org.apache.hadoop.io</A> with parameters of type <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</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>MD5Hash.</B><B><A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html#set(org.apache.hadoop.io.MD5Hash)">set</A></B>(<A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io">MD5Hash</A>&nbsp;that)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copy the contents of another instance into this instance.</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/io/MD5Hash.html" title="class in org.apache.hadoop.io"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/io//class-useMD5Hash.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MD5Hash.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> Copyright &copy; 2006 The Apache Software Foundation </BODY> </HTML>
{'content_hash': 'ef51241d1902328af802f02df34873f0', 'timestamp': '', 'source': 'github', 'line_count': 227, 'max_line_length': 276, 'avg_line_length': 48.92511013215859, 'alnum_prop': 0.6290293535026112, 'repo_name': 'moreus/hadoop', 'id': '5a2c8e692fdfefbda32a88a122ddd0697e81263a', 'size': '11106', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hadoop-0.10.1/docs/api/org/apache/hadoop/io/class-use/MD5Hash.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AspectJ', 'bytes': '31146'}, {'name': 'C', 'bytes': '1067911'}, {'name': 'C++', 'bytes': '521803'}, {'name': 'CSS', 'bytes': '157107'}, {'name': 'Erlang', 'bytes': '232'}, {'name': 'Java', 'bytes': '43984644'}, {'name': 'JavaScript', 'bytes': '87848'}, {'name': 'Perl', 'bytes': '18992'}, {'name': 'Python', 'bytes': '32767'}, {'name': 'Shell', 'bytes': '1369281'}, {'name': 'TeX', 'bytes': '19322'}, {'name': 'XSLT', 'bytes': '185841'}]}
<?php get_header(); ?> <main class="o-area__main" role="main"> <div class="o-area__container"> <?php $pageType = get_post_field( 'post_name' ) ?> <?php // Featured Image ?> <?php include ( get_template_directory() . '/_components/featuredImage.php' ); ?> <h1><?php the_title(); ?></h1> <?php // Include Contentbuilder ?> <?php include ( get_template_directory() . '/_contentbuilder/contentBuilder.php' ); ?> <?php // Add Individual Pagesection with generic item ?> <?php switch ($pageType) { case 'home' : include ( get_template_directory() . '/_parts/pages--home.php' ); break; } ?> </div> </main> <?php get_footer(); ?>
{'content_hash': 'cf5651029cb7455b9342dd823071965d', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 88, 'avg_line_length': 24.85185185185185, 'alnum_prop': 0.5931445603576752, 'repo_name': 'kittn/generator-kittn', 'id': 'c789ad02663691057b74e2e38ba24a8ad5ba62fb', 'size': '671', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'generators/app/templates/src/skeletons/wordpress_contentbuilder/structure/templates/page.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '534158'}, {'name': 'HTML', 'bytes': '581422'}, {'name': 'JavaScript', 'bytes': '641411'}, {'name': 'PHP', 'bytes': '2456458'}, {'name': 'Shell', 'bytes': '39691'}, {'name': 'Vue', 'bytes': '163'}]}
static const char *defaultfile = "/var/run/apache_runtime_status"; static const char *scoreboard_key[] = { "noproc", "startingup", "waitingforconn", "readingrequest", "sendingreply", "keepaliveread", "logging", "dnslookup", "closingconnection", "gracefullyfinishing", "idleworkercleanup", }; static const char *busyidle_key[] = { "busy", "idle", }; int dump(const char *filename) { apr_status_t ret; apr_pool_t *pool; apr_shm_t *m; apr_size_t size, size_expect; void *ptr; global_score *global; process_score *parent; worker_score *servers; // Lots of APR SHM initialization. if ((ret = apr_initialize()) != APR_SUCCESS) { fprintf(stderr, "apr_initialize failed: %d\n", ret); return 3; } if ((ret = apr_pool_create(&pool, NULL)) != APR_SUCCESS) { fprintf(stderr, "apr_pool_create failed: %d\n", ret); return 4; } if ((ret = apr_shm_attach(&m, filename, pool)) != APR_SUCCESS) { fprintf(stderr, "apr_shm_attach failed: %d\n", ret); return 4; } if (!(ptr = apr_shm_baseaddr_get(m))) { fprintf(stderr, "apr_shm_baseaddr_get failed\n"); return 4; } // We'll use the global structure in doing further size checking, so // we check that independently first. if ((size = apr_shm_size_get(m)) < sizeof(*global)) { fprintf(stderr, "shm pointer too small (expected %lu, got %lu)\n", sizeof(*global), size); return 4; } global = ptr; ptr += sizeof(*global); // Expected size of the whole structure. size_expect = sizeof(*global ) + sizeof(*parent ) * global->server_limit + sizeof(*servers) * global->server_limit * global->thread_limit #ifdef SCOREBOARD_BALANCERS + sizeof(lb_score) * global->lb_limit #endif ; if (size != size_expect) { fprintf(stderr, "shm size incorrect\n"); return 4; } parent = ptr; ptr += sizeof(*parent) * global->server_limit; servers = ptr; // Counts for each of the status codes from scoreboard.h: 0-10. int statushist[SERVER_NUM_STATUS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Counts for busy/idle summary statistic. int busyidlehist[2] = {0, 0}; int i, j; for (i = 0; i < global->server_limit; ++i) { worker_score *sub_servers = servers + i * global->thread_limit; for (j = 0; j < global->thread_limit; ++j) { worker_score *server = sub_servers + j; unsigned char status = server->status; // Track status count. ++statushist[status]; // Track busy/idle summary statistic. // Dead servers are neither busy nor idle. if (status == SERVER_DEAD) continue; ++busyidlehist[status == SERVER_READY]; } } // Dump specific status statistics. for (i = 0; i < SERVER_NUM_STATUS; ++i) { printf("worker.%s %d\n", scoreboard_key[i], statushist[i]); } // Dump busy/idle summary statistics. for (i = 0; i < 2; ++i) { printf("worker.%s %d\n", busyidle_key[i], busyidlehist[i]); } return 0; } void usage(char **argv) { fprintf(stderr, "usage: %s [-h] [/path/to/sbfile]\n", argv[0]); fprintf(stderr, " dumps worker statistics from apache scoreboard\n"); fprintf(stderr, " sbfile path defaults to \"%s\"\n", defaultfile); exit(2); } int main(int argc, char **argv) { // Read score board file name from first command-line argument, if // available, otherwise, use default. const char *filename; if (argc == 1) { filename = defaultfile; } else if (argc == 2) { filename = argv[1]; size_t filename_len = strlen(filename); if (0 == strncmp(filename, "-h", filename_len < 2 ? filename_len : 2)) { usage(argv); } } else { usage(argv); } int ret; if ((ret = dump(filename)) != 3) { apr_terminate(); } return ret; }
{'content_hash': '9c0ba2ec2c6c5ae907eacd6fcbce13bf', 'timestamp': '', 'source': 'github', 'line_count': 145, 'max_line_length': 76, 'avg_line_length': 26.020689655172415, 'alnum_prop': 0.6095944871455076, 'repo_name': 'crunchyroll/apachestatsd', 'id': 'ddf582beee15eee762463a3baffebbed5914d857', 'size': '3952', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'asb/main.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '3952'}, {'name': 'Makefile', 'bytes': '148'}, {'name': 'Python', 'bytes': '4152'}]}
from setuptools import setup, find_packages setup( name='Some plugin', packages = find_packages(), entry_points = { 'nose.plugins.0.10': [ 'someplugin = someplugin:SomePlugin' ] })
{'content_hash': 'c2e97b4b8f0ad99ded13055c51592468', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 43, 'avg_line_length': 21.0, 'alnum_prop': 0.6238095238095238, 'repo_name': 'mozilla/sheriffs', 'id': 'e751d183c9e65e0bac628f7b8860329aea6b7420', 'size': '210', 'binary': False, 'copies': '10', 'ref': 'refs/heads/develop', 'path': 'vendor-local/src/python-nose/functional_tests/support/ep/setup.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'D', 'bytes': '2108471'}, {'name': 'JavaScript', 'bytes': '19192'}, {'name': 'Python', 'bytes': '1272000'}, {'name': 'Shell', 'bytes': '2880'}]}
from flask import Flask from flask import render_template from flask import request from flask.ext.bootstrap import Bootstrap app = Flask(__name__) bootstrap = Bootstrap(app) @app.route('/', methods=['GET', 'POST']) def index(): name = None if request.method == 'POST' and 'name' in request.form: name = request.form['name'] return render_template('index8.html', name=name) if __name__ == '__main__': app.run(debug=True)
{'content_hash': '4dacf11bf41b8b2d6ead581331fbf193', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 56, 'avg_line_length': 25.294117647058822, 'alnum_prop': 0.6953488372093023, 'repo_name': 'nirajkvinit/python3-study', 'id': '7a880ee280f0768712d24bd7a8c7ae1c01d02ca8', 'size': '430', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'intro-flask/hello2.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6304'}, {'name': 'HTML', 'bytes': '33043'}, {'name': 'JavaScript', 'bytes': '437'}, {'name': 'Python', 'bytes': '1093883'}, {'name': 'Shell', 'bytes': '3686'}]}
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <include layout="@layout/common_toolbar"/> <ListView android:id="@+id/dishonesty_listview" android:layout_width="match_parent" android:layout_height="match_parent"></ListView> </LinearLayout>
{'content_hash': 'b9b29225b170ff542e94f61b46f948a7', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 72, 'avg_line_length': 44.8, 'alnum_prop': 0.703125, 'repo_name': 'duwenjun199081/qihaosou', 'id': '0869c460e0da5096b801f1cd4dc59ab9dba640a5', 'size': '448', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/activity_dishonesty.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '635656'}]}
module ActiveRecord module ConnectionAdapters class PostgreSQLAdapter < AbstractAdapter # Returns the list of a table's or procedure's column names, data types, and default values. def column_definitions(name) # :nodoc: if procedure_exists?(name) procedure_column_definitions(name) else table_column_definitions(name) end end # Returns the list of a table's column names, data types, and default values. # # Query implementation notes: # - format_type includes the column size constraint, e.g. varchar(50) # - ::regclass is a function that gives the id for a table name def table_column_definitions(name) exec_query(<<-SQL, 'SCHEMA').rows SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '#{quote_table_name(name)}'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum SQL end # Returns the list of procedure's column names, data types, and default values. def procedure_column_definitions(name) exec_query(<<-SQL, 'SCHEMA').rows SELECT argname, format_type(argtype,typtypmod), typdefault, CASE row_number() over() WHEN 1 THEN true ELSE typnotnull END, argtype, typtypmod FROM ( SELECT unnest(proargnames) AS argname, unnest(proallargtypes) AS argtype, unnest(proargmodes) AS argmode FROM pg_proc WHERE proname = '#{name}' ) t JOIN pg_type ON t.argtype = pg_type.oid and t.argmode = 't' SQL end end end end
{'content_hash': 'd82a6f928973a864e73a8bf124f296e1', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 139, 'avg_line_length': 32.0, 'alnum_prop': 0.6816037735849056, 'repo_name': 'tom-kuca/activerecord_postgresql_procedures', 'id': 'fb685f78d47a00fa9764c7df80a49f2c32d6a51b', 'size': '1696', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/activerecord_postgresql_procedures/postgresql_adapter.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '14245'}]}
package com.commonsware.empublite; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.provider.CallLog; import com.commonsware.cwac.wakeful.WakefulIntentService; import java.util.Calendar; public class UpdateReceiver extends BroadcastReceiver { public UpdateReceiver() { } @Override public void onReceive(Context context, Intent intent) { if(intent.getAction() != null) { scheduleAlarm(context); } else { WakefulIntentService.sendWakefulWork(context, DownloadCheckService.class); } } static void scheduleAlarm(Context ctxt) { AlarmManager mgr = (AlarmManager)ctxt.getSystemService(Context.ALARM_SERVICE); Intent i = new Intent(ctxt, UpdateReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, i, 0); Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY, 21); cal.set(Calendar.MINUTE, 37); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); if(cal.getTimeInMillis() < System.currentTimeMillis()) { cal.add(Calendar.DAY_OF_YEAR, 1); } mgr.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pi); } }
{'content_hash': '8571047c5a2144e1798daf051362265b', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 98, 'avg_line_length': 26.346938775510203, 'alnum_prop': 0.7498063516653757, 'repo_name': 'Dustician/EmPubLite', 'id': 'ffe39b811ef35f4482472a2c8c14c8ba5960b1b6', 'size': '1291', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/com/commonsware/empublite/UpdateReceiver.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '624'}, {'name': 'Groovy', 'bytes': '1113'}, {'name': 'Java', 'bytes': '25655'}, {'name': 'Prolog', 'bytes': '653'}]}
"""Test the validation module""" from __future__ import division import sys import warnings import tempfile import os from time import sleep import numpy as np from scipy.sparse import coo_matrix, csr_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_warns from sklearn.utils.mocking import CheckingClassifier, MockDataFrame from sklearn.model_selection import cross_val_score from sklearn.model_selection import cross_val_predict from sklearn.model_selection import permutation_test_score from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import LeaveOneOut from sklearn.model_selection import LeaveOneGroupOut from sklearn.model_selection import LeavePGroupsOut from sklearn.model_selection import GroupKFold from sklearn.model_selection import GroupShuffleSplit from sklearn.model_selection import learning_curve from sklearn.model_selection import validation_curve from sklearn.model_selection._validation import _check_is_permutation from sklearn.datasets import make_regression from sklearn.datasets import load_boston from sklearn.datasets import load_iris from sklearn.metrics import explained_variance_score from sklearn.metrics import make_scorer from sklearn.metrics import precision_score from sklearn.linear_model import Ridge, LogisticRegression from sklearn.linear_model import PassiveAggressiveClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from sklearn.cluster import KMeans from sklearn.preprocessing import Imputer from sklearn.pipeline import Pipeline from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.base import BaseEstimator from sklearn.multiclass import OneVsRestClassifier from sklearn.utils import shuffle from sklearn.datasets import make_classification from sklearn.datasets import make_multilabel_classification from sklearn.model_selection.tests.test_split import MockClassifier try: WindowsError except NameError: WindowsError = None class MockImprovingEstimator(BaseEstimator): """Dummy classifier to test the learning curve""" def __init__(self, n_max_train_sizes): self.n_max_train_sizes = n_max_train_sizes self.train_sizes = 0 self.X_subset = None def fit(self, X_subset, y_subset=None): self.X_subset = X_subset self.train_sizes = X_subset.shape[0] return self def predict(self, X): raise NotImplementedError def score(self, X=None, Y=None): # training score becomes worse (2 -> 1), test error better (0 -> 1) if self._is_training_data(X): return 2. - float(self.train_sizes) / self.n_max_train_sizes else: return float(self.train_sizes) / self.n_max_train_sizes def _is_training_data(self, X): return X is self.X_subset class MockIncrementalImprovingEstimator(MockImprovingEstimator): """Dummy classifier that provides partial_fit""" def __init__(self, n_max_train_sizes): super(MockIncrementalImprovingEstimator, self).__init__(n_max_train_sizes) self.x = None def _is_training_data(self, X): return self.x in X def partial_fit(self, X, y=None, **params): self.train_sizes += X.shape[0] self.x = X[0] class MockEstimatorWithParameter(BaseEstimator): """Dummy classifier to test the validation curve""" def __init__(self, param=0.5): self.X_subset = None self.param = param def fit(self, X_subset, y_subset): self.X_subset = X_subset self.train_sizes = X_subset.shape[0] return self def predict(self, X): raise NotImplementedError def score(self, X=None, y=None): return self.param if self._is_training_data(X) else 1 - self.param def _is_training_data(self, X): return X is self.X_subset # XXX: use 2D array, since 1D X is being detected as a single sample in # check_consistent_length X = np.ones((10, 2)) X_sparse = coo_matrix(X) y = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4]) # The number of samples per class needs to be > n_splits, # for StratifiedKFold(n_splits=3) y2 = np.array([1, 1, 1, 2, 2, 2, 3, 3, 3, 3]) def test_cross_val_score(): clf = MockClassifier() for a in range(-10, 10): clf.a = a # Smoke test scores = cross_val_score(clf, X, y2) assert_array_equal(scores, clf.score(X, y2)) # test with multioutput y multioutput_y = np.column_stack([y2, y2[::-1]]) scores = cross_val_score(clf, X_sparse, multioutput_y) assert_array_equal(scores, clf.score(X_sparse, multioutput_y)) scores = cross_val_score(clf, X_sparse, y2) assert_array_equal(scores, clf.score(X_sparse, y2)) # test with multioutput y scores = cross_val_score(clf, X_sparse, multioutput_y) assert_array_equal(scores, clf.score(X_sparse, multioutput_y)) # test with X and y as list list_check = lambda x: isinstance(x, list) clf = CheckingClassifier(check_X=list_check) scores = cross_val_score(clf, X.tolist(), y2.tolist()) clf = CheckingClassifier(check_y=list_check) scores = cross_val_score(clf, X, y2.tolist()) assert_raises(ValueError, cross_val_score, clf, X, y2, scoring="sklearn") # test with 3d X and X_3d = X[:, :, np.newaxis] clf = MockClassifier(allow_nd=True) scores = cross_val_score(clf, X_3d, y2) clf = MockClassifier(allow_nd=False) assert_raises(ValueError, cross_val_score, clf, X_3d, y2) def test_cross_val_score_predict_groups(): # Check if ValueError (when groups is None) propagates to cross_val_score # and cross_val_predict # And also check if groups is correctly passed to the cv object X, y = make_classification(n_samples=20, n_classes=2, random_state=0) clf = SVC(kernel="linear") group_cvs = [LeaveOneGroupOut(), LeavePGroupsOut(2), GroupKFold(), GroupShuffleSplit()] for cv in group_cvs: assert_raise_message(ValueError, "The groups parameter should not be None", cross_val_score, estimator=clf, X=X, y=y, cv=cv) assert_raise_message(ValueError, "The groups parameter should not be None", cross_val_predict, estimator=clf, X=X, y=y, cv=cv) def test_cross_val_score_pandas(): # check cross_val_score doesn't destroy pandas dataframe types = [(MockDataFrame, MockDataFrame)] try: from pandas import Series, DataFrame types.append((Series, DataFrame)) except ImportError: pass for TargetType, InputFeatureType in types: # X dataframe, y series # 3 fold cross val is used so we need atleast 3 samples per class X_df, y_ser = InputFeatureType(X), TargetType(y2) check_df = lambda x: isinstance(x, InputFeatureType) check_series = lambda x: isinstance(x, TargetType) clf = CheckingClassifier(check_X=check_df, check_y=check_series) cross_val_score(clf, X_df, y_ser) def test_cross_val_score_mask(): # test that cross_val_score works with boolean masks svm = SVC(kernel="linear") iris = load_iris() X, y = iris.data, iris.target kfold = KFold(5) scores_indices = cross_val_score(svm, X, y, cv=kfold) kfold = KFold(5) cv_masks = [] for train, test in kfold.split(X, y): mask_train = np.zeros(len(y), dtype=np.bool) mask_test = np.zeros(len(y), dtype=np.bool) mask_train[train] = 1 mask_test[test] = 1 cv_masks.append((train, test)) scores_masks = cross_val_score(svm, X, y, cv=cv_masks) assert_array_equal(scores_indices, scores_masks) def test_cross_val_score_precomputed(): # test for svm with precomputed kernel svm = SVC(kernel="precomputed") iris = load_iris() X, y = iris.data, iris.target linear_kernel = np.dot(X, X.T) score_precomputed = cross_val_score(svm, linear_kernel, y) svm = SVC(kernel="linear") score_linear = cross_val_score(svm, X, y) assert_array_equal(score_precomputed, score_linear) # Error raised for non-square X svm = SVC(kernel="precomputed") assert_raises(ValueError, cross_val_score, svm, X, y) # test error is raised when the precomputed kernel is not array-like # or sparse assert_raises(ValueError, cross_val_score, svm, linear_kernel.tolist(), y) def test_cross_val_score_fit_params(): clf = MockClassifier() n_samples = X.shape[0] n_classes = len(np.unique(y)) W_sparse = coo_matrix((np.array([1]), (np.array([1]), np.array([0]))), shape=(10, 1)) P_sparse = coo_matrix(np.eye(5)) DUMMY_INT = 42 DUMMY_STR = '42' DUMMY_OBJ = object() def assert_fit_params(clf): # Function to test that the values are passed correctly to the # classifier arguments for non-array type assert_equal(clf.dummy_int, DUMMY_INT) assert_equal(clf.dummy_str, DUMMY_STR) assert_equal(clf.dummy_obj, DUMMY_OBJ) fit_params = {'sample_weight': np.ones(n_samples), 'class_prior': np.ones(n_classes) / n_classes, 'sparse_sample_weight': W_sparse, 'sparse_param': P_sparse, 'dummy_int': DUMMY_INT, 'dummy_str': DUMMY_STR, 'dummy_obj': DUMMY_OBJ, 'callback': assert_fit_params} cross_val_score(clf, X, y, fit_params=fit_params) def test_cross_val_score_score_func(): clf = MockClassifier() _score_func_args = [] def score_func(y_test, y_predict): _score_func_args.append((y_test, y_predict)) return 1.0 with warnings.catch_warnings(record=True): scoring = make_scorer(score_func) score = cross_val_score(clf, X, y, scoring=scoring) assert_array_equal(score, [1.0, 1.0, 1.0]) assert len(_score_func_args) == 3 def test_cross_val_score_errors(): class BrokenEstimator: pass assert_raises(TypeError, cross_val_score, BrokenEstimator(), X) def test_cross_val_score_with_score_func_classification(): iris = load_iris() clf = SVC(kernel='linear') # Default score (should be the accuracy score) scores = cross_val_score(clf, iris.data, iris.target, cv=5) assert_array_almost_equal(scores, [0.97, 1., 0.97, 0.97, 1.], 2) # Correct classification score (aka. zero / one score) - should be the # same as the default estimator score zo_scores = cross_val_score(clf, iris.data, iris.target, scoring="accuracy", cv=5) assert_array_almost_equal(zo_scores, [0.97, 1., 0.97, 0.97, 1.], 2) # F1 score (class are balanced so f1_score should be equal to zero/one # score f1_scores = cross_val_score(clf, iris.data, iris.target, scoring="f1_weighted", cv=5) assert_array_almost_equal(f1_scores, [0.97, 1., 0.97, 0.97, 1.], 2) def test_cross_val_score_with_score_func_regression(): X, y = make_regression(n_samples=30, n_features=20, n_informative=5, random_state=0) reg = Ridge() # Default score of the Ridge regression estimator scores = cross_val_score(reg, X, y, cv=5) assert_array_almost_equal(scores, [0.94, 0.97, 0.97, 0.99, 0.92], 2) # R2 score (aka. determination coefficient) - should be the # same as the default estimator score r2_scores = cross_val_score(reg, X, y, scoring="r2", cv=5) assert_array_almost_equal(r2_scores, [0.94, 0.97, 0.97, 0.99, 0.92], 2) # Mean squared error; this is a loss function, so "scores" are negative neg_mse_scores = cross_val_score(reg, X, y, cv=5, scoring="neg_mean_squared_error") expected_neg_mse = np.array([-763.07, -553.16, -274.38, -273.26, -1681.99]) assert_array_almost_equal(neg_mse_scores, expected_neg_mse, 2) # Explained variance scoring = make_scorer(explained_variance_score) ev_scores = cross_val_score(reg, X, y, cv=5, scoring=scoring) assert_array_almost_equal(ev_scores, [0.94, 0.97, 0.97, 0.99, 0.92], 2) def test_permutation_score(): iris = load_iris() X = iris.data X_sparse = coo_matrix(X) y = iris.target svm = SVC(kernel='linear') cv = StratifiedKFold(2) score, scores, pvalue = permutation_test_score( svm, X, y, n_permutations=30, cv=cv, scoring="accuracy") assert_greater(score, 0.9) assert_almost_equal(pvalue, 0.0, 1) score_group, _, pvalue_group = permutation_test_score( svm, X, y, n_permutations=30, cv=cv, scoring="accuracy", groups=np.ones(y.size), random_state=0) assert_true(score_group == score) assert_true(pvalue_group == pvalue) # check that we obtain the same results with a sparse representation svm_sparse = SVC(kernel='linear') cv_sparse = StratifiedKFold(2) score_group, _, pvalue_group = permutation_test_score( svm_sparse, X_sparse, y, n_permutations=30, cv=cv_sparse, scoring="accuracy", groups=np.ones(y.size), random_state=0) assert_true(score_group == score) assert_true(pvalue_group == pvalue) # test with custom scoring object def custom_score(y_true, y_pred): return (((y_true == y_pred).sum() - (y_true != y_pred).sum()) / y_true.shape[0]) scorer = make_scorer(custom_score) score, _, pvalue = permutation_test_score( svm, X, y, n_permutations=100, scoring=scorer, cv=cv, random_state=0) assert_almost_equal(score, .93, 2) assert_almost_equal(pvalue, 0.01, 3) # set random y y = np.mod(np.arange(len(y)), 3) score, scores, pvalue = permutation_test_score( svm, X, y, n_permutations=30, cv=cv, scoring="accuracy") assert_less(score, 0.5) assert_greater(pvalue, 0.2) def test_permutation_test_score_allow_nans(): # Check that permutation_test_score allows input data with NaNs X = np.arange(200, dtype=np.float64).reshape(10, -1) X[2, :] = np.nan y = np.repeat([0, 1], X.shape[0] / 2) p = Pipeline([ ('imputer', Imputer(strategy='mean', missing_values='NaN')), ('classifier', MockClassifier()), ]) permutation_test_score(p, X, y, cv=5) def test_cross_val_score_allow_nans(): # Check that cross_val_score allows input data with NaNs X = np.arange(200, dtype=np.float64).reshape(10, -1) X[2, :] = np.nan y = np.repeat([0, 1], X.shape[0] / 2) p = Pipeline([ ('imputer', Imputer(strategy='mean', missing_values='NaN')), ('classifier', MockClassifier()), ]) cross_val_score(p, X, y, cv=5) def test_cross_val_score_multilabel(): X = np.array([[-3, 4], [2, 4], [3, 3], [0, 2], [-3, 1], [-2, 1], [0, 0], [-2, -1], [-1, -2], [1, -2]]) y = np.array([[1, 1], [0, 1], [0, 1], [0, 1], [1, 1], [0, 1], [1, 0], [1, 1], [1, 0], [0, 0]]) clf = KNeighborsClassifier(n_neighbors=1) scoring_micro = make_scorer(precision_score, average='micro') scoring_macro = make_scorer(precision_score, average='macro') scoring_samples = make_scorer(precision_score, average='samples') score_micro = cross_val_score(clf, X, y, scoring=scoring_micro, cv=5) score_macro = cross_val_score(clf, X, y, scoring=scoring_macro, cv=5) score_samples = cross_val_score(clf, X, y, scoring=scoring_samples, cv=5) assert_almost_equal(score_micro, [1, 1 / 2, 3 / 4, 1 / 2, 1 / 3]) assert_almost_equal(score_macro, [1, 1 / 2, 3 / 4, 1 / 2, 1 / 4]) assert_almost_equal(score_samples, [1, 1 / 2, 3 / 4, 1 / 2, 1 / 4]) def test_cross_val_predict(): boston = load_boston() X, y = boston.data, boston.target cv = KFold() est = Ridge() # Naive loop (should be same as cross_val_predict): preds2 = np.zeros_like(y) for train, test in cv.split(X, y): est.fit(X[train], y[train]) preds2[test] = est.predict(X[test]) preds = cross_val_predict(est, X, y, cv=cv) assert_array_almost_equal(preds, preds2) preds = cross_val_predict(est, X, y) assert_equal(len(preds), len(y)) cv = LeaveOneOut() preds = cross_val_predict(est, X, y, cv=cv) assert_equal(len(preds), len(y)) Xsp = X.copy() Xsp *= (Xsp > np.median(Xsp)) Xsp = coo_matrix(Xsp) preds = cross_val_predict(est, Xsp, y) assert_array_almost_equal(len(preds), len(y)) preds = cross_val_predict(KMeans(), X) assert_equal(len(preds), len(y)) class BadCV(): def split(self, X, y=None, groups=None): for i in range(4): yield np.array([0, 1, 2, 3]), np.array([4, 5, 6, 7, 8]) assert_raises(ValueError, cross_val_predict, est, X, y, cv=BadCV()) def test_cross_val_predict_input_types(): iris = load_iris() X, y = iris.data, iris.target X_sparse = coo_matrix(X) multioutput_y = np.column_stack([y, y[::-1]]) clf = Ridge(fit_intercept=False, random_state=0) # 3 fold cv is used --> atleast 3 samples per class # Smoke test predictions = cross_val_predict(clf, X, y) assert_equal(predictions.shape, (150,)) # test with multioutput y predictions = cross_val_predict(clf, X_sparse, multioutput_y) assert_equal(predictions.shape, (150, 2)) predictions = cross_val_predict(clf, X_sparse, y) assert_array_equal(predictions.shape, (150,)) # test with multioutput y predictions = cross_val_predict(clf, X_sparse, multioutput_y) assert_array_equal(predictions.shape, (150, 2)) # test with X and y as list list_check = lambda x: isinstance(x, list) clf = CheckingClassifier(check_X=list_check) predictions = cross_val_predict(clf, X.tolist(), y.tolist()) clf = CheckingClassifier(check_y=list_check) predictions = cross_val_predict(clf, X, y.tolist()) # test with 3d X and X_3d = X[:, :, np.newaxis] check_3d = lambda x: x.ndim == 3 clf = CheckingClassifier(check_X=check_3d) predictions = cross_val_predict(clf, X_3d, y) assert_array_equal(predictions.shape, (150,)) def test_cross_val_predict_pandas(): # check cross_val_score doesn't destroy pandas dataframe types = [(MockDataFrame, MockDataFrame)] try: from pandas import Series, DataFrame types.append((Series, DataFrame)) except ImportError: pass for TargetType, InputFeatureType in types: # X dataframe, y series X_df, y_ser = InputFeatureType(X), TargetType(y2) check_df = lambda x: isinstance(x, InputFeatureType) check_series = lambda x: isinstance(x, TargetType) clf = CheckingClassifier(check_X=check_df, check_y=check_series) cross_val_predict(clf, X_df, y_ser) def test_cross_val_score_sparse_fit_params(): iris = load_iris() X, y = iris.data, iris.target clf = MockClassifier() fit_params = {'sparse_sample_weight': coo_matrix(np.eye(X.shape[0]))} a = cross_val_score(clf, X, y, fit_params=fit_params) assert_array_equal(a, np.ones(3)) def test_learning_curve(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(20) with warnings.catch_warnings(record=True) as w: train_sizes, train_scores, test_scores = learning_curve( estimator, X, y, cv=3, train_sizes=np.linspace(0.1, 1.0, 10)) if len(w) > 0: raise RuntimeError("Unexpected warning: %r" % w[0].message) assert_equal(train_scores.shape, (10, 3)) assert_equal(test_scores.shape, (10, 3)) assert_array_equal(train_sizes, np.linspace(2, 20, 10)) assert_array_almost_equal(train_scores.mean(axis=1), np.linspace(1.9, 1.0, 10)) assert_array_almost_equal(test_scores.mean(axis=1), np.linspace(0.1, 1.0, 10)) def test_learning_curve_unsupervised(): X, _ = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(20) train_sizes, train_scores, test_scores = learning_curve( estimator, X, y=None, cv=3, train_sizes=np.linspace(0.1, 1.0, 10)) assert_array_equal(train_sizes, np.linspace(2, 20, 10)) assert_array_almost_equal(train_scores.mean(axis=1), np.linspace(1.9, 1.0, 10)) assert_array_almost_equal(test_scores.mean(axis=1), np.linspace(0.1, 1.0, 10)) def test_learning_curve_verbose(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(20) old_stdout = sys.stdout sys.stdout = StringIO() try: train_sizes, train_scores, test_scores = \ learning_curve(estimator, X, y, cv=3, verbose=1) finally: out = sys.stdout.getvalue() sys.stdout.close() sys.stdout = old_stdout assert("[learning_curve]" in out) def test_learning_curve_incremental_learning_not_possible(): X, y = make_classification(n_samples=2, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) # The mockup does not have partial_fit() estimator = MockImprovingEstimator(1) assert_raises(ValueError, learning_curve, estimator, X, y, exploit_incremental_learning=True) def test_learning_curve_incremental_learning(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockIncrementalImprovingEstimator(20) train_sizes, train_scores, test_scores = learning_curve( estimator, X, y, cv=3, exploit_incremental_learning=True, train_sizes=np.linspace(0.1, 1.0, 10)) assert_array_equal(train_sizes, np.linspace(2, 20, 10)) assert_array_almost_equal(train_scores.mean(axis=1), np.linspace(1.9, 1.0, 10)) assert_array_almost_equal(test_scores.mean(axis=1), np.linspace(0.1, 1.0, 10)) def test_learning_curve_incremental_learning_unsupervised(): X, _ = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockIncrementalImprovingEstimator(20) train_sizes, train_scores, test_scores = learning_curve( estimator, X, y=None, cv=3, exploit_incremental_learning=True, train_sizes=np.linspace(0.1, 1.0, 10)) assert_array_equal(train_sizes, np.linspace(2, 20, 10)) assert_array_almost_equal(train_scores.mean(axis=1), np.linspace(1.9, 1.0, 10)) assert_array_almost_equal(test_scores.mean(axis=1), np.linspace(0.1, 1.0, 10)) def test_learning_curve_batch_and_incremental_learning_are_equal(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) train_sizes = np.linspace(0.2, 1.0, 5) estimator = PassiveAggressiveClassifier(n_iter=1, shuffle=False) train_sizes_inc, train_scores_inc, test_scores_inc = \ learning_curve( estimator, X, y, train_sizes=train_sizes, cv=3, exploit_incremental_learning=True) train_sizes_batch, train_scores_batch, test_scores_batch = \ learning_curve( estimator, X, y, cv=3, train_sizes=train_sizes, exploit_incremental_learning=False) assert_array_equal(train_sizes_inc, train_sizes_batch) assert_array_almost_equal(train_scores_inc.mean(axis=1), train_scores_batch.mean(axis=1)) assert_array_almost_equal(test_scores_inc.mean(axis=1), test_scores_batch.mean(axis=1)) def test_learning_curve_n_sample_range_out_of_bounds(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(20) assert_raises(ValueError, learning_curve, estimator, X, y, cv=3, train_sizes=[0, 1]) assert_raises(ValueError, learning_curve, estimator, X, y, cv=3, train_sizes=[0.0, 1.0]) assert_raises(ValueError, learning_curve, estimator, X, y, cv=3, train_sizes=[0.1, 1.1]) assert_raises(ValueError, learning_curve, estimator, X, y, cv=3, train_sizes=[0, 20]) assert_raises(ValueError, learning_curve, estimator, X, y, cv=3, train_sizes=[1, 21]) def test_learning_curve_remove_duplicate_sample_sizes(): X, y = make_classification(n_samples=3, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(2) train_sizes, _, _ = assert_warns( RuntimeWarning, learning_curve, estimator, X, y, cv=3, train_sizes=np.linspace(0.33, 1.0, 3)) assert_array_equal(train_sizes, [1, 2]) def test_learning_curve_with_boolean_indices(): X, y = make_classification(n_samples=30, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) estimator = MockImprovingEstimator(20) cv = KFold(n_splits=3) train_sizes, train_scores, test_scores = learning_curve( estimator, X, y, cv=cv, train_sizes=np.linspace(0.1, 1.0, 10)) assert_array_equal(train_sizes, np.linspace(2, 20, 10)) assert_array_almost_equal(train_scores.mean(axis=1), np.linspace(1.9, 1.0, 10)) assert_array_almost_equal(test_scores.mean(axis=1), np.linspace(0.1, 1.0, 10)) def test_validation_curve(): X, y = make_classification(n_samples=2, n_features=1, n_informative=1, n_redundant=0, n_classes=2, n_clusters_per_class=1, random_state=0) param_range = np.linspace(0, 1, 10) with warnings.catch_warnings(record=True) as w: train_scores, test_scores = validation_curve( MockEstimatorWithParameter(), X, y, param_name="param", param_range=param_range, cv=2 ) if len(w) > 0: raise RuntimeError("Unexpected warning: %r" % w[0].message) assert_array_almost_equal(train_scores.mean(axis=1), param_range) assert_array_almost_equal(test_scores.mean(axis=1), 1 - param_range) def test_check_is_permutation(): rng = np.random.RandomState(0) p = np.arange(100) rng.shuffle(p) assert_true(_check_is_permutation(p, 100)) assert_false(_check_is_permutation(np.delete(p, 23), 100)) p[0] = 23 assert_false(_check_is_permutation(p, 100)) # Check if the additional duplicate indices are caught assert_false(_check_is_permutation(np.hstack((p, 0)), 100)) def test_cross_val_predict_sparse_prediction(): # check that cross_val_predict gives same result for sparse and dense input X, y = make_multilabel_classification(n_classes=2, n_labels=1, allow_unlabeled=False, return_indicator=True, random_state=1) X_sparse = csr_matrix(X) y_sparse = csr_matrix(y) classif = OneVsRestClassifier(SVC(kernel='linear')) preds = cross_val_predict(classif, X, y, cv=10) preds_sparse = cross_val_predict(classif, X_sparse, y_sparse, cv=10) preds_sparse = preds_sparse.toarray() assert_array_almost_equal(preds_sparse, preds) def test_cross_val_predict_with_method(): iris = load_iris() X, y = iris.data, iris.target X, y = shuffle(X, y, random_state=0) classes = len(set(y)) kfold = KFold(len(iris.target)) methods = ['decision_function', 'predict_proba', 'predict_log_proba'] for method in methods: est = LogisticRegression() predictions = cross_val_predict(est, X, y, method=method) assert_equal(len(predictions), len(y)) expected_predictions = np.zeros([len(y), classes]) func = getattr(est, method) # Naive loop (should be same as cross_val_predict): for train, test in kfold.split(X, y): est.fit(X[train], y[train]) expected_predictions[test] = func(X[test]) predictions = cross_val_predict(est, X, y, method=method, cv=kfold) assert_array_almost_equal(expected_predictions, predictions) def test_score_memmap(): # Ensure a scalar score of memmap type is accepted iris = load_iris() X, y = iris.data, iris.target clf = MockClassifier() tf = tempfile.NamedTemporaryFile(mode='wb', delete=False) tf.write(b'Hello world!!!!!') tf.close() scores = np.memmap(tf.name, dtype=np.float64) score = np.memmap(tf.name, shape=(), mode='r', dtype=np.float64) try: cross_val_score(clf, X, y, scoring=lambda est, X, y: score) # non-scalar should still fail assert_raises(ValueError, cross_val_score, clf, X, y, scoring=lambda est, X, y: scores) finally: # Best effort to release the mmap file handles before deleting the # backing file under Windows scores, score = None, None for _ in range(3): try: os.unlink(tf.name) break except WindowsError: sleep(1.)
{'content_hash': '134469c980ed042185b55c800aba7093', 'timestamp': '', 'source': 'github', 'line_count': 814, 'max_line_length': 79, 'avg_line_length': 37.93120393120393, 'alnum_prop': 0.6261497603316492, 'repo_name': 'zihua/scikit-learn', 'id': '4f45a079fbd7f82dc0317eab57165143d107e7d9', 'size': '30876', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'sklearn/model_selection/tests/test_validation.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '3366'}, {'name': 'C', 'bytes': '394788'}, {'name': 'C++', 'bytes': '140225'}, {'name': 'Makefile', 'bytes': '1588'}, {'name': 'PowerShell', 'bytes': '17312'}, {'name': 'Python', 'bytes': '6272481'}, {'name': 'Shell', 'bytes': '6747'}]}
package events; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ChangeListener; import javafx.scene.input.MouseEvent; import java.util.LinkedList; import java.util.Queue; /** * @author Roxanne Baker */ @Deprecated public class MouseSystem { private final Queue<MouseEvent> firstQueue = new LinkedList<>(); private final Queue<MouseEvent> secondQueue = new LinkedList<>(); private final SimpleObjectProperty<MouseEvent> currentChar = new SimpleObjectProperty<>(); private Queue<MouseEvent> fillQ = firstQueue; private Queue<MouseEvent> processQ = secondQueue; public void takeInput (MouseEvent k) { fillQ.add(k); } public void processInputs () { toggleQueues(); while (!processQ.isEmpty()) { MouseEvent k = processQ.poll(); if (k != null) { currentChar.set(k); } } } @SuppressWarnings("unchecked") public void listenToMousePress (ChangeListener listener) { currentChar.addListener(listener); } @SuppressWarnings("unchecked") public void unListenToMousePress (ChangeListener listener) { currentChar.removeListener(listener); } private void toggleQueues () { if (fillQ == firstQueue) { fillQ = secondQueue; processQ = firstQueue; } else { fillQ = firstQueue; processQ = secondQueue; } } public MouseEvent getCurrentCharKeyEvent () { return currentChar.get(); } }
{'content_hash': '6697747f3ce5fc5de2a5f768e8eeb5d1', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 94, 'avg_line_length': 25.95, 'alnum_prop': 0.6409762363519589, 'repo_name': 'roxanne-baker/game-authoring-environment', 'id': '0b6e13e9d0a39c5f8e253d2112ce0e1ccad99879', 'size': '1557', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/events/MouseSystem.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '113825'}, {'name': 'Groovy', 'bytes': '52337'}, {'name': 'HTML', 'bytes': '3967156'}, {'name': 'Java', 'bytes': '473918'}, {'name': 'JavaScript', 'bytes': '827'}]}
#ifndef _GASNET_CORE_INTERNAL_H #define _GASNET_CORE_INTERNAL_H #include <gasnet_internal.h> #include <gasnet_bootstrap_internal.h> #endif
{'content_hash': '5b59e1e7fadc119cd7785f50fe383aa4', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 38, 'avg_line_length': 15.88888888888889, 'alnum_prop': 0.7552447552447552, 'repo_name': 'jbreitbart/sa-pgas', 'id': '891bc57e7d6c97fc0efaa3e5878c9b8db92c6f3b', 'size': '405', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'vendor/source/GASNet-1.16.2/other/testspawn/gasnet_core_internal.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '8888'}, {'name': 'C++', 'bytes': '188565'}]}
var fs = require('fs') module.exports = constructor module.exports.stdout = constructor(process.stdout) module.exports.stderr = constructor(process.stderr) function log(output, strings, ...values){ for (var i = 0; i < strings.length || i < values.length; i++) { var str = strings[i] var value = values[i] if (typeof str !== 'undefined') { str = str .replace(/\n[\t ]+/g, '\n') .replace(/^\n/, '') .replace(/\n$/, '') output.write(str) } if (typeof value !== 'undefined') { output.write(value) } } output.write('\n') } function constructor(output){ var obj = log.bind(null, output) obj.raw = function(data){ output.write(data) } return obj } function fromFile(path, enc){ return constructor(fs.createWriteStream(path, enc)) }
{'content_hash': '4da88533bdd1dec43c09d2b505be5a2e', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 65, 'avg_line_length': 20.475, 'alnum_prop': 0.6007326007326007, 'repo_name': 'devTristan/dockerscript', 'id': 'e4f2ce50765a71c43abe181597e4ada32bd29a25', 'size': '819', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/log.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '11457'}]}
@NonNullApi package org.gradle.internal.execution.caching; import org.gradle.api.NonNullApi;
{'content_hash': '114c7b6ad70f9aed85db8f862b9e12aa', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 46, 'avg_line_length': 19.0, 'alnum_prop': 0.8210526315789474, 'repo_name': 'blindpirate/gradle', 'id': '4c6990417d8a6b8c26292845a230a67a2ac7ebce', 'size': '710', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'subprojects/execution/src/main/java/org/gradle/internal/execution/caching/package-info.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '277'}, {'name': 'Brainfuck', 'bytes': '54'}, {'name': 'C', 'bytes': '123600'}, {'name': 'C++', 'bytes': '1781062'}, {'name': 'CSS', 'bytes': '173356'}, {'name': 'GAP', 'bytes': '424'}, {'name': 'Gherkin', 'bytes': '191'}, {'name': 'Groovy', 'bytes': '30003442'}, {'name': 'HTML', 'bytes': '59961'}, {'name': 'Java', 'bytes': '28084200'}, {'name': 'JavaScript', 'bytes': '78583'}, {'name': 'Kotlin', 'bytes': '4000485'}, {'name': 'Objective-C', 'bytes': '652'}, {'name': 'Objective-C++', 'bytes': '441'}, {'name': 'Python', 'bytes': '57'}, {'name': 'Ruby', 'bytes': '16'}, {'name': 'Scala', 'bytes': '10840'}, {'name': 'Shell', 'bytes': '12897'}, {'name': 'Swift', 'bytes': '2040'}, {'name': 'XSLT', 'bytes': '42693'}, {'name': 'jq', 'bytes': '171'}]}
package org.neo4j.ogm.domain.generic_hierarchy.relationship; public class TargetEntityWithEntityInterface implements EntityInterface { private Long id; }
{'content_hash': '412d18e524fd588ff4a87219944582a3', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 73, 'avg_line_length': 23.0, 'alnum_prop': 0.8198757763975155, 'repo_name': 'neo4j/neo4j-ogm', 'id': '7e619612ca03e66974eab4c515598d3a0f37c875', 'size': '833', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'neo4j-ogm-tests/neo4j-ogm-integration-tests/src/test/java/org/neo4j/ogm/domain/generic_hierarchy/relationship/TargetEntityWithEntityInterface.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '59863'}, {'name': 'Java', 'bytes': '3445039'}, {'name': 'JavaScript', 'bytes': '30397'}, {'name': 'Kotlin', 'bytes': '33151'}, {'name': 'Shell', 'bytes': '450'}, {'name': 'Slim', 'bytes': '672'}, {'name': 'sed', 'bytes': '550'}]}
package com.kawansoft.app.util; import com.kawansoft.aceql.gui.util.AceQLManagerUtil; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PushbackInputStream; /** * This class is to support reading CRLF terminated lines that contain only * US-ASCII characters from an input stream. Provides functionality that is * similar to the deprecated <code>DataInputStream.readLine()</code>. Expected * use is to read lines as String objects from a RFC822 stream. * * It is implemented as a FilterInputStream, so one can just wrap this class * around any input stream and read bytes from this filter. * * @author John Mani */ public class LineInputStream extends FilterInputStream { private char[] lineBuffer = null; // reusable byte buffer public LineInputStream(InputStream in) { super(in); //super(wrapStream(in)); } // /** // * Insures that the InputStream in use is a BufferedInputStream. // * This will optimize calls to the sub-layer InputStream read() method and // * prevent errors related to the PushBack mechanism (see readLine()).<br> // * If the given InputStream is a BufferedInputStream, it is only casted and // * returned unwrapped. // * @param isIn the InputStream to wrap // * @return an instance of BufferedInputStream wrapping the given InputStream // */ // // private static BufferedInputStream wrapStream(InputStream isIn) // { // if(isIn instanceof BufferedInputStream) // return (BufferedInputStream) isIn ; // else // return new BufferedInputStream(isIn) ; // } /** * Read a line containing only ASCII characters from the input stream. A * line is terminated by a CR or NL or CR-NL sequence. The line terminator * is not returned as part of the returned String. Returns null if no data * is available. * <p> * * This class is similar to the deprecated * <code>DataInputStream.readLine()</code> */ public String readLine() throws IOException { InputStream in = this.in; char[] buf = lineBuffer; if (buf == null) { buf = lineBuffer = new char[128]; } int c1; int room = buf.length; int offset = 0; while ((c1 = in.read()) != -1) { if (c1 == '\n') // Got NL, outa here. { break; } else if (c1 == '\r') { // Got CR, is the next char NL ? int c2 = in.read(); if (c2 != '\n') { // If not NL, push it back if (!(in instanceof PushbackInputStream)) { in = this.in = new PushbackInputStream(in); } ((PushbackInputStream) in).unread(c2); } break; // outa here. } // Not CR, NL or CR-NL ... // .. Insert the byte into our byte buffer if (--room < 0) { // No room, need to grow. buf = new char[offset + 128]; room = buf.length - offset - 1; System.arraycopy(lineBuffer, 0, buf, 0, offset); lineBuffer = buf; } buf[offset++] = (char) c1; } if ((c1 == -1) && (offset == 0)) { return null; } return String.copyValueOf(buf, 0, offset); } //Rule 8: Make your classes noncloneable public final Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException(); } //Rule 9: Make your classes nonserializeable private final void writeObject(ObjectOutputStream out) throws IOException { AceQLManagerUtil.debugEvent(out); throw new IOException("Object cannot be serialized"); } //Rule 10: Make your classes nondeserializeable private final void readObject(ObjectInputStream in) throws IOException { AceQLManagerUtil.debugEvent(in); throw new IOException("Class cannot be deserialized"); } }
{'content_hash': 'a0de6094bcf88d73346c4c6aa0140d4e', 'timestamp': '', 'source': 'github', 'line_count': 126, 'max_line_length': 79, 'avg_line_length': 33.07936507936508, 'alnum_prop': 0.6019673704414588, 'repo_name': 'kawansoft/aceql-http-gui', 'id': '43262a930c12719d23e1a8a829229f3fbd2fbaad', 'size': '5624', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/kawansoft/app/util/LineInputStream.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3260'}, {'name': 'HTML', 'bytes': '20745'}, {'name': 'Java', 'bytes': '774456'}]}
.panel { overflow: hidden; text-align: left; margin: 0; border: 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .panel-header, .panel-body { border-width: 1px; border-style: solid; } .panel-header { padding: 5px; position: relative; } .panel-title { background: url('images/blank.gif') no-repeat; } .panel-header-noborder { border-width: 0 0 1px 0; } .panel-body { overflow: auto; border-top-width: 0; padding: 0; } .panel-body-noheader { border-top-width: 1px; } .panel-body-noborder { border-width: 0px; } .panel-body-nobottom { border-bottom-width: 0; } .panel-with-icon { padding-left: 18px; } .panel-icon, .panel-tool { position: absolute; top: 50%; margin-top: -8px; height: 16px; overflow: hidden; } .panel-icon { left: 5px; width: 16px; } .panel-tool { right: 5px; width: auto; } .panel-tool a { display: inline-block; width: 16px; height: 16px; opacity: 0.6; filter: alpha(opacity=60); margin: 0 0 0 2px; vertical-align: top; } .panel-tool a:hover { opacity: 1; filter: alpha(opacity=100); background-color: #eaf2ff; -moz-border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; } .panel-loading { padding: 11px 0px 10px 30px; } .panel-noscroll { overflow: hidden; } .panel-fit, .panel-fit body { height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .panel-loading { background: url('images/loading.gif') no-repeat 10px 10px; } .panel-tool-close { background: url('images/panel_tools.png') no-repeat -16px 0px; } .panel-tool-min { background: url('images/panel_tools.png') no-repeat 0px 0px; } .panel-tool-max { background: url('images/panel_tools.png') no-repeat 0px -16px; } .panel-tool-restore { background: url('images/panel_tools.png') no-repeat -16px -16px; } .panel-tool-collapse { background: url('images/panel_tools.png') no-repeat -32px 0; } .panel-tool-expand { background: url('images/panel_tools.png') no-repeat -32px -16px; } .panel-header, .panel-body { border-color: #95b8e7; } .panel-header { background-color: #e0ecff; background: -webkit-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: -moz-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: -o-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: linear-gradient(to bottom, #eff5ff 0, #e0ecff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eff5ff, endColorstr=#e0ecff, GradientType=0); } .panel-body { background-color: #fff; color: #000; font-size: 12px; } .panel-title { font-size: 12px; font-weight: bold; color: #0e2d5f; height: 16px; line-height: 16px; } .panel-footer { border: 1px solid #95b8e7; overflow: hidden; background: #f4f4f4; } .panel-footer-noborder { border-width: 1px 0 0 0; } .accordion { overflow: hidden; border-width: 1px; border-style: solid; } .accordion .accordion-header { border-width: 0 0 1px; cursor: pointer; } .accordion .accordion-body { border-width: 0 0 1px; } .accordion-noborder { border-width: 0; } .accordion-noborder .accordion-header { border-width: 0 0 1px; } .accordion-noborder .accordion-body { border-width: 0 0 1px; } .accordion-collapse { background: url('images/accordion_arrows.png') no-repeat 0 0; } .accordion-expand { background: url('images/accordion_arrows.png') no-repeat -16px 0; } .accordion { background: #fff; border-color: #95b8e7; } .accordion .accordion-header { background: #e0ecff; filter: none; } .accordion .accordion-header-selected { background: #ffe48d; } .accordion .accordion-header-selected .panel-title { color: #000; } .window { overflow: hidden; padding: 5px; border-width: 1px; border-style: solid; } .window .window-header { background: transparent; padding: 0px 0px 6px 0px; } .window .window-body { border-width: 1px; border-style: solid; border-top-width: 0px; } .window .window-body-noheader { border-top-width: 1px; } .window .panel-body-nobottom { border-bottom-width: 0; } .window .window-header .panel-icon, .window .window-header .panel-tool { top: 50%; margin-top: -11px; } .window .window-header .panel-icon { left: 1px; } .window .window-header .panel-tool { right: 1px; } .window .window-header .panel-with-icon { padding-left: 18px; } .window-proxy { position: absolute; overflow: hidden; } .window-proxy-mask { position: absolute; filter: alpha(opacity=5); opacity: 0.05; } .window-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: alpha(opacity=40); opacity: 0.40; font-size: 1px; overflow: hidden; } .window, .window-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .window-shadow { background: #ccc; -moz-box-shadow: 2px 2px 3px #ccc; -webkit-box-shadow: 2px 2px 3px #ccc; box-shadow: 2px 2px 3px #ccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2, MakeShadow=false, ShadowOpacity=0.2); } .window, .window .window-body { border-color: #95b8e7; } .window { background-color: #e0ecff; background: -webkit-linear-gradient(top, #eff5ff 0, #e0ecff 20%); background: -moz-linear-gradient(top, #eff5ff 0, #e0ecff 20%); background: -o-linear-gradient(top, #eff5ff 0, #e0ecff 20%); background: linear-gradient(to bottom, #eff5ff 0, #e0ecff 20%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eff5ff, endColorstr=#e0ecff, GradientType=0); } .window-proxy { border: 1px dashed #95b8e7; } .window-proxy-mask, .window-mask { background: #ccc; } .window .panel-footer { border: 1px solid #95b8e7; position: relative; top: -1px; } .window-thinborder { padding: 0; } .window-thinborder .window-header { padding: 5px 5px 6px 5px; } .window-thinborder .window-body { border-width: 0px; } .window-thinborder .window-header .panel-icon, .window-thinborder .window-header .panel-tool { margin-top: -9px; margin-left: 5px; margin-right: 5px; } .window-noborder { border: 0; } .dialog-content { overflow: auto; } .dialog-toolbar { position: relative; padding: 2px 5px; } .dialog-tool-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .dialog-button { position: relative; top: -1px; padding: 5px; text-align: right; } .dialog-button .l-btn { margin-left: 5px; } .dialog-toolbar, .dialog-button { background: #f4f4f4; border-width: 1px; border-style: solid; } .dialog-toolbar { border-color: #95b8e7 #95b8e7 #ddd #95b8e7; } .dialog-button { border-color: #ddd #95b8e7 #95b8e7 #95b8e7; } .window-thinborder .dialog-toolbar { border-left: transparent; border-right: transparent; border-top-color: #f4f4f4; } .window-thinborder .dialog-button { top: 0px; padding: 5px 8px 8px 8px; border-left: transparent; border-right: transparent; border-bottom: transparent; } .l-btn { text-decoration: none; display: inline-block; overflow: hidden; margin: 0; padding: 0; cursor: pointer; outline: none; text-align: center; vertical-align: middle; line-height: normal; } .l-btn-plain { border-width: 0; padding: 1px; } .l-btn-left { display: inline-block; position: relative; overflow: hidden; margin: 0; padding: 0; vertical-align: top; } .l-btn-text { display: inline-block; vertical-align: top; width: auto; line-height: 24px; font-size: 12px; padding: 0; margin: 0 4px; } .l-btn-icon { display: inline-block; width: 16px; height: 16px; line-height: 16px; position: absolute; top: 50%; margin-top: -8px; font-size: 1px; } .l-btn span span .l-btn-empty { display: inline-block; margin: 0; width: 16px; height: 24px; font-size: 1px; vertical-align: top; } .l-btn span .l-btn-icon-left { padding: 0 0 0 20px; background-position: left center; } .l-btn span .l-btn-icon-right { padding: 0 20px 0 0; background-position: right center; } .l-btn-icon-left .l-btn-text { margin: 0 4px 0 24px; } .l-btn-icon-left .l-btn-icon { left: 4px; } .l-btn-icon-right .l-btn-text { margin: 0 24px 0 4px; } .l-btn-icon-right .l-btn-icon { right: 4px; } .l-btn-icon-top .l-btn-text { margin: 20px 4px 0 4px; } .l-btn-icon-top .l-btn-icon { top: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-icon-bottom .l-btn-text { margin: 0 4px 20px 4px; } .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-left .l-btn-empty { margin: 0 4px; width: 16px; } .l-btn-plain:hover { padding: 0; } .l-btn-focus { outline: #00f dotted thin; } .l-btn-large .l-btn-text { line-height: 40px; } .l-btn-large .l-btn-icon { width: 32px; height: 32px; line-height: 32px; margin-top: -16px; } .l-btn-large .l-btn-icon-left .l-btn-text { margin-left: 40px; } .l-btn-large .l-btn-icon-right .l-btn-text { margin-right: 40px; } .l-btn-large .l-btn-icon-top .l-btn-text { margin-top: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-top .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-bottom .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-left .l-btn-empty { margin: 0 4px; width: 32px; } .l-btn { color: #444; background: #fafafa; background-repeat: repeat-x; border: 1px solid #bbb; background: -webkit-linear-gradient(top, #fff 0, #eee 100%); background: -moz-linear-gradient(top, #fff 0, #eee 100%); background: -o-linear-gradient(top, #fff 0, #eee 100%); background: linear-gradient(to bottom, #fff 0, #eee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fff, endColorstr=#eee, GradientType=0); -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn:hover { background: #eaf2ff; color: #000; border: 1px solid #b7d2ff; filter: none; } .l-btn-plain { background: transparent; border-width: 0; filter: none; } .l-btn-outline { border-width: 1px; border-color: #b7d2ff; padding: 0; } .l-btn-plain:hover { background: #eaf2ff; color: #000; border: 1px solid #b7d2ff; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn-disabled, .l-btn-disabled:hover { opacity: 0.5; cursor: default; background: #fafafa; color: #444; background: -webkit-linear-gradient(top, #fff 0, #eee 100%); background: -moz-linear-gradient(top, #fff 0, #eee 100%); background: -o-linear-gradient(top, #fff 0, #eee 100%); background: linear-gradient(to bottom, #fff 0, #eee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fff, endColorstr=#eee, GradientType=0); } .l-btn-disabled .l-btn-text, .l-btn-disabled .l-btn-icon { filter: alpha(opacity=50); } .l-btn-plain-disabled, .l-btn-plain-disabled:hover { background: transparent; filter: alpha(opacity=50); } .l-btn-selected, .l-btn-selected:hover { background: #ddd; filter: none; } .l-btn-plain-selected, .l-btn-plain-selected:hover { background: #ddd; } .textbox { position: relative; border: 1px solid #95b8e7; background-color: #fff; vertical-align: middle; display: inline-block; overflow: hidden; white-space: nowrap; margin: 0; padding: 0; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { font-size: 12px; border: 0; margin: 0; padding: 4px; white-space: normal; vertical-align: top; outline-style: none; resize: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text::-ms-clear, .textbox .textbox-text::-ms-reveal { display: none; } .textbox textarea.textbox-text { white-space: pre-wrap; } .textbox .textbox-prompt { font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { background-position: 3px center; padding-left: 21px; } .textbox .textbox-button, .textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; vertical-align: top; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .textbox .textbox-button-right, .textbox .textbox-button-right:hover { right: 0; border-width: 0 0 0 1px; } .textbox .textbox-button-left, .textbox .textbox-button-left:hover { left: 0; border-width: 0 1px 0 0; } .textbox .textbox-button-top, .textbox .textbox-button-top:hover { left: 0; border-width: 0 0 1px 0; } .textbox .textbox-button-bottom, .textbox .textbox-button-bottom:hover { top: auto; bottom: 0; left: 0; border-width: 1px 0 0 0; } .textbox-addon { position: absolute; top: 0; } .textbox-label { display: inline-block; width: 80px; height: 22px; line-height: 22px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-right: 5px; } .textbox-label-after { padding-left: 5px; padding-right: 0; } .textbox-label-top { display: block; width: auto; padding: 0; } .textbox-disabled, .textbox-label-disabled { opacity: 0.6; filter: alpha(opacity=60); } .textbox-icon { display: inline-block; width: 18px; height: 20px; overflow: hidden; vertical-align: top; background-position: center center; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); text-decoration: none; outline-style: none; } .textbox-icon-disabled, .textbox-icon-readonly { cursor: default; } .textbox-icon:hover { opacity: 1.0; filter: alpha(opacity=100); } .textbox-icon-disabled:hover { opacity: 0.6; filter: alpha(opacity=60); } .textbox-focused { border-color: #6b9cde; -moz-box-shadow: 0 0 3px 0 #95b8e7; -webkit-box-shadow: 0 0 3px 0 #95b8e7; box-shadow: 0 0 3px 0 #95b8e7; } .textbox-invalid { border-color: #ffa8a8; background-color: #fff3f3; } .passwordbox-open { background: url('images/passwordbox_open.png') no-repeat center center; } .passwordbox-close { background: url('images/passwordbox_close.png') no-repeat center center; } .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } .filebox-label { display: inline-block; position: absolute; width: 100%; height: 100%; cursor: pointer; left: 0; top: 0; z-index: 10; background: url('images/blank.gif') no-repeat; } .l-btn-disabled .filebox-label { cursor: default; } .combo-arrow { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .combo-arrow-hover { opacity: 1.0; filter: alpha(opacity=100); } .combo-panel { overflow: auto; } .combo-arrow { background: url('images/combo_arrow.png') no-repeat center center; } .combo-panel { background-color: #fff; } .combo-arrow { background-color: #e0ecff; } .combo-arrow-hover { background-color: #eaf2ff; } .combo-arrow:hover { background-color: #eaf2ff; } .combo .textbox-icon-disabled:hover { cursor: default; } .combobox-item, .combobox-group, .combobox-stick { font-size: 12px; padding: 3px; } .combobox-item-disabled { opacity: 0.5; filter: alpha(opacity=50); } .combobox-gitem { padding-left: 10px; } .combobox-group, .combobox-stick { font-weight: bold; } .combobox-stick { position: absolute; top: 1px; left: 1px; right: 1px; background: inherit; } .combobox-item-hover { background-color: #eaf2ff; color: #000; } .combobox-item-selected { background-color: #ffe48d; color: #000; } .combobox-icon { display: inline-block; width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; } .tagbox { cursor: text; } .tagbox .textbox-text { float: left; } .tagbox-label { position: relative; display: block; margin: 4px 0 0 4px; padding: 0 20px 0 4px; float: left; vertical-align: top; text-decoration: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #eaf2ff; color: #000; } .tagbox-remove { background: url('images/tagbox_icons.png') no-repeat -16px center; position: absolute; display: block; width: 16px; height: 16px; right: 2px; top: 50%; margin-top: -8px; opacity: 0.6; filter: alpha(opacity=60); } .tagbox-remove:hover { opacity: 1; filter: alpha(opacity=100); } .textbox-disabled .tagbox-label { cursor: default; } .textbox-disabled .tagbox-remove:hover { cursor: default; opacity: 0.6; filter: alpha(opacity=60); } .layout { position: relative; overflow: hidden; margin: 0; padding: 0; z-index: 0; } .layout-panel { position: absolute; overflow: hidden; } .layout-body { min-width: 1px; min-height: 1px; } .layout-panel-east, .layout-panel-west { z-index: 2; } .layout-panel-north, .layout-panel-south { z-index: 3; } .layout-expand { position: absolute; padding: 0px; font-size: 1px; cursor: pointer; z-index: 1; } .layout-expand .panel-header, .layout-expand .panel-body { background: transparent; filter: none; overflow: hidden; } .layout-expand .panel-header { border-bottom-width: 0px; } .layout-expand .panel-body { position: relative; } .layout-expand .panel-body .panel-icon { margin-top: 0; top: 0; left: 50%; margin-left: -8px; } .layout-expand-west .panel-header .panel-icon, .layout-expand-east .panel-header .panel-icon { display: none; } .layout-expand-title { position: absolute; top: 0; left: 21px; white-space: nowrap; word-wrap: normal; -webkit-transform: rotate(90deg); -webkit-transform-origin: 0 0; -moz-transform: rotate(90deg); -moz-transform-origin: 0 0; -o-transform: rotate(90deg); -o-transform-origin: 0 0; transform: rotate(90deg); transform-origin: 0 0; } .layout-expand-with-icon { top: 18px; } .layout-expand .panel-body-noheader .layout-expand-title, .layout-expand .panel-body-noheader .panel-icon { top: 5px; } .layout-expand .panel-body-noheader .layout-expand-with-icon { top: 23px; } .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; font-size: 1px; display: none; z-index: 5; } .layout-split-proxy-h { width: 5px; cursor: e-resize; } .layout-split-proxy-v { height: 5px; cursor: n-resize; } .layout-mask { position: absolute; background: #fafafa; filter: alpha(opacity=10); opacity: 0.10; z-index: 4; } .layout-button-up { background: url('images/layout_arrows.png') no-repeat -16px -16px; } .layout-button-down { background: url('images/layout_arrows.png') no-repeat -16px 0; } .layout-button-left { background: url('images/layout_arrows.png') no-repeat 0 0; } .layout-button-right { background: url('images/layout_arrows.png') no-repeat 0 -16px; } .layout-split-proxy-h, .layout-split-proxy-v { background-color: #aac5e7; } .layout-split-north { border-bottom: 5px solid #e6eef8; } .layout-split-south { border-top: 5px solid #e6eef8; } .layout-split-east { border-left: 5px solid #e6eef8; } .layout-split-west { border-right: 5px solid #e6eef8; } .layout-expand { background-color: #e0ecff; } .layout-expand-over { background-color: #e0ecff; } .tabs-container { overflow: hidden; } .tabs-header { border-width: 1px; border-style: solid; border-bottom-width: 0; position: relative; padding: 0; padding-top: 2px; overflow: hidden; } .tabs-scroller-left, .tabs-scroller-right { position: absolute; top: auto; bottom: 0; width: 18px; font-size: 1px; display: none; cursor: pointer; border-width: 1px; border-style: solid; } .tabs-scroller-left { left: 0; } .tabs-scroller-right { right: 0; } .tabs-tool { position: absolute; bottom: 0; padding: 1px; overflow: hidden; border-width: 1px; border-style: solid; } .tabs-header-plain .tabs-tool { padding: 0 1px; } .tabs-wrap { position: relative; left: 0; overflow: hidden; width: 100%; margin: 0; padding: 0; } .tabs-scrolling { margin-left: 18px; margin-right: 18px; } .tabs-disabled { opacity: 0.3; filter: alpha(opacity=30); } .tabs { list-style-type: none; height: 26px; margin: 0px; padding: 0px; padding-left: 4px; width: 50000px; border-style: solid; border-width: 0 0 1px 0; } .tabs li { float: left; display: inline-block; margin: 0 4px -1px 0; padding: 0; position: relative; border: 0; } .tabs li a.tabs-inner { display: inline-block; text-decoration: none; margin: 0; padding: 0 10px; height: 25px; line-height: 25px; text-align: center; white-space: nowrap; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .tabs li.tabs-selected a.tabs-inner { font-weight: bold; outline: none; } .tabs li.tabs-selected a:hover.tabs-inner { cursor: default; pointer: default; } .tabs li a.tabs-close, .tabs-p-tool { position: absolute; font-size: 1px; display: block; height: 12px; padding: 0; top: 50%; margin-top: -6px; overflow: hidden; } .tabs li a.tabs-close { width: 12px; right: 5px; opacity: 0.6; filter: alpha(opacity=60); } .tabs-p-tool { right: 16px; } .tabs-p-tool a { display: inline-block; font-size: 1px; width: 12px; height: 12px; margin: 0; opacity: 0.6; filter: alpha(opacity=60); } .tabs li a:hover.tabs-close, .tabs-p-tool a:hover { opacity: 1; filter: alpha(opacity=100); cursor: hand; cursor: pointer; } .tabs-with-icon { padding-left: 18px; } .tabs-icon { position: absolute; width: 16px; height: 16px; left: 10px; top: 50%; margin-top: -8px; } .tabs-title { font-size: 12px; } .tabs-closable { padding-right: 8px; } .tabs-panels { margin: 0px; padding: 0px; border-width: 1px; border-style: solid; border-top-width: 0; overflow: hidden; } .tabs-header-bottom { border-width: 0 1px 1px 1px; padding: 0 0 2px 0; } .tabs-header-bottom .tabs { border-width: 1px 0 0 0; } .tabs-header-bottom .tabs li { margin: -1px 4px 0 0; } .tabs-header-bottom .tabs li a.tabs-inner { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .tabs-header-bottom .tabs-tool { top: 0; } .tabs-header-bottom .tabs-scroller-left, .tabs-header-bottom .tabs-scroller-right { top: 0; bottom: auto; } .tabs-panels-top { border-width: 1px 1px 0 1px; } .tabs-header-left { float: left; border-width: 1px 0 1px 1px; padding: 0; } .tabs-header-right { float: right; border-width: 1px 1px 1px 0; padding: 0; } .tabs-header-left .tabs-wrap, .tabs-header-right .tabs-wrap { height: 100%; } .tabs-header-left .tabs { height: 100%; padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, .tabs-header-right .tabs li { display: block; width: 100%; position: relative; } .tabs-header-left .tabs li { left: auto; right: 0; margin: 0 -1px 4px 0; float: right; } .tabs-header-right .tabs li { left: 0; right: auto; margin: 0 0 4px -1px; float: left; } .tabs-justified li a.tabs-inner { padding-left: 0; padding-right: 0; } .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .tabs-panels-right { float: right; border-width: 1px 1px 1px 0; } .tabs-panels-left { float: left; border-width: 1px 0 1px 1px; } .tabs-header-noborder, .tabs-panels-noborder { border: 0px; } .tabs-header-plain { border: 0px; background: transparent; } .tabs-pill { padding-bottom: 3px; } .tabs-header-bottom .tabs-pill { padding-top: 3px; padding-bottom: 0; } .tabs-header-left .tabs-pill { padding-right: 3px; } .tabs-header-right .tabs-pill { padding-left: 3px; } .tabs-header .tabs-pill li a.tabs-inner { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tabs-header-narrow, .tabs-header-narrow .tabs-narrow { padding: 0; } .tabs-narrow li, .tabs-header-bottom .tabs-narrow li { margin-left: 0; margin-right: -1px; } .tabs-narrow li.tabs-last, .tabs-header-bottom .tabs-narrow li.tabs-last { margin-right: 0; } .tabs-header-left .tabs-narrow, .tabs-header-right .tabs-narrow { padding-top: 0; } .tabs-header-left .tabs-narrow li { margin-bottom: -1px; margin-right: -1px; } .tabs-header-left .tabs-narrow li.tabs-last, .tabs-header-right .tabs-narrow li.tabs-last { margin-bottom: 0; } .tabs-header-right .tabs-narrow li { margin-bottom: -1px; margin-left: -1px; } .tabs-scroller-left { background: #e0ecff url('images/tabs_icons.png') no-repeat 1px center; } .tabs-scroller-right { background: #e0ecff url('images/tabs_icons.png') no-repeat -15px center; } .tabs li a.tabs-close { background: url('images/tabs_icons.png') no-repeat -34px center; } .tabs li a.tabs-inner:hover { background: #eaf2ff; color: #000; filter: none; } .tabs li.tabs-selected a.tabs-inner { background-color: #fff; color: #0e2d5f; background: -webkit-linear-gradient(top, #eff5ff 0, #fff 100%); background: -moz-linear-gradient(top, #eff5ff 0, #fff 100%); background: -o-linear-gradient(top, #eff5ff 0, #fff 100%); background: linear-gradient(to bottom, #eff5ff 0, #fff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eff5ff, endColorstr=#fff, GradientType=0); } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(top, #fff 0, #eff5ff 100%); background: -moz-linear-gradient(top, #fff 0, #eff5ff 100%); background: -o-linear-gradient(top, #fff 0, #eff5ff 100%); background: linear-gradient(to bottom, #fff 0, #eff5ff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fff, endColorstr=#eff5ff, GradientType=0); } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left, #eff5ff 0, #fff 100%); background: -moz-linear-gradient(left, #eff5ff 0, #fff 100%); background: -o-linear-gradient(left, #eff5ff 0, #fff 100%); background: linear-gradient(to right, #eff5ff 0, #fff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eff5ff, endColorstr=#fff, GradientType=1); } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left, #fff 0, #eff5ff 100%); background: -moz-linear-gradient(left, #fff 0, #eff5ff 100%); background: -o-linear-gradient(left, #fff 0, #eff5ff 100%); background: linear-gradient(to right, #fff 0, #eff5ff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fff, endColorstr=#eff5ff, GradientType=1); } .tabs li a.tabs-inner { color: #0e2d5f; background-color: #e0ecff; background: -webkit-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: -moz-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: -o-linear-gradient(top, #eff5ff 0, #e0ecff 100%); background: linear-gradient(to bottom, #eff5ff 0, #e0ecff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eff5ff, endColorstr=#e0ecff, GradientType=0); } .tabs-header, .tabs-tool { background-color: #e0ecff; } .tabs-header-plain { background: transparent; } .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-color: #95b8e7; } .tabs-p-tool a:hover, .tabs li a:hover.tabs-close, .tabs-scroller-over { background-color: #eaf2ff; } .tabs li.tabs-selected a.tabs-inner { border-bottom: 1px solid #fff; } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { border-top: 1px solid #fff; } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { border-right: 1px solid #fff; } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #fff; } .tabs-header .tabs-pill li.tabs-selected a.tabs-inner { background: #ffe48d; color: #000; filter: none; border-color: #95b8e7; } .datagrid .panel-body { overflow: hidden; position: relative; } .datagrid-view { position: relative; overflow: hidden; } .datagrid-view1, .datagrid-view2 { position: absolute; overflow: hidden; top: 0; } .datagrid-view1 { left: 0; } .datagrid-view2 { right: 0; } .datagrid-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.3; filter: alpha(opacity=30); display: none; } .datagrid-mask-msg { position: absolute; top: 50%; margin-top: -20px; padding: 10px 5px 10px 30px; width: auto; height: 16px; border-width: 2px; border-style: solid; display: none; } .datagrid-empty { position: absolute; left: 0; top: 0; width: 100%; height: 25px; line-height: 25px; text-align: center; } .datagrid-sort-icon { padding: 0; display: none; } .datagrid-toolbar { height: auto; padding: 1px 2px; border-width: 0 0 1px 0; border-style: solid; } .datagrid-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .datagrid .datagrid-pager { display: block; margin: 0; border-width: 1px 0 0 0; border-style: solid; } .datagrid .datagrid-pager-top { border-width: 0 0 1px 0; } .datagrid-header { overflow: hidden; cursor: default; border-width: 0 0 1px 0; border-style: solid; } .datagrid-header-inner { float: left; width: 10000px; } .datagrid-header-row, .datagrid-row { height: 25px; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-width: 0 1px 1px 0; border-style: dotted; margin: 0; padding: 0; } .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { margin: 0; padding: 0 4px; white-space: nowrap; word-wrap: normal; overflow: hidden; height: 18px; line-height: 18px; font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { font-size: 12px; } .datagrid-cell-group { text-align: center; text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { width: 30px; text-align: center; margin: 0; padding: 0; } .datagrid-body { margin: 0; padding: 0; overflow: auto; zoom: 1; } .datagrid-view1 .datagrid-body-inner { padding-bottom: 20px; } .datagrid-view1 .datagrid-body { overflow: hidden; } .datagrid-footer { overflow: hidden; } .datagrid-footer-inner { border-width: 1px 0 0 0; border-style: solid; width: 10000px; float: left; } .datagrid-row-editing .datagrid-cell { height: auto; } .datagrid-header-check, .datagrid-cell-check { padding: 0; width: 27px; height: 18px; font-size: 1px; text-align: center; overflow: hidden; } .datagrid-header-check input, .datagrid-cell-check input { margin: 0; padding: 0; width: 15px; height: 18px; } .datagrid-resize-proxy { position: absolute; width: 1px; height: 10000px; top: 0; cursor: e-resize; display: none; } .datagrid-body .datagrid-editable { margin: 0; padding: 0; } .datagrid-body .datagrid-editable table { width: 100%; height: 100%; } .datagrid-body .datagrid-editable td { border: 0; margin: 0; padding: 0; } .datagrid-view .datagrid-editable-input { margin: 0; padding: 2px 4px; border: 1px solid #95b8e7; font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .datagrid-view .validatebox-invalid { border-color: #ffa8a8; } .datagrid-sort .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -64px center; } .datagrid-sort-desc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } .datagrid-row-collapse { background: url('images/datagrid_icons.png') no-repeat -48px center; } .datagrid-row-expand { background: url('images/datagrid_icons.png') no-repeat -32px center; } .datagrid-mask-msg { background: #fff url('images/loading.gif') no-repeat scroll 5px center; } .datagrid-header, .datagrid-td-rownumber { background-color: #efefef; background: -webkit-linear-gradient(top, #f9f9f9 0, #efefef 100%); background: -moz-linear-gradient(top, #f9f9f9 0, #efefef 100%); background: -o-linear-gradient(top, #f9f9f9 0, #efefef 100%); background: linear-gradient(to bottom, #f9f9f9 0, #efefef 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#f9f9f9, endColorstr=#efefef, GradientType=0); } .datagrid-cell-rownumber { color: #000; } .datagrid-resize-proxy { background: #aac5e7; } .datagrid-mask { background: #ccc; } .datagrid-mask-msg { border-color: #95b8e7; } .datagrid-toolbar, .datagrid-pager { background: #f4f4f4; } .datagrid-header, .datagrid-toolbar, .datagrid-pager, .datagrid-footer-inner { border-color: #ddd; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-color: #ccc; } .datagrid-htable, .datagrid-btable, .datagrid-ftable { color: #000; border-collapse: separate; } .datagrid-row-alt { background: #fafafa; } .datagrid-row-over, .datagrid-header td.datagrid-header-over { background: #eaf2ff; color: #000; cursor: default; } .datagrid-row-selected { background: #ffe48d; color: #000; } .datagrid-row-editing .textbox, .datagrid-row-editing .textbox-text { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .propertygrid .datagrid-view1 .datagrid-body td { padding-bottom: 1px; border-width: 0 1px 0 0; } .propertygrid .datagrid-group { height: 21px; overflow: hidden; border-width: 0 0 1px 0; border-style: solid; } .propertygrid .datagrid-group span { font-weight: bold; } .propertygrid .datagrid-view1 .datagrid-body td { border-color: #ddd; } .propertygrid .datagrid-view1 .datagrid-group { border-color: #e0ecff; } .propertygrid .datagrid-view2 .datagrid-group { border-color: #ddd; } .propertygrid .datagrid-group, .propertygrid .datagrid-view1 .datagrid-body, .propertygrid .datagrid-view1 .datagrid-row-over, .propertygrid .datagrid-view1 .datagrid-row-selected { background: #e0ecff; } .datalist .datagrid-header { border-width: 0; } .datalist .datagrid-group, .m-list .m-list-group { height: 25px; line-height: 25px; font-weight: bold; overflow: hidden; background-color: #efefef; border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .datalist .datagrid-group-expander { display: none; } .datalist .datagrid-group-title { padding: 0 4px; } .datalist .datagrid-btable { width: 100%; table-layout: fixed; } .datalist .datagrid-row td { border-style: solid; border-left-color: transparent; border-right-color: transparent; border-bottom-width: 0; } .datalist-lines .datagrid-row td { border-bottom-width: 1px; } .datalist .datagrid-cell, .m-list li { width: auto; height: auto; padding: 2px 4px; line-height: 18px; position: relative; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link, .m-list li > a { display: block; position: relative; cursor: pointer; color: #000; text-decoration: none; overflow: hidden; margin: -2px -4px; padding: 2px 4px; padding-right: 16px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link::after, .m-list li > a::after { position: absolute; display: block; width: 8px; height: 8px; content: ''; right: 6px; top: 50%; margin-top: -4px; border-style: solid; border-width: 1px 1px 0 0; -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .m-list { margin: 0; padding: 0; list-style: none; } .m-list li { border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .m-list li > a:hover { background: #eaf2ff; color: #000; } .m-list .m-list-group { padding: 0 4px; } .pagination { zoom: 1; } .pagination table { float: left; height: 30px; } .pagination td { border: 0; } .pagination-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 3px 1px; } .pagination .pagination-num { border-width: 1px; border-style: solid; margin: 0 2px; padding: 2px; width: 2em; height: auto; } .pagination-page-list { margin: 0px 6px; padding: 1px 2px; width: auto; height: auto; border-width: 1px; border-style: solid; } .pagination-info { float: right; margin: 0 6px 0 0; padding: 0; height: 30px; line-height: 30px; font-size: 12px; } .pagination span { font-size: 12px; } .pagination-link .l-btn-text { width: 24px; text-align: center; margin: 0; } .pagination-first { background: url('images/pagination_icons.png') no-repeat 0 center; } .pagination-prev { background: url('images/pagination_icons.png') no-repeat -16px center; } .pagination-next { background: url('images/pagination_icons.png') no-repeat -32px center; } .pagination-last { background: url('images/pagination_icons.png') no-repeat -48px center; } .pagination-load { background: url('images/pagination_icons.png') no-repeat -64px center; } .pagination-loading { background: url('images/loading.gif') no-repeat center center; } .pagination-page-list, .pagination .pagination-num { border-color: #95b8e7; } .calendar { border-width: 1px; border-style: solid; padding: 1px; overflow: hidden; } .calendar table { table-layout: fixed; border-collapse: separate; font-size: 12px; width: 100%; height: 100%; } .calendar table td, .calendar table th { font-size: 12px; } .calendar-noborder { border: 0; } .calendar-header { position: relative; height: 22px; } .calendar-title { text-align: center; height: 22px; } .calendar-title span { position: relative; display: inline-block; top: 2px; padding: 0 3px; height: 18px; line-height: 18px; font-size: 12px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth, .calendar-nextmonth, .calendar-prevyear, .calendar-nextyear { position: absolute; top: 50%; margin-top: -7px; width: 14px; height: 14px; cursor: pointer; font-size: 1px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth { left: 20px; background: url('images/calendar_arrows.png') no-repeat -18px -2px; } .calendar-nextmonth { right: 20px; background: url('images/calendar_arrows.png') no-repeat -34px -2px; } .calendar-prevyear { left: 3px; background: url('images/calendar_arrows.png') no-repeat -1px -2px; } .calendar-nextyear { right: 3px; background: url('images/calendar_arrows.png') no-repeat -49px -2px; } .calendar-body { position: relative; } .calendar-body th, .calendar-body td { text-align: center; } .calendar-day { border: 0; padding: 1px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-other-month { opacity: 0.3; filter: alpha(opacity=30); } .calendar-disabled { opacity: 0.6; filter: alpha(opacity=60); cursor: default; } .calendar-menu { position: absolute; top: 0; left: 0; width: 180px; height: 150px; padding: 5px; font-size: 12px; display: none; overflow: hidden; } .calendar-menu-year-inner { text-align: center; padding-bottom: 5px; } .calendar-menu-year { width: 50px; text-align: center; border-width: 1px; border-style: solid; outline-style: none; resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { display: inline-block; width: 21px; height: 21px; vertical-align: top; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev { margin-right: 10px; background: url('images/calendar_arrows.png') no-repeat 2px 2px; } .calendar-menu-next { margin-left: 10px; background: url('images/calendar_arrows.png') no-repeat -45px 2px; } .calendar-menu-month { text-align: center; cursor: pointer; font-weight: bold; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-body th, .calendar-menu-month { color: #4d4d4d; } .calendar-day { color: #000; } .calendar-sunday { color: #c22; } .calendar-saturday { color: #0e0; } .calendar-today { color: #00f; } .calendar-menu-year { border-color: #95b8e7; } .calendar { border-color: #95b8e7; } .calendar-header { background: #e0ecff; } .calendar-body, .calendar-menu { background: #fff; } .calendar-body th { background: #f4f4f4; padding: 2px 0; } .calendar-hover, .calendar-nav-hover, .calendar-menu-hover { background-color: #eaf2ff; color: #000; } .calendar-hover { border: 1px solid #b7d2ff; padding: 0; } .calendar-selected { background-color: #ffe48d; color: #000; border: 1px solid #ffab3f; padding: 0; } .datebox-calendar-inner { height: 180px; } .datebox-button { padding: 0 5px; text-align: center; } .datebox-button a { line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; opacity: 0.6; filter: alpha(opacity=60); } .datebox-button a:hover { opacity: 1.0; filter: alpha(opacity=100); } .datebox-current, .datebox-close { float: left; } .datebox-close { float: right; } .datebox .combo-arrow { background-image: url('images/datebox_arrow.png'); background-position: center center; } .datebox-button { background-color: #f4f4f4; } .datebox-button a { color: #444; } .spinner-arrow { background-color: #e0ecff; display: inline-block; overflow: hidden; vertical-align: top; margin: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); width: 18px; } .spinner-arrow-up, .spinner-arrow-down { opacity: 0.6; filter: alpha(opacity=60); display: block; font-size: 1px; width: 18px; height: 10px; width: 100%; height: 50%; color: #444; outline-style: none; } .spinner-arrow-hover { background-color: #eaf2ff; opacity: 1.0; filter: alpha(opacity=100); } .spinner-arrow-up:hover, .spinner-arrow-down:hover { opacity: 1.0; filter: alpha(opacity=100); background-color: #eaf2ff; } .textbox-icon-disabled .spinner-arrow-up:hover, .textbox-icon-disabled .spinner-arrow-down:hover { opacity: 0.6; filter: alpha(opacity=60); background-color: #e0ecff; cursor: default; } .spinner .textbox-icon-disabled { opacity: 0.6; filter: alpha(opacity=60); } .spinner-arrow-up { background: url('images/spinner_arrows.png') no-repeat 1px center; } .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } .spinner-button-up { background: url('images/spinner_arrows.png') no-repeat -32px center; } .spinner-button-down { background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; overflow: hidden; position: relative; } .progressbar-text { text-align: center; position: absolute; } .progressbar-value { position: relative; overflow: hidden; width: 0; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .progressbar { border-color: #95b8e7; } .progressbar-text { color: #000; font-size: 12px; } .progressbar-value .progressbar-text { background-color: #ffe48d; color: #000; } .searchbox-button { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .searchbox-button-hover { opacity: 1.0; filter: alpha(opacity=100); } .searchbox .l-btn-plain { border: 0; padding: 0; vertical-align: top; opacity: 0.6; filter: alpha(opacity=60); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .l-btn-plain:hover { border: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox a.m-btn-plain-active { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .m-btn-active { border-width: 0 1px 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .textbox-button-right { border-width: 0 0 0 1px; } .searchbox .textbox-button-left { border-width: 0 1px 0 0; } .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } .searchbox .l-btn-plain { background: #e0ecff; } .searchbox .l-btn-plain-disabled, .searchbox .l-btn-plain-disabled:hover { opacity: 0.5; filter: alpha(opacity=50); } .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 5px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: auto; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #95b8e7; background: #e0ecff; } .slider-rule span { border-color: #95b8e7; } .slider-rulelabel span { color: #000; } .menu { position: absolute; margin: 0; padding: 2px; border-width: 1px; border-style: solid; overflow: hidden; } .menu-inline { position: relative; } .menu-item { position: relative; margin: 0; padding: 0; overflow: hidden; white-space: nowrap; cursor: pointer; border-width: 1px; border-style: solid; } .menu-text { height: 20px; line-height: 20px; float: left; padding-left: 28px; } .menu-icon { position: absolute; width: 16px; height: 16px; left: 2px; top: 50%; margin-top: -8px; } .menu-rightarrow { position: absolute; width: 16px; height: 16px; right: 0; top: 50%; margin-top: -8px; } .menu-line { position: absolute; left: 26px; top: 0; height: 2000px; font-size: 1px; } .menu-sep { margin: 3px 0px 3px 25px; font-size: 1px; } .menu-noline .menu-line { display: none; } .menu-noline .menu-sep { margin-left: 0; margin-right: 0; } .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .menu-item-disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: default; } .menu-text, .menu-text span { font-size: 12px; } .menu-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #ccc; -moz-box-shadow: 2px 2px 3px #ccc; -webkit-box-shadow: 2px 2px 3px #ccc; box-shadow: 2px 2px 3px #ccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2, MakeShadow=false, ShadowOpacity=0.2); } .menu-rightarrow { background: url('images/menu_arrows.png') no-repeat -32px center; } .menu-line { border-left: 1px solid #ccc; border-right: 1px solid #fff; } .menu-sep { border-top: 1px solid #ccc; border-bottom: 1px solid #fff; } .menu { background-color: #fafafa; border-color: #ddd; color: #444; } .menu-content { background: #fff; } .menu-item { border-color: transparent; _border-color: #fafafa; } .menu-active { border-color: #b7d2ff; color: #000; background: #eaf2ff; } .menu-active-disabled { border-color: transparent; background: transparent; color: #444; } .m-btn-downarrow, .s-btn-downarrow { display: inline-block; position: absolute; width: 16px; height: 16px; font-size: 1px; right: 0; top: 50%; margin-top: -8px; } .m-btn-active, .s-btn-active { background: #eaf2ff; color: #000; border: 1px solid #b7d2ff; filter: none; } .m-btn-plain-active, .s-btn-plain-active { background: transparent; padding: 0; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .m-btn .l-btn-left .l-btn-text { margin-right: 20px; } .m-btn .l-btn-icon-right .l-btn-text { margin-right: 40px; } .m-btn .l-btn-icon-right .l-btn-icon { right: 20px; } .m-btn .l-btn-icon-top .l-btn-text { margin-right: 4px; margin-bottom: 14px; } .m-btn .l-btn-icon-bottom .l-btn-text { margin-right: 4px; margin-bottom: 34px; } .m-btn .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 20px; } .m-btn .l-btn-icon-top .m-btn-downarrow, .m-btn .l-btn-icon-bottom .m-btn-downarrow { top: auto; bottom: 0px; left: 50%; margin-left: -8px; } .m-btn-line { display: inline-block; position: absolute; font-size: 1px; display: none; } .m-btn .l-btn-left .m-btn-line { right: 0; width: 16px; height: 500px; border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } .m-btn .l-btn-icon-top .m-btn-line, .m-btn .l-btn-icon-bottom .m-btn-line { left: 0; bottom: 0; width: 500px; height: 16px; border-width: 1px 0 0 0; } .m-btn-large .l-btn-icon-right .l-btn-text { margin-right: 56px; } .m-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 50px; } .m-btn-downarrow, .s-btn-downarrow { background: url('images/menu_arrows.png') no-repeat 0 center; } .m-btn-plain-active, .s-btn-plain-active { border-color: #b7d2ff; background-color: #eaf2ff; color: #000; } .s-btn:hover .m-btn-line, .s-btn-active .m-btn-line, .s-btn-plain-active .m-btn-line { display: inline-block; } .l-btn:hover .s-btn-downarrow, .s-btn-active .s-btn-downarrow, .s-btn-plain-active .s-btn-downarrow { border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } .messager-body { padding: 10px 10px 30px 10px; overflow: auto; } .messager-button { text-align: center; padding: 5px; } .messager-button .l-btn { width: 70px; } .messager-icon { float: left; width: 32px; height: 32px; margin: 0 10px 10px 0; } .messager-error { background: url('images/messager_icons.png') no-repeat scroll -64px 0; } .messager-info { background: url('images/messager_icons.png') no-repeat scroll 0 0; } .messager-question { background: url('images/messager_icons.png') no-repeat scroll -32px 0; } .messager-warning { background: url('images/messager_icons.png') no-repeat scroll -96px 0; } .messager-progress { padding: 10px; } .messager-p-msg { margin-bottom: 5px; } .messager-body .messager-input { width: 100%; padding: 4px 0; outline-style: none; border: 1px solid #95b8e7; } .window-thinborder .messager-button { padding-bottom: 8px; } .tree { margin: 0; padding: 0; list-style-type: none; } .tree li { white-space: nowrap; } .tree li ul { list-style-type: none; margin: 0; padding: 0; } .tree-node { height: 18px; white-space: nowrap; cursor: pointer; } .tree-hit { cursor: pointer; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; vertical-align: top; overflow: hidden; } .tree-expanded { background: url('images/tree_icons.png') no-repeat -18px 0px; } .tree-expanded-hover { background: url('images/tree_icons.png') no-repeat -50px 0px; } .tree-collapsed { background: url('images/tree_icons.png') no-repeat 0px 0px; } .tree-collapsed-hover { background: url('images/tree_icons.png') no-repeat -32px 0px; } .tree-lines .tree-expanded, .tree-lines .tree-root-first .tree-expanded { background: url('images/tree_icons.png') no-repeat -144px 0; } .tree-lines .tree-collapsed, .tree-lines .tree-root-first .tree-collapsed { background: url('images/tree_icons.png') no-repeat -128px 0; } .tree-lines .tree-node-last .tree-expanded, .tree-lines .tree-root-one .tree-expanded { background: url('images/tree_icons.png') no-repeat -80px 0; } .tree-lines .tree-node-last .tree-collapsed, .tree-lines .tree-root-one .tree-collapsed { background: url('images/tree_icons.png') no-repeat -64px 0; } .tree-line { background: url('images/tree_icons.png') no-repeat -176px 0; } .tree-join { background: url('images/tree_icons.png') no-repeat -192px 0; } .tree-joinbottom { background: url('images/tree_icons.png') no-repeat -160px 0; } .tree-folder { background: url('images/tree_icons.png') no-repeat -208px 0; } .tree-folder-open { background: url('images/tree_icons.png') no-repeat -224px 0; } .tree-file { background: url('images/tree_icons.png') no-repeat -240px 0; } .tree-loading { background: url('images/loading.gif') no-repeat center center; } .tree-checkbox0 { background: url('images/tree_icons.png') no-repeat -208px -18px; } .tree-checkbox1 { background: url('images/tree_icons.png') no-repeat -224px -18px; } .tree-checkbox2 { background: url('images/tree_icons.png') no-repeat -240px -18px; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: top; white-space: nowrap; padding: 0 2px; height: 18px; line-height: 18px; } .tree-node-proxy { font-size: 12px; line-height: 20px; padding: 0 2px 0 20px; border-width: 1px; border-style: solid; z-index: 9900000; } .tree-dnd-icon { display: inline-block; position: absolute; width: 16px; height: 18px; left: 2px; top: 50%; margin-top: -9px; } .tree-dnd-yes { background: url('images/tree_icons.png') no-repeat -256px 0; } .tree-dnd-no { background: url('images/tree_icons.png') no-repeat -256px -18px; } .tree-node-top { border-top: 1px dotted red; } .tree-node-bottom { border-bottom: 1px dotted red; } .tree-node-append .tree-title { border: 1px dotted red; } .tree-editor { border: 1px solid #95b8e7; font-size: 12px; line-height: 16px; padding: 0 4px; margin: 0; width: 80px; outline-style: none; vertical-align: top; position: absolute; top: 0; } .tree-node-proxy { background-color: #fff; color: #000; border-color: #95b8e7; } .tree-node-hover { background: #eaf2ff; color: #000; } .tree-node-selected { background: #ffe48d; color: #000; } .tree-node-hidden { display: none; } .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; color: #000; } .tooltip { position: absolute; display: none; z-index: 9900000; outline: none; opacity: 1; filter: alpha(opacity=100); padding: 5px; border-width: 1px; border-style: solid; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tooltip-content { font-size: 12px; } .tooltip-arrow-outer, .tooltip-arrow { position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; border-style: solid; border-width: 6px; border-color: transparent; _border-color: tomato; _filter: chroma(color=tomato); } .tooltip-arrow { display: none \9; } .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; margin: -6px 0 0 -13px; } .tooltip-right .tooltip-arrow { left: 0; top: 50%; margin: -6px 0 0 -12px; } .tooltip-left .tooltip-arrow-outer { right: 0; top: 50%; margin: -6px -13px 0 0; } .tooltip-left .tooltip-arrow { right: 0; top: 50%; margin: -6px -12px 0 0; } .tooltip-top .tooltip-arrow-outer { bottom: 0; left: 50%; margin: 0 0 -13px -6px; } .tooltip-top .tooltip-arrow { bottom: 0; left: 50%; margin: 0 0 -12px -6px; } .tooltip-bottom .tooltip-arrow-outer { top: 0; left: 50%; margin: -13px 0 0 -6px; } .tooltip-bottom .tooltip-arrow { top: 0; left: 50%; margin: -12px 0 0 -6px; } .tooltip { background-color: #fff; border-color: #95b8e7; color: #000; } .tooltip-right .tooltip-arrow-outer { border-right-color: #95b8e7; } .tooltip-right .tooltip-arrow { border-right-color: #fff; } .tooltip-left .tooltip-arrow-outer { border-left-color: #95b8e7; } .tooltip-left .tooltip-arrow { border-left-color: #fff; } .tooltip-top .tooltip-arrow-outer { border-top-color: #95b8e7; } .tooltip-top .tooltip-arrow { border-top-color: #fff; } .tooltip-bottom .tooltip-arrow-outer { border-bottom-color: #95b8e7; } .tooltip-bottom .tooltip-arrow { border-bottom-color: #fff; } .switchbutton { text-decoration: none; display: inline-block; overflow: hidden; vertical-align: middle; margin: 0; padding: 0; cursor: pointer; background: #bbb; border: 1px solid #bbb; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-inner { display: inline-block; overflow: hidden; position: relative; top: -1px; left: -1px; } .switchbutton-on, .switchbutton-off, .switchbutton-handle { display: inline-block; text-align: center; height: 100%; float: left; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-on { background: #ffe48d; color: #000; } .switchbutton-off { background-color: #fff; color: #000; } .switchbutton-on, .switchbutton-reversed .switchbutton-off { -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .switchbutton-off, .switchbutton-reversed .switchbutton-on { -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .switchbutton-handle { position: absolute; top: 0; left: 50%; background-color: #fff; color: #000; border: 1px solid #bbb; -moz-box-shadow: 0 0 3px 0 #bbb; -webkit-box-shadow: 0 0 3px 0 #bbb; box-shadow: 0 0 3px 0 #bbb; } .switchbutton-value { position: absolute; top: 0; left: -5000px; } .switchbutton-disabled { opacity: 0.5; filter: alpha(opacity=50); } .switchbutton-disabled, .switchbutton-readonly { cursor: default; }
{'content_hash': '4fa05bbc80e5c9cc2df52460edd0d35c', 'timestamp': '', 'source': 'github', 'line_count': 3541, 'max_line_length': 115, 'avg_line_length': 18.205591640779442, 'alnum_prop': 0.6337604318555518, 'repo_name': 'osdu/xcloud-client', 'id': 'c65a80fd4ba046b2639596faf8728b0ccb235a17', 'size': '64466', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'themes/easyui/default/easyui.css', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '372'}, {'name': 'Batchfile', 'bytes': '1021'}, {'name': 'CSS', 'bytes': '1079081'}, {'name': 'HTML', 'bytes': '22793'}, {'name': 'JavaScript', 'bytes': '5287433'}, {'name': 'PHP', 'bytes': '7181'}, {'name': 'Smarty', 'bytes': '18975'}]}
<!-- TODO - Add author names and HTML5, Phaser.io and CSS3 logos --> <footer class="footer"> <div class="container-fluid"> <div class="row"> <div class="col-md-6 col-md-12" style="background-color: #f5f5f5"> HTML5 Videogame </div> <!-- TODO - Add link for Phaser.io --> <div class="col-md-6 col-md-12" style="padding-top: 10px; background-color: #f5f5f5"> Realized with Phaser.io </div> </div> </div> </footer>
{'content_hash': '5f3f758cd2696e1e1aba2fc66451f0c7', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 97, 'avg_line_length': 37.714285714285715, 'alnum_prop': 0.5265151515151515, 'repo_name': 'marcoalessandro/bubble-evolution', 'id': 'ff2ee0a9c4a0c8766e5421eaf85ddb8255bedfa9', 'size': '528', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'snippets/footer.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1083'}, {'name': 'HTML', 'bytes': '24476'}, {'name': 'JavaScript', 'bytes': '3126071'}]}
<!-- _includes/base.html --> <!DOCTYPE html> <html> <head> <title>Transient RLC</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>PSLab help</title> <!-- core CSS --> <link href="../css/bootstrap.min.css" rel="stylesheet"> <link href="../css/main.css" rel="stylesheet"> <link href="../css/highlight.css" rel="stylesheet"> </head> <body class="homepage"> <header id="header"> <nav class="navbar navbar-inverse" role="banner"> <div class="container-fluid"> <div class="navbar-header pull-left"> <a class="navbar-brand" href="../index.html"><img src="../images/logo.png" style="max-height:50px;background:#7a7;" alt="logo"></a> </div> <ul class="nav navbar-nav pull-left"> <li ><a href="../index.html">Home</a></li> <li ><a href="../utilities/index.html">Utilities</a></li> <li ><a href="../apps/index.html">Experiments</a></li> </ul> <!-- <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> --> </div> </nav> </header><!--/header--> <!-- _includes/base.html --> <!-- _includes/base.html --> <div id="mySidenav" class="sidenav"> <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a> <a href="../utilities/index.html"> Utilities Section </a> <a href="../apps/index.html"> Experiments Section </a> <hr> <ul> </ul> <hr> <ul> <li><a href="../apps/B_LEMON_CELL.html" title="Lemon cell">Lemon cell</a></li> <li><a href="../apps/C_AC_GENERATOR.html" title="AC Generator">AC Generator</a></li> <li><a href="../apps/E_transientRLC.html" title="Transient RLC">Transient RLC</a></li> <li><a href="../apps/K_bodePlots.html" title="Bode Plots">Bode Plots</a></li> <li><a href="../apps/astable-multivibrator.html" title="Astable Multivibrator">Astable Multivibrator</a></li> <li><a href="../apps/A_AC_AND_DC.html" title="AC and DC">AC and DC</a></li> <li><a href="../apps/DUST_SENSOR.html" title="Dust Sensor">Dust Sensor</a></li> <li><a href="../apps/D_RESISTANCE.html" title="Resistors">Resistors</a></li> <li><a href="../apps/L_LinearRampGen.html" title="Ramp Generator">Ramp Generator</a></li> <li><a href="../apps/Precision_Rectifier.html" title="Precision Rectifier">Precision Rectifier</a></li> <li><a href="../apps/Z_designer.html" title="Experiment Designer">Experiment Designer</a></li> <li><a href="../apps/D_NFET.html" title="N-channel FET">N-channel FET</a></li> <li><a href="../apps/D_ZenerIV.html" title="Zener Diode IV">Zener Diode IV</a></li> <li><a href="../apps/D_diodeIV.html" title="Diode IV">Diode IV</a></li> <li><a href="../apps/D_transistorCE.html" title="Transistor CE">Transistor CE</a></li> <li><a href="../apps/D_transistorCB.html" title="Transistor CB">Transistor CB</a></li> <li><a href="../apps/L_halfWave.html" title="Half-Wave Rectifier">Half-Wave Rectifier</a></li> <li><a href="../apps/M_FullWave.html" title="Full-Wave Rectifier">Full-Wave Rectifier</a></li> <li><a href="../apps/H_SOUND_BEATS.html" title="Sounds Beats">Sounds Beats</a></li> <li><a href="../apps/M_RANDOM_SAMPLING.html" title="Random Sampling">Random Sampling</a></li> <li><a href="../apps/I_CAPACITANCE.html" title="Capacitors 101">Capacitors 101</a></li> <li><a href="../apps/L_Summing.html" title="Summing Junction">Summing Junction</a></li> <li><a href="../apps/E_OhmsLaw.html" title="Ohm's Law">Ohm's Law</a></li> <li><a href="../apps/E_RESISTANCE_BODY.html" title="Body Resistance">Body Resistance</a></li> <li><a href="../apps/F_WATER_RESISTANCE.html" title="Resistance of Water">Resistance of Water</a></li> <li><a href="../apps/F_EM_INDUCTION.html" title="Mutual Inductance">Mutual Inductance</a></li> </ul> </div> <div style="padding:10px;"><span id="menubutton" style="font-size:30px;cursor:pointer;" onclick="openNav()">&#9776; Experiments</span></div> <div id="main"> <div class="center wow fadeInDown"> <br><h2>Transient RLC</h2> <p class="lead"> Study transient response of RLC circuits</p> </div> <section id="recent-works"> <div class="container"> <h2 id="schematic">Schematic</h2> <p><img src="images/schematics/astable-multivibrator.svg" alt="" width="400px" /></p> <p>A voltage step from 5V to 0V is applied to a series LCR circuit, and the voltage across the capacitor is recorded.</p> <p>The inductor used is a coil with around 125 mH of inductance, and 550 Ohms of coil resistance.</p> <p>If the response shows that it is under-damped, series resistance may be added to increase damping.</p> <h2 id="analysis">Analysis</h2> <p>Drag the blue region to select a portion of the graph, and click on the ‘Fit data’ button to fit it with a damped sine function</p> <h2 id="screenshot">Screenshot</h2> <p><img src="images/screenshots/astable-multivibrator.png" alt="" /></p> <h2 id="additional-reading">Additional reading</h2> <p><a href="http://www.electronics-tutorials.ws/waveforms/astable.html">Tutorial</a></p> </div> <script type="text/javascript"> var linkElement = document.createElement("link"); linkElement.rel = "stylesheet"; linkElement.href = "../css/leftnav.css"; document.head.appendChild(linkElement); function openNav() { document.getElementById("mySidenav").style.width = "250px"; document.getElementById("main").style.marginLeft = "250px"; document.getElementById("menubutton").style.visibility = "hidden"; } function closeNav() { document.getElementById("mySidenav").style.width = "0"; document.getElementById("main").style.marginLeft= "0"; document.getElementById("menubutton").style.visibility = "visible"; } </script> <div class="footer navbar-fixed-bottom" > <footer > <div class="container"> <ul> <li><a href="mailto:pslab-fossasia@google-groups.com">bug-reports</a></li> <li><a href="https://fossasia.org/pslab">fossasia.org/pslab</a></li> </ul> </div> </footer> </div> <!-- <script src="/js/jquery.js"></script> <script src="/js/bootstrap.min.js"></script> <script src="/js/jquery.prettyPhoto.js"></script> <script src="/js/jquery.isotope.min.js"></script> <script src="/js/main.js"></script> <script src="/js/wow.min.js"></script> --> </body> </html>
{'content_hash': '2206bb58d335e383e21a3799f2d3ed49', 'timestamp': '', 'source': 'github', 'line_count': 213, 'max_line_length': 144, 'avg_line_length': 31.788732394366196, 'alnum_prop': 0.6309260079751883, 'repo_name': 'viveksb007/pslab-android', 'id': '309493c1df8af6a4ab7bd189ba251cddc0629ec9', 'size': '6775', 'binary': False, 'copies': '2', 'ref': 'refs/heads/development', 'path': 'app/src/main/assets/DOC_HTML/apps/E_transientRLC.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '9478'}, {'name': 'HTML', 'bytes': '224171'}, {'name': 'Java', 'bytes': '1087915'}, {'name': 'Shell', 'bytes': '1614'}]}
from oslo_config import cfg from oslo_db.sqlalchemy import utils from oslo_log import log from cloudkitty import db from cloudkitty.storage_state import migration from cloudkitty.storage_state import models from cloudkitty import tzutils LOG = log.getLogger(__name__) CONF = cfg.CONF # NOTE(peschk_l): Required for defaults CONF.import_opt('backend', 'cloudkitty.fetcher', 'fetcher') CONF.import_opt('collector', 'cloudkitty.collector', 'collect') CONF.import_opt('scope_key', 'cloudkitty.collector', 'collect') class StateManager(object): """Class allowing state management in CloudKitty""" model = models.IdentifierState def get_all(self, identifier=None, fetcher=None, collector=None, scope_key=None, limit=100, offset=0): """Returns the state of all scopes. This function returns the state of all scopes with support for optional filters. :param identifier: optional scope identifiers to filter on :type identifier: list :param fetcher: optional scope fetchers to filter on :type fetcher: list :param collector: optional collectors to filter on :type collector: list :param fetcher: optional fetchers to filter on :type fetcher: list :param scope_key: optional scope_keys to filter on :type scope_key: list """ session = db.get_session() session.begin() q = utils.model_query(self.model, session) if identifier: q = q.filter(self.model.identifier.in_(identifier)) if fetcher: q = q.filter(self.model.fetcher.in_(fetcher)) if collector: q = q.filter(self.model.collector.in_(collector)) if scope_key: q = q.filter(self.model.scope_key.in_(scope_key)) q = q.offset(offset).limit(limit) r = q.all() session.close() for item in r: item.state = tzutils.utc_to_local(item.state) return r def _get_db_item(self, session, identifier, fetcher=None, collector=None, scope_key=None): fetcher = fetcher or CONF.fetcher.backend collector = collector or CONF.collect.collector scope_key = scope_key or CONF.collect.scope_key q = utils.model_query(self.model, session) r = q.filter(self.model.identifier == identifier). \ filter(self.model.scope_key == scope_key). \ filter(self.model.fetcher == fetcher). \ filter(self.model.collector == collector). \ first() # In case the identifier exists with empty columns, update them if not r: # NOTE(peschk_l): We must use == instead of 'is' because sqlalchemy # overloads this operator r = q.filter(self.model.identifier == identifier). \ filter(self.model.scope_key == None). \ filter(self.model.fetcher == None). \ filter(self.model.collector == None). \ first() # noqa if r: r.scope_key = scope_key r.collector = collector r.fetcher = fetcher LOG.info('Updating identifier "{i}" with scope_key "{sk}", ' 'collector "{c}" and fetcher "{f}"'.format( i=identifier, sk=scope_key, c=collector, f=fetcher)) session.commit() return r def set_state(self, identifier, state, fetcher=None, collector=None, scope_key=None): """Set the state of a scope. :param identifier: Identifier of the scope :type identifier: str :param state: state of the scope :type state: datetime.datetime :param fetcher: Fetcher associated to the scope :type fetcher: str :param collector: Collector associated to the scope :type collector: str :param scope_key: scope_key associated to the scope :type scope_key: str """ state = tzutils.local_to_utc(state, naive=True) session = db.get_session() session.begin() r = self._get_db_item( session, identifier, fetcher, collector, scope_key) if r: if r.state != state: r.state = state session.commit() else: state_object = self.model( identifier=identifier, state=state, fetcher=fetcher, collector=collector, scope_key=scope_key, ) session.add(state_object) session.commit() session.close() def get_state(self, identifier, fetcher=None, collector=None, scope_key=None): """Get the state of a scope. :param identifier: Identifier of the scope :type identifier: str :param fetcher: Fetcher associated to the scope :type fetcher: str :param collector: Collector associated to the scope :type collector: str :param scope_key: scope_key associated to the scope :type scope_key: str :rtype: datetime.datetime """ session = db.get_session() session.begin() r = self._get_db_item( session, identifier, fetcher, collector, scope_key) session.close() return tzutils.utc_to_local(r.state) if r else None def init(self): migration.upgrade('head') # This is made in order to stay compatible with legacy behavior but # shouldn't be used def get_tenants(self, begin=None, end=None): session = db.get_session() session.begin() q = utils.model_query(self.model, session) session.close() return [tenant.identifier for tenant in q]
{'content_hash': '4bf27aec6d1d9fd88cbf007e13dd297c', 'timestamp': '', 'source': 'github', 'line_count': 174, 'max_line_length': 79, 'avg_line_length': 34.48850574712644, 'alnum_prop': 0.5734044325945675, 'repo_name': 'stackforge/cloudkitty', 'id': 'c965aedf9e0d8fa9e3e49a82369cde7f46fb778b', 'size': '6633', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'cloudkitty/storage_state/__init__.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Mako', 'bytes': '1648'}, {'name': 'Python', 'bytes': '452298'}, {'name': 'Shell', 'bytes': '12116'}]}
import i18n from 'i18next'; import { batch } from 'react-redux'; // @ts-expect-error import UIEvents from '../../../../service/UI/UIEvents'; import { IStore } from '../../app/types'; import { approveParticipant } from '../../av-moderation/actions'; import { UPDATE_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes'; import { getBreakoutRooms } from '../../breakout-rooms/functions'; import { toggleE2EE } from '../../e2ee/actions'; import { MAX_MODE } from '../../e2ee/constants'; import { showNotification } from '../../notifications/actions'; import { LOCAL_RECORDING_NOTIFICATION_ID, NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants'; import { isForceMuted } from '../../participants-pane/functions'; import { CALLING, INVITED } from '../../presence-status/constants'; import { RAISE_HAND_SOUND_ID } from '../../reactions/constants'; import { RECORDING_OFF_SOUND_ID, RECORDING_ON_SOUND_ID } from '../../recording/constants'; import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes'; import { CONFERENCE_WILL_JOIN } from '../conference/actionTypes'; import { forEachConference, getCurrentConference } from '../conference/functions'; import { IJitsiConference } from '../conference/reducer'; import { SET_CONFIG } from '../config/actionTypes'; import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any'; import { JitsiConferenceEvents } from '../lib-jitsi-meet'; import { MEDIA_TYPE } from '../media/constants'; import MiddlewareRegistry from '../redux/MiddlewareRegistry'; import StateListenerRegistry from '../redux/StateListenerRegistry'; import { playSound, registerSound, unregisterSound } from '../sounds/actions'; import { DOMINANT_SPEAKER_CHANGED, GRANT_MODERATOR, KICK_PARTICIPANT, LOCAL_PARTICIPANT_AUDIO_LEVEL_CHANGED, LOCAL_PARTICIPANT_RAISE_HAND, MUTE_REMOTE_PARTICIPANT, OVERWRITE_PARTICIPANTS_NAMES, OVERWRITE_PARTICIPANT_NAME, PARTICIPANT_DISPLAY_NAME_CHANGED, PARTICIPANT_JOINED, PARTICIPANT_LEFT, PARTICIPANT_UPDATED, RAISE_HAND_UPDATED, SET_LOCAL_PARTICIPANT_RECORDING_STATUS } from './actionTypes'; import { localParticipantIdChanged, localParticipantJoined, localParticipantLeft, overwriteParticipantName, participantLeft, participantUpdated, raiseHand, raiseHandUpdateQueue, setLoadableAvatarUrl } from './actions'; import { LOCAL_PARTICIPANT_DEFAULT_ID, LOWER_HAND_AUDIO_LEVEL, PARTICIPANT_JOINED_SOUND_ID, PARTICIPANT_LEFT_SOUND_ID } from './constants'; import { getDominantSpeakerParticipant, getFirstLoadableAvatarUrl, getLocalParticipant, getParticipantById, getParticipantCount, getParticipantDisplayName, getRaiseHandsQueue, getRemoteParticipants, hasRaisedHand, isLocalParticipantModerator, isScreenShareParticipant, isWhiteboardParticipant } from './functions'; import logger from './logger'; import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds'; import { IJitsiParticipant } from './types'; import './subscriber'; /** * Middleware that captures CONFERENCE_JOINED and CONFERENCE_LEFT actions and * updates respectively ID of local participant. * * @param {Store} store - The redux store. * @returns {Function} */ MiddlewareRegistry.register(store => next => action => { switch (action.type) { case APP_WILL_MOUNT: _registerSounds(store); return _localParticipantJoined(store, next, action); case APP_WILL_UNMOUNT: _unregisterSounds(store); return _localParticipantLeft(store, next, action); case CONFERENCE_WILL_JOIN: store.dispatch(localParticipantIdChanged(action.conference.myUserId())); break; case DOMINANT_SPEAKER_CHANGED: { // Lower hand through xmpp when local participant becomes dominant speaker. const { id } = action.participant; const state = store.getState(); const participant = getLocalParticipant(state); const dominantSpeaker = getDominantSpeakerParticipant(state); const isLocal = participant && participant.id === id; if (isLocal && dominantSpeaker?.id !== id && hasRaisedHand(participant) && !getDisableRemoveRaisedHandOnFocus(state)) { store.dispatch(raiseHand(false)); } break; } case LOCAL_PARTICIPANT_AUDIO_LEVEL_CHANGED: { const state = store.getState(); const participant = getDominantSpeakerParticipant(state); if ( participant?.local && hasRaisedHand(participant) && action.level > LOWER_HAND_AUDIO_LEVEL && !getDisableRemoveRaisedHandOnFocus(state) ) { store.dispatch(raiseHand(false)); } break; } case GRANT_MODERATOR: { const { conference } = store.getState()['features/base/conference']; conference?.grantOwner(action.id); break; } case KICK_PARTICIPANT: { const { conference } = store.getState()['features/base/conference']; conference?.kickParticipant(action.id); break; } case LOCAL_PARTICIPANT_RAISE_HAND: { const { raisedHandTimestamp } = action; const localId = getLocalParticipant(store.getState())?.id; store.dispatch(participantUpdated({ // XXX Only the local participant is allowed to update without // stating the JitsiConference instance (i.e. participant property // `conference` for a remote participant) because the local // participant is uniquely identified by the very fact that there is // only one local participant. id: localId ?? '', local: true, raisedHandTimestamp })); store.dispatch(raiseHandUpdateQueue({ id: localId ?? '', raisedHandTimestamp })); if (typeof APP !== 'undefined') { APP.API.notifyRaiseHandUpdated(localId, raisedHandTimestamp); } break; } case SET_CONFIG: { const result = next(action); const state = store.getState(); const { deploymentInfo } = state['features/base/config']; // if there userRegion set let's use it for the local participant if (deploymentInfo?.userRegion) { const localId = getLocalParticipant(state)?.id; if (localId) { store.dispatch(participantUpdated({ id: localId, local: true, region: deploymentInfo.userRegion })); } } return result; } case SET_LOCAL_PARTICIPANT_RECORDING_STATUS: { const state = store.getState(); const { recording, onlySelf } = action; const localId = getLocalParticipant(state)?.id; const { localRecording } = state['features/base/config']; if (localRecording?.notifyAllParticipants && !onlySelf && localId) { store.dispatch(participantUpdated({ // XXX Only the local participant is allowed to update without // stating the JitsiConference instance (i.e. participant property // `conference` for a remote participant) because the local // participant is uniquely identified by the very fact that there is // only one local participant. id: localId, local: true, localRecording: recording })); } break; } case MUTE_REMOTE_PARTICIPANT: { const { conference } = store.getState()['features/base/conference']; conference?.muteParticipant(action.id, action.mediaType); break; } // TODO Remove this middleware when the local display name update flow is // fully brought into redux. case PARTICIPANT_DISPLAY_NAME_CHANGED: { if (typeof APP !== 'undefined') { const participant = getLocalParticipant(store.getState()); if (participant && participant.id === action.id) { APP.UI.emitEvent(UIEvents.NICKNAME_CHANGED, action.name); } } break; } case RAISE_HAND_UPDATED: { const { participant } = action; let queue = getRaiseHandsQueue(store.getState()); if (participant.raisedHandTimestamp) { queue.push({ id: participant.id, raisedHandTimestamp: participant.raisedHandTimestamp }); // sort the queue before adding to store. queue = queue.sort(({ raisedHandTimestamp: a }, { raisedHandTimestamp: b }) => a - b); } else { // no need to sort on remove value. queue = queue.filter(({ id }) => id !== participant.id); } action.queue = queue; break; } case PARTICIPANT_JOINED: { // Do not play sounds when a screenshare or whiteboard participant tile is created for screenshare. (!isScreenShareParticipant(action.participant) && !isWhiteboardParticipant(action.participant) ) && _maybePlaySounds(store, action); return _participantJoinedOrUpdated(store, next, action); } case PARTICIPANT_LEFT: { // Do not play sounds when a tile for screenshare or whiteboard is removed. (!isScreenShareParticipant(action.participant) && !isWhiteboardParticipant(action.participant) ) && _maybePlaySounds(store, action); break; } case PARTICIPANT_UPDATED: return _participantJoinedOrUpdated(store, next, action); case OVERWRITE_PARTICIPANTS_NAMES: { const { participantList } = action; if (!Array.isArray(participantList)) { logger.error('Overwrite names failed. Argument is not an array.'); return; } batch(() => { participantList.forEach(p => { store.dispatch(overwriteParticipantName(p.id, p.name)); }); }); break; } case OVERWRITE_PARTICIPANT_NAME: { const { dispatch, getState } = store; const state = getState(); const { id, name } = action; let breakoutRoom = false, identifier = id; if (id.indexOf('@') !== -1) { identifier = id.slice(id.indexOf('/') + 1); breakoutRoom = true; action.id = identifier; } if (breakoutRoom) { const rooms = getBreakoutRooms(state); const roomCounter = state['features/breakout-rooms'].roomCounter; const newRooms: any = {}; Object.entries(rooms).forEach(([ key, r ]) => { const participants = r?.participants || {}; const jid = Object.keys(participants).find(p => p.slice(p.indexOf('/') + 1) === identifier); if (jid) { newRooms[key] = { ...r, participants: { ...participants, [jid]: { ...participants[jid], displayName: name } } }; } else { newRooms[key] = r; } }); dispatch({ type: UPDATE_BREAKOUT_ROOMS, rooms, roomCounter, updatedNames: true }); } else { dispatch(participantUpdated({ id: identifier, name })); } break; } } return next(action); }); /** * Syncs the redux state features/base/participants up with the redux state * features/base/conference by ensuring that the former does not contain remote * participants no longer relevant to the latter. Introduced to address an issue * with multiplying thumbnails in the filmstrip. */ StateListenerRegistry.register( /* selector */ state => getCurrentConference(state), /* listener */ (conference, { dispatch, getState }) => { batch(() => { for (const [ id, p ] of getRemoteParticipants(getState())) { (!conference || p.conference !== conference) && dispatch(participantLeft(id, p.conference, { isReplaced: p.isReplaced })); } }); }); /** * Reset the ID of the local participant to * {@link LOCAL_PARTICIPANT_DEFAULT_ID}. Such a reset is deemed possible only if * the local participant and, respectively, her ID is not involved in a * conference which is still of interest to the user and, consequently, the app. * For example, a conference which is in the process of leaving is no longer of * interest the user, is unrecoverable from the perspective of the user and, * consequently, the app. */ StateListenerRegistry.register( /* selector */ state => state['features/base/conference'], /* listener */ ({ leaving }, { dispatch, getState }) => { const state = getState(); const localParticipant = getLocalParticipant(state); let id: string; if (!localParticipant || (id = localParticipant.id) === LOCAL_PARTICIPANT_DEFAULT_ID) { // The ID of the local participant has been reset already. return; } // The ID of the local may be reset only if it is not in use. const dispatchLocalParticipantIdChanged = forEachConference( state, conference => conference === leaving || conference.myUserId() !== id); dispatchLocalParticipantIdChanged && dispatch( localParticipantIdChanged(LOCAL_PARTICIPANT_DEFAULT_ID)); }); /** * Registers listeners for participant change events. */ StateListenerRegistry.register( state => state['features/base/conference'].conference, (conference, store) => { if (conference) { const propertyHandlers: { [key: string]: Function; } = { 'e2ee.enabled': (participant: IJitsiParticipant, value: string) => _e2eeUpdated(store, conference, participant.getId(), value), 'features_e2ee': (participant: IJitsiParticipant, value: boolean) => store.dispatch(participantUpdated({ conference, id: participant.getId(), e2eeSupported: value })), 'features_jigasi': (participant: IJitsiParticipant, value: boolean) => store.dispatch(participantUpdated({ conference, id: participant.getId(), isJigasi: value })), // eslint-disable-next-line @typescript-eslint/no-unused-vars 'features_screen-sharing': (participant: IJitsiParticipant, value: string) => store.dispatch(participantUpdated({ conference, id: participant.getId(), features: { 'screen-sharing': true } })), 'localRecording': (participant: IJitsiParticipant, value: string) => _localRecordingUpdated(store, conference, participant.getId(), value), 'raisedHand': (participant: IJitsiParticipant, value: string) => _raiseHandUpdated(store, conference, participant.getId(), value), 'region': (participant: IJitsiParticipant, value: string) => store.dispatch(participantUpdated({ conference, id: participant.getId(), region: value })), 'remoteControlSessionStatus': (participant: IJitsiParticipant, value: boolean) => store.dispatch(participantUpdated({ conference, id: participant.getId(), remoteControlSessionStatus: value })) }; // update properties for the participants that are already in the conference conference.getParticipants().forEach((participant: any) => { Object.keys(propertyHandlers).forEach(propertyName => { const value = participant.getProperty(propertyName); if (value !== undefined) { propertyHandlers[propertyName as keyof typeof propertyHandlers](participant, value); } }); }); // We joined a conference conference.on( JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED, (participant: IJitsiParticipant, propertyName: string, oldValue: string, newValue: string) => { if (propertyHandlers.hasOwnProperty(propertyName)) { propertyHandlers[propertyName](participant, newValue); } }); } else { const localParticipantId = getLocalParticipant(store.getState)?.id; // We left the conference, the local participant must be updated. _e2eeUpdated(store, conference, localParticipantId ?? '', false); _raiseHandUpdated(store, conference, localParticipantId ?? '', 0); } } ); /** * Handles a E2EE enabled status update. * * @param {Store} store - The redux store. * @param {Object} conference - The conference for which we got an update. * @param {string} participantId - The ID of the participant from which we got an update. * @param {boolean} newValue - The new value of the E2EE enabled status. * @returns {void} */ function _e2eeUpdated({ getState, dispatch }: IStore, conference: IJitsiConference, participantId: string, newValue: string | boolean) { const e2eeEnabled = newValue === 'true'; const { e2ee = {} } = getState()['features/base/config']; dispatch(participantUpdated({ conference, id: participantId, e2eeEnabled })); if (e2ee.externallyManagedKey) { return; } const { maxMode } = getState()['features/e2ee'] || {}; if (maxMode !== MAX_MODE.THRESHOLD_EXCEEDED || !e2eeEnabled) { dispatch(toggleE2EE(e2eeEnabled)); } } /** * Initializes the local participant and signals that it joined. * * @private * @param {Store} store - The redux store. * @param {Dispatch} next - The redux dispatch function to dispatch the * specified action to the specified store. * @param {Action} action - The redux action which is being dispatched * in the specified store. * @private * @returns {Object} The value returned by {@code next(action)}. */ function _localParticipantJoined({ getState, dispatch }: IStore, next: Function, action: any) { const result = next(action); const settings = getState()['features/base/settings']; // @ts-ignore dispatch(localParticipantJoined({ avatarURL: settings.avatarURL, email: settings.email, name: settings.displayName })); return result; } /** * Signals that the local participant has left. * * @param {Store} store - The redux store. * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the * specified {@code action} into the specified {@code store}. * @param {Action} action - The redux action which is being dispatched in the * specified {@code store}. * @private * @returns {Object} The value returned by {@code next(action)}. */ function _localParticipantLeft({ dispatch }: IStore, next: Function, action: any) { const result = next(action); dispatch(localParticipantLeft()); return result; } /** * Plays sounds when participants join/leave conference. * * @param {Store} store - The redux store. * @param {Action} action - The redux action. Should be either * {@link PARTICIPANT_JOINED} or {@link PARTICIPANT_LEFT}. * @private * @returns {void} */ function _maybePlaySounds({ getState, dispatch }: IStore, action: any) { const state = getState(); const { startAudioMuted } = state['features/base/config']; const { soundsParticipantJoined: joinSound, soundsParticipantLeft: leftSound } = state['features/base/settings']; // We're not playing sounds for local participant // nor when the user is joining past the "startAudioMuted" limit. // The intention there was to not play user joined notification in big // conferences where 100th person is joining. if (!action.participant.local && (!startAudioMuted || getParticipantCount(state) < startAudioMuted)) { const { isReplacing, isReplaced } = action.participant; if (action.type === PARTICIPANT_JOINED) { if (!joinSound) { return; } const { presence } = action.participant; // The sounds for the poltergeist are handled by features/invite. if (presence !== INVITED && presence !== CALLING && !isReplacing) { dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID)); } } else if (action.type === PARTICIPANT_LEFT && !isReplaced && leftSound) { dispatch(playSound(PARTICIPANT_LEFT_SOUND_ID)); } } } /** * Notifies the feature base/participants that the action * {@code PARTICIPANT_JOINED} or {@code PARTICIPANT_UPDATED} is being dispatched * within a specific redux store. * * @param {Store} store - The redux store in which the specified {@code action} * is being dispatched. * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the * specified {@code action} in the specified {@code store}. * @param {Action} action - The redux action {@code PARTICIPANT_JOINED} or * {@code PARTICIPANT_UPDATED} which is being dispatched in the specified * {@code store}. * @private * @returns {Object} The value returned by {@code next(action)}. */ function _participantJoinedOrUpdated(store: IStore, next: Function, action: any) { const { dispatch, getState } = store; const { overwrittenNameList } = store.getState()['features/base/participants']; const { participant: { avatarURL, email, id, local, localRecording, name, raisedHandTimestamp } } = action; // Send an external update of the local participant's raised hand state // if a new raised hand state is defined in the action. if (typeof raisedHandTimestamp !== 'undefined') { if (local) { const { conference } = getState()['features/base/conference']; const rHand = parseInt(raisedHandTimestamp, 10); // Send raisedHand signalling only if there is a change if (conference && rHand !== getLocalParticipant(getState())?.raisedHandTimestamp) { conference.setLocalParticipantProperty('raisedHand', rHand); } } } if (overwrittenNameList[id]) { action.participant.name = overwrittenNameList[id]; } // Send an external update of the local participant's local recording state // if a new local recording state is defined in the action. if (typeof localRecording !== 'undefined') { if (local) { const conference = getCurrentConference(getState); // Send localRecording signalling only if there is a change if (conference && localRecording !== getLocalParticipant(getState())?.localRecording) { conference.setLocalParticipantProperty('localRecording', localRecording); } } } // Allow the redux update to go through and compare the old avatar // to the new avatar and emit out change events if necessary. const result = next(action); // Only run this if the config is populated, otherwise we preload external resources // even if disableThirdPartyRequests is set to true in config if (Object.keys(getState()['features/base/config']).length) { const { disableThirdPartyRequests } = getState()['features/base/config']; if (!disableThirdPartyRequests && (avatarURL || email || id || name)) { const participantId = !id && local ? getLocalParticipant(getState())?.id : id; const updatedParticipant = getParticipantById(getState(), participantId); getFirstLoadableAvatarUrl(updatedParticipant ?? { id: '' }, store) .then((urlData?: { isUsingCORS: boolean; src: string; }) => { dispatch(setLoadableAvatarUrl(participantId, urlData?.src ?? '', Boolean(urlData?.isUsingCORS))); }); } } // Notify external listeners of potential avatarURL changes. if (typeof APP === 'object') { const currentKnownId = local ? APP.conference.getMyUserId() : id; // Force update of local video getting a new id. APP.UI.refreshAvatarDisplay(currentKnownId); } return result; } /** * Handles a local recording status update. * * @param {Function} dispatch - The Redux dispatch function. * @param {Object} conference - The conference for which we got an update. * @param {string} participantId - The ID of the participant from which we got an update. * @param {boolean} newValue - The new value of the local recording status. * @returns {void} */ function _localRecordingUpdated({ dispatch, getState }: IStore, conference: IJitsiConference, participantId: string, newValue: string) { const state = getState(); dispatch(participantUpdated({ conference, id: participantId, localRecording: newValue })); const participantName = getParticipantDisplayName(state, participantId); dispatch(showNotification({ titleKey: 'notify.somebody', title: participantName, descriptionKey: newValue ? 'notify.localRecordingStarted' : 'notify.localRecordingStopped', uid: LOCAL_RECORDING_NOTIFICATION_ID }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM)); dispatch(playSound(newValue ? RECORDING_ON_SOUND_ID : RECORDING_OFF_SOUND_ID)); } /** * Handles a raise hand status update. * * @param {Function} dispatch - The Redux dispatch function. * @param {Object} conference - The conference for which we got an update. * @param {string} participantId - The ID of the participant from which we got an update. * @param {boolean} newValue - The new value of the raise hand status. * @returns {void} */ function _raiseHandUpdated({ dispatch, getState }: IStore, conference: IJitsiConference, participantId: string, newValue: string | number) { let raisedHandTimestamp; switch (newValue) { case undefined: case 'false': raisedHandTimestamp = 0; break; case 'true': raisedHandTimestamp = Date.now(); break; default: raisedHandTimestamp = parseInt(`${newValue}`, 10); } const state = getState(); dispatch(participantUpdated({ conference, id: participantId, raisedHandTimestamp })); dispatch(raiseHandUpdateQueue({ id: participantId, raisedHandTimestamp })); if (typeof APP !== 'undefined') { APP.API.notifyRaiseHandUpdated(participantId, raisedHandTimestamp); } const isModerator = isLocalParticipantModerator(state); const participant = getParticipantById(state, participantId); let shouldDisplayAllowAction = false; if (isModerator) { shouldDisplayAllowAction = isForceMuted(participant, MEDIA_TYPE.AUDIO, state) || isForceMuted(participant, MEDIA_TYPE.VIDEO, state); } const action = shouldDisplayAllowAction ? { customActionNameKey: [ 'notify.allowAction' ], customActionHandler: [ () => dispatch(approveParticipant(participantId)) ] } : {}; if (raisedHandTimestamp) { let notificationTitle; const participantName = getParticipantDisplayName(state, participantId); const { raisedHandsQueue } = state['features/base/participants']; if (raisedHandsQueue.length > 1) { const raisedHands = raisedHandsQueue.length - 1; notificationTitle = i18n.t('notify.raisedHands', { participantName, raisedHands }); } else { notificationTitle = participantName; } dispatch(showNotification({ titleKey: 'notify.somebody', title: notificationTitle, descriptionKey: 'notify.raisedHand', concatText: true, uid: RAISE_HAND_NOTIFICATION_ID, ...action }, shouldDisplayAllowAction ? NOTIFICATION_TIMEOUT_TYPE.MEDIUM : NOTIFICATION_TIMEOUT_TYPE.SHORT)); dispatch(playSound(RAISE_HAND_SOUND_ID)); } } /** * Registers sounds related with the participants feature. * * @param {Store} store - The redux store. * @private * @returns {void} */ function _registerSounds({ dispatch }: IStore) { dispatch( registerSound(PARTICIPANT_JOINED_SOUND_ID, PARTICIPANT_JOINED_FILE)); dispatch(registerSound(PARTICIPANT_LEFT_SOUND_ID, PARTICIPANT_LEFT_FILE)); } /** * Unregisters sounds related with the participants feature. * * @param {Store} store - The redux store. * @private * @returns {void} */ function _unregisterSounds({ dispatch }: IStore) { dispatch(unregisterSound(PARTICIPANT_JOINED_SOUND_ID)); dispatch(unregisterSound(PARTICIPANT_LEFT_SOUND_ID)); }
{'content_hash': '55d62f8486be6e2c19acaa802ffc0feb', 'timestamp': '', 'source': 'github', 'line_count': 840, 'max_line_length': 117, 'avg_line_length': 35.675, 'alnum_prop': 0.6123736109720693, 'repo_name': 'jitsi/jitsi-meet', 'id': 'f2ea7043474ea6be60f785968197d33469c36b49', 'size': '29967', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'react/features/base/participants/middleware.ts', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '829'}, {'name': 'HTML', 'bytes': '20408'}, {'name': 'Java', 'bytes': '232895'}, {'name': 'JavaScript', 'bytes': '2550511'}, {'name': 'Lua', 'bytes': '301404'}, {'name': 'Makefile', 'bytes': '4160'}, {'name': 'Objective-C', 'bytes': '154389'}, {'name': 'Ruby', 'bytes': '7816'}, {'name': 'SCSS', 'bytes': '152946'}, {'name': 'Shell', 'bytes': '36422'}, {'name': 'Starlark', 'bytes': '152'}, {'name': 'Swift', 'bytes': '50411'}, {'name': 'TypeScript', 'bytes': '2866536'}]}
using EmailValidationConverter.WinPhone.Resources; namespace EmailValidationConverter.WinPhone { /// <summary> /// Provides access to string resources. /// </summary> public class LocalizedStrings { private static AppResources _localizedResources = new AppResources(); public AppResources LocalizedResources { get { return _localizedResources; } } } }
{'content_hash': '0399c435ffa975082ae551fdfed697d2', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 86, 'avg_line_length': 28.214285714285715, 'alnum_prop': 0.7088607594936709, 'repo_name': 'Teness/xamarin-forms-book-preview-2', 'id': '62b01bfee8d1ffc7edd8e6dc46c1ce93b4a3ea60', 'size': '397', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'Chapter23/EmailValidationConv/EmailValidationConverter/EmailValidationConverter.WinPhone/LocalizedStrings.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '7812203'}]}
<?xml version="1.0" ?> <!DOCTYPE catalog PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <!-- The directory DTD and stylesheet files are installed under --> <group xml:base="file:///usr/share/sgml/docbook/" > <!-- Resolve DTD URL system ID to local file --> <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.2/" rewritePrefix="xml-dtd-4.2-1.0-17/" /> <!-- Resolve stylesheet URL to local file --> <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="xsl-stylesheets/" /> <!-- Resolve DTD PUBLIC identifiers --> <nextCatalog catalog="xml-dtd-4.2-1.0-17/catalog.xml" /> <!-- To resolve simple DTD SYSTEM identifiers. --> <!-- Note: this does not work with Java resolver --> <!-- classes in Saxon or Xalan --> <system systemId="docbook.dtd" uri="xml-dtd-4.2-1.0-17/docbookx.dtd" /> <!-- To resolve short stylesheet references --> <uri name="docbook_html.xsl" uri="xsl-stylesheets/xhtml/docbook.xsl" /> <uri name="docbook_chunk.xsl" uri="xsl-stylesheets/xhtml/chunk.xsl" /> <uri name="docbook_fo.xsl" uri="xsl-stylesheets/fo/docbook.xsl" /> </group> </catalog>
{'content_hash': '978f843db394f0315583d8390e528de2', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 76, 'avg_line_length': 33.74418604651163, 'alnum_prop': 0.6264645072363887, 'repo_name': 'sshirokov/CLSQL', 'id': '3b2d92fa859bd2aca034aad16d93ce6809a5e135', 'size': '1451', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'doc/catalog-redhat.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '9068'}, {'name': 'C++', 'bytes': '326'}, {'name': 'Common Lisp', 'bytes': '1138749'}, {'name': 'Shell', 'bytes': '2491'}]}
<?php /* Safe sample input : get the field userData from the variable $_GET via an object sanitize : cast in float construction : use of sprintf via a %d with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ class Input{ private $input; public function getInput(){ return $this->input; } public function __construct(){ $this->input = $_GET['UserData'] ; } } $temp = new Input(); $tainted = $temp->getInput(); $tainted = (float) $tainted ; $var = include(sprintf("pages/'%d'.php", $tainted)); ?>
{'content_hash': '77e9e071ff0eb9e4de02d6fa612268cd', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 75, 'avg_line_length': 21.21212121212121, 'alnum_prop': 0.7435714285714285, 'repo_name': 'stivalet/PHP-Vulnerability-test-suite', 'id': 'f3c5ddb368f91a9f741880ab41c926210f37a19b', 'size': '1400', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Injection/CWE_98/safe/CWE_98__object-classicGet__CAST-cast_float__include_file_id-sprintf_%d_simple_quote.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '64184004'}]}
<?php namespace Akeneo\Bundle\BatchBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; class PushBatchLogHandlerPass implements CompilerPassInterface { /** * {@inheritdoc} */ public function process(ContainerBuilder $container) { if (!$container->has('monolog.logger.batch')) { return; } $container ->getDefinition('monolog.logger.batch') ->addMethodCall('pushHandler', array(new Reference('akeneo_batch.logger.batch_log_handler'))); } }
{'content_hash': '764d1b1c92a8b41343d52642c70acb2f', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 106, 'avg_line_length': 28.04, 'alnum_prop': 0.7075606276747504, 'repo_name': 'rseliberty/BatchBundle', 'id': 'e29939d9060c156e4e8b85cae2153c0407a1273b', 'size': '926', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'DependencyInjection/Compiler/PushBatchLogHandlerPass.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '1073'}, {'name': 'PHP', 'bytes': '307045'}]}
title: "Aloha ReactJS, pakai Javascript Framework supaya bisa lebih kenal sama Vanilla JS :D" date: "2015-11-23" image: "./featured.jpg" --- Ada yang udah baca tulisannya om Paul Lewis tentang ‘The Cost of Framework’? Cukup banyak orang-orang yang sangat jago yang ngerespon artikel tersebut, silahkan gugling aja artikelnya :D. Om Paul membandingkan performa beberapa framework javascript dengan vanillajs. Ya, lagi-lagi tentang perbandingan framework. Dunia front end emang cukup banyak framework, release nya pun cukup cepat. Bagi gue, yang mau mulai belajar javascript jadi agak bingung mau memulai dengan framework yang mana. Sebetulnya sama aja kaya gue sekarang mengapa menghindari pakai Framework Twitter Bootstrap untuk pembuatan web, padahal banyak yang make. Tapi bagi gue, Bootstrap itu ukuran css nya cukup besar karena elemennya yang hampir komplit. Tapi gak semua elemen bakalan dipake juga. Ribet struktur htmlnya. Untuk grid nya gak fleksibel, coba buat 5 atau 7 kolom sama panjang pake Bootstrap. Bisa sih, tapi aneh. Slider? Duh, banyak yang lebih bagus. Pusing deh intinya pake bootstrap menurut gue. Bagi gue sekarang, gak perlu lagi elemen-elemen dari framework enakan buat sendiri, jadi tau mana elemen yang bakalan dibutuhin. Karena mungkin gue udah ngerti gimana cara buat elemen-elemen tersebut. Jadi bisa nentuin mana elemen yang dipake mana yang enggak. Ukuran file css pun jadi ramping. Seenggaknya mengurangi jatah ‘**Unused CSS**‘. Tapi, gue menghindari Bootsrap bukan berarti gue bilang Bootstrap itu jelek. Bootstrap bagus untuk mereka yang mau cepat proses pembuatan webnya, misalnya mau pake elemen button tinggal panggil aja elemennya, mau ubah bentuk tinggal edit sedikit aja. Bentuk dasarnya udah ada. Apalagi untuk programmer yang gak begitu dalemin css, Bootstrap ngebantu banget nyelesein proyek mereka. Dulu juga awalnya gue pakai bootstrap sebelum gue dalemin CSS, gue belajar dari framework gimana cara buat elemen. Gimana caranya menulis dengan rapih. Dan sebagainya sampai gue ngerasa gue lebih asik buat elemen sendiri daripada ubah sedikit elemen dari framework. Mungkin yang udah jago agak aneh ngeliat/pake framework. Tapi framework bagus untuk langkah awal belajar. Dan bisa jadi pakai framework malah buat lu jadi lebih produktif. Dari hal ini gue juga mempraktekan hal yang sama untuk proses belajar Vanilla Javascript. Gue memulai dengan menggunakan Framework ReactJS. Untuk pemula, ReactJS ini cukup sulit dimengerti. Mesti sabar. Seenggaknya sedikit-sedikit gue jadi mengerti apa itu ES6 dan udah mulai bisa baca syntaxnya. Walaupun tetep lebih ngerti ES5\. Sebelumnya, sama sekali gak tau apa itu ES5/ES6. Eniwei, ini rangkuman stuff (router, filtering and sorting table, infinite load) yang gue implementasi selama di Beritagar, yang mau liat rangkuman awal gue belajar ReactJS bisa liat [di github gue](https://github.com/preschian/aloha-react). Untuk proses development sekarang udah pindah haluan pakai Gulpjs yang sebelumnya pakai Gruntjs. Untuk code editor juga pindah haluan sekarang pakai Atom, klo sebelumnya pakai Sublime. Gara-gara ReactJS sih gue jadi pindah ke Atom, plugin untuk ngoding ReactJS lebih asik di Atom. Nah, tapi untuk development ReactJS ini gue belum nemu ‘*setup*‘ yang cocok pakai Gulp, compilenya masih lama klo pake Gulp. Jadi, sementara ini gue compile JSX-nya langsung dari ‘npm run’ tanpa pake Gulp dulu. Mungkin kalian ada yang mau nyobain ReactJS juga artikel ini cukup membantu untuk memahami alur ReactJS-nya [Execution sequence of a React component’s lifecycle methods](https://javascript.tutorialhorizon.com/2014/09/13/execution-sequence-of-a-react-components-lifecycle-methods/).
{'content_hash': 'fc934a58df4285574dd3f39ca4eb062b', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 173, 'avg_line_length': 85.69767441860465, 'alnum_prop': 0.8157394843962008, 'repo_name': 'preschian/preschian-com', 'id': '7cd9753ad9fbf7d6265b7eedc774846d2e211ae4', 'size': '3707', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'post/2015-11-23/aloha-reactjs-pakai-javascript-framework-supaya-bisa-lebih-kenal-sama-vanilla-js-d.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '12906'}]}
'use strict';var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var messaging_api_1 = require('angular2/src/web_workers/shared/messaging_api'); var async_1 = require('angular2/src/core/facade/async'); var message_bus_1 = require('angular2/src/web_workers/shared/message_bus'); var anchor_based_app_root_url_1 = require('angular2/src/core/compiler/anchor_based_app_root_url'); var lang_1 = require('angular2/src/core/facade/lang'); var di_1 = require('angular2/src/core/di'); var WebWorkerSetup = (function () { function WebWorkerSetup(_bus, anchorBasedAppRootUrl) { this._bus = _bus; this.rootUrl = anchorBasedAppRootUrl.value; } WebWorkerSetup.prototype.start = function () { var _this = this; this._bus.initChannel(messaging_api_1.SETUP_CHANNEL, false); var sink = this._bus.to(messaging_api_1.SETUP_CHANNEL); var source = this._bus.from(messaging_api_1.SETUP_CHANNEL); async_1.ObservableWrapper.subscribe(source, function (message) { if (lang_1.StringWrapper.equals(message, "ready")) { async_1.ObservableWrapper.callNext(sink, { "rootUrl": _this.rootUrl }); } }); }; WebWorkerSetup = __decorate([ di_1.Injectable(), __metadata('design:paramtypes', [message_bus_1.MessageBus, anchor_based_app_root_url_1.AnchorBasedAppRootUrl]) ], WebWorkerSetup); return WebWorkerSetup; })(); exports.WebWorkerSetup = WebWorkerSetup; //# sourceMappingURL=setup.js.map
{'content_hash': '5931b2d663b61bf0956ef662de1ce81e', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 134, 'avg_line_length': 54.09756097560975, 'alnum_prop': 0.6550946798917944, 'repo_name': 'iproduct/low-latency-high-throughput', 'id': '553a8db7c65124c00358bf81e8dbe69d996b7b2e', 'size': '2218', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'IPT_Reactor_Demo_JUG_Wishes_1_0/src/main/webapp/node_modules/angular2/src/web_workers/ui/setup.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2446'}, {'name': 'HTML', 'bytes': '3499'}, {'name': 'Java', 'bytes': '425345'}, {'name': 'JavaScript', 'bytes': '154699'}, {'name': 'TypeScript', 'bytes': '8674'}]}
package org.apache.jackrabbit.core.query.lucene; import java.math.BigDecimal; import java.net.URI; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Set; import java.util.concurrent.Executor; import javax.jcr.NamespaceException; import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import org.apache.jackrabbit.core.id.NodeId; import org.apache.jackrabbit.core.id.PropertyId; import org.apache.jackrabbit.core.state.ChildNodeEntry; import org.apache.jackrabbit.core.state.ItemStateException; import org.apache.jackrabbit.core.state.ItemStateManager; import org.apache.jackrabbit.core.state.NoSuchItemStateException; import org.apache.jackrabbit.core.state.NodeState; import org.apache.jackrabbit.core.state.PropertyState; import org.apache.jackrabbit.core.value.InternalValue; import org.apache.jackrabbit.spi.Name; import org.apache.jackrabbit.spi.Path; import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver; import org.apache.jackrabbit.spi.commons.name.NameConstants; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Fieldable; import org.apache.lucene.index.FieldInfo; import org.apache.tika.metadata.Metadata; import org.apache.tika.mime.MediaType; import org.apache.tika.parser.ParseContext; import org.apache.tika.parser.Parser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Creates a lucene <code>Document</code> object from a {@link javax.jcr.Node}. */ public class NodeIndexer { /** * The logger instance for this class. */ private static final Logger log = LoggerFactory.getLogger(NodeIndexer.class); /** * The default boost for a lucene field: 1.0f. */ protected static final float DEFAULT_BOOST = IndexingConfiguration.DEFAULT_BOOST; /** * The <code>NodeState</code> of the node to index */ protected final NodeState node; /** * The persistent item state provider */ protected final ItemStateManager stateProvider; /** * Namespace mappings to use for indexing. This is the internal * namespace mapping. */ protected final NamespaceMappings mappings; /** * Name and Path resolver. */ protected final NamePathResolver resolver; /** * Background task executor used for full text extraction. */ private final Executor executor; /** * Parser used for extracting text content from binary properties * for full text indexing. */ private final Parser parser; /** * The media types supported by the parser used. */ private Set<MediaType> supportedMediaTypes; /** * The indexing configuration or <code>null</code> if none is available. */ protected IndexingConfiguration indexingConfig; /** * If set to <code>true</code> the fulltext field is stored and and a term * vector is created with offset information. */ protected boolean supportHighlighting = false; /** * Indicates index format for this node indexer. */ protected IndexFormatVersion indexFormatVersion = IndexFormatVersion.V1; /** * List of {@link FieldNames#FULLTEXT} fields which should not be used in * an excerpt. */ protected List<Fieldable> doNotUseInExcerpt = new ArrayList<Fieldable>(); /** * The maximum number of characters to extract from binaries. */ private int maxExtractLength = Integer.MAX_VALUE; /** * Creates a new node indexer. * * @param node the node state to index. * @param stateProvider the persistent item state manager to retrieve properties. * @param mappings internal namespace mappings. * @param executor background task executor for text extraction * @param parser parser for binary properties */ public NodeIndexer( NodeState node, ItemStateManager stateProvider, NamespaceMappings mappings, Executor executor, Parser parser) { this.node = node; this.stateProvider = stateProvider; this.mappings = mappings; this.resolver = NamePathResolverImpl.create(mappings); this.executor = executor; this.parser = parser; } /** * Returns the <code>NodeId</code> of the indexed node. * @return the <code>NodeId</code> of the indexed node. */ public NodeId getNodeId() { return node.getNodeId(); } /** * If set to <code>true</code> additional information is stored in the index * to support highlighting using the rep:excerpt pseudo property. * * @param b <code>true</code> to enable highlighting support. */ public void setSupportHighlighting(boolean b) { supportHighlighting = b; } /** * Sets the index format version * * @param indexFormatVersion the index format version */ public void setIndexFormatVersion(IndexFormatVersion indexFormatVersion) { this.indexFormatVersion = indexFormatVersion; } /** * Sets the indexing configuration for this node indexer. * * @param config the indexing configuration. */ public void setIndexingConfiguration(IndexingConfiguration config) { this.indexingConfig = config; } /** * Returns the maximum number of characters to extract from binaries. * * @return maximum extraction length */ public int getMaxExtractLength() { return maxExtractLength; } /** * Sets the maximum number of characters to extract from binaries. * * @param length maximum extraction length */ public void setMaxExtractLength(int length) { this.maxExtractLength = length; } /** * Creates a lucene Document. * * @return the lucene Document with the index layout. * @throws RepositoryException if an error occurs while reading property * values from the <code>ItemStateProvider</code>. */ public Document createDoc() throws RepositoryException { doNotUseInExcerpt.clear(); Document doc = new Document(); doc.setBoost(getNodeBoost()); // special fields // UUID doc.add(new IDField(node.getNodeId())); try { // parent UUID if (node.getParentId() == null) { // root node Field parent = new Field(FieldNames.PARENT, false, "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO); parent.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY); doc.add(parent); addNodeName(doc, "", ""); } else if (node.getSharedSet().isEmpty()) { addParentChildRelation(doc, node.getParentId()); } else { // shareable node for (NodeId id : node.getSharedSet()) { addParentChildRelation(doc, id); } // mark shareable nodes doc.add(new Field(FieldNames.SHAREABLE_NODE, false, "", Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } } catch (NoSuchItemStateException e) { throwRepositoryException(e); } catch (ItemStateException e) { throwRepositoryException(e); } catch (NamespaceException e) { // will never happen, because this.mappings will dynamically add // unknown uri<->prefix mappings } Set<Name> props = node.getPropertyNames(); for (Name propName : props) { if (isIndexed(propName)) { PropertyId id = new PropertyId(node.getNodeId(), propName); try { PropertyState propState = (PropertyState) stateProvider.getItemState(id); // add each property to the _PROPERTIES_SET for searching // beginning with V2 if (indexFormatVersion.getVersion() >= IndexFormatVersion.V2.getVersion()) { addPropertyName(doc, propState.getName()); } InternalValue[] values = propState.getValues(); for (InternalValue value : values) { addValue(doc, value, propState.getName()); } if (values.length > 1) { // real multi-valued addMVPName(doc, propState.getName()); } } catch (NoSuchItemStateException e) { throwRepositoryException(e); } catch (ItemStateException e) { throwRepositoryException(e); } } } // now add fields that are not used in excerpt (must go at the end) for (Fieldable field : doNotUseInExcerpt) { doc.add(field); } return doc; } /** * Wraps the exception <code>e</code> into a <code>RepositoryException</code> * and throws the created exception. * * @param e the base exception. */ protected void throwRepositoryException(Exception e) throws RepositoryException { String msg = "Error while indexing node: " + node.getNodeId() + " of " + "type: " + node.getNodeTypeName(); throw new RepositoryException(msg, e); } /** * Adds a {@link FieldNames#MVP} field to <code>doc</code> with the resolved * <code>name</code> using the internal search index namespace mapping. * * @param doc the lucene document. * @param name the name of the multi-value property. */ protected void addMVPName(Document doc, Name name) { try { String propName = resolver.getJCRName(name); doc.add(new Field(FieldNames.MVP, false, propName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } catch (NamespaceException e) { // will never happen, prefixes are created dynamically } } /** * Adds a value to the lucene Document. * * @param doc the document. * @param value the internal jackrabbit value. * @param name the name of the property. */ protected void addValue(Document doc, InternalValue value, Name name) throws RepositoryException { String fieldName = name.getLocalName(); try { fieldName = resolver.getJCRName(name); } catch (NamespaceException e) { // will never happen } switch (value.getType()) { case PropertyType.BINARY: addBinaryValue(doc, fieldName, value); break; case PropertyType.BOOLEAN: addBooleanValue(doc, fieldName, value.getBoolean()); break; case PropertyType.DATE: addCalendarValue(doc, fieldName, value.getDate()); break; case PropertyType.DOUBLE: addDoubleValue(doc, fieldName, value.getDouble()); break; case PropertyType.LONG: addLongValue(doc, fieldName, value.getLong()); break; case PropertyType.REFERENCE: addReferenceValue(doc, fieldName, value.getNodeId(), false); break; case PropertyType.WEAKREFERENCE: addReferenceValue(doc, fieldName, value.getNodeId(), true); break; case PropertyType.PATH: addPathValue(doc, fieldName, value.getPath()); break; case PropertyType.URI: addURIValue(doc, fieldName, value.getURI()); break; case PropertyType.STRING: // never fulltext index jcr:uuid String if (name.equals(NameConstants.JCR_UUID)) { addStringValue(doc, fieldName, value.getString(), false, false, DEFAULT_BOOST, true); } else { addStringValue(doc, fieldName, value.getString(), true, isIncludedInNodeIndex(name), getPropertyBoost(name), useInExcerpt(name)); } break; case PropertyType.NAME: addNameValue(doc, fieldName, value.getName()); break; case PropertyType.DECIMAL: addDecimalValue(doc, fieldName, value.getDecimal()); break; default: throw new IllegalArgumentException("illegal internal value type: " + value.getType()); } addValueProperty(doc, value, name, fieldName); } /** * Adds a property related value to the lucene Document. <br> * * Like <code>length</code> for indexed fields. * * @param doc * the document. * @param value * the internal jackrabbit value. * @param name * the name of the property. */ protected void addValueProperty(Document doc, InternalValue value, Name name, String fieldName) throws RepositoryException { // add length if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion()) { addLength(doc, fieldName, value); } } /** * Adds the property name to the lucene _:PROPERTIES_SET field. * * @param doc the document. * @param name the name of the property. */ protected void addPropertyName(Document doc, Name name) { String fieldName = name.getLocalName(); try { fieldName = resolver.getJCRName(name); } catch (NamespaceException e) { // will never happen } doc.add(new Field(FieldNames.PROPERTIES_SET, false, fieldName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } /** * Adds the binary value to the document as the named field. * <p> * This implementation checks if this {@link #node} is of type nt:resource * and if that is the case, tries to extract text from the binary property * using the {@link #parser}. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addBinaryValue(Document doc, String fieldName, InternalValue internalValue) { // 'check' if node is of type nt:resource try { String jcrData = mappings.getPrefix(Name.NS_JCR_URI) + ":data"; if (!jcrData.equals(fieldName)) { // don't know how to index return; } InternalValue type = getValue(NameConstants.JCR_MIMETYPE); if (type != null && isSupportedMediaType(type.getString())) { Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, type.getString()); // jcr:encoding is not mandatory InternalValue encoding = getValue(NameConstants.JCR_ENCODING); if (encoding != null) { metadata.set( Metadata.CONTENT_ENCODING, encoding.getString()); } doc.add(createFulltextField(internalValue, metadata, false)); } } catch (Throwable t) { // TODO: How to recover from a transient indexing failure? log.warn("Exception while indexing binary property", t); } } /** * Utility method that extracts the first value of the named property * of the current node. Returns <code>null</code> if the property does * not exist or contains no values. * * @param name property name * @return value of the named property, or <code>null</code> * @throws ItemStateException if the property can not be accessed */ protected InternalValue getValue(Name name) throws ItemStateException { try { PropertyId id = new PropertyId(node.getNodeId(), name); PropertyState property = (PropertyState) stateProvider.getItemState(id); InternalValue[] values = property.getValues(); if (values.length > 0) { return values[0]; } else { return null; } } catch (NoSuchItemStateException e) { return null; } } /** * Adds the string representation of the boolean value to the document as * the named field. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addBooleanValue(Document doc, String fieldName, Object internalValue) { doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.BOOLEAN)); } /** * Creates a field of name <code>fieldName</code> with the value of <code> * internalValue</code>. The created field is indexed without norms. * * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. * @param propertyType the property type. */ protected Field createFieldWithoutNorms(String fieldName, String internalValue, int propertyType) { if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion()) { Field field = new Field(FieldNames.PROPERTIES, new SingletonTokenStream( FieldNames.createNamedValue(fieldName, internalValue), propertyType) ); field.setOmitNorms(true); return field; } else { return new Field(FieldNames.PROPERTIES, false, FieldNames.createNamedValue(fieldName, internalValue), Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO); } } /** * Adds the calendar value to the document as the named field. The calendar * value is converted to an indexable string value using the * {@link DateField} class. * * @param doc * The document to which to add the field * @param fieldName * The name of the field to add * @param internalValue * The value for the field to add to the document. */ protected void addCalendarValue(Document doc, String fieldName, Calendar internalValue) { try { doc.add(createFieldWithoutNorms(fieldName, DateField.timeToString(internalValue.getTimeInMillis()), PropertyType.DATE)); } catch (IllegalArgumentException e) { log.warn("'{}' is outside of supported date value range.", internalValue); } } /** * Adds the double value to the document as the named field. The double * value is converted to an indexable string value using the * {@link DoubleField} class. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addDoubleValue(Document doc, String fieldName, double internalValue) { doc.add(createFieldWithoutNorms(fieldName, DoubleField.doubleToString(internalValue), PropertyType.DOUBLE)); } /** * Adds the long value to the document as the named field. The long * value is converted to an indexable string value using the {@link LongField} * class. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addLongValue(Document doc, String fieldName, long internalValue) { doc.add(createFieldWithoutNorms(fieldName, LongField.longToString(internalValue), PropertyType.LONG)); } /** * Adds the long value to the document as the named field. The long * value is converted to an indexable string value using the {@link LongField} * class. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addDecimalValue(Document doc, String fieldName, BigDecimal internalValue) { doc.add(createFieldWithoutNorms(fieldName, DecimalField.decimalToString(internalValue), PropertyType.DECIMAL)); } /** * Adds the reference value to the document as the named field. The value's * string representation is added as the reference data. Additionally the * reference data is stored in the index. As of Jackrabbit 2.0 this method * also adds the reference UUID as a {@link FieldNames#WEAK_REFS} field * to the index if it is a weak reference. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. * @param weak Flag indicating whether it's a WEAKREFERENCE (true) or a REFERENCE (flase) */ protected void addReferenceValue(Document doc, String fieldName, NodeId internalValue, boolean weak) { String uuid = internalValue.toString(); doc.add(createFieldWithoutNorms(fieldName, uuid, weak ? PropertyType.WEAKREFERENCE : PropertyType.REFERENCE)); doc.add(new Field(FieldNames.PROPERTIES, false, FieldNames .createNamedValue(fieldName, uuid), Field.Store.YES, Field.Index.NO, Field.TermVector.NO)); if (weak) { doc.add(new Field(FieldNames.WEAK_REFS, false, uuid, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } } /** * Adds the path value to the document as the named field. The path * value is converted to an indexable string value using the name space * mappings with which this class has been created. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addPathValue(Document doc, String fieldName, Path internalValue) { String pathString = internalValue.toString(); try { pathString = resolver.getJCRPath(internalValue); } catch (NamespaceException e) { // will never happen } doc.add(createFieldWithoutNorms(fieldName, pathString, PropertyType.PATH)); } /** * Adds the uri value to the document as the named field. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addURIValue(Document doc, String fieldName, URI internalValue) { doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.URI)); } /** * Adds the string value to the document both as the named field and for * full text indexing. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. * @deprecated Use {@link #addStringValue(Document, String, String, boolean) * addStringValue(Document, String, Object, boolean)} instead. */ protected void addStringValue(Document doc, String fieldName, String internalValue) { addStringValue(doc, fieldName, internalValue, true, true, DEFAULT_BOOST, true); } /** * Adds the string value to the document both as the named field and * optionally for full text indexing if <code>tokenized</code> is * <code>true</code>. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. * @param tokenized If <code>true</code> the string is also tokenized * and fulltext indexed. */ protected void addStringValue(Document doc, String fieldName, String internalValue, boolean tokenized) { addStringValue(doc, fieldName, internalValue, tokenized, true, DEFAULT_BOOST, true); } /** * Adds the string value to the document both as the named field and * optionally for full text indexing if <code>tokenized</code> is * <code>true</code>. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the * document. * @param tokenized If <code>true</code> the string is also * tokenized and fulltext indexed. * @param includeInNodeIndex If <code>true</code> the string is also * tokenized and added to the node scope fulltext * index. * @param boost the boost value for this string field. * @deprecated use {@link #addStringValue(Document, String, String, boolean, boolean, float, boolean)} instead. */ protected void addStringValue(Document doc, String fieldName, String internalValue, boolean tokenized, boolean includeInNodeIndex, float boost) { addStringValue(doc, fieldName, internalValue, tokenized, includeInNodeIndex, boost, true); } /** * Adds the string value to the document both as the named field and * optionally for full text indexing if <code>tokenized</code> is * <code>true</code>. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the * document. * @param tokenized If <code>true</code> the string is also * tokenized and fulltext indexed. * @param includeInNodeIndex If <code>true</code> the string is also * tokenized and added to the node scope fulltext * index. * @param boost the boost value for this string field. * @param useInExcerpt If <code>true</code> the string may show up in * an excerpt. */ protected void addStringValue(Document doc, String fieldName, String internalValue, boolean tokenized, boolean includeInNodeIndex, float boost, boolean useInExcerpt) { // simple String doc.add(createFieldWithoutNorms(fieldName, internalValue, PropertyType.STRING)); if (tokenized) { if (internalValue.length() == 0) { return; } // create fulltext index on property int idx = fieldName.indexOf(':'); fieldName = fieldName.substring(0, idx + 1) + FieldNames.FULLTEXT_PREFIX + fieldName.substring(idx + 1); boolean hasNorms = boost != DEFAULT_BOOST; Field.Index indexType = hasNorms ? Field.Index.ANALYZED : Field.Index.ANALYZED_NO_NORMS; Field f = new Field(fieldName, true, internalValue, Field.Store.NO, indexType, Field.TermVector.NO); f.setBoost(boost); doc.add(f); if (includeInNodeIndex) { // also create fulltext index of this value boolean store = supportHighlighting && useInExcerpt; f = createFulltextField(internalValue, store, supportHighlighting, hasNorms); if (useInExcerpt) { doc.add(f); } else { doNotUseInExcerpt.add(f); } } } } /** * Adds the name value to the document as the named field. The name * value is converted to an indexable string treating the internal value * as a <code>Name</code> and mapping the name space using the name space * mappings with which this class has been created. * * @param doc The document to which to add the field * @param fieldName The name of the field to add * @param internalValue The value for the field to add to the document. */ protected void addNameValue(Document doc, String fieldName, Name internalValue) { try { String normValue = mappings.getPrefix(internalValue.getNamespaceURI()) + ":" + internalValue.getLocalName(); doc.add(createFieldWithoutNorms(fieldName, normValue, PropertyType.NAME)); } catch (NamespaceException e) { // will never happen } } /** * Creates a fulltext field for the string <code>value</code>. * * @param value the string value. * @return a lucene field. * @deprecated use {@link #createFulltextField(String, boolean, boolean, boolean)} instead. */ protected Field createFulltextField(String value) { return createFulltextField(value, supportHighlighting, supportHighlighting); } /** * Creates a fulltext field for the string <code>value</code>. * * @param value the string value. * @param store if the value of the field should be stored. * @param withOffsets if a term vector with offsets should be stored. * @return a lucene field. * @deprecated use {@link #createFulltextField(String, boolean, boolean, boolean)} instead. */ protected Field createFulltextField(String value, boolean store, boolean withOffsets) { return createFulltextField(value, store, withOffsets, true); } /** * Creates a fulltext field for the string <code>value</code>. * * @param value the string value. * @param store if the value of the field should be stored. * @param withOffsets if a term vector with offsets should be stored. * @param withNorms if norm information should be added for this value * @return a lucene field. */ protected Field createFulltextField(String value, boolean store, boolean withOffsets, boolean withNorms) { Field.TermVector tv; if (withOffsets) { tv = Field.TermVector.WITH_OFFSETS; } else { tv = Field.TermVector.NO; } Field.Index index; if (withNorms) { index = Field.Index.ANALYZED; } else { index = Field.Index.ANALYZED_NO_NORMS; } if (store) { // We would be able to store the field compressed or not depending // on a criterion but then we could not determine later is this field // has been compressed or not, so we choose to store it uncompressed return new Field(FieldNames.FULLTEXT, false, value, Field.Store.YES, index, tv); } else { return new Field(FieldNames.FULLTEXT, false, value, Field.Store.NO, index, tv); } } /** * Creates a fulltext field for the reader <code>value</code>. * * @param value the binary value * @param metadata document metatadata * @return a lucene field. * @deprecated use {@link #createFulltextField(InternalValue, Metadata, boolean)} instead. */ protected Fieldable createFulltextField( InternalValue value, Metadata metadata) { return createFulltextField(value, metadata, true); } /** * Creates a fulltext field for the reader <code>value</code>. * * @param value the binary value * @param metadata document metatadata * @param withNorms if norm information should be added for this value * @return a lucene field. */ protected Fieldable createFulltextField( InternalValue value, Metadata metadata, boolean withNorms) { return new LazyTextExtractorField(parser, value, metadata, executor, supportHighlighting, getMaxExtractLength(), withNorms); } /** * Returns <code>true</code> if the property with the given name should * be indexed. The default is to index all properties unless explicit * indexing configuration is specified. The <code>jcr:primaryType</code> * and <code>jcr:mixinTypes</code> properties are always indexed for * correct node type resolution in queries. * * @param propertyName name of a property. * @return <code>true</code> if the property should be indexed; * <code>false</code> otherwise. */ protected boolean isIndexed(Name propertyName) { return indexingConfig == null || propertyName.equals(NameConstants.JCR_PRIMARYTYPE) || propertyName.equals(NameConstants.JCR_MIXINTYPES) || indexingConfig.isIndexed(node, propertyName); } /** * Returns <code>true</code> if the property with the given name should also * be added to the node scope index. * * @param propertyName the name of a property. * @return <code>true</code> if it should be added to the node scope index; * <code>false</code> otherwise. */ protected boolean isIncludedInNodeIndex(Name propertyName) { if (indexingConfig == null) { return true; } else { return indexingConfig.isIncludedInNodeScopeIndex(node, propertyName); } } /** * Returns <code>true</code> if the content of the property with the given * name should the used to create an excerpt. * * @param propertyName the name of a property. * @return <code>true</code> if it should be used to create an excerpt; * <code>false</code> otherwise. */ protected boolean useInExcerpt(Name propertyName) { if (indexingConfig == null) { return true; } else { return indexingConfig.useInExcerpt(node, propertyName); } } /** * Returns <code>true</code> if the provided type is among the types * supported by the Tika parser we are using. * * @param type the type to check. * @return whether the type is supported by the Tika parser we are using. */ protected boolean isSupportedMediaType(final String type) { if (supportedMediaTypes == null) { supportedMediaTypes = parser.getSupportedTypes(new ParseContext()); } return supportedMediaTypes.contains(MediaType.parse(type)); } /** * Returns the boost value for the given property name. * * @param propertyName the name of a property. * @return the boost value for the given property name. */ protected float getPropertyBoost(Name propertyName) { if (indexingConfig == null) { return DEFAULT_BOOST; } else { return indexingConfig.getPropertyBoost(node, propertyName); } } /** * @return the boost value for this {@link #node} state. */ protected float getNodeBoost() { if (indexingConfig == null) { return DEFAULT_BOOST; } else { return indexingConfig.getNodeBoost(node); } } /** * Adds a {@link FieldNames#PROPERTY_LENGTHS} field to <code>document</code> * with a named length value. * * @param doc the lucene document. * @param propertyName the property name. * @param value the internal value. */ protected void addLength(Document doc, String propertyName, InternalValue value) { long length = Util.getLength(value); if (length != -1) { doc.add(new Field(FieldNames.PROPERTY_LENGTHS, false, FieldNames .createNamedLength(propertyName, length), Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } } /** * Depending on the index format version adds one or two fields to the * document for the node name. * * @param doc the lucene document. * @param namespaceURI the namespace URI of the node name. * @param localName the local name of the node. */ protected void addNodeName(Document doc, String namespaceURI, String localName) throws NamespaceException { String name = mappings.getPrefix(namespaceURI) + ":" + localName; doc.add(new Field(FieldNames.LABEL, false, name, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); // as of version 3, also index combination of namespace URI and local name if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion()) { doc.add(new Field(FieldNames.NAMESPACE_URI, false, namespaceURI, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); doc.add(new Field(FieldNames.LOCAL_NAME, false, localName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } } /** * Adds a parent child relation to the given <code>doc</code>. * * @param doc the document. * @param parentId the id of the parent node. * @throws ItemStateException if the parent node cannot be read. * @throws RepositoryException if the parent node does not have a child node * entry for the current node. */ protected void addParentChildRelation(Document doc, NodeId parentId) throws ItemStateException, RepositoryException { Field parentField = new Field(FieldNames.PARENT, false, parentId.toString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO); parentField.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY); doc.add(parentField); NodeState parent = (NodeState) stateProvider.getItemState(parentId); ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId()); if (child == null) { // this can only happen when jackrabbit // is running in a cluster. throw new RepositoryException( "Missing child node entry for node with id: " + node.getNodeId()); } Name name = child.getName(); addNodeName(doc, name.getNamespaceURI(), name.getLocalName()); } }
{'content_hash': '9d220e6341809351e0dbdf09d3368f84', 'timestamp': '', 'source': 'github', 'line_count': 1023, 'max_line_length': 115, 'avg_line_length': 39.618768328445746, 'alnum_prop': 0.598272884283247, 'repo_name': 'bartosz-grabski/jackrabbit', 'id': 'a224ec828e6dca7191e4f54415117414d4d97cd8', 'size': '41332', 'binary': False, 'copies': '8', 'ref': 'refs/heads/trunk', 'path': 'jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2538'}, {'name': 'Java', 'bytes': '23018946'}, {'name': 'JavaScript', 'bytes': '7410'}, {'name': 'Shell', 'bytes': '1817'}, {'name': 'XSLT', 'bytes': '49729'}]}
import re from ufal.udpipe import Model, Pipeline, ProcessingError class Parser: MODELS = { "swe": "data/swedish-talbanken-ud-2.5-191206.udpipe", } def __init__(self, language, lazy_load=True): self.language = language self.model = None if not lazy_load: self.model = Parser.load_model(language) @staticmethod def load_model(language): model_path = Parser.MODELS.get(language, None) if not model_path: raise ParserException("Cannot find model for language '%s'" % language) model = Model.load(model_path) if not model: raise ParserException("Cannot load model from file '%s'\n" % model_path) return model def parse(self, text): # Lazy load model file to speed up startup if not self.model: self.model = self.load_model(self.language) text = text.strip() # Adding a period improves detection on especially short sentences period_added = False last_character = text.strip()[-1] if re.match(r"\w", last_character, flags=re.UNICODE): text += "." period_added = True pipeline = Pipeline( self.model, "tokenize", Pipeline.DEFAULT, Pipeline.DEFAULT, "conllu" ) error = ProcessingError() processed = pipeline.process(text, error) if error.occurred(): raise ParserException(error.message) # Remove the period to make sure input corresponds to output if period_added: processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n" return processed class ParserException(Exception): pass
{'content_hash': 'd16ad1a032ab6fd725f21f98d8f3a2bc', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 84, 'avg_line_length': 28.580645161290324, 'alnum_prop': 0.5840857787810384, 'repo_name': 'EmilStenstrom/json-tagger', 'id': 'fe51af7615e35415de5cb08e6be67c49a5378b28', 'size': '1772', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'api/ud_helper.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '18835'}, {'name': 'JavaScript', 'bytes': '209'}, {'name': 'Python', 'bytes': '6828'}, {'name': 'Ruby', 'bytes': '175'}, {'name': 'Shell', 'bytes': '1455'}]}
.class Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver; .super Landroid/content/BroadcastReceiver; .source "ManagedServices.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lcom/android/server/notification/ManagedServices; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x0 name = "SettingRestoredReceiver" .end annotation # instance fields .field final synthetic this$0:Lcom/android/server/notification/ManagedServices; # direct methods .method constructor <init>(Lcom/android/server/notification/ManagedServices;)V .locals 0 iput-object p1, p0, Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver;->this$0:Lcom/android/server/notification/ManagedServices; invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V return-void .end method # virtual methods .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V .locals 5 const-string/jumbo v3, "android.os.action.SETTING_RESTORED" invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String; move-result-object v4 invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_1 const-string/jumbo v3, "setting_name" invoke-virtual {p2, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String; move-result-object v0 iget-object v3, p0, Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver;->this$0:Lcom/android/server/notification/ManagedServices; invoke-static {v3}, Lcom/android/server/notification/ManagedServices;->-get0(Lcom/android/server/notification/ManagedServices;)Lcom/android/server/notification/ManagedServices$Config; move-result-object v3 iget-object v3, v3, Lcom/android/server/notification/ManagedServices$Config;->secureSettingName:Ljava/lang/String; invoke-static {v0, v3}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v3 if-nez v3, :cond_0 iget-object v3, p0, Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver;->this$0:Lcom/android/server/notification/ManagedServices; invoke-static {v3}, Lcom/android/server/notification/ManagedServices;->-get0(Lcom/android/server/notification/ManagedServices;)Lcom/android/server/notification/ManagedServices$Config; move-result-object v3 iget-object v3, v3, Lcom/android/server/notification/ManagedServices$Config;->secondarySettingName:Ljava/lang/String; invoke-static {v0, v3}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_1 :cond_0 const-string/jumbo v3, "previous_value" invoke-virtual {p2, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String; move-result-object v2 const-string/jumbo v3, "new_value" invoke-virtual {p2, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String; move-result-object v1 iget-object v3, p0, Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver;->this$0:Lcom/android/server/notification/ManagedServices; invoke-virtual {p0}, Lcom/android/server/notification/ManagedServices$SettingRestoredReceiver;->getSendingUserId()I move-result v4 invoke-virtual {v3, v0, v2, v1, v4}, Lcom/android/server/notification/ManagedServices;->settingRestored(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V :cond_1 return-void .end method
{'content_hash': '934fa03a13d17d45699944dd4fb841f4', 'timestamp': '', 'source': 'github', 'line_count': 106, 'max_line_length': 187, 'avg_line_length': 34.235849056603776, 'alnum_prop': 0.7668779278038027, 'repo_name': 'BatMan-Rom/ModdedFiles', 'id': '5e16c2f3076973056e0992d6d6bc86449589690d', 'size': '3629', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'services.jar.out/smali/com/android/server/notification/ManagedServices$SettingRestoredReceiver.smali', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'GLSL', 'bytes': '15069'}, {'name': 'HTML', 'bytes': '139176'}, {'name': 'Smali', 'bytes': '541934400'}]}
import json from tempest_lib import exceptions as tempest_exceptions from functionaltests.api import base sample_data = {"name": "test_assembly", "description": "A test to create assembly", "project_id": "project_id", "user_id": "user_id", "status": "QUEUED", "application_uri": "http://localhost:5000"} plan_sample_data = {"version": "1", "name": "test_plan", "description": "A test to create plan", "project_id": "project_id", "user_id": "user_id"} class TestAssemblyController(base.TestCase): def setUp(self): super(TestAssemblyController, self).setUp() def tearDown(self): super(TestAssemblyController, self).tearDown() self.client.delete_created_assemblies() self.client.delete_created_plans() def _assert_output_expected(self, body_data, data): self.assertEqual(body_data['description'], data['description']) self.assertEqual(body_data['plan_uri'], data['plan_uri']) self.assertEqual(body_data['name'], data['name']) self.assertIsNotNone(body_data['uuid']) self.assertEqual(body_data['status'], data['status']) self.assertEqual(body_data['application_uri'], data['application_uri']) def test_assemblies_get_all(self): # Create assemblies to find p_resp_1 = self.client.create_plan() self.assertEqual(p_resp_1.status, 201) a_resp_1 = self.client.create_assembly(data=sample_data, plan_uuid=p_resp_1.uuid) self.assertEqual(a_resp_1.status, 201) p_resp_2 = self.client.create_plan() self.assertEqual(p_resp_2.status, 201) a_resp_2 = self.client.create_assembly(data=sample_data, plan_uuid=p_resp_2.uuid) self.assertEqual(a_resp_2.status, 201) # Get list of all assemblies resp, body = self.client.get('v1/assemblies') self.assertEqual(resp.status, 200) # Search for uuids of created assemblies assembly_list = json.loads(body) found_uuid_1 = False found_uuid_2 = False for assembly in assembly_list: uuid = json.dumps(assembly['uuid']) if a_resp_1.uuid in uuid: found_uuid_1 = True elif a_resp_2.uuid in uuid: found_uuid_2 = True self.assertTrue(found_uuid_1, 'Cannot find assembly [%s] in list of all assemblies.' % a_resp_1.uuid) self.assertTrue(found_uuid_2, 'Cannot find assembly [%s] in list of all assemblies.' % a_resp_2.uuid) def test_assemblies_create(self): plan_resp = self.client.create_plan() self.assertEqual(plan_resp.status, 201) assembly_resp = self.client.create_assembly( plan_uuid=plan_resp.uuid, data=sample_data) self.assertEqual(assembly_resp.status, 201) sample_data['plan_uri'] = "%s/v1/plans/%s" % (self.client.base_url, plan_resp.uuid) self._assert_output_expected(assembly_resp.data, sample_data) def test_assemblies_create_none(self): self.assertRaises(tempest_exceptions.BadRequest, self.client.post, 'v1/assemblies', "{}") def test_assemblies_get(self): plan_resp = self.client.create_plan(data=plan_sample_data) self.assertEqual(plan_resp.status, 201) plan_uuid = plan_resp.uuid assembly_resp = self.client.create_assembly( plan_uuid=plan_uuid, data=sample_data) self.assertEqual(assembly_resp.status, 201) uuid = assembly_resp.uuid sample_data['plan_uri'] = "%s/v1/plans/%s" % (self.client.base_url, plan_uuid) resp, body = self.client.get('v1/assemblies/%s' % uuid) self.assertEqual(resp.status, 200) json_data = json.loads(body) self._assert_output_expected(json_data, sample_data) # Now check that HTTPS is respected. No new assemblies are created. for k in ['plan_uri', 'trigger_uri']: if k in sample_data: sample_data[k] = sample_data[k].replace('http:', 'https:', 1) use_https = {'X-Forwarded-Proto': 'https'} resp, body = self.client.get('v1/assemblies/%s' % uuid, headers=use_https) self.assertEqual(resp.status, 200) json_data = json.loads(body) self._assert_output_expected(json_data, sample_data) def test_assemblies_get_not_found(self): self.assertRaises(tempest_exceptions.NotFound, self.client.get, 'v1/assemblies/not_found') def test_assemblies_put(self): plan_resp = self.client.create_plan() self.assertEqual(plan_resp.status, 201) plan_uuid = plan_resp.uuid assembly_resp = self.client.create_assembly( plan_uuid=plan_uuid, data=sample_data) self.assertEqual(assembly_resp.status, 201) uuid = assembly_resp.uuid uri = "%s/v1/plans/%s" % (self.client.base_url, plan_uuid) updated_data = {"name": "test_assembly_updated", "description": "A test to create assembly updated", "plan_uri": uri, "user_id": "user_id updated", "status": "new_status", "application_uri": "new_uri"} updated_json = json.dumps(updated_data) resp, body = self.client.put('v1/assemblies/%s' % uuid, updated_json) self.assertEqual(resp.status, 200) json_data = json.loads(body) self._assert_output_expected(json_data, updated_data) def test_assemblies_put_not_found(self): updated_data = {"name": "test_assembly_updated", "description": "A test to create assembly updated", "plan_uri": 'fake_uri', "project_id": "project_id updated", "user_id": "user_id updated", "status": "new_status", "application_uri": "new_uri"} updated_json = json.dumps(updated_data) self.assertRaises(tempest_exceptions.NotFound, self.client.put, 'v1/assemblies/not_found', updated_json) def test_assemblies_put_none(self): self.assertRaises(tempest_exceptions.BadRequest, self.client.put, 'v1/assemblies/any', "{}") def test_assemblies_put_cannot_update(self): plan_resp = self.client.create_plan() self.assertEqual(plan_resp.status, 201) plan_uuid = plan_resp.uuid assembly_resp = self.client.create_assembly( plan_uuid=plan_uuid, data=sample_data) self.assertEqual(assembly_resp.status, 201) uuid = assembly_resp.uuid immutables = [ ('id', 'new_assembly_id'), ('uuid', 'new_assembly_uuid'), ('project_id', 'new_project_id'), ] for key_value in immutables: updated_data = dict([key_value]) updated_json = json.dumps(updated_data) self.assertRaises(tempest_exceptions.BadRequest, self.client.put, 'v1/assemblies/%s' % uuid, updated_json) def test_assemblies_delete(self): plan_resp = self.client.create_plan() self.assertEqual(plan_resp.status, 201) assembly_resp = self.client.create_assembly( plan_uuid=plan_resp.uuid, data=sample_data) self.assertEqual(assembly_resp.status, 201) uuid = assembly_resp.uuid resp, body = self.client.delete_assembly(uuid) self.assertEqual(resp.status, 204) self.assertEqual(body, '') self.assertTrue(self.client.assembly_delete_done(uuid), "Assembly couldn't be deleted.") def test_assemblies_delete_not_found(self): self.assertRaises(tempest_exceptions.NotFound, self.client.delete, 'v1/assemblies/not_found')
{'content_hash': 'dc2efb52d4e60802b23091cc3fee6850', 'timestamp': '', 'source': 'github', 'line_count': 199, 'max_line_length': 79, 'avg_line_length': 42.562814070351756, 'alnum_prop': 0.5598583234946871, 'repo_name': 'devdattakulkarni/test-solum', 'id': '3cceb4a5a0c1d6e976e2929ea7a837914bd0778a', 'size': '9080', 'binary': False, 'copies': '1', 'ref': 'refs/heads/add-virt-driver', 'path': 'functionaltests/api/v1/test_assembly.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Mako', 'bytes': '958'}, {'name': 'Python', 'bytes': '1240622'}, {'name': 'Shell', 'bytes': '82235'}]}
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd "> <persistence-unit name="italent" transaction-type="RESOURCE_LOCAL"> <!-- <exclude-unlisted-classes>false</exclude-unlisted-classes> --> <validation-mode>CALLBACK</validation-mode> <properties> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.8.154.2-itproject.rhcloud.com:3306/italent" /> <property name="javax.persistence.jdbc.user" value="adminkgnI5Nk" /> <property name="javax.persistence.jdbc.password" value="HiGAW1BJfshb" /> <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.show_sql" value="false" /> </properties> </persistence-unit> </persistence>
{'content_hash': 'c799c3a5df87de7f819e70700f07a1c8', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 123, 'avg_line_length': 57.526315789473685, 'alnum_prop': 0.6742909423604757, 'repo_name': 'niekvandael/iTalent', 'id': '1e4602051e25e208232c85e2e733c78ccb974c9a', 'size': '1093', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'italent/target/classes/META-INF/persistence.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '210'}, {'name': 'CSS', 'bytes': '79618'}, {'name': 'HTML', 'bytes': '2092479'}, {'name': 'Java', 'bytes': '145036'}, {'name': 'JavaScript', 'bytes': '74574'}, {'name': 'Shell', 'bytes': '269'}]}
<div class="jumbotron text-center"> <h1>The Ultimate ticketing master</h1> <img src="/img/ticketmaster-logo.jpg"> </div>
{'content_hash': '26a90331e0ea3d22878e72a459b8c9ed', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 42, 'avg_line_length': 25.8, 'alnum_prop': 0.6821705426356589, 'repo_name': 'oyron/cloudorama', 'id': '85f37346ef7f3da33641e24befcae1548b960b37', 'size': '129', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'public/views/home.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '140259'}, {'name': 'HTML', 'bytes': '8693'}, {'name': 'JavaScript', 'bytes': '22894'}]}
package org.springframework.cloud.netflix.zuul; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Map; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.actuate.trace.InMemoryTraceRepository; import org.springframework.boot.actuate.trace.TraceRepository; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.IntegrationTest; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.TestRestTemplate; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.cloud.netflix.ribbon.RibbonClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.netflix.appinfo.EurekaInstanceConfig; import com.netflix.loadbalancer.BaseLoadBalancer; import com.netflix.loadbalancer.ILoadBalancer; import com.netflix.loadbalancer.Server; import com.netflix.zuul.ZuulFilter; import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = FormZuulServletProxyApplication.class) @WebAppConfiguration @IntegrationTest({ "server.port:0", "zuul.routes.simple:/simple/**" }) @DirtiesContext public class FormZuulServletProxyApplicationTests { @Value("${local.server.port}") private int port; @Test public void postWithForm() { MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>(); form.set("foo", "bar"); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/zuul/simple/form", HttpMethod.POST, new HttpEntity<MultiValueMap<String, String>>(form, headers), String.class); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("Posted! {foo=[bar]}", result.getBody()); } @Test public void postWithMultipartForm() { MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>(); form.set("foo", "bar"); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/zuul/simple/form", HttpMethod.POST, new HttpEntity<MultiValueMap<String, String>>(form, headers), String.class); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("Posted! {foo=[bar]}", result.getBody()); } @Test public void postWithMultipartFile() { MultiValueMap<String, Object> form = new LinkedMultiValueMap<String, Object>(); HttpHeaders part = new HttpHeaders(); part.setContentType(MediaType.TEXT_PLAIN); part.setContentDispositionFormData("file", "foo.txt"); form.set("foo", new HttpEntity<byte[]>("bar".getBytes(), part)); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/zuul/simple/file", HttpMethod.POST, new HttpEntity<MultiValueMap<String, Object>>(form, headers), String.class); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("Posted! bar", result.getBody()); } @Test public void postWithUTF8Form() { MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>(); form.set("foo", "bar"); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType .valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE + "; charset=UTF-8")); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/zuul/simple/form", HttpMethod.POST, new HttpEntity<MultiValueMap<String, String>>(form, headers), String.class); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("Posted! {foo=[bar]}", result.getBody()); } } // Don't use @SpringBootApplication because we don't want to component scan @Configuration @EnableAutoConfiguration @RestController @EnableZuulProxy @RibbonClients(@RibbonClient(name = "simple", configuration = ServletFormRibbonClientConfiguration.class)) @Slf4j class FormZuulServletProxyApplication { @RequestMapping(value = "/form", method = RequestMethod.POST) public String accept(@RequestParam MultiValueMap<String, String> form) throws IOException { return "Posted! " + form; } // TODO: Why does this not work if you add @RequestParam as above? @RequestMapping(value = "/file", method = RequestMethod.POST) public String file(@RequestParam(required = false) MultipartFile file) throws IOException { byte[] bytes = new byte[0]; if (file != null) { if (file.getSize() > 1024) { bytes = new byte[1024]; InputStream inputStream = file.getInputStream(); inputStream.read(bytes); byte[] buffer = new byte[1024 * 1024 * 10]; while (inputStream.read(buffer) >= 0) { log.info("Read more bytes"); } } else { bytes = file.getBytes(); } } return "Posted! " + new String(bytes); } @Bean public ZuulFilter sampleFilter() { return new ZuulFilter() { @Override public String filterType() { return "pre"; } @Override public boolean shouldFilter() { return true; } @Override public Object run() { return null; } @Override public int filterOrder() { return 0; } }; } @Bean public TraceRepository traceRepository() { return new InMemoryTraceRepository() { @Override public void add(Map<String, Object> map) { if (map.containsKey("body")) { map.get("body"); } super.add(map); } }; } public static void main(String[] args) { new SpringApplicationBuilder(FormZuulProxyApplication.class).properties( "zuul.routes.simple:/zuul/simple/**", "zuul.routes.direct.url:http://localhost:9999", "zuul.routes.direct.path:/zuul/direct/**", "multipart.maxFileSize:4096MB", "multipart.maxRequestSize:4096MB").run( args); } } // Load balancer with fixed server list for "simple" pointing to localhost @Configuration class ServletFormRibbonClientConfiguration { @Bean public ILoadBalancer ribbonLoadBalancer(EurekaInstanceConfig instance) { BaseLoadBalancer balancer = new BaseLoadBalancer(); balancer.setServersList(Arrays.asList(new Server("localhost", instance .getNonSecurePort()))); // balancer.setServersList(Arrays.asList(new Server("localhost", 8000))); return balancer; } }
{'content_hash': 'ba92bf12b461c35bb88e71b5105c60e9', 'timestamp': '', 'source': 'github', 'line_count': 223, 'max_line_length': 106, 'avg_line_length': 34.30493273542601, 'alnum_prop': 0.7564705882352941, 'repo_name': 'navarrogabriela/spring-cloud-netflix', 'id': '0ddf917539440392f3276776407927b499044231', 'size': '8270', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/FormZuulServletProxyApplicationTests.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5150'}, {'name': 'CSS', 'bytes': '52460'}, {'name': 'HTML', 'bytes': '10440'}, {'name': 'Java', 'bytes': '724518'}, {'name': 'JavaScript', 'bytes': '33512'}, {'name': 'Ruby', 'bytes': '481'}, {'name': 'Shell', 'bytes': '7123'}]}
using System.Collections.Generic; using System.Threading.Tasks; using NCubeSolvers.Core; namespace NCubeSolver.Plugins.Solvers.Size5 { internal class MiddleLayerTredgeSolver : IPartialSolver { public async Task<IEnumerable<IRotation>> Solve(CubeConfiguration<FaceColour> configuration) { var solution = new List<IRotation>(); await Repeat.SolvingUntilNoMovesCanBeMade(solution, async () => { await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); await CheckRightBackEdge(configuration, solution).ConfigureAwait(false); await CheckBackLeftEdge(configuration, solution).ConfigureAwait(false); await CheckLeftFrontEdge(configuration, solution).ConfigureAwait(false); }).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(CubeRotations.YClockwise, solution, configuration).ConfigureAwait(false); await Repeat.SolvingUntilNoMovesCanBeMade(solution, async () => { await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); await CheckRightBackEdge(configuration, solution).ConfigureAwait(false); await CheckLeftFrontEdge(configuration, solution).ConfigureAwait(false); }).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(CubeRotations.YClockwise, solution, configuration).ConfigureAwait(false); await Repeat.SolvingUntilNoMovesCanBeMade(solution, async () => { await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); await CheckLeftFrontEdge(configuration, solution).ConfigureAwait(false); }).ConfigureAwait(false); await SolveLastTredge(configuration, solution).ConfigureAwait(false); return solution; } private async Task SolveLastTredge(CubeConfiguration<FaceColour> configuration, List<IRotation> solution) { if (Utilities.IsInnerEdgeComplete(FaceType.Front, FaceType.Right, configuration)) { return; } await CommonActions.ApplyAndAddRotation(CubeRotations.ZAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerRight2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Back2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Upper2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerLeftClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Upper2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerRightAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Upper2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerRightClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Upper2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Front2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerRightClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Front2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerLeftAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Back2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerRight2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(CubeRotations.ZClockwise, solution, configuration).ConfigureAwait(false); // OPTIONAL } private static async Task CheckFrontRightEdge(CubeConfiguration<FaceColour> configuration, List<IRotation> solution) { var frontFaceColour = configuration.Faces[FaceType.Front].LeftCentre(); var leftFaceColour = configuration.Faces[FaceType.Left].RightCentre(); var rightEdgeOnFace = configuration.Faces[FaceType.Front].GetEdge(Edge.Right); var frontFaceTop = rightEdgeOnFace[configuration.MinInnerLayerIndex()]; var frontFaceBottom = rightEdgeOnFace[configuration.MaxInnerLayerIndex()]; var leftEdgeOnRightFace = configuration.Faces[FaceType.Right].GetEdge(Edge.Left); var rightFaceTop = leftEdgeOnRightFace[configuration.MinInnerLayerIndex()]; var rightFaceBottom = leftEdgeOnRightFace[configuration.MaxInnerLayerIndex()]; if (frontFaceTop == frontFaceColour && rightFaceTop == leftFaceColour) { await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerDownClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerDownAntiClockwise, solution, configuration).ConfigureAwait(false); } if (frontFaceBottom == frontFaceColour && rightFaceBottom == leftFaceColour) { await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperAntiClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperClockwise, solution, configuration).ConfigureAwait(false); } if (frontFaceTop == leftFaceColour && rightFaceTop == frontFaceColour) { await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperAntiClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperClockwise, solution, configuration).ConfigureAwait(false); } if (frontFaceBottom == leftFaceColour && rightFaceBottom == frontFaceColour) { await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperAntiClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperClockwise, solution, configuration).ConfigureAwait(false); } } private static async Task CheckRightBackEdge(CubeConfiguration<FaceColour> configuration, List<IRotation> solution) { var frontFaceColour = configuration.Faces[FaceType.Front].LeftCentre(); var leftFaceColour = configuration.Faces[FaceType.Left].RightCentre(); var rightEdgeOnFace = configuration.Faces[FaceType.Right].GetEdge(Edge.Right); var rightFaceTop = rightEdgeOnFace[configuration.MinInnerLayerIndex()]; var rightFaceBottom = rightEdgeOnFace[configuration.MaxInnerLayerIndex()]; var leftEdgeOnBackFace = configuration.Faces[FaceType.Back].GetEdge(Edge.Left); var backFaceTop = leftEdgeOnBackFace[configuration.MinInnerLayerIndex()]; var backFaceBottom = leftEdgeOnBackFace[configuration.MaxInnerLayerIndex()]; if ((rightFaceTop == frontFaceColour && backFaceTop == leftFaceColour) || (rightFaceBottom == frontFaceColour && backFaceBottom == leftFaceColour) || (rightFaceTop == leftFaceColour && backFaceTop == frontFaceColour) || (rightFaceBottom == leftFaceColour && backFaceBottom == frontFaceColour)) { await CommonActions.ApplyAndAddRotation(Rotations.Right2, solution, configuration).ConfigureAwait(false); await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); } } private static async Task CheckBackLeftEdge(CubeConfiguration<FaceColour> configuration, List<IRotation> solution) { var frontFaceColour = configuration.Faces[FaceType.Front].LeftCentre(); var leftFaceColour = configuration.Faces[FaceType.Left].RightCentre(); var rightEdgeOnFace = configuration.Faces[FaceType.Back].GetEdge(Edge.Right); var backFaceTop = rightEdgeOnFace[configuration.MinInnerLayerIndex()]; var backFaceBottom = rightEdgeOnFace[configuration.MaxInnerLayerIndex()]; var leftEdgeOnLeftFace = configuration.Faces[FaceType.Left].GetEdge(Edge.Left); var leftFaceTop = leftEdgeOnLeftFace[configuration.MinInnerLayerIndex()]; var leftFaceBottom = leftEdgeOnLeftFace[configuration.MaxInnerLayerIndex()]; if ((backFaceTop == frontFaceColour && leftFaceTop == leftFaceColour) || (backFaceBottom == frontFaceColour && leftFaceBottom == leftFaceColour) || (backFaceTop == leftFaceColour && leftFaceTop == frontFaceColour) || (backFaceBottom == leftFaceColour && leftFaceBottom == frontFaceColour)) { await CommonActions.ApplyAndAddRotation(Rotations.Back2, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.Right2, solution, configuration).ConfigureAwait(false); await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); } } private static async Task CheckLeftFrontEdge(CubeConfiguration<FaceColour> configuration, List<IRotation> solution) { var frontFaceColour = configuration.Faces[FaceType.Front].LeftCentre(); var leftFaceColour = configuration.Faces[FaceType.Left].RightCentre(); var rightEdgeOnFace = configuration.Faces[FaceType.Left].GetEdge(Edge.Right); var leftFaceTop = rightEdgeOnFace[configuration.MinInnerLayerIndex()]; var leftFaceBottom = rightEdgeOnFace[configuration.MaxInnerLayerIndex()]; var leftEdgeOnFrontFace = configuration.Faces[FaceType.Front].GetEdge(Edge.Left); var frontFaceTop = leftEdgeOnFrontFace[configuration.MinInnerLayerIndex()]; var frontFaceBottom = leftEdgeOnFrontFace[configuration.MaxInnerLayerIndex()]; if (leftFaceTop == frontFaceColour && frontFaceTop == leftFaceColour) { await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperAntiClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerUpperClockwise, solution, configuration).ConfigureAwait(false); await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); } if (leftFaceBottom == frontFaceColour && frontFaceBottom == leftFaceColour) { await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerDownClockwise, solution, configuration).ConfigureAwait(false); await PerformFlip(solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.SecondLayerDownAntiClockwise, solution, configuration).ConfigureAwait(false); await CheckFrontRightEdge(configuration, solution).ConfigureAwait(false); } } private static async Task PerformFlip(List<IRotation> solution, CubeConfiguration<FaceColour> configuration) { await CommonActions.ApplyAndAddRotation(Rotations.RightClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.UpperClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.RightAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.FrontClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.RightAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.FrontAntiClockwise, solution, configuration).ConfigureAwait(false); await CommonActions.ApplyAndAddRotation(Rotations.RightClockwise, solution, configuration).ConfigureAwait(false); } } }
{'content_hash': 'b2ac8790bf737abf2d243f0edfa1356a', 'timestamp': '', 'source': 'github', 'line_count': 265, 'max_line_length': 144, 'avg_line_length': 50.554716981132074, 'alnum_prop': 0.712696872434127, 'repo_name': 'EdwardSalter/NCubeSolver', 'id': 'cce65737d28c153a28cca7d015b84df8114f6f7f', 'size': '13399', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Plugins/Plugin.Solvers/Size5/MiddleLayerTredgeSolver.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1000'}, {'name': 'C#', 'bytes': '603301'}, {'name': 'GLSL', 'bytes': '412'}, {'name': 'JavaScript', 'bytes': '1173'}]}
#ifndef BlynkSimpleEsp8266_SSL_h #define BlynkSimpleEsp8266_SSL_h #ifndef ESP8266 #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif #ifndef BLYNK_INFO_DEVICE #define BLYNK_INFO_DEVICE "ESP8266" #endif #define BLYNK_DEFAULT_FINGERPRINT "A2 10 3C 79 7D 19 FB B2 50 0D 02 C6 39 8B 94 D0 02 B8 88 88" #include <BlynkApiArduino.h> #include <Blynk/BlynkProtocol.h> #include <Adapters/BlynkArduinoClient.h> #include <ESP8266WiFi.h> #include <WiFiClientSecure.h> template <typename Client> class BlynkArduinoClientSecure : public BlynkArduinoClientGen<Client> { public: BlynkArduinoClientSecure(Client& client) : BlynkArduinoClientGen<Client>(client) , fingerprint(NULL) {} void setFingerprint(const char* fp) { fingerprint = fp; } bool connect() { if (BlynkArduinoClientGen<Client>::connect()) { if (fingerprint && !this->client.verify(fingerprint, this->domain)) { BLYNK_LOG("Certificate doesn't match"); return false; } else { BLYNK_LOG("Certificate OK"); } return true; } return false; } private: const char* fingerprint; }; template <typename Transport> class BlynkWifi : public BlynkProtocol<Transport> { typedef BlynkProtocol<Transport> Base; public: BlynkWifi(Transport& transp) : Base(transp) {} void connectWiFi(const char* ssid, const char* pass) { BLYNK_LOG("Connecting to %s", ssid); WiFi.mode(WIFI_STA); if (pass && strlen(pass)) { WiFi.begin(ssid, pass); } else { WiFi.begin(ssid); } while (WiFi.status() != WL_CONNECTED) { ::delay(500); } BLYNK_LOG("Connected to WiFi"); IPAddress myip = WiFi.localIP(); BLYNK_LOG("My IP: %d.%d.%d.%d", myip[0], myip[1], myip[2], myip[3]); } void config(const char* auth, const char* domain = BLYNK_DEFAULT_DOMAIN, uint16_t port = BLYNK_DEFAULT_PORT_SSL, const char* fingerprint = BLYNK_DEFAULT_FINGERPRINT) { Base::begin(auth); this->conn.begin(domain, port); this->conn.setFingerprint(fingerprint); } void config(const char* auth, IPAddress ip, uint16_t port = BLYNK_DEFAULT_PORT_SSL, const char* fingerprint = BLYNK_DEFAULT_FINGERPRINT) { Base::begin(auth); this->conn.begin(ip, port); this->conn.setFingerprint(fingerprint); } void begin(const char* auth, const char* ssid, const char* pass, const char* domain = BLYNK_DEFAULT_DOMAIN, uint16_t port = BLYNK_DEFAULT_PORT_SSL, const char* fingerprint = BLYNK_DEFAULT_FINGERPRINT) { connectWiFi(ssid, pass); config(auth, domain, port, fingerprint); } void begin(const char* auth, const char* ssid, const char* pass, IPAddress ip, uint16_t port = BLYNK_DEFAULT_PORT_SSL, const char* fingerprint = BLYNK_DEFAULT_FINGERPRINT) { connectWiFi(ssid, pass); config(auth, ip, port, fingerprint); } }; static WiFiClientSecure _blynkWifiClient; static BlynkArduinoClientSecure<WiFiClientSecure> _blynkTransport(_blynkWifiClient); BlynkWifi<BlynkArduinoClientSecure<WiFiClientSecure> > Blynk(_blynkTransport); #include <BlynkWidgets.h> #endif
{'content_hash': 'b191b02199f67069d249fb7ab3a71092', 'timestamp': '', 'source': 'github', 'line_count': 129, 'max_line_length': 100, 'avg_line_length': 26.93798449612403, 'alnum_prop': 0.6258992805755396, 'repo_name': 'myDevicesIoT/Cayenne-Arduino-Library', 'id': '99fa720d1e11bc05bf1f1f6d5104171679e629c8', 'size': '3718', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'BlynkSimpleEsp8266_SSL.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '2034'}, {'name': 'C', 'bytes': '32580'}, {'name': 'C++', 'bytes': '138198'}, {'name': 'Python', 'bytes': '20980'}, {'name': 'Shell', 'bytes': '5722'}]}
package org.wintersleep.util.spring.tracer; public class SystemCurrentTimeMillisProvider implements CurrentTimeProvider { @Override public long get() { return System.currentTimeMillis(); } }
{'content_hash': '76122af60f4a977fb795d432342b0e5a', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 77, 'avg_line_length': 21.4, 'alnum_prop': 0.7383177570093458, 'repo_name': 'dverstap/wintersleep', 'id': '02a526449d63717d0d1134c866479eb28746e05a', 'size': '214', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wintersleep-spring-util/src/main/java/org/wintersleep/util/spring/tracer/SystemCurrentTimeMillisProvider.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '12170'}, {'name': 'Java', 'bytes': '272382'}, {'name': 'Logos', 'bytes': '3494'}, {'name': 'Python', 'bytes': '1599'}]}
<?php // Get class files include LS_ROOT_PATH.'/classes/class.ls.posts.php'; include LS_ROOT_PATH.'/classes/class.ls.sliders.php'; class LayerSlider { public $sources, $sliders, $posts, $autoupdate; function __construct() { // Get instances $this->posts = new LS_Posts(); // Do other stuff later } } ?>
{'content_hash': '652da0b69602c08c94cfcb87e07814f6', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 53, 'avg_line_length': 16.05, 'alnum_prop': 0.660436137071651, 'repo_name': 'brianmontecillo/wordpress', 'id': '9e8c69cc3b69727e5bdd209f772913d0e2740231', 'size': '321', 'binary': False, 'copies': '80', 'ref': 'refs/heads/master', 'path': 'wp-content/plugins/LayerSlider/classes/layerslider.class.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2988281'}, {'name': 'JavaScript', 'bytes': '5540422'}, {'name': 'LiveScript', 'bytes': '6103'}, {'name': 'PHP', 'bytes': '21748126'}]}
package org.avirtuos.teslog.config; public interface ConfigService { <T> T get(ConfigKey<T> configKey); }
{'content_hash': 'e93a549d5686f53611feec26b0e17915', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 38, 'avg_line_length': 22.2, 'alnum_prop': 0.7387387387387387, 'repo_name': 'avirtuos/teslog', 'id': 'c0dc9114d6fa569f29fb1d52432e612ee245654f', 'size': '111', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/avirtuos/teslog/config/ConfigService.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '84'}, {'name': 'Java', 'bytes': '34571'}, {'name': 'Python', 'bytes': '2599'}]}
<?xml version="1.0" encoding="UTF-8"?> <project name="semweb4j" xsi:noNamespaceSchemaLocation="http://people.apache.org/~vsiveton/doxia-decoration-model/decoration-1.0.0.xsd"> <skin> <groupId>org.semweb4j</groupId> <artifactId>skin</artifactId> <version>${project.version}</version> </skin> <bannerLeft> <src>images/logos/semweb4j.png</src> <href>http://semweb4j.org/</href> </bannerLeft> <publishDate format="yyyy-MM-dd" /> <body> <head> <meta name="keywords" content="semweb4j, mv2178imnetz" /> <link rel="meta" title="DOAP" type="application/rdf+xml" href="doap.rdf" /> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-271022-2"; urchinTracker(); </script> </head> </body> </project>
{'content_hash': '03cc41a408b123180b63bb327c11a647', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 112, 'avg_line_length': 28.466666666666665, 'alnum_prop': 0.6510538641686182, 'repo_name': 'semweb4j/semweb4j', 'id': '99dd3f6f6657b06e17be23431553ae97644e0354', 'size': '854', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'org.semweb4j.rdfreactor.generator/src/site/site.xml', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '8059'}, {'name': 'Java', 'bytes': '2135754'}, {'name': 'Web Ontology Language', 'bytes': '13427'}]}
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <!-- G4系统级SQL语句映射装载.批注:业务系统的SQL语句请加入到app.sqlmap.xml文件 --> <sqlMapConfig> <settings useStatementNamespaces="true" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Organization.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Resource.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/User.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Role.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Param.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/IdGenerator.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/ArmTagSupport.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Monitor.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/Part.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/DevToolkit.Oracle.xml" /> <sqlMap resource="org/g4studio/system/common/dao/sqlmap/biz/DevToolkit.Mysql.xml" /> <sqlMap resource="org/g4studio/demo/dao/sqlmap/biz/Demo.xml" /> </sqlMapConfig>
{'content_hash': '397b075236096f8ae69aa41f51c224bc', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 126, 'avg_line_length': 69.5, 'alnum_prop': 0.7482014388489209, 'repo_name': 'G4Studio/tobacco', 'id': 'cfebb91ca120676739b2d3532d1134159ab341f1', 'size': '1299', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'G4Studio5/src/config/g4/g4.sqlmap.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1434139'}, {'name': 'Java', 'bytes': '3526354'}, {'name': 'JavaScript', 'bytes': '3105545'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>TREK Slovakia</title> <!-- Bootstrap Core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'> <!-- Plugin CSS --> <link href="vendor/magnific-popup/magnific-popup.css" rel="stylesheet"> <!-- Theme CSS --> <link href="css/creative.min.css" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body id="page-top"> <nav id="mainNav" class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> Menu <i class="fa fa-bars"></i> </button> <a class="navbar-brand page-scroll" href="#page-top">UCI 2.1 WorldTour team TREK</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a class="page-scroll" href="#about">O nás</a> </li> <li> <a class="page-scroll" href="#services">Služby</a> </li> <li> <a class="page-scroll" href="#portfolio">Náš tím</a> </li> <li> <a class="page-scroll" href="#contact">Kontakt</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <header> <div class="header-content"> <div class="header-content-inner"> <h1 id="homeHeading">TREK Slovakia</h1> <hr> <p>Si bajker? Máš dobrú kondičku? Si dobrý šprintér? Ak áno, neváhaj, pridaj sa do nášho tímu a dostaň za to zaplatené!</p> <a href="#about" class="btn btn-primary btn-xl page-scroll">Zistiť viac</a> </div> </div> </header> <section class="bg-primary" id="about"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-center"> <h2 class="section-heading">Máme to, čo potrebuješ!</h2> <hr class="light"> <p class="text-faded">Dáme ti bajk, športovú výživu a dres a dostaneš riadny plat, výška ktorého závisí len od tvojich výsledkov na súťažiach! To všetko pod vedením špičkových trénerov Slovenska! Zaregistruj sa na vstupný test a ak si dobrý, zamestnáme ťa!</p> <a href="#services" class="page-scroll btn btn-default btn-xl sr-button">Zaregistrovať sa na vstupný test!</a> </div> </div> </div> </section> <section id="services"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2 class="section-heading">Sme tu pre Vás!</h2> <hr class="primary"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-lg-3 col-md-6 text-center"> <div class="service-box"> <i class="fa fa-4x fa-paper-plane text-primary sr-icons"></i> <h3>Predaj bicyklov a príslušenstva</h3> <p class="text-muted">Príď do našej predajne a vyber si z našej širokej ponuky bicyklov TREK za najlepšie ceny na Slovensku!</p> </div> </div> <div class="col-lg-3 col-md-6 text-center"> <div class="service-box"> <i class="fa fa-4x fa-paper-plane text-primary sr-icons"></i> <h3>Prenájom bicyklov</h3> <p class="text-muted">Nemáš peniaze na nový bike TREK a chceš si ho vyskúšať? My ti ho požičiame za super cenu!</p> </div> </div> <div class="col-lg-3 col-md-6 text-center"> <div class="service-box"> <i class="fa fa-4x fa-paper-plane text-primary sr-icons"></i> <h3>Servis bicyklov</h3> <p class="text-muted">Máš problém s bicyklom? Príď a my ti ho opravíme rýchlo, spoľahlivo a za skvelé ceny!</p> </div> </div> <div class="col-lg-3 col-md-6 text-center"> <div class="service-box"> <i class="fa fa-4x fa-paper-plane text-primary sr-icons"></i> <h3>Tréningový plán na mieru</h3> <p class="text-muted">Naši profesionálni tréneri s dlhoročnými skúsenosťami ti poradia a napíšu tréningový plán na mieru!</p> </div> </div> </div> </div> </section> <section class="no-padding" id="portfolio"> <div class="container-fluid"> <div class="row no-gutter popup-gallery"> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/1.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/1.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/2.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/2.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/3.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/3.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/4.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/4.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/5.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/5.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> <div class="col-lg-4 col-sm-6"> <a href="img/portfolio/fullsize/6.jpg" class="portfolio-box"> <img src="img/portfolio/thumbnails/6.jpg" class="img-responsive" alt=""> <div class="portfolio-box-caption"> <div class="portfolio-box-caption-content"> <div class="project-category text-faded"> </div> <div class="project-name"> </div> </div> </div> </a> </div> </div> </div> </section> <aside class="bg-dark"> <div class="container text-center"> <div class="call-to-action"> <h2>Vstúpte do nášho eshopu!</h2> <a href="http://startbootstrap.com/template-overviews/creative/" class="btn btn-default btn-xl sr-button">Vstúpiť!</a> </div> </div> </aside> <section id="contact"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-center"> <h2 class="section-heading">Ozvite sa nám!</h2> <hr class="primary"> <p>Či už sa chcete k nám pridať, kúpiť alebo prenajať bike TREK, príp. zostaviť si tréningový plán na mieru, my Vám radi pomôžeme!</p> </div> <div class="col-lg-4 col-lg-offset-2 text-center"> <i class="fa fa-phone fa-3x sr-contact"></i> <p>+421 xxx xxx xxx</p> </div> <div class="col-lg-4 text-center"> <i class="fa fa-envelope-o fa-3x sr-contact"></i> <p><a href="mailto:your-email@your-domain.com">reginahupianova@gmail.com</a></p> </div> </div> </div> </section> <!-- jQuery --> <script src="vendor/jquery/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="vendor/scrollreveal/scrollreveal.min.js"></script> <script src="vendor/magnific-popup/jquery.magnific-popup.min.js"></script> <!-- Theme JavaScript --> <script src="js/creative.min.js"></script> </body> </html>
{'content_hash': 'ffd1ff8d295c9c2c656d81a7d928a816', 'timestamp': '', 'source': 'github', 'line_count': 286, 'max_line_length': 280, 'avg_line_length': 45.12237762237762, 'alnum_prop': 0.46129407206509104, 'repo_name': 'zorallina26/mnis', 'id': 'a46409831a77a6a8817aed321c70f298584c88d9', 'size': '13019', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18299'}, {'name': 'HTML', 'bytes': '65558'}, {'name': 'JavaScript', 'bytes': '4918'}]}
package org.kvj.bravo7.form.impl.bundle; import android.os.Bundle; import org.kvj.bravo7.form.BundleAdapter; public class LongBundleAdapter extends BundleAdapter<Long> { @Override public Long get(Bundle bundle, String name, Long def) { return bundle.getLong(name, def); } @Override public void set(Bundle bundle, String name, Long value) { bundle.putLong(name, value); } }
{'content_hash': 'b8bf111f500d5911c41c39ca3f81a122', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 60, 'avg_line_length': 20.473684210526315, 'alnum_prop': 0.7480719794344473, 'repo_name': 'Doctor-Andonuts/taskwarriorandroid', 'id': 'b8e8f11187a1744470e8dd4d99430dae3b59e040', 'size': '389', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Lima1Common/src/main/java/org/kvj/bravo7/form/impl/bundle/LongBundleAdapter.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '659148'}, {'name': 'C++', 'bytes': '1864451'}, {'name': 'CMake', 'bytes': '108766'}, {'name': 'Java', 'bytes': '401627'}, {'name': 'Perl', 'bytes': '1100043'}, {'name': 'Python', 'bytes': '787760'}, {'name': 'Shell', 'bytes': '43961'}, {'name': 'VimL', 'bytes': '12652'}]}
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* | ------------------------------------------------------------------------- | URI ROUTING | ------------------------------------------------------------------------- | This file lets you re-map URI requests to specific controller functions. | | Typically there is a one-to-one relationship between a URL string | and its corresponding controller class/method. The segments in a | URL normally follow this pattern: | | example.com/class/method/id/ | | In some instances, however, you may want to remap this relationship | so that a different class/function is called than the one | corresponding to the URL. | | Please see the user guide for complete details: | | http://codeigniter.com/user_guide/general/routing.html | | ------------------------------------------------------------------------- | RESERVED ROUTES | ------------------------------------------------------------------------- | | There are three reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded. | | $route['404_override'] = 'errors/page_missing'; | | This route will tell the Router which controller/method to use if those | provided in the URL cannot be matched to a valid route. | | $route['translate_uri_dashes'] = FALSE; | | This is not exactly a route, but allows you to automatically route | controller and method names that contain dashes. '-' isn't a valid | class or method name character, so it requires translation. | When you set this option to TRUE, it will replace ALL dashes in the | controller and method URI segments. | | Examples: my-controller/index -> my_controller/index | my-controller/my-method -> my_controller/my_method */ $route['default_controller'] = 'member'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE;
{'content_hash': 'cc9d4b5aad6a3e118814c2107e8d4298', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 75, 'avg_line_length': 36.44444444444444, 'alnum_prop': 0.6255081300813008, 'repo_name': 'neusdq/www', 'id': '4336de20e6248e37d6ffc018c9aa5443653adf8a', 'size': '1968', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'application/config/routes.php', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1584'}, {'name': 'CSS', 'bytes': '269550'}, {'name': 'Go', 'bytes': '15680'}, {'name': 'HTML', 'bytes': '9598186'}, {'name': 'JavaScript', 'bytes': '668442'}, {'name': 'PHP', 'bytes': '2480996'}, {'name': 'Python', 'bytes': '12750'}]}
var express = require('express'); var router = express.Router(); var winston = require('winston'); var bodyParser = require('body-parser'); var Status = require(global.root + '/config/status'); var APICustomError = require(global.root + '/error/APICustomError'); var Job = require(global.root + '/model/jobDAO'); var Result = require(global.root + '/model/resultDAO'); var auth = require(global.root + '/route/middleware/auth'); var permissions = require(global.root + '/model/permissions'); router.use(bodyParser.urlencoded({extended: false})); router.use(bodyParser.json()); const GET_JOBS_PERM = 19; const GET_RESULT_PERM = 0; /** * @swagger * /job: * get: * tags: * - Job * description: Returns a list of all jobs. * parameters: * - name: x-access-token * in: header * required: true * type: string * produces: * - application/json * responses: * 200: * description: An array with all the jobs. * type: array * items: * $ref: '#/definitions/Job' * 401: * description: Unauthorized. * 500: * description: Internal Server Error. */ router.get('/', auth(GET_JOBS_PERM), function(req, res, next) { winston.info("Getting all 'job'-s..."); Job.find({}, function(err, jobs) { if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } for (var i = 0; i != jobs.length; i++) { jobs[i] = jobs[i].toDTO(); } res.status(Status.OK).json(jobs); }); }); /** * @swagger * /job/{uuid}: * get: * tags: * - Job * description: Returns a job based on uuid. * parameters: * - name: uuid * in: path * required: true * type: string * - name: x-access-token * in: header * required: true * type: string * produces: * - application/json * responses: * 200: * description: All information regarding a job. * schema: * $ref: '#/definitions/Job' * 401: * description: Unauthorized. * 404: * description: Not Found. * 500: * description: Internal Server Error. */ router.get('/:jobUuid', auth(GET_JOBS_PERM), function(req, res, next) { winston.info("Getting 'job' by uuid..."); var jobUuid = req.params["jobUuid"]; Job.findOne({uuid: jobUuid}, function(err, job) { if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } if (job == null) { winston.error("Not found!"); next(new APICustomError(Status.NotFound)); return; } res.status(Status.OK).json(job.toDTO()); }); }); /** * @swagger * /job/{uuid}/result: * get: * tags: * - Job * description: Returns a the result of the given job. * parameters: * - name: uuid * in: path * required: true * type: string * - name: x-access-token * in: header * required: true * type: string * produces: * - application/json * responses: * 200: * description: The job result. * schema: * $ref: '#/definitions/Result' * 401: * description: Unauthorized. * 404: * description: Not Found. * 500: * description: Internal Server Error. */ router.get('/:jobUuid/result', auth(GET_RESULT_PERM), function(req, res, next) { winston.info("Getting 'job' result by uuid..."); var jobUuid = req.params["jobUuid"]; var payload = req.body; Job.findOne({uuid: jobUuid}, function(err, job) { if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } if (job == null) { winston.error("Not found!"); next(new APICustomError(Status.NotFound)); return; } if (job.result == undefined) { res.status(Status.OK).json({}); return; } res.status(Status.OK).json(job.result.toDTO()); }); }); /** * @swagger * /job/{uuid}/result: * post: * tags: * - Job * description: Post job result. Can only be used by jobrunner. * parameters: * - name: uuid * in: path * required: true * type: string * - name: x-access-token * in: header * required: true * type: string * produces: * - application/json * responses: * 201: * description: Job result submitted. * 401: * description: Unauthorized. * 404: * description: Not Found. * 500: * description: Internal Server Error. */ router.post('/:jobUuid/result', auth(permissions.special.JOBRUNNER), function(req, res, next) { winston.info("Creating 'job' result by uuid..."); var jobUuid = req.params["jobUuid"]; var payload = req.body; Job.findOne({uuid: jobUuid}, function(err, job) { if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } if (job == null) { winston.error("Not found!"); next(new APICustomError(Status.NotFound)); return; } winston.debug("Creating result ...."); var result = new Result(payload); result.save(function (err) { if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } winston.debug("Updating job ..."); job.result = result; job.status = "Completed"; job.save(function (err) { winston.debug("Job saved!"); if (err) { winston.error(err); next(new APICustomError(Status.InternalServerError)); return; } res.status(Status.Created).send(); }); }); }); }); module.exports = router;
{'content_hash': 'e5dd3fb709c4358a569f70fb943c31dd', 'timestamp': '', 'source': 'github', 'line_count': 243, 'max_line_length': 95, 'avg_line_length': 26.25102880658436, 'alnum_prop': 0.51638187803731, 'repo_name': 'code31415926535/olympos', 'id': '3b04a8b9312451781f22d5d033fd0c135287477f', 'size': '6379', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'api/src/route/job.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '23434'}, {'name': 'HTML', 'bytes': '5526'}, {'name': 'JavaScript', 'bytes': '192587'}, {'name': 'Python', 'bytes': '44096'}, {'name': 'Shell', 'bytes': '6802'}]}
class AddAccountTypeToBankAccountEndpoint < ActiveRecord::Migration def change execute %Q{ CREATE OR REPLACE VIEW "1"."bank_accounts" AS SELECT ba.user_id, b.name AS bank_name, b.code AS bank_code, ba.account, ba.account_digit, ba.agency, ba.agency_digit, ba.owner_name, ba.owner_document, ba.created_at, ba.updated_at, ba.id AS bank_account_id, ba.bank_id, ba.account_type FROM (bank_accounts ba JOIN banks b ON ((b.id = ba.bank_id))) WHERE is_owner_or_admin(ba.user_id); } end end
{'content_hash': '8c16b10c22dce4d565b8a311e4662b69', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 67, 'avg_line_length': 23.125, 'alnum_prop': 0.6522522522522523, 'repo_name': 'danielweinmann/catarse', 'id': '5679cfae88039bd2d24a0eb1df30d95fd7d9e04b', 'size': '555', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'db/migrate/20170302145903_add_account_type_to_bank_account_endpoint.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '326918'}, {'name': 'DOT', 'bytes': '745'}, {'name': 'JavaScript', 'bytes': '174330'}, {'name': 'Ruby', 'bytes': '485980'}]}
/** \file stlsoft/smartptr/scoped_handle.hpp * * \brief [C++ only] Definition of the stlsoft::scoped_handle smart * pointer class template * (\ref group__library__smart_pointers "Smart Pointers" Library). */ #ifndef STLSOFT_INCL_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE #define STLSOFT_INCL_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION # define STLSOFT_VER_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE_MAJOR 5 # define STLSOFT_VER_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE_MINOR 4 # define STLSOFT_VER_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE_REVISION 3 # define STLSOFT_VER_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE_EDIT 667 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ /* ///////////////////////////////////////////////////////////////////////// * Includes */ #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT # include <stlsoft/stlsoft.h> #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */ #if defined(STLSOFT_COMPILER_IS_BORLAND) # include <stlsoft/smartptr/scoped_handle_borland_.hpp> #else /* ? compiler */ /* ///////////////////////////////////////////////////////////////////////// * Compiler warnings */ #if defined(STLSOFT_COMPILER_IS_MSVC) && \ _MSC_VER >= 1400 # pragma warning(push) # pragma warning(disable : 4191) #endif /* compiler */ /* ///////////////////////////////////////////////////////////////////////// * Namespace */ #ifndef _STLSOFT_NO_NAMESPACE namespace stlsoft { #endif /* _STLSOFT_NO_NAMESPACE */ /* ///////////////////////////////////////////////////////////////////////// * Classes */ #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION template <ss_typename_param_k H> struct H_holder { /// \name Member Types /// @{ public: typedef H resource_type; typedef H handle_type; typedef H_holder<H> class_type; /// @} /// \name Construction /// @{ public: H_holder(H h) : bPointer(false) { this->u.h = h; } H_holder(H* ph) : bPointer(true) { this->u.ph = ph; } /// @} /// \name Operations /// @{ public: H get() const { return bPointer ? *u.ph : u.h; } void set(H h) { (bPointer ? *u.ph : u.h) = h; } /// @} /// \name Member Variables /// @{ public: union { H h; H* ph; } u; const bool bPointer; /// @} private: H_holder(class_type const&); class_type& operator =(class_type const&); }; # ifdef STLSOFT_CF_CDECL_SUPPORTED template< ss_typename_param_k H , ss_typename_param_k R > struct function_translator_cdecl { private: typedef void (STLSOFT_CDECL* degenerate_function_type)(); // C++-98; 5.2.10;6 public: typedef R (STLSOFT_CDECL* function_type)(H); typedef R (STLSOFT_CDECL* indirect_function_type)(H*); typedef H_holder<H> holder_type; static void translate(holder_type& h, degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_ASSERT(!h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.h); } static void translate_indirect(holder_type& h, degenerate_function_type pv) { indirect_function_type fn = reinterpret_cast<indirect_function_type>(pv); STLSOFT_ASSERT(h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.ph); } }; # endif /* STLSOFT_CF_CDECL_SUPPORTED */ # ifdef STLSOFT_CF_FASTCALL_SUPPORTED template< ss_typename_param_k H , ss_typename_param_k R > struct function_translator_fastcall { private: typedef void (STLSOFT_CDECL* degenerate_function_type)(); public: typedef R (STLSOFT_FASTCALL* function_type)(H); typedef R (STLSOFT_FASTCALL* indirect_function_type)(H*); typedef H_holder<H> holder_type; static void translate(holder_type& h, degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_ASSERT(!h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.h); } static void translate_indirect(holder_type& h, degenerate_function_type pv) { indirect_function_type fn = reinterpret_cast<indirect_function_type>(pv); STLSOFT_ASSERT(h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.ph); } }; # endif /* STLSOFT_CF_FASTCALL_SUPPORTED */ # ifdef STLSOFT_CF_STDCALL_SUPPORTED template< ss_typename_param_k H , ss_typename_param_k R > struct function_translator_stdcall { private: typedef void (STLSOFT_CDECL* degenerate_function_type)(); public: typedef R (STLSOFT_STDCALL* function_type)(H); typedef R (STLSOFT_STDCALL* indirect_function_type)(H*); typedef H_holder<H> holder_type; static void translate(holder_type& h, degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_ASSERT(!h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.h); } static void translate_indirect(holder_type& h, degenerate_function_type pv) { indirect_function_type fn = reinterpret_cast<indirect_function_type>(pv); STLSOFT_ASSERT(h.bPointer); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(h.u.ph); } }; # endif /* STLSOFT_CF_STDCALL_SUPPORTED */ # ifdef STLSOFT_CF_CDECL_SUPPORTED template< ss_typename_param_k R > struct function_translator_cdecl_void { private: typedef void (STLSOFT_CDECL *degenerate_function_type)(); // C++-98; 5.2.10;6 public: typedef R (STLSOFT_CDECL *function_type)(void); static void translate(degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(); } }; # endif /* STLSOFT_CF_CDECL_SUPPORTED */ # ifdef STLSOFT_CF_FASTCALL_SUPPORTED template< ss_typename_param_k R > struct function_translator_fastcall_void { private: typedef void (STLSOFT_CDECL *degenerate_function_type)(); public: typedef R (STLSOFT_FASTCALL *function_type)(void); static void translate(degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(); } }; # endif /* STLSOFT_CF_FASTCALL_SUPPORTED */ # ifdef STLSOFT_CF_STDCALL_SUPPORTED template< ss_typename_param_k R > struct function_translator_stdcall_void { private: typedef void (STLSOFT_CDECL *degenerate_function_type)(); public: typedef R (STLSOFT_STDCALL *function_type)(void); static void translate(degenerate_function_type pv) { function_type fn = reinterpret_cast<function_type>(pv); STLSOFT_MESSAGE_ASSERT("function pointer must not be NULL", NULL != fn); fn(); } }; # endif /* STLSOFT_CF_STDCALL_SUPPORTED */ #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ /** \brief Provides automated scope-based cleanup of arbitrary resource * types without any memory allocation required to implement the generic * support. * * \ingroup group__library__smart_pointers * * The template is parameterised on the resource type (e.g. FILE*, int, void*) * and instances are initialised from a resource handle and the address of a * (single-parameter) cleanup function, as in: * \code ::stlsoft::scoped_handle<void*> h3(::malloc(100), ::free); \endcode * * or: * \code ::stlsoft::scoped_handle<int> h1(::open("file.ext"), ::close); \endcode * * or: * \code FILE* file = ::fopen("file.ext", "r"); ::stlsoft::scoped_handle<FILE*> h2(file, ::fclose); \endcode * * \note This class provides externally-initialised immutable-RAII (see section * 3.5 of Imperfect C++; http://imperfectcplusplus.com/). The managed resource * must be provided in the constructor, and the managing instance cannot be set * to manage another resource. However, there is a nod to convenience in so far * as there is a detach() method, which can be used to clear the resource from * the managing instance and return it to the calling context. */ template<ss_typename_param_k H> class scoped_handle { /// \name Types /// @{ private: typedef void (STLSOFT_CDECL* degenerate_function_type)(); typedef H_holder<H> holder_type; public: /// \brief The resource type typedef H resource_type; /// \brief The handle type typedef H handle_type; /// \brief The instantiation of the type typedef scoped_handle<H> class_type; /// @} /// \name Construction /// @{ public: #ifdef STLSOFT_CF_CDECL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up function with void return type scoped_handle( resource_type h , void (STLSOFT_CDECL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_cdecl<H, void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up function with void return type scoped_handle( resource_type* ph , void (STLSOFT_CDECL *f)(resource_type*) , resource_type hNull = 0) : m_hh(ph) , m_hNull(hNull) , m_tfn(&function_translator_cdecl<H, void>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type h , R (STLSOFT_CDECL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_cdecl<H, R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type* ph , R (STLSOFT_CDECL *f)(resource_type*) , resource_type hNull = 0) : m_hh(ph) , m_hNull(hNull) , m_tfn(&function_translator_cdecl<H, R>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_CDECL_SUPPORTED */ #ifdef STLSOFT_CF_FASTCALL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up "fastcall" function with void return type scoped_handle( resource_type h , void (STLSOFT_FASTCALL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_fastcall<H, void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up "fastcall" function with void return type scoped_handle( resource_type h , void (STLSOFT_FASTCALL *f)(resource_type *) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_fastcall<H, void>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up "fastcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type h , R (STLSOFT_FASTCALL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_fastcall<H, R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up "fastcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type* ph , R (STLSOFT_FASTCALL *f)(resource_type*) , resource_type hNull = 0) : m_hh(ph) , m_hNull(hNull) , m_tfn(&function_translator_fastcall<H, R>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */ #ifdef STLSOFT_CF_STDCALL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up "stdcall" function with void return type scoped_handle( resource_type h , void (STLSOFT_STDCALL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_stdcall<H, void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up "stdcall" function with void return type scoped_handle( resource_type* ph , void (STLSOFT_STDCALL *f)(resource_type*) , resource_type hNull = 0) : m_hh(ph) , m_hNull(hNull) , m_tfn(&function_translator_stdcall<H, void>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up "stdcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type h , R (STLSOFT_STDCALL *f)(resource_type) , resource_type hNull = 0) : m_hh(h) , m_hNull(hNull) , m_tfn(&function_translator_stdcall<H, R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } /// \brief Construct from a resource handle and an indirect clean-up "stdcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( resource_type* ph , R (STLSOFT_STDCALL *f)(resource_type*) , resource_type hNull = 0) : m_hh(ph) , m_hNull(hNull) , m_tfn(&function_translator_stdcall<H, R>::translate_indirect) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_STDCALL_SUPPORTED */ /// \brief "Releases" the managed resource. /// /// Invokes the cleanup function, unless close() or detach() have /// already been called ~scoped_handle() { STLSOFT_MESSAGE_ASSERT("Invariant violation: function pointer must not be NULL", NULL != m_fn); if(!empty()) { m_tfn(m_hh, m_fn); } } /// @} /// \name Attributes /// @{ public: /// \brief Indicates whether the instance holds a non-"null" resource bool empty() const { STLSOFT_MESSAGE_ASSERT("Invariant violation: function pointer must not be NULL", NULL != m_fn); return get_null_value_() == m_hh.get(); } /// @} /// \name Operations /// @{ public: /// \brief Closes the handle immediately /// /// \note Calling this method more than once has no effect. void close() { STLSOFT_MESSAGE_ASSERT("Invariant violation: function pointer must not be NULL", NULL != m_fn); if(!empty()) { m_tfn(m_hh, m_fn); m_hh.set(get_null_value_()); } } /// \brief Detaches the resource, and returns it to the caller. /// /// \remarks Calling this method removes the resource from the managing /// instance, so it will not be automatically closed. resource_type detach() { STLSOFT_MESSAGE_ASSERT("Invariant violation: function pointer must not be NULL", NULL != m_fn); resource_type h = m_hh.get(); m_hh.set(get_null_value_()); return h; } /// @} /// \name Accessors /// @{ public: /// \brief Provides the bare resource handle to the caller. Does not /// detach the handle from the managing instance. /// /// \deprecated Deprecated in favour of get() resource_type handle() const { #if defined(STLSOFT_COMPILER_IS_WATCOM) return (resource_type)(m_hh.get()); #else /* ? compiler */ return const_cast<resource_type>(m_hh.get()); #endif /* compiler */ } /// \brief Provides the bare resource handle to the caller. Does not detach the /// handle from the managing instance. resource_type get() const { return const_cast<class_type&>(*this).m_hh.get(); } /// @} /// \name Implementation /// @{ private: resource_type get_null_value_() const { return m_hNull; } /// @} /// \name Members /// @{ private: holder_type m_hh; //!< The handle to the managed resource const resource_type m_hNull; //!< The value for the null handle void (*m_tfn)(holder_type&, degenerate_function_type); //!< The function translator function degenerate_function_type m_fn; //!< The actual resource release function /// @} /// \name Not to be implemented /// @{ private: scoped_handle(class_type const&); class_type& operator =(class_type const&); /// @} }; // scoped_handle<void> #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION STLSOFT_TEMPLATE_SPECIALISATION class scoped_handle<void> { /// \name Types /// @{ private: typedef void (STLSOFT_CDECL *degenerate_function_type)(); public: /// \brief The resource type typedef void resource_type; /// \brief The handle type typedef void handle_type; /// \brief The instantiation of the type typedef scoped_handle<void> class_type; /// @} /// \name Construction /// @{ public: #ifdef STLSOFT_CF_CDECL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up function with void return type scoped_handle( void (STLSOFT_CDECL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_cdecl_void<void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up function with non-void return type template <ss_typename_param_k R> scoped_handle( R (STLSOFT_CDECL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_cdecl_void<R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_CDECL_SUPPORTED */ #ifdef STLSOFT_CF_FASTCALL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up "fastcall" function with void return type scoped_handle( void (STLSOFT_FASTCALL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_fastcall_void<void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up "fastcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( R (STLSOFT_FASTCALL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_fastcall_void<R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */ #ifdef STLSOFT_CF_STDCALL_SUPPORTED # if !defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) || \ defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED) /// \brief Construct from a resource handle and a clean-up "stdcall" function with void return type scoped_handle( void (STLSOFT_STDCALL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_stdcall_void<void>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* !STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT || STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ # if defined(STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT) /// \brief Construct from a resource handle and a clean-up "stdcall" function with non-void return type template <ss_typename_param_k R> scoped_handle( R (STLSOFT_STDCALL *f)()) : m_bInvoked(false) , m_tfn(&function_translator_stdcall_void<R>::translate) , m_fn(reinterpret_cast<degenerate_function_type>(f)) { STLSOFT_MESSAGE_ASSERT("Precondition violation: cannot initialise with a NULL function pointer", NULL != f); } # endif /* STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ #endif /* STLSOFT_CF_STDCALL_SUPPORTED */ /// \brief "Releases" the managed resource. /// /// Invokes the cleanup function, unless close() or detach() have /// already been called ~scoped_handle() { close(); } /// @} /// \name Attributes /// @{ public: /// \brief Indicates whether the instance holds a non-"null" resource bool empty() const { return m_bInvoked; } /// @} /// \name Operations /// @{ public: /// \brief Closes the handle immediately /// /// \note Calling this method more than once has no effect. void close() { if(!empty()) { m_tfn(m_fn); m_bInvoked = true; } } /// \brief Detaches the resource, and returns it to the caller. /// /// \remarks Calling this method removes the resource from the managing /// instance, so it will not be automatically closed. resource_type detach() { m_bInvoked = true; } /// @} /// \name Accessors /// @{ public: /// \brief Provides the bare resource handle to the caller. Does not /// detach the handle from the managing instance. /// /// \deprecated Deprecated in favour of get() resource_type handle() const { } /// \brief Provides the bare resource handle to the caller. Does not detach the /// handle from the managing instance. resource_type get() const { } /// @} /// \name Members /// @{ private: ss_bool_t m_bInvoked; //!< Indicates whether the cleanup function has been invoked void (*m_tfn)(degenerate_function_type); //!< The function translator function degenerate_function_type m_fn; //!< The actual resource release function /// @} /// \name Not to be implemented /// @{ private: scoped_handle(class_type const&); class_type& operator =(class_type const&); /// @} }; #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ /* ///////////////////////////////////////////////////////////////////////// * swapping */ template< ss_typename_param_k H > inline void swap(scoped_handle<H>& lhs, scoped_handle<H>& rhs) { lhs.swap(rhs); } //////////////////////////////////////////////////////////////////////////// // Shims template<ss_typename_param_k H> #if defined(STLSOFT_COMPILER_IS_WATCOM) inline H get_handle(scoped_handle<H> const& h) #else /* ? compiler */ inline ss_typename_type_ret_k scoped_handle<H>::handle_type get_handle(scoped_handle<H> const& h) #endif /* compiler */ { return h.get(); } /* ///////////////////////////////////////////////////////////////////////// * Unit-testing */ #ifdef STLSOFT_UNITTEST # include "./unittest/scoped_handle_unittest_.h" #endif /* STLSOFT_UNITTEST */ /* ////////////////////////////////////////////////////////////////////// */ #ifndef _STLSOFT_NO_NAMESPACE } // namespace stlsoft #endif /* _STLSOFT_NO_NAMESPACE */ /* In the special case of Intel behaving as VC++ 7.0 or earlier on Win32, we * illegally insert into the std namespace. */ #if defined(STLSOFT_CF_std_NAMESPACE) # if ( ( defined(STLSOFT_COMPILER_IS_INTEL) && \ defined(_MSC_VER))) && \ _MSC_VER < 1310 namespace std { template< ss_typename_param_k H > inline void swap(stlsoft_ns_qual(scoped_handle)<H>& lhs, stlsoft_ns_qual(scoped_handle)<H>& rhs) { lhs.swap(rhs); } } // namespace std # endif /* INTEL && _MSC_VER < 1310 */ #endif /* STLSOFT_CF_std_NAMESPACE */ /* ////////////////////////////////////////////////////////////////////// */ #endif /* ? compiler */ /* ///////////////////////////////////////////////////////////////////////// * Compiler warnings */ #if defined(STLSOFT_COMPILER_IS_MSVC) && \ _MSC_VER >= 1400 # pragma warning(pop) #endif /* compiler */ /* ////////////////////////////////////////////////////////////////////// */ #endif /* !STLSOFT_INCL_STLSOFT_SMARTPTR_HPP_SCOPED_HANDLE */ /* ///////////////////////////// end of file //////////////////////////// */
{'content_hash': '4edcc006ef0a5b89b23a41462eef1d97', 'timestamp': '', 'source': 'github', 'line_count': 880, 'max_line_length': 128, 'avg_line_length': 33.03636363636364, 'alnum_prop': 0.6085924600990644, 'repo_name': 'RichieSams/thehalflingproject', 'id': 'c5d0be316783af76ff0820bc889f756ae3ebb391', 'size': '31220', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'libs/stlsoft/include/stlsoft/smartptr/scoped_handle.hpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '63'}, {'name': 'C', 'bytes': '535455'}, {'name': 'C#', 'bytes': '8542'}, {'name': 'C++', 'bytes': '11857718'}, {'name': 'HLSL', 'bytes': '112050'}, {'name': 'Rich Text Format', 'bytes': '46532'}]}
@interface VerifyViewController : UIViewController<RegisterViaPhoneNumberDelegate, ConnectIMServerDelegate> @property (nonatomic, copy) NSString *phoneNumber; @end
{'content_hash': '182292b5484d648d347f31fa494364a4', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 107, 'avg_line_length': 33.2, 'alnum_prop': 0.8493975903614458, 'repo_name': 'Re-cover/VChat', 'id': '3e13b3f1c0e5500807028f4b7dc1c083bd2daebd', 'size': '378', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'VChat/Register/VerifyViewController.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '150404'}, {'name': 'Ruby', 'bytes': '363'}]}
BEGIN TRANSACTION; CREATE TABLE "posts" ( id VARCHAR(255) NOT NULL PRIMARY KEY, path VARCHAR(255) NOT NULL, created UNSIGNED INTEGER NOT NULL, updated UNSIGNED INTEGER NOT NULL, title VARCHAR(255) NOT NULL, author VARCHAR(255) NOT NULL, draft INT(1) NOT NULL, public INT(1) NOT NULL, body TEXT NOT NULL, tags VARCHAR(255) ); CREATE INDEX visible ON posts ( created, draft, public ); CREATE INDEX visible_tags ON posts ( tags, created, draft, public ); CREATE INDEX visible_author ON posts ( author, created, draft, public ); COMMIT;
{'content_hash': 'd6df42bb8a0fec0580a78fc8efefc72f', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 72, 'avg_line_length': 28.8, 'alnum_prop': 0.6979166666666666, 'repo_name': 'weierophinney/mwop.net', 'id': '4877f55a7b3f1b37ed2da9e7a9c6ab373b507c97', 'size': '576', 'binary': False, 'copies': '2', 'ref': 'refs/heads/main', 'path': 'data/posts.sql', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '2756'}, {'name': 'Dockerfile', 'bytes': '3296'}, {'name': 'HTML', 'bytes': '134026'}, {'name': 'JavaScript', 'bytes': '2783'}, {'name': 'Makefile', 'bytes': '3293'}, {'name': 'PHP', 'bytes': '401163'}, {'name': 'Shell', 'bytes': '5059'}]}
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("03. DecimalTo Hexaecimal")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("03. DecimalTo Hexaecimal")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f621f7e7-ee7d-4b0d-aa91-591553432245")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{'content_hash': 'af14ffaca376db20abe8fada7c2b43ed', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 84, 'avg_line_length': 39.47222222222222, 'alnum_prop': 0.745249824067558, 'repo_name': 'IvanGrigorov/CSharp-2', 'id': '52779c82dbabdc2a51b487de1b2d639901d2c417', 'size': '1424', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'NumeralSystems/03. DecimalTo Hexaecimal/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '232977'}]}
package stericson.RootTools; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.LineNumberReader; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.concurrent.TimeoutException; //no modifier, this is package-private which means that no one but the library can access it. class InternalMethods { //-------------------- //# Internal methods # //-------------------- protected boolean returnPath() throws TimeoutException { File tmpDir = new File("/data/local/tmp"); try { if (!tmpDir.exists()) { RootTools.sendShell(new String[]{"mkdir /data/local/tmp"}, 0, InternalVariables.timeout); } InternalVariables.path = new HashSet<String>(); //Try to read from the file. LineNumberReader lnr = null; RootTools.sendShell(new String[]{"dd if=/init.rc of=/data/local/tmp/init.rc", "chmod 0777 /data/local/tmp/init.rc"}, 0, InternalVariables.timeout); lnr = new LineNumberReader(new FileReader("/data/local/tmp/init.rc")); String line; while ((line = lnr.readLine()) != null) { RootTools.log(line); if (line.contains("export PATH")) { int tmp = line.indexOf("/"); InternalVariables.path = new HashSet<String>(Arrays.asList(line.substring(tmp).split(":"))); return true; } } return false; } catch (Exception e) { if (RootTools.debugMode) { RootTools.log("Error: " + e.getMessage()); e.printStackTrace(); } return false; } } protected ArrayList<Mount> getMounts() throws FileNotFoundException, IOException { LineNumberReader lnr = null; try { lnr = new LineNumberReader(new FileReader("/proc/mounts")); String line; ArrayList<Mount> mounts = new ArrayList<Mount>(); while ((line = lnr.readLine()) != null) { RootTools.log(line); String[] fields = line.split(" "); mounts.add(new Mount( new File(fields[0]), // device new File(fields[1]), // mountPoint fields[2], // fstype fields[3] // flags )); } return mounts; } finally { //no need to do anything here. } } protected ArrayList<Symlink> getSymLinks() throws FileNotFoundException, IOException { LineNumberReader lnr = null; try { lnr = new LineNumberReader(new FileReader("/data/local/symlinks.txt")); String line; ArrayList<Symlink> symlink = new ArrayList<Symlink>(); while ((line = lnr.readLine()) != null) { RootTools.log(line); String[] fields = line.split(" "); symlink.add(new Symlink( new File(fields[fields.length - 3]), // file new File(fields[fields.length - 1]) // SymlinkPath )); } return symlink; } finally { //no need to do anything here. } } protected Permissions getPermissions(String line) { String[] lineArray = line.split(" "); String rawPermissions = lineArray[0]; if (rawPermissions.length() == 10 && (rawPermissions.charAt(0) == '-' || rawPermissions.charAt(0) == 'd' || rawPermissions.charAt(0) == 'l') && (rawPermissions.charAt(1) == '-' || rawPermissions.charAt(1) == 'r') && (rawPermissions.charAt(2) == '-' || rawPermissions.charAt(2) == 'w')) { RootTools.log(rawPermissions); Permissions permissions = new Permissions(); permissions.setType(rawPermissions.substring(0, 1)); RootTools.log(permissions.getType()); permissions.setUserPermissions(rawPermissions.substring(1, 4)); RootTools.log(permissions.getUserPermissions()); permissions.setGroupPermissions(rawPermissions.substring(4, 7)); RootTools.log(permissions.getGroupPermissions()); permissions.setOtherPermissions(rawPermissions.substring(7, 10)); RootTools.log(permissions.getOtherPermissions()); String finalPermissions; finalPermissions = Integer.toString(parsePermissions(permissions.getUserPermissions())); finalPermissions += Integer.toString(parsePermissions(permissions.getGroupPermissions())); finalPermissions += Integer.toString(parsePermissions(permissions.getOtherPermissions())); permissions.setPermissions(Integer.parseInt(finalPermissions)); return permissions; } return null; } protected int parsePermissions(String permission) { int tmp; if (permission.charAt(0) == 'r') tmp = 4; else tmp = 0; RootTools.log("permission " + tmp); RootTools.log("character " + permission.charAt(0)); if (permission.charAt(1) == 'w') tmp = tmp + 2; else tmp = tmp + 0; RootTools.log("permission " + tmp); RootTools.log("character " + permission.charAt(1)); if (permission.charAt(2) == 'x') tmp = tmp + 1; else tmp = tmp + 0; RootTools.log("permission " + tmp); RootTools.log("character " + permission.charAt(2)); return tmp; } /* * @return long Size, converted to kilobytes (from xxx or xxxm or xxxk etc.) */ protected long getConvertedSpace(String spaceStr) { try { double multiplier = 1.0; char c; StringBuffer sb = new StringBuffer(); for (int i = 0; i < spaceStr.length(); i++) { c = spaceStr.charAt(i); if (!Character.isDigit(c) && c != '.') { if (c == 'm' || c == 'M') { multiplier = 1024.0; } else if (c == 'g' || c == 'G') { multiplier = 1024.0 * 1024.0; } break; } sb.append(spaceStr.charAt(i)); } return (long) Math.ceil(Double.valueOf(sb.toString()) * multiplier); } catch (Exception e) { return -1; } } }
{'content_hash': '39c960e10b2b7dbb091f4b668c6bb635', 'timestamp': '', 'source': 'github', 'line_count': 200, 'max_line_length': 115, 'avg_line_length': 32.73, 'alnum_prop': 0.544607393828292, 'repo_name': 'FunnyParty/ADAT', 'id': '2e5b4b80e1257c984e334dd106e447679a8172c5', 'size': '7552', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/stericson/RootTools/InternalMethods.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '1046'}, {'name': 'Java', 'bytes': '138799'}]}
<?php if (file_exists(__DIR__.'/vendor/autoload.php')) { require_once __DIR__.'/vendor/autoload.php'; } else { spl_autoload_register(function ($class) { // project-specific namespace prefix $prefix = 'MessageBird\\'; // base directory for the namespace prefix $base_dir = __DIR__ . '/src/MessageBird/'; // does the class use the namespace prefix? $len = strlen($prefix); if (strncmp($prefix, $class, $len) !== 0) { // no, move to the next registered autoloader return; } // get the relative class name $relative_class = substr($class, $len); // replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require $file; } }); }
{'content_hash': '273b6b711c15ef8e475bb70c08beea6c', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 82, 'avg_line_length': 31.757575757575758, 'alnum_prop': 0.5601145038167938, 'repo_name': 'dennisvdvliet/php-rest-api', 'id': 'e37a6b6b815b3642ebbe7956205b8bd479698958', 'size': '1048', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'autoload.php', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'PHP', 'bytes': '247611'}]}
This application makes use of the following third party libraries: ## Alamofire Copyright (c) 2014–2016 Alamofire Software Foundation (http://alamofire.org/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Kingfisher The MIT License (MIT) Copyright (c) 2015 Wei Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## MBProgressHUD Copyright (c) 2009-2015 Matej Bukovinski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Reveal-iOS-SDK # REVEAL LICENSE AGREEMENT v1.1 ## NOTICE TO USER: This is a legally enforceable agreement between you (__"you"__ or __"yours"__ and other grammatical equivalents) and Itty Bitty Apps Pty Ltd. (__"the Company"__), which covers your use of the Reveal software product that accompanies this Agreement and related software components, which may include associated media, printed materials, and "online" or electronic documentation. All such software and materials are referred to herein as the __"Software"__ or __"the Reveal Software"__. If you do not agree to the terms of this License Agreement, then do not install or use the Software. By explicitly accepting this License Agreement, or by installing, copying, downloading, accessing, or otherwise using the Software, you are acknowledging and agreeing to be bound by the following terms: ## 1. DEFINITIONS __(a) "Software"__ shall mean the Reveal software including any Updates thereto, in object and source form, and the media and Documentation provided by the Company to you and for which you are granted a license pursuant to this Agreement. __(b) "Documentation"__ shall mean the printed or online written reference material furnished to you in conjunction with the Software, including, without limitation, instructions, guidelines, and end user guides. __(c) "Intellectual Property Rights"__ shall mean all intellectual property rights, including, without limitation, patent, copyright, trademark, and trade secret. __(d) "Updates"__ shall mean a modification, error correction, bug fix, new release, or other update to or for the Software. ## 2. LICENSE GRANT The Company may, at its sole discretion, grant you a Trial License, a Personal License, an Educational License, a Commercial Seat License, a Site License or an Enterprise License. If you have not purchased or otherwise rightfully obtained a Personal License, an Educational License, a Commercial Seat License, a Site License or an Enterprise License for the Reveal Software, the Trial License Terms (2.1) are applicable to your use of the Reveal Software. The Trial License Terms are also applicable to any usage of the Reveal Software by you that is not covered under any other licenses you may have. The Personal License Terms (2.2) apply if you have a Personal License. The Commercial Seat License Terms (2.3) apply if you have a Commercial Seat License. The Educational License Terms (2.4) apply if you have an Educational License. The Site License Terms (2.5) apply if you have a Site License. The Enterprise License Terms (2.6) apply if you have an Enterprise License. The General Terms (3) apply in all cases. ### 2.1 TRIAL LICENSE TERMS The Company grants you a non-exclusive license to use the Software for time-limited evaluation purposes, only in accordance with the terms and conditions set forth herein. The Software may be used for a period of 30 calendar days from the first time you run the Software. Upon lapse of such trial period all of or part of the functionality of the Software will be disabled automatically. If you wish to use the Software after the trial period, you must purchase a Personal License, a Commercial Seat License, an Educational License, a Site License or an Enterprise License. The Company may extend to you an expiring license key, in which event such a license key will be considered a means to extend the trial period under the Trial License Terms. ### 2.2 PERSONAL LICENSE TERMS The Company grants you a non-exclusive license to use the Software, only in accordance with the terms and conditions set forth herein. This License grants you the right to activate and use the Software on no more than 2 computers primarily used by you. Use of the Software under this license may be for both commercial and non-commercial purposes. Personal licences are not available to companies, commercial institutions, government agencies or business entities. ### 2.3 COMMERCIAL SEAT LICENSE TERMS The Company grants you a non-exclusive license to use the Software, only in accordance with the terms and conditions set forth herein. This License is only available to companies, commercial institutions, government agencies and business entities. This License does not allow the Software to be activated and used on computers that are not either a) owned by you, b) owned by any fully owned subsidiary of yours, c) owned by or operated primarily by your employees or employees of any fully owned subsidiary of yours. A Commercial Seat License must be purchased for every person employed by you or employed by any fully owned subsidiary of yours wishing to use the Software. This license is granted exclusively on a per-employee basis within your organisation and is not transferable to another current employee without written permission. This License does not allow the use of the Software other than for business purposes of your company. If entering into a Commercial Seat License you personally warrant that you have full legal authority to enter into this agreement on behalf of your employer. ### 2.4 EDUCATIONAL LICENSE TERMS The Company grants you a non-exclusive license to use the Software, only in accordance with the terms and conditions set forth herein. This License grants you the right to activate and use the Software on no more than 2 computers primarily used by you. Educational Licenses are available only to individual students and teaching staff. Use of the Software under this license must be for non-commercial purposes only, including education and research. ### 2.5 SITE LICENSE TERMS The Company grants you a non-exclusive license to use the Software, only in accordance with the terms and conditions set forth herein. This License is only available to companies, commercial institutions, government agencies and business entities. This License does not allow the Software to be activated and used on computers that are not either a) owned by you, b) owned by any fully owned subsidiary of yours, c) owned by or operated primarily by your employees or employees of any fully owned subsidiary of yours. Unless otherwise specified, any Site License you acquire from the Company is valid only for use at the business locations listed on your sales invoice. This License does not allow the use of the Software other than for business purposes of your company. If entering into a Site License you personally warrant that you have full legal authority to enter into this agreement on behalf of your employer. ### 2.6 ENTERPRISE LICENSE TERMS The Company grants you a non-exclusive license to use the Software, only in accordance with the terms and conditions set forth herein. This License is only available to companies, commercial institutions, government agencies and business entities. This License does not allow the Software to be activated and used on computers that are not either a) owned by you, b) owned by any fully owned subsidiary of yours, c) owned by or operated primarily by your employees or employees of any fully owned subsidiary of yours. This License allows global use of the Software by all employees or employees of any fully owned subsidiary of the company, commercial institution, government agency or business entity listed in your sales invoice. This License does not allow the use of the Software other than for business purposes of your company. If entering into an Enterprise License you personally warrant that you have full legal authority to enter into this agreement on behalf of your employer. ## 3. GENERAL TERMS ### 3.1 TITLE ‘REVEAL’™ and ‘ITTY BITTY APPS’™ represent proprietary common law trademarks owned by the Company and must not be used without written permission. The Company shall own and retain all right, title and interest in and to all Intellectual Property Rights related to the Software, the Documentation and all improvements to any of them however so created. You do not acquire any other rights, express or implied, in the Software. ALL RIGHTS NOT EXPRESSLY GRANTED HEREUNDER ARE RESERVED TO THE COMPANY. ### 3.2 ARCHIVAL OR BACKUP COPIES You may copy the Software for backup and archival purposes only, provided that the original and each copy is kept in your possession and that your installation and use of the Software does not exceed that allowed in the "License Grant" section above. ### 3.3 THINGS YOU MUST NOT DO The Software and Documentation are protected by Australian and international copyright law. You must treat the Software and Documentation like any other copyrighted material—for example, a book. You may not: * copy the Documentation, * copy the Software except to make archival or backup copies as provided above, * modify or adapt the Software or merge it into another program, * reverse engineer, disassemble, decompile or make any attempt to discover the source code of the Software, * place the Software onto a server so that it is accessible via a public network such as the Internet, or * sublicense, rent, lease, sublicense or lend any portion of the Software or Documentation. ### 3.4 LIMITATION OF LICENSE VALIDITY Any License to use the Software granted to you under this License Agreement is limited to the current major release of the Software exclusively. The Company will at its sole discretion decide when a version of the Software will be considered a new major release. The Company reserves the right to change the terms of this agreement in any future major or minor release of the software. ### 3.5 ADDITIONAL SERVICES Fees may apply for additional services and products offered by the company and others, such as services that integrate with the Software or extend the functionality of the Software. ### 3.6 TECHNICAL AND RELATED INFORMATION The Company and its subsidiaries may collect and use technical and related information, such as technical information concerning your computer, system and application software. The Company does not collect (a) any information that identifies your work, (b) any file names or file contents of anything you work on using the Software. The Company and its subsidiaries are free to use the collected information in any form that does not personally identify you. ### 3.7 PRIVACY The Company will not sell or in any way license usage of your personal information to third parties. The Company will make reasonable efforts to keep your personal information secure. ### 3.8 TRANSFERS With prior notice to the Company, you may transfer all your rights to use the Software and Documentation only once and permanently to another person or legal entity provided you transfer this License Agreement, the Software and Documentation, including all copies, updates and prior versions to such person or entity and that you retain no copies, including copies stored on computer. The receiving person or legal entity must satisfy the conditions of the applicable license terms set out in section 2. ### 3.9 LIMITED WARRANTY We warrant that for a period of 14 days after delivery of this copy of the Software to you the Software will perform in substantial accordance with the Documentation. To the extent permitted by applicable law, THE FOREGOING LIMITED WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES OR CONDITIONS, EXPRESS OR IMPLIED, AND WE DISCLAIM ANY AND ALL IMPLIED WARRANTIES OR CONDITIONS, INCLUDING ANY IMPLIED WARRANTY OF TITLE, NONINFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, regardless of whether we know or had reason to know of your particular needs. No employee, agent, dealer or distributor of ours is authorized to modify this limited warranty, nor to make any additional warranties. SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION MAY NOT APPLY TO YOU. ### 3.10 LIMITED REMEDY Our entire liability and your exclusive remedy for breach of the foregoing warranty shall be, at our option, to return the price you paid minus fees incurred to transfer those funds to you. IN NO EVENT WILL WE BE LIABLE TO YOU FOR ANY DIRECT OR INDIRECT DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM THE USE OR THE INABILITY TO USE THE SOFTWARE (EVEN IF WE OR AN AUTHORIZED DEALER OR DISTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF THESE DAMAGES), OR FOR ANY CLAIM BY ANY OTHER PARTY. SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION MAY NOT APPLY TO YOU. ### 3.11 TERM AND TERMINATION This license agreement takes effect upon your use of the software and remains effective until terminated. You may terminate it at any time by destroying all copies of the Software and Documentation in your possession. It will also automatically terminate if you fail to comply with any term or condition of this license agreement. You hereby agree that on termination of this license to permanently destroy all copies of the Software and Documentation in your possession. ### 3.12 CONFIDENTIALITY The Software contains trade secrets and proprietary know-how that belong to the Company and it is being made available to you in strict confidence. ANY USE OR DISCLOSURE OF THE SOFTWARE, OR OF ITS ALGORITHMS, PROTOCOLS OR INTERFACES, OTHER THAN IN STRICT ACCORDANCE WITH THIS LICENSE AGREEMENT, MAY BE ACTIONABLE AS A VIOLATION OF THE COMPANY'S TRADE SECRET RIGHTS. ### 3.13 GENERAL PROVISIONS __3.13.1__ This written license agreement is the exclusive agreement between you and the Company concerning the Software and Documentation and supersedes any prior purchase order, communication, advertising or representation concerning the Software. __3.13.2__ This is the entire agreement between the parties relating to the subject matter hereof and all other terms are rejected. No waiver or modification of this Agreement shall be valid unless in writing signed by each party. The waiver of a breach of any term hereof shall in no way be construed as a waiver of any term or other breach hereof. If any provision of this Agreement is held by a court of competent jurisdiction to be contrary to law the remaining provisions of this Agreement shall remain in full force and effect. __3.13.3__ In the event of litigation between you and the Company concerning the Software or Documentation, the prevailing party in the litigation will be entitled to recover attorney fees and expenses from the other party. __3.13.4__ This Agreement, and all disputes arising out of or related thereto, shall be governed by and construed under the laws of the State of Victoria, Australia, without reference to conflict of laws principles. All such disputes shall be subject to the exclusive jurisdiction of the state and federal courts located in Australia, and the parties agree and submit to the personal and exclusive jurisdiction and venue of these courts. ## 4. CONTACT INFORMATION If you have any questions about this License Agreement, or if you want to contact the Company for any reason, please direct all mail correspondence to: Itty Bitty Apps Pty. Ltd. Level 2, 27 Hardware Lane, Melbourne, Victoria, Australia, 3000, or electronic correspondence to info@ittybittyapps.com. Do you agree to be bound by the terms of this agreement? ## SnapKit Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## SwiftyJSON The MIT License (MIT) Copyright (c) 2014 Ruoyu Fu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Generated by CocoaPods - https://cocoapods.org
{'content_hash': 'dc654171d6f452935365c759d40805cd', 'timestamp': '', 'source': 'github', 'line_count': 285, 'max_line_length': 788, 'avg_line_length': 73.50877192982456, 'alnum_prop': 0.8020047732696898, 'repo_name': 'cache0928/CCWeibo', 'id': 'ee7e401960ef50c26ac3c6a0a84ffd86cb2162f1', 'size': '20985', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CCWeibo/Pods/Target Support Files/Pods-CCWeibo/Pods-CCWeibo-acknowledgements.markdown', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '58678'}, {'name': 'Ruby', 'bytes': '373'}, {'name': 'Shell', 'bytes': '26234'}, {'name': 'Swift', 'bytes': '626933'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="fr"> <head> <!-- Generated by javadoc (1.8.0_121) on Thu Jun 15 11:16:07 CEST 2017 --> <title>Overview</title> <meta name="date" content="2017-06-15"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Overview"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li class="navBarCell1Rev">Overview</li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="overview-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="contentContainer"> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Packages table, listing packages, and an explanation"> <caption><span>Packages</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="rowColor"> <td class="colFirst"><a href="Controller/package-summary.html">Controller</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="Controller/Menu/package-summary.html">Controller.Menu</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="Model/package-summary.html">Model</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="Model/Menu/package-summary.html">Model.Menu</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="Model/MenuBar/package-summary.html">Model.MenuBar</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="View/package-summary.html">View</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="View/User/package-summary.html">View.User</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li class="navBarCell1Rev">Overview</li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="overview-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{'content_hash': 'b519d309d204d588609d5342007d36c7', 'timestamp': '', 'source': 'github', 'line_count': 159, 'max_line_length': 137, 'avg_line_length': 30.07547169811321, 'alnum_prop': 0.6403178586365538, 'repo_name': 'chloecorfmat/ENSSAT---Projet-DevObjet-V2', 'id': '64a570f254e34b75b2f7daa62fffac70cd5beed7', 'size': '4782', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'JavaDoc/overview-summary.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '12842'}, {'name': 'HTML', 'bytes': '1045708'}, {'name': 'Java', 'bytes': '60805'}, {'name': 'JavaScript', 'bytes': '827'}, {'name': 'Shell', 'bytes': '285'}]}
Spree::OrdersController.class_eval do helper Spree::Api::ApiHelpers include Spree::ApiFrontendFixConcern # Adds a new item to the order (creating a new order if none already exists) def populate order = current_order(create_order_if_necessary: true) variant = Spree::Variant.find(params[:variant_id]) quantity = params[:quantity].to_i options = params[:options] || {} # 2,147,483,647 is crazy. See issue #2695. if quantity.between?(1, 2_147_483_647) begin order.contents.add(variant, quantity, options) rescue ActiveRecord::RecordInvalid => e error = e.record.errors.full_messages.join(', ') end else error = Spree.t(:please_enter_reasonable_quantity) end if error respond_with(order) do |format| format.json { render json: { error: error }, status: 422 } format.html do flash[:error] = error redirect_back_or_default(spree.root_path) end end else respond_with(order) do |format| format.json do @order = order render 'spree/api/v1/orders/show', layout: false end format.html { redirect_to cart_path } end end end end
{'content_hash': 'ba5a3025d94ca79c6e2e8adc087d2625', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 78, 'avg_line_length': 30.024390243902438, 'alnum_prop': 0.6230706742485784, 'repo_name': 'mysteryihs/guan_shu_v2', 'id': '64fae05ff7bd2527e63277697e610986b7e6fd7d', 'size': '1231', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/controllers/spree/orders_controller_decorator.rb', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '6365'}, {'name': 'HTML', 'bytes': '12686'}, {'name': 'JavaScript', 'bytes': '76125'}, {'name': 'Ruby', 'bytes': '264216'}]}
using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace TeamCityConsole.Utils { public class PathHelper { public static string PathRelativeTo(string path, string root) { var pathParts = GetPathParts(path); var rootParts = GetPathParts(root); var length = pathParts.Count > rootParts.Count ? rootParts.Count : pathParts.Count; for (int i = 0; i < length; i++) { if (pathParts.First() == rootParts.First()) { pathParts.RemoveAt(0); rootParts.RemoveAt(0); } else { break; } } for (int i = 0; i < rootParts.Count; i++) { pathParts.Insert(0, ".."); } return pathParts.Count > 0 ? Path.Combine(pathParts.ToArray()) : string.Empty; } public static IList<string> GetPathParts(string path) { return path.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).ToList(); } } }
{'content_hash': 'c4df640d09840e3edc176f57e9559e9c', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 117, 'avg_line_length': 28.642857142857142, 'alnum_prop': 0.5087281795511222, 'repo_name': 'ComputerWorkware/TeamCityApi', 'id': '0e8a2dac4417b3e171dc2d591b1d1bfa690a3fde', 'size': '1205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/TeamCityConsole/Utils/PathHelper.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '653'}, {'name': 'C#', 'bytes': '665787'}, {'name': 'PowerShell', 'bytes': '73229'}, {'name': 'XSLT', 'bytes': '10348'}]}
'use strict'; var _ = require('lodash'); var asyncSettle = require('async-settle'); var nowAndLater = require('now-and-later'); var helpers = require('./helpers'); function buildSettleParallel(){ var args = helpers.verifyArguments(arguments); var extensions = helpers.getExtensions(_.last(args)); if(extensions){ args = _.initial(args); } function settleParallel(done){ nowAndLater.map(args, asyncSettle, extensions, helpers.onSettled(done)); } return settleParallel; } module.exports = buildSettleParallel;
{'content_hash': 'ac3a08ba9004f10e9bed4869d3703d04', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 76, 'avg_line_length': 21.52, 'alnum_prop': 0.7118959107806692, 'repo_name': 'doowb/bach', 'id': '2dfd1d1b05bd03f2cee7e8045f7f8dd01e626574', 'size': '538', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'lib/settleParallel.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '13899'}]}
<?php namespace BuurtboerderijBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files. * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritdoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('buurtboerderij'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
{'content_hash': '8eebc1027997becf493ed471128c0cf2', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 131, 'avg_line_length': 31.535714285714285, 'alnum_prop': 0.7202718006795017, 'repo_name': 'deregenboog/ecd', 'id': '729638498bbcbe634959f14c2b90efe4bdda2e77', 'size': '883', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/BuurtboerderijBundle/DependencyInjection/Configuration.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '39384'}, {'name': 'Dockerfile', 'bytes': '1506'}, {'name': 'JavaScript', 'bytes': '199321'}, {'name': 'PHP', 'bytes': '4527452'}, {'name': 'SCSS', 'bytes': '34'}, {'name': 'Shell', 'bytes': '7702'}, {'name': 'Twig', 'bytes': '1454381'}]}
/* { dg-do run } */ extern void abort (void); static max; static void __attribute__((noinline)) storemax (int i) { if (i > max) max = i; } static int CallFunctionRec(int (*fun)(int depth), int depth) { if (!fun(depth)) { return 0; } if (depth < 10) { CallFunctionRec(fun, depth + 1); } return 1; } static int CallFunction(int (*fun)(int depth)) { return CallFunctionRec(fun, 1) && !fun(0); } static int callback(int depth) { storemax (depth); return depth != 0; } int main() { CallFunction(callback); if (max != 10) abort (); return 0; }
{'content_hash': '71d4d3a6bdf72a2cd9ae4a8ae8507272', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 62, 'avg_line_length': 16.22222222222222, 'alnum_prop': 0.5941780821917808, 'repo_name': 'alpine9000/BitOS', 'id': 'ff66d83df38d1aac8e5e9f9b2698b54664797f60', 'size': '584', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/gcc.c-torture/pr42231.c', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Assembly', 'bytes': '1676541'}, {'name': 'Awk', 'bytes': '570'}, {'name': 'C', 'bytes': '33004377'}, {'name': 'C++', 'bytes': '3762963'}, {'name': 'DIGITAL Command Language', 'bytes': '1044'}, {'name': 'Emacs Lisp', 'bytes': '21698'}, {'name': 'Groff', 'bytes': '51951'}, {'name': 'Haskell', 'bytes': '2540'}, {'name': 'Lex', 'bytes': '3013'}, {'name': 'Logos', 'bytes': '14359'}, {'name': 'Makefile', 'bytes': '4908310'}, {'name': 'Mathematica', 'bytes': '3483'}, {'name': 'Objective-C', 'bytes': '1482'}, {'name': 'Perl', 'bytes': '86338'}, {'name': 'Shell', 'bytes': '349374'}, {'name': 'SourcePawn', 'bytes': '71695'}, {'name': 'SuperCollider', 'bytes': '8638'}, {'name': 'TeX', 'bytes': '411427'}, {'name': 'Yacc', 'bytes': '8101'}]}
<!doctype html> <html lang="en-gb"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="robots" content="noindex, nofollow"> <!--[if lt IE 9]> <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> <![endif]--> <title>Advent calendar 2016 &#8211; Suffolk Libraries</title> <link rel="stylesheet" href="/css/style.css"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-regular.woff2"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-italic.woff2"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-700.woff2"> </head> <body class="custom-sans-serif lh-copy dark-gray bg-moon-gray"> <ul class="clip"> <li><a href="#content">Skip to content</a></li> <li><a href="#footer-nav">Skip to navigation menu</a></li> </ul> <div class="bg-black white pa2 ph3-ns"> <div class="custom-max-width"> <p class="f6 ma0 custom-lh-title"><span role='image' aria-label='Debit card' class='pr1'>💳</span> You can now pay online. <a href=" https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB?RDT=/SpydusCitizenPay/default.aspx " class="underline lightest-blue"> Pay charges now &rarr; </a></p> </div> </div> <header id="site-header" class="custom-lh-title"> <div class="bg-white dark-gray ph2 ph3-ns pt2 pt3-ns"> <div class="custom-max-width flex"> <div class="w-30"> <a href="/"><img src="/images/logos/sl.svg" class="v-btm w3 w4-ns" alt="Suffolk Libraries"></a> </div> <div class="w-70 flex justify-end items-center"> <div><a href="/support-us/" class="dib blue pv1 pv2-ns f7 f6-ns pr2">Donate</a></div> <div><a href="/help/joining-the-library/" class="dib custom-icon custom-icon-card blue pv1 pv2-ns f7 f6-ns">Join</a></div> <div><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="dib custom-icon custom-icon-lock blue pv1 pv2-ns ml2 f7 f6-ns">Login</a></div> <div><a href="/search-form/" class="dib custom-icon custom-icon-search blue ml2 pv1 pv2-ns f7 f6-ns">Search</a></div> </div> </div> </div> <div class="custom-bg-corporate white ph2 ph3-ns bb b--white"> <div class="custom-max-width"> <ul class="ma0 pa0 list f6"> <li class="dib mr2 mr3-l"><a href="/" class="white underline db pv2">Home</a></li> <li class="dib mr2 mr3-l"><a href="/elibrary/" class="white underline db pv2">eLibrary</a></li> <li class="dib mr2 mr3-l"><a href="/events-activities/online-and-streamed-events/" class="white underline db pv2">Online events</a></li> <li class="dib mr2 mr3-l"><a href="/help/" class="white underline db pv2">Help</a></li> <li class="dib mr2 mr3-l"><a href="/contact/" class="white underline db pv2">Contact</a></li> <!-- <li class="dib mr2 mr3-l"><a href="/about/" class="white underline db pv2">About</a></li> <li class="dib"><a class="white underline db pv2" href="/support-us/">Donate</a></li> --> </ul> </div> </div> </header> <div class="pv2 pv3-ns cf custom-max-width "> <main id="content" class="bg-white pa2 pa5-ns pv4-ns cf mb2 border-box b--light-gray "> <div class="pa2 ph3-ns bg-white ba b--light-gray custom-underline f6"> <a class="blue underline" href="/">Home</a> → <a class="blue underline" href="/new-suggestions/">New suggestions</a> → <a class="blue underline" href="/new-suggestions/reviews/">Reviews</a> → Advent calendar 2016 </div> <div class="custom-visited custom-underline"> <h1 class="custom-lh-title f2 pa0 ma0 mb3 tc custom-icon-xmas-24 dib mb4-ns">Suffolk Libraries advent calendar 2016</h1> <p class="pa3 ma0 mb4 bg-red white">Every day until Christmas Eve a member of Suffolk Libraries reveals a book, album or film they'll be giving as a Christmas present, and why.</p> <div class="custom-flex-container"> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-1 f5 b dark-green ma0 mb2 pr2">December 1</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-01/"><img class="custom-constrain-img" src="/images/featured/featured-secret-diary.jpg" alt="The Secret Diary of Hendrik Groen, 83 &frac14;"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-01/" class="blue"><cite>The Secret Diary of Hendrik Groen, 83 &frac14;</cite>, by Anonymous.</a></h1> <p class="f5 ma0 pr2">Stock team member Jo Dixon recommends <cite>The Secret Diary of Hendrik Groen, 83 &frac14;</cite>, by an anonymous Dutch author.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-2 f5 b dark-green ma0 mb2 pr2">December 2</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-02/"><img class="custom-constrain-img" src="/images/featured/featured-dinosaur-pooped-740.jpg" alt="The Dinosaur That Pooped Christmas"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-02/" class="blue"><cite>The Dinosaur That Pooped Christmas</cite>, by Tom Fletcher, Dougie Poynter &amp; Garry Parsons</a></h1> <p class="f5 ma0 pr2">Library and information advisor Emma Maguire recommends <cite>The Dinosaur That Pooped Christmas</cite>, by Tom Fletcher, Dougie Poynter &amp; Garry Parsons.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-3 f5 b dark-green ma0 mb2 pr2">December 3</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-03/"><img class="custom-constrain-img" src="/images/featured/featured-ten-little-elves.jpg" alt="Ten Little Elves"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-03/" class="blue"><cite>Ten Little Elves</cite>, by Michael Brownlow &amp; Simon Rickerty.</a></h1> <p class="f5 ma0 pr2">Kedington Library manager Dawn Bamford recommends <cite>Ten Little Elves</cite>, by Michael Brownlow &amp; Simon Rickerty.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-4 f5 b dark-green ma0 mb2 pr2">December 4</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-04/"><img class="custom-constrain-img" src="/images/featured/featured-elf.jpg" alt="Elf"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-04/" class="blue"><cite>Elf</cite></a></h1> <p class="f5 ma0 pr2">Elmswell Library manager Emma Yarrow recommends the film <cite>Elf</cite>.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-5 f5 b dark-green ma0 mb2 pr2">December 5</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-05/"><img class="custom-constrain-img" src="/images/featured/featured-room.jpg" alt="Room"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-05/" class="blue"><cite>Room</cite></a></h1> <p class="f5 ma0 pr2">Library and information advisor Nilima Banerji recommends the film <cite>Room</cite></p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-6 f5 b dark-green ma0 mb2 pr2">December 6</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-06/"><img class="custom-constrain-img" src="/images/featured/featured-the-bfg.jpg" alt="The BFG"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-06/" class="blue"><cite>The BFG</cite></a></h1> <p class="f5 ma0 pr2">Bookstart administrator Kate Bacon recommends the film <cite>The BFG</cite>.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-7 f5 b dark-green ma0 mb2 pr2">December 7</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-07/"><img class="custom-constrain-img" src="/images/featured/featured-book-thief.jpg" alt="The Book Thief"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-07/" class="blue"><cite>The Book Thief</cite>, by Markus Zusak.</a></h1> <p class="f5 ma0 pr2">library and information advisor Tanya Collins recommends <cite>The Book Thief</cite>, by Markus Zusak.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-8 f5 b dark-green ma0 mb2 pr2">December 8</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-08/"><img class="custom-constrain-img" src="/images/featured/featured-bubble-boy.jpg" alt="The Bubble Boy"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-08/" class="blue"><cite>The Bubble Boy</cite>, by Stewart Foster</a></h1> <p class="f5 ma0 pr2">Libraries innovation and development manager Krystal Vittles recommends <cite>The Bubble Boy</cite>, by Stewart Foster.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-9 f5 b dark-green ma0 mb2 pr2">December 9</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-09/"><img class="custom-constrain-img" src="/images/featured/featured-night-before-xmas.jpg" alt="The Night Before Christmas"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-09/" class="blue"><cite>A Visit From St Nicholas</cite>, by Clement C. Moore.</a></h1> <p class="f5 ma0 pr2">Bury St Edmunds Library assistant manager Gill Turner recommends <cite>A Visit From St Nicholas</cite>, by Clement C. Moore.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-10 f5 b dark-green ma0 mb2 pr2">December 10</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-10/"><img class="custom-constrain-img" src="/images/featured/featured-tailor-of-gloucester.jpg" alt="The Tailor of Gloucester"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-10/" class="blue"><cite>The Tailor of Gloucester</cite>, by Beatrix Potter</a></h1> <p class="f5 ma0 pr2">Southwold Library manager Charlotte Clark recommends <cite>The Tailor of Gloucester</cite>, by Beatrix Potter.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-11 f5 b dark-green ma0 mb2 pr2">December 11</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-11/"><img class="custom-constrain-img" src="/images/featured/featured-polar-express.jpg" alt="The Polar Express"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-11/" class="blue"><cite>The Polar Express</cite></a></h1> <p class="f5 ma0 pr2">Gainsborough Library staff member Alison Catchpole recommends <cite>The Polar Express</cite>.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-12 f5 b dark-green ma0 mb2 pr2">December 12</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-12/"><img class="custom-constrain-img" src="/images/featured/featured-bilbo-lifeguard-dog.jpg" alt="Bilbo The Lifeguard Dog"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-12/" class="blue"><cite>Bilbo The Lifeguard Dog: a true story of friendship and heroism</cite>, by Steven Jamieson</a></h1> <p class="f5 ma0 pr2">Bury St Edmunds Library staff member Natasha Catchpole recommends <cite>Bilbo The Lifeguard Dog: a true story of friendship and heroism</cite>, by Steven Jamieson.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-13 f5 b dark-green ma0 mb2 pr2">December 13</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-13/"><img class="custom-constrain-img" src="/images/featured/featured-home-for-christmas.jpg" alt="I'll Be Home For Christmas"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-13/" class="blue"><cite>I'll Be Home For Christmas</cite>, by various authors</a></h1> <p class="f5 ma0 pr2">Library and information advisor Debra Rowe recommends <cite>I'll Be Home For Christmas</cite>, by various authors.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-14 f5 b dark-green ma0 mb2 pr2">December 14</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-14/"><img class="custom-constrain-img" src="/images/featured/featured-ticket-to-ride-europe.jpg" alt="Ticket To Ride: Europe"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-14/" class="blue"><cite>Ticket To Ride: Europe</cite></a></h1> <p class="f5 ma0 pr2">Library and information advisor Andrew Miller recommends the board game <cite>Ticket To Ride: Europe</cite>, which is available to hire from the branch's Board Games Library.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-15 f5 b dark-green ma0 mb2 pr2">December 15</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-15/"><img class="custom-constrain-img" src="/images/featured/featured-body-in-barcelona.jpg" alt="A Body in Barcelona"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-15/" class="blue"><cite>A Body in Barcelona</cite>, by Jason Webster</a></h1> <p class="f5 ma0 pr2">Stock team member Jo Dixon recommends <cite>A Body in Barcelona</cite>, by Jason Webster.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-16 f5 b dark-green ma0 mb2 pr2">December 16</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-16/"><img class="custom-constrain-img" src="/images/featured/featured-mindfulness-eight-weeks.jpg" alt="Mindfulness in Eight Weeks"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-16/" class="blue"><cite>Mindfulness in Eight Weeks</cite>, by Michael Chaskalson</a></h1> <p class="f5 ma0 pr2">Library and information advisor Helen Kerridge recommends <cite>Mindfulness in Eight Weeks</cite>, by Michael Chaskalson.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-17 f5 b dark-green ma0 mb2 pr2">December 17</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-17/"><img class="custom-constrain-img" src="/images/featured/featured-fresh-india.jpg" alt="Fresh India"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-17/" class="blue"><cite>Fresh India: 130 quick, easy and delicious vegetarian recipes for every day</cite>, by Meera Sodha</a></h1> <p class="f5 ma0 pr2">Leiston Library manager Gayla Rowling recommends <cite>Fresh India: 130 quick, easy and delicious vegetarian recipes for every day</cite>, by Meera Sodha.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-18 f5 b dark-green ma0 mb2 pr2">December 18</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-18/"><img class="custom-constrain-img" src="/images/featured/featured-elizabeth-is-missing.jpg" alt="Elizabeth Is Missing"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-18/" class="blue"><cite>Elizabeth Is Missing</cite>, by Emma Healey</a></h1> <p class="f5 ma0 pr2">Haverhill Library library and information advisor Audrey Woodley recommends <cite>Elizabeth Is Missing</cite>, by Emma Healey.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-19 f5 b dark-green ma0 mb2 pr2">December 19</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-19/"><img class="custom-constrain-img" src="/images/featured/featured-last-of-spirits.jpg" alt="The Last of the Spirits"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-19/" class="blue"><cite>The Last of the Spirits</cite>, by Chris Priestley</a></h1> <p class="f5 ma0 pr2">Lakenheath Library manager Chris Howard recommends <cite>The Last of the Spirits</cite>, by Chris Priestley.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-20 f5 b dark-green ma0 mb2 pr2">December 20</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-20/"><img class="custom-constrain-img" src="/images/featured/featured-a-place-called-winter.jpg" alt="A Place Called Winter"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-20/" class="blue"><cite>A Place Called Winter</cite>, by Patrick Gale</a></h1> <p class="f5 ma0 pr2">Library and information advisor Theo Clarke recommends <cite>A Place Called Winter</cite>, by Patrick Gale.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-21 f5 b dark-green ma0 mb2 pr2">December 21</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-21/"><img class="custom-constrain-img" src="/images/featured/featured-the-outrun.jpg" alt="The Outrun"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-21/" class="blue"><cite>The Outrun</cite>, by Amy Liptrot</a></h1> <p class="f5 ma0 pr2">Stock and content manager Paul Howarth recommends <cite>The Outrun</cite>, by Amy Liptrot.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-22 f5 b dark-green ma0 mb2 pr2">December 22</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-22/"><img class="custom-constrain-img" src="/images/featured/featured-tales-of-horror.jpg" alt="Tales of Horror and the Supernatural"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-22/" class="blue"><cite>Tales of Horror and the Supernatural</cite>, by Arthur Machen</a></h1> <p class="f5 ma0 pr2">Deputy head of IT Leon Paternoster recommends <cite>Tales of Horror and the Supernatural</cite>, by Arthur Machen.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-23 f5 b dark-green ma0 mb2 pr2">December 23</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-23/"><img class="custom-constrain-img" src="/images/featured/featured-girl-with-no-name.jpg" alt="The Girl With No Name"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-23/" class="blue"><cite>The Girl With No Name</cite>, by Diney Costeloe</a></h1> <p class="f5 ma0 pr2">Web content editor Alice Violett recommends <cite>The Girl With No Name</cite>, by Diney Costeloe.</p> </article> <article class="custom-flex-row pv2 bt b--light-gray"> <p class="custom-icon-xmas-24 f5 b dark-green ma0 mb2 pr2">December 24</p> <a class="white" href="/new-suggestions/reviews/staff-picks/advent-calendar-24/"><img class="custom-constrain-img" src="/images/featured/featured-ladybird-meeting.jpg" alt="The Ladybird Book of the Meeting"></a> <h1 class="f5 fw6 ma0 pa0 pr2"><a href="/new-suggestions/reviews/staff-picks/advent-calendar-24/" class="blue"><cite>The Ladybird Book of the Meeting</cite>, by Jason Hazeley &amp; Joel Morris</a></h1> <p class="f5 ma0 pr2">Chief executive officer Alison Wheeler recommends <cite>The Ladybird Book of the Meeting</cite>, by Jason Hazeley &amp; Joel Morris.</p> </article> </div> </div> </main> </div> <footer id="footer" class="pa2 pt3 pa3-ns pt4-ns bg-near-black white custom-underline"> <div class="custom-max-width"> <div class="flex-l justify-between-l"> <div class="w-30-l mb4 f6"> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Do it online</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk" class="link light-gray hover-white">Search &amp; reserve</a></li> <li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="link light-gray hover-white">Login &amp; renew</a></li> <li class="mb2 mb1-ns"><a class="link light-gray hover-white" href="/elibrary">eLibrary</a></li> <li class="mb2 mb1-ns"><a href="/help/joining-the-library/" class="link light-gray hover-white">Get a library card</a></li> </ul> </section> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Support your library</h2> <p>We're a charity that makes life in Suffolk better for thousands of people.</p> <p class="ma0"><a class="b pa1 br2 custom-bg-corporate-green hover-bg-green white custom-no-underline" href="/support-us">Donate</a></p> </section> </div> <div class="w-30-l mb4 f6"> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Contact us</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="tel:01473351249" class="link light-gray hover-white">01473 351249</a></li> <li class="mb2 mb1-ns"><a href="mailto:help@suffolklibraries.co.uk" class="link light-gray hover-white">help@suffolklibraries.co.uk</a></li> </ul> </section> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Social media</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="http://facebook.com/suffolklibraries" class="link light-gray hover-white">Facebook</a></li> <li class="mb2 mb1-ns"><a href="https://www.youtube.com/user/SuffolkLibraries/" class="link light-gray hover-white">YouTube</a></li> <li class="mb2 mb1-ns"><a href="http://twitter.com/suffolklibrary" class="link light-gray hover-white">Twitter</a></li> <li class="mb2 mb1-ns"><a href="https://instagram.com/suffolklibraries" class="link light-gray hover-white">Instagram</a></li> <li class="mb2 mb1-ns"><a href="https://www.linkedin.com/company/suffolk-libraries/" class="link light-gray hover-white">LinkedIn</a></li> <li class="mb2 mb1-ns"><a href="/newsletter" class="link light-gray hover-white">Email newsletter</a></li> </ul> </section> </div> <div class="w-30-l mb4 f6"> <nav class="pb4" id="footer-nav"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Sections</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="/elibrary/" class="link light-gray hover-white">eLibrary</a></li> <li class="mb2 mb1-ns"><a href="/libraries/" class="link light-gray hover-white">Libraries</a></li> <li class="mb2 mb1-ns"><a href="/mobiles-home/" class="link light-gray hover-white">Mobile &amp; home service</a></li> <li class="mb2 mb1-ns"><a href="/help/" class="link light-gray hover-white">Help using the service</a></li> <li class="mb2 mb1-ns"><a href="/new-suggestions/" class="link light-gray hover-white">Recommendations &amp; reviews</a></li> <li class="mb2 mb1-ns"><a href="/events-activities/" class="link light-gray hover-white">Events &amp; activities</a></li> <li class="mb2 mb1-ns"><a href="/research-and-reference/" class="link light-gray hover-white">Research &amp; reference</a></li> <li class="mb2 mb1-ns"><a href="/parents-carers-and-children/" class="link light-gray hover-white">Parents, carers &amp; children</a></li> <li class="mb2 mb1-ns"><a href="/teachers-and-home-educators/" class="link light-gray hover-white">Teachers &amp; home educators</a></li> <li class="mb2 mb1-ns"><a href="/health/" class="link light-gray hover-white">Health &amp; wellbeing</a></li> <li class="mb2 mb1-ns"><a href="/help-with-reading-and-literacy/" class="link light-gray hover-white">Help with reading &amp; literacy</a></li> <li class="mb2 mb1-ns"><a href="/work-and-benefits/" class="link light-gray hover-white">Work &amp; benefits</a></li> <li class="mb2 mb1-ns"><a href="/business-and-room-hire/" class="link light-gray hover-white">Business &amp; room hire</a></li> <li class="mb2 mb1-ns"><a href="/bloc/" class="link light-gray hover-white">BLOC</a></li> <li class="mb2 mb1-ns"><a href="/music-and-drama/" class="link light-gray hover-white">Music &amp; Drama Library</a></li> <li class="mb2 mb1-ns"><a href="/news/" class="link light-gray hover-white">News</a></li> <li class="mb2 mb1-ns"><a href="/about/jobs/" class="link light-gray hover-white">Jobs</a></li> <li class="mb2 mb1-ns"><a href="/volunteer/" class="link light-gray hover-white">Volunteering</a></li> <li class="mb2 mb1-ns"><a href="/about/" class="link light-gray hover-white">About us</a></li> </ul> </nav> </div> </div> <section class="pb4 f6"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Privacy &amp; cookies</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns">Find out what cookies we use and how we use your data: <a href="/help/privacy-and-cookies/" class="light-gray underline hover-white">our privacy policies</a>.</li> <li class="mb2 mb1-ns"><a href="/about/jobs/privacy-notice-for-job-applicants/" class="light-gray underline hover-white">Privacy notice for job applicants</a></li> </ul> </section> <div class="pb4 f6"> <p class="ma0 light-gray">Suffolk Libraries HMRC charity number XT34476. Registered company number IP031542.</p> </div> </div> </footer> </body> </html>
{'content_hash': '61eac0dbe9d63e6ed7abbaa24b3fe0c0', 'timestamp': '', 'source': 'github', 'line_count': 670, 'max_line_length': 232, 'avg_line_length': 42.84925373134328, 'alnum_prop': 0.6349576787766902, 'repo_name': 'suffolklibraries/sljekyll', 'id': 'd151b84b5b38f6a20de77b7406fcd0d410672250', 'size': '28718', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_site/new-suggestions/reviews/advent-calendar-2016/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '157758'}, {'name': 'HTML', 'bytes': '27181305'}, {'name': 'JavaScript', 'bytes': '247140'}, {'name': 'Rich Text Format', 'bytes': '265002'}, {'name': 'Ruby', 'bytes': '1015'}]}
package com.esri.core.geometry; import java.util.ArrayList; class OperatorImportFromWktLocal extends OperatorImportFromWkt { @Override public Geometry execute(int import_flags, Geometry.Type type, String wkt_string, ProgressTracker progress_tracker) { WktParser wkt_parser = new WktParser(wkt_string); int current_token = wkt_parser.nextToken(); return importFromWkt(import_flags, type, wkt_parser); } @Override public OGCStructure executeOGC(int import_flags, String wkt_string, ProgressTracker progress_tracker) { ArrayList<OGCStructure> stack = new ArrayList<OGCStructure>(0); WktParser wkt_parser = new WktParser(wkt_string); OGCStructure root = new OGCStructure(); root.m_structures = new ArrayList<OGCStructure>(0); stack.add(root); // add dummy root while (wkt_parser.nextToken() != WktParser.WktToken.not_available) { int current_token = wkt_parser.currentToken(); if (current_token == WktParser.WktToken.right_paren) { stack.remove(stack.size() - 1); continue; } int ogc_type = current_token; OGCStructure last = stack.get(stack.size() - 1); if (current_token == WktParser.WktToken.geometrycollection) { current_token = wkt_parser.nextToken(); if (current_token == WktParser.WktToken.attribute_z || current_token == WktParser.WktToken.attribute_m || current_token == WktParser.WktToken.attribute_zm) wkt_parser.nextToken(); OGCStructure next = new OGCStructure(); next.m_type = ogc_type; next.m_structures = new ArrayList<OGCStructure>(0); last.m_structures.add(next); if (current_token != WktParser.WktToken.empty) stack.add(next); continue; } Geometry geometry = importFromWkt(import_flags, Geometry.Type.Unknown, wkt_parser); OGCStructure leaf = new OGCStructure(); leaf.m_type = ogc_type; leaf.m_geometry = geometry; last.m_structures.add(leaf); } return root; } static Geometry importFromWkt(int import_flags, Geometry.Type type, WktParser wkt_parser) { int current_token = wkt_parser.currentToken(); switch (current_token) { case WktParser.WktToken.multipolygon: if (type != Geometry.Type.Polygon && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return polygonTaggedText(true, import_flags, wkt_parser); case WktParser.WktToken.multilinestring: if (type != Geometry.Type.Polyline && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return lineStringTaggedText(true, import_flags, wkt_parser); case WktParser.WktToken.multipoint: if (type != Geometry.Type.MultiPoint && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return multiPointTaggedText(import_flags, wkt_parser); case WktParser.WktToken.polygon: if (type != Geometry.Type.Polygon && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return polygonTaggedText(false, import_flags, wkt_parser); case WktParser.WktToken.linestring: if (type != Geometry.Type.Polyline && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return lineStringTaggedText(false, import_flags, wkt_parser); case WktParser.WktToken.point: if (type != Geometry.Type.Point && type != Geometry.Type.Unknown) throw new IllegalArgumentException("invalid shapetype"); return pointTaggedText(import_flags, wkt_parser); default: break; // warning fix } return null; } static Geometry polygonTaggedText(boolean b_multi_polygon, int import_flags, WktParser wkt_parser) { MultiPath multi_path; MultiPathImpl multi_path_impl; AttributeStreamOfDbl zs = null; AttributeStreamOfDbl ms = null; AttributeStreamOfDbl position; AttributeStreamOfInt32 paths; AttributeStreamOfInt8 path_flags; position = (AttributeStreamOfDbl) AttributeStreamBase .createDoubleStream(0); paths = (AttributeStreamOfInt32) AttributeStreamBase.createIndexStream( 1, 0); path_flags = (AttributeStreamOfInt8) AttributeStreamBase .createByteStream(1, (byte) 0); multi_path = new Polygon(); multi_path_impl = (MultiPathImpl) multi_path._getImpl(); int current_token = wkt_parser.nextToken(); if (current_token == WktParser.WktToken.attribute_z) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.Z); multi_path_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } int point_count; if (b_multi_polygon) point_count = multiPolygonText(zs, ms, position, paths, path_flags, wkt_parser); else point_count = polygonText(zs, ms, position, paths, path_flags, 0, wkt_parser); if (point_count != 0) { assert (2 * point_count == position.size()); multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.POSITION, position); multi_path_impl.setPathStreamRef(paths); multi_path_impl.setPathFlagsStreamRef(path_flags); if (zs != null) multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.Z, zs); if (ms != null) multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.M, ms); multi_path_impl.notifyModified(MultiPathImpl.DirtyFlags.DirtyAll); if (!InternalUtils.isClockwiseRing(multi_path_impl, 0)) multi_path_impl.reverseAllPaths(); } if ((import_flags & (int) WktImportFlags.wktImportNonTrusted) == 0) multi_path_impl.setIsSimple(MultiPathImpl.GeometryXSimple.Weak, 0.0, false); multi_path_impl.setDirtyOGCFlags(false); return multi_path; } static Geometry lineStringTaggedText(boolean b_multi_linestring, int import_flags, WktParser wkt_parser) { MultiPath multi_path; MultiPathImpl multi_path_impl; AttributeStreamOfDbl zs = null; AttributeStreamOfDbl ms = null; AttributeStreamOfDbl position; AttributeStreamOfInt32 paths; AttributeStreamOfInt8 path_flags; position = (AttributeStreamOfDbl) AttributeStreamBase .createDoubleStream(0); paths = (AttributeStreamOfInt32) AttributeStreamBase.createIndexStream( 1, 0); path_flags = (AttributeStreamOfInt8) AttributeStreamBase .createByteStream(1, (byte) 0); multi_path = new Polyline(); multi_path_impl = (MultiPathImpl) multi_path._getImpl(); int current_token = wkt_parser.nextToken(); if (current_token == WktParser.WktToken.attribute_z) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_path_impl.addAttribute(VertexDescription.Semantics.Z); multi_path_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } int point_count; if (b_multi_linestring) point_count = multiLineStringText(zs, ms, position, paths, path_flags, wkt_parser); else point_count = lineStringText(false, zs, ms, position, paths, path_flags, wkt_parser); if (point_count != 0) { assert (2 * point_count == position.size()); multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.POSITION, position); multi_path_impl.setPathStreamRef(paths); multi_path_impl.setPathFlagsStreamRef(path_flags); if (zs != null) multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.Z, zs); if (ms != null) multi_path_impl.setAttributeStreamRef( VertexDescription.Semantics.M, ms); multi_path_impl.notifyModified(MultiPathImpl.DirtyFlags.DirtyAll); } return multi_path; } static Geometry multiPointTaggedText(int import_flags, WktParser wkt_parser) { MultiPoint multi_point; MultiPointImpl multi_point_impl; AttributeStreamOfDbl zs = null; AttributeStreamOfDbl ms = null; AttributeStreamOfDbl position; position = (AttributeStreamOfDbl) AttributeStreamBase .createDoubleStream(0); multi_point = new MultiPoint(); multi_point_impl = (MultiPointImpl) multi_point._getImpl(); int current_token = wkt_parser.nextToken(); if (current_token == WktParser.WktToken.attribute_z) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_point_impl.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_point_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { zs = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); ms = (AttributeStreamOfDbl) AttributeStreamBase.createDoubleStream( 0, NumberUtils.TheNaN); multi_point_impl.addAttribute(VertexDescription.Semantics.Z); multi_point_impl.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } int point_count = multiPointText(zs, ms, position, wkt_parser); if (point_count != 0) { assert (2 * point_count == position.size()); multi_point_impl.resize(point_count); multi_point_impl.setAttributeStreamRef( VertexDescription.Semantics.POSITION, position); if (zs != null) multi_point_impl.setAttributeStreamRef( VertexDescription.Semantics.Z, zs); if (ms != null) multi_point_impl.setAttributeStreamRef( VertexDescription.Semantics.M, ms); multi_point_impl.notifyModified(MultiPointImpl.DirtyFlags.DirtyAll); } return multi_point; } static Geometry pointTaggedText(int import_flags, WktParser wkt_parser) { Point point = new Point(); int current_token = wkt_parser.nextToken(); if (current_token == WktParser.WktToken.attribute_z) { point.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { point.addAttribute(VertexDescription.Semantics.Z); point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } // At start of PointText current_token = wkt_parser.currentToken(); if (current_token != WktParser.WktToken.empty) { wkt_parser.nextToken(); double x = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); double y = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); point.setXY(x, y); if (wkt_parser.hasZs()) { double z = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); point.setZ(z); } if (wkt_parser.hasMs()) { double m = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); point.setM(m); } } return point; } static int multiPolygonText(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, AttributeStreamOfInt32 paths, AttributeStreamOfInt8 path_flags, WktParser wkt_parser) { // At start of MultiPolygonText int current_token = wkt_parser.currentToken(); int total_point_count = 0; if (current_token == WktParser.WktToken.empty) return total_point_count; current_token = wkt_parser.nextToken(); while (current_token != WktParser.WktToken.right_paren) { // At start of PolygonText total_point_count = polygonText(zs, ms, position, paths, path_flags, total_point_count, wkt_parser); current_token = wkt_parser.nextToken(); } return total_point_count; } static int multiLineStringText(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, AttributeStreamOfInt32 paths, AttributeStreamOfInt8 path_flags, WktParser wkt_parser) { // At start of MultiLineStringText int current_token = wkt_parser.currentToken(); int total_point_count = 0; if (current_token == WktParser.WktToken.empty) return total_point_count; current_token = wkt_parser.nextToken(); while (current_token != WktParser.WktToken.right_paren) { // At start of LineStringText int point_count = lineStringText(false, zs, ms, position, paths, path_flags, wkt_parser); total_point_count += point_count; current_token = wkt_parser.nextToken(); } return total_point_count; } static int multiPointText(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, WktParser wkt_parser) { // At start of MultiPointText int current_token = wkt_parser.currentToken(); int point_count = 0; if (current_token == WktParser.WktToken.empty) return point_count; current_token = wkt_parser.nextToken(); while (current_token != WktParser.WktToken.right_paren) { // At start of PointText point_count += pointText(zs, ms, position, wkt_parser); if (current_token == WktParser.WktToken.left_paren || current_token == WktParser.WktToken.empty) current_token = wkt_parser.nextToken(); // ogc standard else current_token = wkt_parser.currentToken(); // not ogc standard. // treat as // linestring } return point_count; } static int polygonText(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, AttributeStreamOfInt32 paths, AttributeStreamOfInt8 path_flags, int total_point_count, WktParser wkt_parser) { // At start of PolygonText int current_token = wkt_parser.currentToken(); if (current_token == WktParser.WktToken.empty) return total_point_count; boolean b_first_line_string = true; current_token = wkt_parser.nextToken(); while (current_token != WktParser.WktToken.right_paren) { // At start of LineStringText int point_count = lineStringText(true, zs, ms, position, paths, path_flags, wkt_parser); if (point_count != 0) { if (b_first_line_string) { b_first_line_string = false; path_flags.setBits(path_flags.size() - 2, (byte) PathFlags.enumOGCStartPolygon); } path_flags.setBits(path_flags.size() - 2, (byte) PathFlags.enumClosed); total_point_count += point_count; } current_token = wkt_parser.nextToken(); } return total_point_count; } static int lineStringText(boolean b_ring, AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, AttributeStreamOfInt32 paths, AttributeStreamOfInt8 path_flags, WktParser wkt_parser) { // At start of LineStringText int current_token = wkt_parser.currentToken(); int point_count = 0; if (current_token == WktParser.WktToken.empty) return point_count; boolean b_start_path = true; double startx = NumberUtils.TheNaN; double starty = NumberUtils.TheNaN; double startz = NumberUtils.TheNaN; double startm = NumberUtils.TheNaN; current_token = wkt_parser.nextToken(); while (current_token != WktParser.WktToken.right_paren) { // At start of x double x = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); double y = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); double z = NumberUtils.TheNaN, m = NumberUtils.TheNaN; if (wkt_parser.hasZs()) { z = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); } if (wkt_parser.hasMs()) { m = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); } current_token = wkt_parser.currentToken(); boolean b_add_point = true; if (b_ring && point_count >= 2 && current_token == WktParser.WktToken.right_paren) { // If the last point in the ring is not equal to the start // point, then let's add it. if ((startx == x || (NumberUtils.isNaN(startx) && NumberUtils .isNaN(x))) && (starty == y || (NumberUtils.isNaN(starty) && NumberUtils .isNaN(y))) && (!wkt_parser.hasZs() || startz == z || (NumberUtils .isNaN(startz) && NumberUtils.isNaN(z))) && (!wkt_parser.hasMs() || startm == m || (NumberUtils .isNaN(startm) && NumberUtils.isNaN(m)))) b_add_point = false; } if (b_add_point) { if (b_start_path) { b_start_path = false; startx = x; starty = y; startz = z; startm = m; } point_count++; addToStreams(zs, ms, position, x, y, z, m); } } if (point_count == 1) { point_count++; addToStreams(zs, ms, position, startx, starty, startz, startm); } paths.add(position.size() / 2); path_flags.add((byte) 0); return point_count; } static int pointText(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, WktParser wkt_parser) { // At start of PointText int current_token = wkt_parser.currentToken(); if (current_token == WktParser.WktToken.empty) return 0; if (current_token == WktParser.WktToken.left_paren) wkt_parser.nextToken(); // ogc standard // At start of x double x = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); double y = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); double z = NumberUtils.TheNaN; double m = NumberUtils.TheNaN; if (zs != null) { z = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); } if (ms != null) { m = wkt_parser.currentNumericLiteral(); wkt_parser.nextToken(); } addToStreams(zs, ms, position, x, y, z, m); return 1; } static void addToStreams(AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, double x, double y, double z, double m) { position.add(x); position.add(y); if (zs != null) zs.add(z); if (ms != null) ms.add(m); } }
{'content_hash': '5eba74ea558ad558b7665f2e6ecbfaa4', 'timestamp': '', 'source': 'github', 'line_count': 625, 'max_line_length': 79, 'avg_line_length': 30.1328, 'alnum_prop': 0.7119418042797218, 'repo_name': 'syntelos/shapefile-java', 'id': 'd742caa9a4b274d61d2ff06541316133857c8f2b', 'size': '19608', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/esri/core/geometry/OperatorImportFromWktLocal.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '2451999'}]}
import isPromise from 'is-promise'; /** * @param {jQuery} el * @param {String} controlName * * @return {Function} */ function emit ( el, controlName ) { /** * @param {String} eventName */ return function ( eventName ) { el.trigger(`${eventName}:${controlName}`, [el]); }; } /** * @param {Object} ctx * * @return {Function} */ function waitForLayout ( ctx ) { /** * Some banners report incorrect size so we have to take render time difference. * * @param {Function} cb * @param {Number} pTimeout */ return function ( cb, timeout ) { setTimeout(cb.bind(ctx), timeout || 300); }; } class Control { /** * @class * * @return {Control} */ constructor () { this.controls = []; } /** * @param {Object} control */ add ( control ) { this.controls.push({ name: '', condition: () => true, callback: () => {}, ...control }); } /** * @param {Banner} banner */ resolve ( banner ) { const $banner = banner.$el; this.controls.forEach(( control ) => { const condition = control.condition.call($banner[0], $banner); if ( isPromise(condition) ) { condition.then(( bool ) => { if ( bool ) { control.callback.call($banner[0], $banner, emit($banner, control.name), waitForLayout(this)); } return bool; }); } else if ( condition ) { control.callback.call($banner[0], $banner, emit($banner, control.name), waitForLayout(this)); } }); } destroy () { this.controls = []; } } export default Control;
{'content_hash': 'c25752b5aa8e9350d5a6d40cc19b1d7b', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 99, 'avg_line_length': 16.76923076923077, 'alnum_prop': 0.5740498034076016, 'repo_name': 'niksy/kist-lazyads', 'id': '67065d9cc625dbd23b9d110966519e93312504b4', 'size': '1526', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/control.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '215'}, {'name': 'HTML', 'bytes': '1972'}, {'name': 'JavaScript', 'bytes': '22710'}]}
'use strict'; var ReactRef = require('ReactRef'); var ReactInstrumentation = require('ReactInstrumentation'); var warning = require('warning'); /** * Helper to call ReactRef.attachRefs with this composite component, split out * to avoid allocations in the transaction mount-ready queue. */ function attachRefs() { ReactRef.attachRefs(this, this._currentElement); } var ReactReconciler = { /** * Initializes the component, renders markup, and registers event listeners. * * @param {ReactComponent} internalInstance * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction * @param {?object} the containing host component instance * @param {?object} info about the host container * @return {?string} Rendered markup to be inserted into the DOM. * @final * @internal */ mountComponent: function( internalInstance, transaction, hostParent, hostContainerInfo, context ) { if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeMountComponent( internalInstance._debugID, internalInstance._currentElement ); ReactInstrumentation.debugTool.onBeginReconcilerTimer( internalInstance._debugID, 'mountComponent' ); } } var markup = internalInstance.mountComponent( transaction, hostParent, hostContainerInfo, context ); if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer( internalInstance._debugID, 'mountComponent' ); ReactInstrumentation.debugTool.onMountComponent( internalInstance._debugID ); } } return markup; }, /** * Returns a value that can be passed to * ReactComponentEnvironment.replaceNodeWithMarkup. */ getHostNode: function(internalInstance) { return internalInstance.getHostNode(); }, /** * Releases any resources allocated by `mountComponent`. * * @final * @internal */ unmountComponent: function(internalInstance, safely) { if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeginReconcilerTimer( internalInstance._debugID, 'unmountComponent' ); } } ReactRef.detachRefs(internalInstance, internalInstance._currentElement); internalInstance.unmountComponent(safely); if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer( internalInstance._debugID, 'unmountComponent' ); ReactInstrumentation.debugTool.onUnmountComponent( internalInstance._debugID ); } } }, /** * Update a component using a new element. * * @param {ReactComponent} internalInstance * @param {ReactElement} nextElement * @param {ReactReconcileTransaction} transaction * @param {object} context * @internal */ receiveComponent: function( internalInstance, nextElement, transaction, context ) { var prevElement = internalInstance._currentElement; if (nextElement === prevElement && context === internalInstance._context ) { // Since elements are immutable after the owner is rendered, // we can do a cheap identity compare here to determine if this is a // superfluous reconcile. It's possible for state to be mutable but such // change should trigger an update of the owner which would recreate // the element. We explicitly check for the existence of an owner since // it's possible for an element created outside a composite to be // deeply mutated and reused. // TODO: Bailing out early is just a perf optimization right? // TODO: Removing the return statement should affect correctness? return; } if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeUpdateComponent( internalInstance._debugID, nextElement ); ReactInstrumentation.debugTool.onBeginReconcilerTimer( internalInstance._debugID, 'receiveComponent' ); } } var refsChanged = ReactRef.shouldUpdateRefs( prevElement, nextElement ); if (refsChanged) { ReactRef.detachRefs(internalInstance, prevElement); } internalInstance.receiveComponent(nextElement, transaction, context); if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer( internalInstance._debugID, 'receiveComponent' ); ReactInstrumentation.debugTool.onUpdateComponent( internalInstance._debugID ); } } }, /** * Flush any dirty changes in a component. * * @param {ReactComponent} internalInstance * @param {ReactReconcileTransaction} transaction * @internal */ performUpdateIfNecessary: function( internalInstance, transaction, updateBatchNumber ) { if (internalInstance._updateBatchNumber !== updateBatchNumber) { // The component's enqueued batch number should always be the current // batch or the following one. warning( internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber ); return; } if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeginReconcilerTimer( internalInstance._debugID, 'performUpdateIfNecessary' ); ReactInstrumentation.debugTool.onBeforeUpdateComponent( internalInstance._debugID, internalInstance._currentElement ); } } internalInstance.performUpdateIfNecessary(transaction); if (__DEV__) { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer( internalInstance._debugID, 'performUpdateIfNecessary' ); ReactInstrumentation.debugTool.onUpdateComponent( internalInstance._debugID ); } } }, }; module.exports = ReactReconciler;
{'content_hash': 'ad211df05b55f2d33659ecef9919059f', 'timestamp': '', 'source': 'github', 'line_count': 238, 'max_line_length': 83, 'avg_line_length': 29.04621848739496, 'alnum_prop': 0.6541299001880515, 'repo_name': 'theseyi/react', 'id': '99fb813de38e047e71de1615768a427b64f284f2', 'size': '7255', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/renderers/shared/stack/reconciler/ReactReconciler.js', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '5341'}, {'name': 'C++', 'bytes': '44974'}, {'name': 'CoffeeScript', 'bytes': '11786'}, {'name': 'JavaScript', 'bytes': '2596535'}, {'name': 'Makefile', 'bytes': '189'}, {'name': 'Python', 'bytes': '9094'}, {'name': 'Shell', 'bytes': '525'}, {'name': 'TypeScript', 'bytes': '15060'}]}
package org.apereo.portal.events.aggr.tabrender; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.persistence.TypedQuery; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.JoinType; import javax.persistence.criteria.ParameterExpression; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.apereo.portal.events.aggr.AggregationInterval; import org.apereo.portal.events.aggr.DateDimension; import org.apereo.portal.events.aggr.JpaBaseAggregationDao; import org.apereo.portal.events.aggr.TimeDimension; import org.apereo.portal.events.aggr.groups.AggregatedGroupMapping; import org.apereo.portal.events.aggr.tabs.AggregatedTabMapping; import org.apereo.portal.events.aggr.tabs.AggregatedTabMappingImpl; import org.springframework.stereotype.Repository; /** * DAO for Tab Render Aggregations * * @author Eric Dalquist */ @Repository public class JpaTabRenderAggregationDao extends JpaBaseAggregationDao<TabRenderAggregationImpl, TabRenderAggregationKey> implements TabRenderAggregationPrivateDao { private ParameterExpression<Set> tabMappingParameter; public JpaTabRenderAggregationDao() { super(TabRenderAggregationImpl.class); } @Override protected void createParameterExpressions() { this.tabMappingParameter = this.createParameterExpression(Set.class, "tabMapping"); } @Override protected void addFetches(Root<TabRenderAggregationImpl> root) { root.fetch(TabRenderAggregationImpl_.statisticalSummary, JoinType.LEFT); } @Override protected void addUnclosedPredicate( CriteriaBuilder cb, Root<TabRenderAggregationImpl> root, List<Predicate> keyPredicates) { keyPredicates.add(cb.isFalse(root.get(TabRenderAggregationImpl_.complete))); } @Override protected void addAggregationSpecificKeyPredicate( CriteriaBuilder cb, Root<TabRenderAggregationImpl> root, List<Predicate> keyPredicates) { keyPredicates.add( root.get(TabRenderAggregationImpl_.aggregatedTab).in(tabMappingParameter)); } @Override protected void bindAggregationSpecificKeyParameters( TypedQuery<TabRenderAggregationImpl> query, Set<TabRenderAggregationKey> keys) { query.setParameter(this.tabMappingParameter, extractAggregateTabMappings(keys)); } private Set<AggregatedTabMapping> extractAggregateTabMappings( Set<TabRenderAggregationKey> keys) { Set<AggregatedTabMapping> portletMappings = new HashSet<AggregatedTabMapping>(); for (TabRenderAggregationKey key : keys) { portletMappings.add(key.getTabMapping()); } return portletMappings; } @Override protected void bindAggregationSpecificKeyParameters( NaturalIdQuery<TabRenderAggregationImpl> query, TabRenderAggregationKey key) { query.using( TabRenderAggregationImpl_.aggregatedTab, (AggregatedTabMappingImpl) key.getTabMapping()); } @Override protected TabRenderAggregationImpl createAggregationInstance(TabRenderAggregationKey key) { final TimeDimension timeDimension = key.getTimeDimension(); final DateDimension dateDimension = key.getDateDimension(); final AggregationInterval interval = key.getInterval(); final AggregatedGroupMapping aggregatedGroup = key.getAggregatedGroup(); final AggregatedTabMapping tabMapping = key.getTabMapping(); return new TabRenderAggregationImpl( timeDimension, dateDimension, interval, aggregatedGroup, tabMapping); } @Override protected TabRenderAggregationKey getAggregationKey(TabRenderAggregationImpl instance) { return instance.getAggregationKey(); } }
{'content_hash': '1d897e4ddb4186bb761a475f37e1152b', 'timestamp': '', 'source': 'github', 'line_count': 103, 'max_line_length': 95, 'avg_line_length': 37.90291262135922, 'alnum_prop': 0.7461577868852459, 'repo_name': 'jhelmer-unicon/uPortal', 'id': '9a7e9a963b3967ae6ce2cdf11e3c180d06d4af93', 'size': '4693', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'uportal-war/src/main/java/org/apereo/portal/events/aggr/tabrender/JpaTabRenderAggregationDao.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'}]}
octopress-build =============== Scripts to build my octopress site
{'content_hash': 'ce4e79a507cfe9bd20d9f86c616cb0a1', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 34, 'avg_line_length': 17.0, 'alnum_prop': 0.6323529411764706, 'repo_name': 'sihugh/octopress-build', 'id': '7f67c71f54d3fe5c8b95fd80ef6e1e22c0104064', 'size': '68', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '366'}]}
struct NonPOD { NonPOD(int); }; // PODs enum Enum { EV }; struct POD { Enum e; int i; float f; NonPOD* p; }; struct Empty {}; typedef Empty EmptyAr[10]; typedef int Int; typedef Int IntAr[10]; typedef Int IntArNB[]; class Statics { static int priv; static NonPOD np; }; union EmptyUnion {}; union Union { int i; float f; }; struct HasFunc { void f (); }; struct HasOp { void operator *(); }; struct HasConv { operator int(); }; struct HasAssign { void operator =(int); }; struct HasAnonymousUnion { union { int i; float f; }; }; typedef int Vector __attribute__((vector_size(16))); typedef int VectorExt __attribute__((ext_vector_type(4))); // Not PODs typedef const void cvoid; struct Derives : POD {}; typedef Derives DerivesAr[10]; typedef Derives DerivesArNB[]; struct DerivesEmpty : Empty {}; struct HasCons { HasCons(int); }; struct HasCopyAssign { HasCopyAssign operator =(const HasCopyAssign&); }; struct HasMoveAssign { HasMoveAssign operator =(const HasMoveAssign&&); }; struct HasNoThrowMoveAssign { HasNoThrowMoveAssign& operator=( const HasNoThrowMoveAssign&&) throw(); }; struct HasNoExceptNoThrowMoveAssign { HasNoExceptNoThrowMoveAssign& operator=( const HasNoExceptNoThrowMoveAssign&&) noexcept; }; struct HasThrowMoveAssign { HasThrowMoveAssign& operator=( const HasThrowMoveAssign&&) throw(POD); }; struct HasNoExceptFalseMoveAssign { HasNoExceptFalseMoveAssign& operator=( const HasNoExceptFalseMoveAssign&&) noexcept(false); }; struct HasMoveCtor { HasMoveCtor(const HasMoveCtor&&); }; struct HasMemberMoveCtor { HasMoveCtor member; }; struct HasMemberMoveAssign { HasMoveAssign member; }; struct HasStaticMemberMoveCtor { static HasMoveCtor member; }; struct HasStaticMemberMoveAssign { static HasMoveAssign member; }; struct HasMemberThrowMoveAssign { HasThrowMoveAssign member; }; struct HasMemberNoExceptFalseMoveAssign { HasNoExceptFalseMoveAssign member; }; struct HasMemberNoThrowMoveAssign { HasNoThrowMoveAssign member; }; struct HasMemberNoExceptNoThrowMoveAssign { HasNoExceptNoThrowMoveAssign member; }; struct HasDefaultTrivialCopyAssign { HasDefaultTrivialCopyAssign &operator=( const HasDefaultTrivialCopyAssign&) = default; }; struct TrivialMoveButNotCopy { TrivialMoveButNotCopy &operator=(TrivialMoveButNotCopy&&) = default; TrivialMoveButNotCopy &operator=(const TrivialMoveButNotCopy&); }; struct NonTrivialDefault { NonTrivialDefault(); }; struct HasDest { ~HasDest(); }; class HasPriv { int priv; }; class HasProt { protected: int prot; }; struct HasRef { int i; int& ref; HasRef() : i(0), ref(i) {} }; struct HasNonPOD { NonPOD np; }; struct HasVirt { virtual void Virt() {}; }; typedef NonPOD NonPODAr[10]; typedef HasVirt VirtAr[10]; typedef NonPOD NonPODArNB[]; union NonPODUnion { int i; Derives n; }; struct DerivesHasCons : HasCons {}; struct DerivesHasCopyAssign : HasCopyAssign {}; struct DerivesHasMoveAssign : HasMoveAssign {}; struct DerivesHasDest : HasDest {}; struct DerivesHasPriv : HasPriv {}; struct DerivesHasProt : HasProt {}; struct DerivesHasRef : HasRef {}; struct DerivesHasVirt : HasVirt {}; struct DerivesHasMoveCtor : HasMoveCtor {}; struct HasNoThrowCopyAssign { void operator =(const HasNoThrowCopyAssign&) throw(); }; struct HasMultipleCopyAssign { void operator =(const HasMultipleCopyAssign&) throw(); void operator =(volatile HasMultipleCopyAssign&); }; struct HasMultipleNoThrowCopyAssign { void operator =(const HasMultipleNoThrowCopyAssign&) throw(); void operator =(volatile HasMultipleNoThrowCopyAssign&) throw(); }; struct HasNoThrowConstructor { HasNoThrowConstructor() throw(); }; struct HasNoThrowConstructorWithArgs { HasNoThrowConstructorWithArgs(HasCons i = HasCons(0)) throw(); }; struct HasNoThrowCopy { HasNoThrowCopy(const HasNoThrowCopy&) throw(); }; struct HasMultipleCopy { HasMultipleCopy(const HasMultipleCopy&) throw(); HasMultipleCopy(volatile HasMultipleCopy&); }; struct HasMultipleNoThrowCopy { HasMultipleNoThrowCopy(const HasMultipleNoThrowCopy&) throw(); HasMultipleNoThrowCopy(volatile HasMultipleNoThrowCopy&) throw(); }; struct HasVirtDest { virtual ~HasVirtDest(); }; struct DerivedVirtDest : HasVirtDest {}; typedef HasVirtDest VirtDestAr[1]; class AllPrivate { AllPrivate() throw(); AllPrivate(const AllPrivate&) throw(); AllPrivate &operator=(const AllPrivate &) throw(); ~AllPrivate() throw(); }; struct ThreeArgCtor { ThreeArgCtor(int*, char*, int); }; void is_pod() { { int arr[T(__is_pod(int))]; } { int arr[T(__is_pod(Enum))]; } { int arr[T(__is_pod(POD))]; } { int arr[T(__is_pod(Int))]; } { int arr[T(__is_pod(IntAr))]; } { int arr[T(__is_pod(Statics))]; } { int arr[T(__is_pod(Empty))]; } { int arr[T(__is_pod(EmptyUnion))]; } { int arr[T(__is_pod(Union))]; } { int arr[T(__is_pod(HasFunc))]; } { int arr[T(__is_pod(HasOp))]; } { int arr[T(__is_pod(HasConv))]; } { int arr[T(__is_pod(HasAssign))]; } { int arr[T(__is_pod(IntArNB))]; } { int arr[T(__is_pod(HasAnonymousUnion))]; } { int arr[T(__is_pod(Vector))]; } { int arr[T(__is_pod(VectorExt))]; } { int arr[T(__is_pod(Derives))]; } { int arr[T(__is_pod(DerivesAr))]; } { int arr[T(__is_pod(DerivesArNB))]; } { int arr[T(__is_pod(DerivesEmpty))]; } { int arr[T(__is_pod(HasPriv))]; } { int arr[T(__is_pod(HasProt))]; } { int arr[T(__is_pod(DerivesHasPriv))]; } { int arr[T(__is_pod(DerivesHasProt))]; } { int arr[F(__is_pod(HasCons))]; } { int arr[F(__is_pod(HasCopyAssign))]; } { int arr[F(__is_pod(HasMoveAssign))]; } { int arr[F(__is_pod(HasDest))]; } { int arr[F(__is_pod(HasRef))]; } { int arr[F(__is_pod(HasVirt))]; } { int arr[F(__is_pod(DerivesHasCons))]; } { int arr[F(__is_pod(DerivesHasCopyAssign))]; } { int arr[F(__is_pod(DerivesHasMoveAssign))]; } { int arr[F(__is_pod(DerivesHasDest))]; } { int arr[F(__is_pod(DerivesHasRef))]; } { int arr[F(__is_pod(DerivesHasVirt))]; } { int arr[F(__is_pod(NonPOD))]; } { int arr[F(__is_pod(HasNonPOD))]; } { int arr[F(__is_pod(NonPODAr))]; } { int arr[F(__is_pod(NonPODArNB))]; } { int arr[F(__is_pod(void))]; } { int arr[F(__is_pod(cvoid))]; } // { int arr[F(__is_pod(NonPODUnion))]; } } typedef Empty EmptyAr[10]; struct Bit0 { int : 0; }; struct Bit0Cons { int : 0; Bit0Cons(); }; struct BitOnly { int x : 3; }; struct DerivesVirt : virtual POD {}; void is_empty() { { int arr[T(__is_empty(Empty))]; } { int arr[T(__is_empty(DerivesEmpty))]; } { int arr[T(__is_empty(HasCons))]; } { int arr[T(__is_empty(HasCopyAssign))]; } { int arr[T(__is_empty(HasMoveAssign))]; } { int arr[T(__is_empty(HasDest))]; } { int arr[T(__is_empty(HasFunc))]; } { int arr[T(__is_empty(HasOp))]; } { int arr[T(__is_empty(HasConv))]; } { int arr[T(__is_empty(HasAssign))]; } { int arr[T(__is_empty(Bit0))]; } { int arr[T(__is_empty(Bit0Cons))]; } { int arr[F(__is_empty(Int))]; } { int arr[F(__is_empty(POD))]; } { int arr[F(__is_empty(EmptyUnion))]; } { int arr[F(__is_empty(EmptyAr))]; } { int arr[F(__is_empty(HasRef))]; } { int arr[F(__is_empty(HasVirt))]; } { int arr[F(__is_empty(BitOnly))]; } { int arr[F(__is_empty(void))]; } { int arr[F(__is_empty(IntArNB))]; } { int arr[F(__is_empty(HasAnonymousUnion))]; } // { int arr[F(__is_empty(DerivesVirt))]; } } typedef Derives ClassType; void is_class() { { int arr[T(__is_class(Derives))]; } { int arr[T(__is_class(HasPriv))]; } { int arr[T(__is_class(ClassType))]; } { int arr[T(__is_class(HasAnonymousUnion))]; } { int arr[F(__is_class(int))]; } { int arr[F(__is_class(Enum))]; } { int arr[F(__is_class(Int))]; } { int arr[F(__is_class(IntAr))]; } { int arr[F(__is_class(DerivesAr))]; } { int arr[F(__is_class(Union))]; } { int arr[F(__is_class(cvoid))]; } { int arr[F(__is_class(IntArNB))]; } } typedef Union UnionAr[10]; typedef Union UnionType; void is_union() { { int arr[T(__is_union(Union))]; } { int arr[T(__is_union(UnionType))]; } { int arr[F(__is_union(int))]; } { int arr[F(__is_union(Enum))]; } { int arr[F(__is_union(Int))]; } { int arr[F(__is_union(IntAr))]; } { int arr[F(__is_union(UnionAr))]; } { int arr[F(__is_union(cvoid))]; } { int arr[F(__is_union(IntArNB))]; } { int arr[F(__is_union(HasAnonymousUnion))]; } } typedef Enum EnumType; void is_enum() { { int arr[T(__is_enum(Enum))]; } { int arr[T(__is_enum(EnumType))]; } { int arr[F(__is_enum(int))]; } { int arr[F(__is_enum(Union))]; } { int arr[F(__is_enum(Int))]; } { int arr[F(__is_enum(IntAr))]; } { int arr[F(__is_enum(UnionAr))]; } { int arr[F(__is_enum(Derives))]; } { int arr[F(__is_enum(ClassType))]; } { int arr[F(__is_enum(cvoid))]; } { int arr[F(__is_enum(IntArNB))]; } { int arr[F(__is_enum(HasAnonymousUnion))]; } } struct FinalClass final { }; template<typename T> struct PotentiallyFinal { }; template<typename T> struct PotentiallyFinal<T*> final { }; template<> struct PotentiallyFinal<int> final { }; void is_final() { { int arr[T(__is_final(FinalClass))]; } { int arr[T(__is_final(PotentiallyFinal<float*>))]; } { int arr[T(__is_final(PotentiallyFinal<int>))]; } { int arr[F(__is_final(int))]; } { int arr[F(__is_final(Union))]; } { int arr[F(__is_final(Int))]; } { int arr[F(__is_final(IntAr))]; } { int arr[F(__is_final(UnionAr))]; } { int arr[F(__is_final(Derives))]; } { int arr[F(__is_final(ClassType))]; } { int arr[F(__is_final(cvoid))]; } { int arr[F(__is_final(IntArNB))]; } { int arr[F(__is_final(HasAnonymousUnion))]; } { int arr[F(__is_final(PotentiallyFinal<float>))]; } } typedef HasVirt Polymorph; struct InheritPolymorph : Polymorph {}; void is_polymorphic() { { int arr[T(__is_polymorphic(Polymorph))]; } { int arr[T(__is_polymorphic(InheritPolymorph))]; } { int arr[F(__is_polymorphic(int))]; } { int arr[F(__is_polymorphic(Union))]; } { int arr[F(__is_polymorphic(Int))]; } { int arr[F(__is_polymorphic(IntAr))]; } { int arr[F(__is_polymorphic(UnionAr))]; } { int arr[F(__is_polymorphic(Derives))]; } { int arr[F(__is_polymorphic(ClassType))]; } { int arr[F(__is_polymorphic(Enum))]; } { int arr[F(__is_polymorphic(cvoid))]; } { int arr[F(__is_polymorphic(IntArNB))]; } } void is_integral() { int t01[T(__is_integral(bool))]; int t02[T(__is_integral(char))]; int t03[T(__is_integral(signed char))]; int t04[T(__is_integral(unsigned char))]; //int t05[T(__is_integral(char16_t))]; //int t06[T(__is_integral(char32_t))]; int t07[T(__is_integral(wchar_t))]; int t08[T(__is_integral(short))]; int t09[T(__is_integral(unsigned short))]; int t10[T(__is_integral(int))]; int t11[T(__is_integral(unsigned int))]; int t12[T(__is_integral(long))]; int t13[T(__is_integral(unsigned long))]; int t21[F(__is_integral(float))]; int t22[F(__is_integral(double))]; int t23[F(__is_integral(long double))]; int t24[F(__is_integral(Union))]; int t25[F(__is_integral(UnionAr))]; int t26[F(__is_integral(Derives))]; int t27[F(__is_integral(ClassType))]; int t28[F(__is_integral(Enum))]; int t29[F(__is_integral(void))]; int t30[F(__is_integral(cvoid))]; int t31[F(__is_integral(IntArNB))]; } void is_floating_point() { int t01[T(__is_floating_point(float))]; int t02[T(__is_floating_point(double))]; int t03[T(__is_floating_point(long double))]; int t11[F(__is_floating_point(bool))]; int t12[F(__is_floating_point(char))]; int t13[F(__is_floating_point(signed char))]; int t14[F(__is_floating_point(unsigned char))]; //int t15[F(__is_floating_point(char16_t))]; //int t16[F(__is_floating_point(char32_t))]; int t17[F(__is_floating_point(wchar_t))]; int t18[F(__is_floating_point(short))]; int t19[F(__is_floating_point(unsigned short))]; int t20[F(__is_floating_point(int))]; int t21[F(__is_floating_point(unsigned int))]; int t22[F(__is_floating_point(long))]; int t23[F(__is_floating_point(unsigned long))]; int t24[F(__is_floating_point(Union))]; int t25[F(__is_floating_point(UnionAr))]; int t26[F(__is_floating_point(Derives))]; int t27[F(__is_floating_point(ClassType))]; int t28[F(__is_floating_point(Enum))]; int t29[F(__is_floating_point(void))]; int t30[F(__is_floating_point(cvoid))]; int t31[F(__is_floating_point(IntArNB))]; } void is_arithmetic() { int t01[T(__is_arithmetic(float))]; int t02[T(__is_arithmetic(double))]; int t03[T(__is_arithmetic(long double))]; int t11[T(__is_arithmetic(bool))]; int t12[T(__is_arithmetic(char))]; int t13[T(__is_arithmetic(signed char))]; int t14[T(__is_arithmetic(unsigned char))]; //int t15[T(__is_arithmetic(char16_t))]; //int t16[T(__is_arithmetic(char32_t))]; int t17[T(__is_arithmetic(wchar_t))]; int t18[T(__is_arithmetic(short))]; int t19[T(__is_arithmetic(unsigned short))]; int t20[T(__is_arithmetic(int))]; int t21[T(__is_arithmetic(unsigned int))]; int t22[T(__is_arithmetic(long))]; int t23[T(__is_arithmetic(unsigned long))]; int t24[F(__is_arithmetic(Union))]; int t25[F(__is_arithmetic(UnionAr))]; int t26[F(__is_arithmetic(Derives))]; int t27[F(__is_arithmetic(ClassType))]; int t28[F(__is_arithmetic(Enum))]; int t29[F(__is_arithmetic(void))]; int t30[F(__is_arithmetic(cvoid))]; int t31[F(__is_arithmetic(IntArNB))]; } struct ACompleteType {}; struct AnIncompleteType; void is_complete_type() { int t01[T(__is_complete_type(float))]; int t02[T(__is_complete_type(double))]; int t03[T(__is_complete_type(long double))]; int t11[T(__is_complete_type(bool))]; int t12[T(__is_complete_type(char))]; int t13[T(__is_complete_type(signed char))]; int t14[T(__is_complete_type(unsigned char))]; //int t15[T(__is_complete_type(char16_t))]; //int t16[T(__is_complete_type(char32_t))]; int t17[T(__is_complete_type(wchar_t))]; int t18[T(__is_complete_type(short))]; int t19[T(__is_complete_type(unsigned short))]; int t20[T(__is_complete_type(int))]; int t21[T(__is_complete_type(unsigned int))]; int t22[T(__is_complete_type(long))]; int t23[T(__is_complete_type(unsigned long))]; int t24[T(__is_complete_type(ACompleteType))]; int t30[F(__is_complete_type(AnIncompleteType))]; } void is_void() { int t01[T(__is_void(void))]; int t02[T(__is_void(cvoid))]; int t10[F(__is_void(float))]; int t11[F(__is_void(double))]; int t12[F(__is_void(long double))]; int t13[F(__is_void(bool))]; int t14[F(__is_void(char))]; int t15[F(__is_void(signed char))]; int t16[F(__is_void(unsigned char))]; int t17[F(__is_void(wchar_t))]; int t18[F(__is_void(short))]; int t19[F(__is_void(unsigned short))]; int t20[F(__is_void(int))]; int t21[F(__is_void(unsigned int))]; int t22[F(__is_void(long))]; int t23[F(__is_void(unsigned long))]; int t24[F(__is_void(Union))]; int t25[F(__is_void(UnionAr))]; int t26[F(__is_void(Derives))]; int t27[F(__is_void(ClassType))]; int t28[F(__is_void(Enum))]; int t29[F(__is_void(IntArNB))]; int t30[F(__is_void(void*))]; int t31[F(__is_void(cvoid*))]; } void is_array() { int t01[T(__is_array(IntAr))]; int t02[T(__is_array(IntArNB))]; int t03[T(__is_array(UnionAr))]; int t10[F(__is_array(void))]; int t11[F(__is_array(cvoid))]; int t12[F(__is_array(float))]; int t13[F(__is_array(double))]; int t14[F(__is_array(long double))]; int t15[F(__is_array(bool))]; int t16[F(__is_array(char))]; int t17[F(__is_array(signed char))]; int t18[F(__is_array(unsigned char))]; int t19[F(__is_array(wchar_t))]; int t20[F(__is_array(short))]; int t21[F(__is_array(unsigned short))]; int t22[F(__is_array(int))]; int t23[F(__is_array(unsigned int))]; int t24[F(__is_array(long))]; int t25[F(__is_array(unsigned long))]; int t26[F(__is_array(Union))]; int t27[F(__is_array(Derives))]; int t28[F(__is_array(ClassType))]; int t29[F(__is_array(Enum))]; int t30[F(__is_array(void*))]; int t31[F(__is_array(cvoid*))]; } template <typename T> void tmpl_func(T&) {} template <typename T> struct type_wrapper { typedef T type; typedef T* ptrtype; typedef T& reftype; }; void is_function() { int t01[T(__is_function(type_wrapper<void(void)>::type))]; int t02[T(__is_function(typeof(tmpl_func<int>)))]; typedef void (*ptr_to_func_type)(void); int t10[F(__is_function(void))]; int t11[F(__is_function(cvoid))]; int t12[F(__is_function(float))]; int t13[F(__is_function(double))]; int t14[F(__is_function(long double))]; int t15[F(__is_function(bool))]; int t16[F(__is_function(char))]; int t17[F(__is_function(signed char))]; int t18[F(__is_function(unsigned char))]; int t19[F(__is_function(wchar_t))]; int t20[F(__is_function(short))]; int t21[F(__is_function(unsigned short))]; int t22[F(__is_function(int))]; int t23[F(__is_function(unsigned int))]; int t24[F(__is_function(long))]; int t25[F(__is_function(unsigned long))]; int t26[F(__is_function(Union))]; int t27[F(__is_function(Derives))]; int t28[F(__is_function(ClassType))]; int t29[F(__is_function(Enum))]; int t30[F(__is_function(void*))]; int t31[F(__is_function(cvoid*))]; int t32[F(__is_function(void(*)()))]; int t33[F(__is_function(ptr_to_func_type))]; int t34[F(__is_function(type_wrapper<void(void)>::ptrtype))]; int t35[F(__is_function(type_wrapper<void(void)>::reftype))]; } void is_reference() { int t01[T(__is_reference(int&))]; int t02[T(__is_reference(const int&))]; int t03[T(__is_reference(void *&))]; int t10[F(__is_reference(int))]; int t11[F(__is_reference(const int))]; int t12[F(__is_reference(void *))]; } void is_lvalue_reference() { int t01[T(__is_lvalue_reference(int&))]; int t02[T(__is_lvalue_reference(void *&))]; int t03[T(__is_lvalue_reference(const int&))]; int t04[T(__is_lvalue_reference(void * const &))]; int t10[F(__is_lvalue_reference(int))]; int t11[F(__is_lvalue_reference(const int))]; int t12[F(__is_lvalue_reference(void *))]; } #if __has_feature(cxx_rvalue_references) void is_rvalue_reference() { int t01[T(__is_rvalue_reference(const int&&))]; int t02[T(__is_rvalue_reference(void * const &&))]; int t10[F(__is_rvalue_reference(int&))]; int t11[F(__is_rvalue_reference(void *&))]; int t12[F(__is_rvalue_reference(const int&))]; int t13[F(__is_rvalue_reference(void * const &))]; int t14[F(__is_rvalue_reference(int))]; int t15[F(__is_rvalue_reference(const int))]; int t16[F(__is_rvalue_reference(void *))]; } #endif void is_fundamental() { int t01[T(__is_fundamental(float))]; int t02[T(__is_fundamental(double))]; int t03[T(__is_fundamental(long double))]; int t11[T(__is_fundamental(bool))]; int t12[T(__is_fundamental(char))]; int t13[T(__is_fundamental(signed char))]; int t14[T(__is_fundamental(unsigned char))]; //int t15[T(__is_fundamental(char16_t))]; //int t16[T(__is_fundamental(char32_t))]; int t17[T(__is_fundamental(wchar_t))]; int t18[T(__is_fundamental(short))]; int t19[T(__is_fundamental(unsigned short))]; int t20[T(__is_fundamental(int))]; int t21[T(__is_fundamental(unsigned int))]; int t22[T(__is_fundamental(long))]; int t23[T(__is_fundamental(unsigned long))]; int t24[T(__is_fundamental(void))]; int t25[T(__is_fundamental(cvoid))]; int t30[F(__is_fundamental(Union))]; int t31[F(__is_fundamental(UnionAr))]; int t32[F(__is_fundamental(Derives))]; int t33[F(__is_fundamental(ClassType))]; int t34[F(__is_fundamental(Enum))]; int t35[F(__is_fundamental(IntArNB))]; } void is_object() { int t01[T(__is_object(int))]; int t02[T(__is_object(int *))]; int t03[T(__is_object(void *))]; int t04[T(__is_object(Union))]; int t05[T(__is_object(UnionAr))]; int t06[T(__is_object(ClassType))]; int t07[T(__is_object(Enum))]; int t10[F(__is_object(type_wrapper<void(void)>::type))]; int t11[F(__is_object(int&))]; int t12[F(__is_object(void))]; } void is_scalar() { int t01[T(__is_scalar(float))]; int t02[T(__is_scalar(double))]; int t03[T(__is_scalar(long double))]; int t04[T(__is_scalar(bool))]; int t05[T(__is_scalar(char))]; int t06[T(__is_scalar(signed char))]; int t07[T(__is_scalar(unsigned char))]; int t08[T(__is_scalar(wchar_t))]; int t09[T(__is_scalar(short))]; int t10[T(__is_scalar(unsigned short))]; int t11[T(__is_scalar(int))]; int t12[T(__is_scalar(unsigned int))]; int t13[T(__is_scalar(long))]; int t14[T(__is_scalar(unsigned long))]; int t15[T(__is_scalar(Enum))]; int t16[T(__is_scalar(void*))]; int t17[T(__is_scalar(cvoid*))]; int t20[F(__is_scalar(void))]; int t21[F(__is_scalar(cvoid))]; int t22[F(__is_scalar(Union))]; int t23[F(__is_scalar(UnionAr))]; int t24[F(__is_scalar(Derives))]; int t25[F(__is_scalar(ClassType))]; int t26[F(__is_scalar(IntArNB))]; } struct StructWithMembers { int member; void method() {} }; void is_compound() { int t01[T(__is_compound(void*))]; int t02[T(__is_compound(cvoid*))]; int t03[T(__is_compound(void (*)()))]; int t04[T(__is_compound(int StructWithMembers::*))]; int t05[T(__is_compound(void (StructWithMembers::*)()))]; int t06[T(__is_compound(int&))]; int t07[T(__is_compound(Union))]; int t08[T(__is_compound(UnionAr))]; int t09[T(__is_compound(Derives))]; int t10[T(__is_compound(ClassType))]; int t11[T(__is_compound(IntArNB))]; int t12[T(__is_compound(Enum))]; int t20[F(__is_compound(float))]; int t21[F(__is_compound(double))]; int t22[F(__is_compound(long double))]; int t23[F(__is_compound(bool))]; int t24[F(__is_compound(char))]; int t25[F(__is_compound(signed char))]; int t26[F(__is_compound(unsigned char))]; int t27[F(__is_compound(wchar_t))]; int t28[F(__is_compound(short))]; int t29[F(__is_compound(unsigned short))]; int t30[F(__is_compound(int))]; int t31[F(__is_compound(unsigned int))]; int t32[F(__is_compound(long))]; int t33[F(__is_compound(unsigned long))]; int t34[F(__is_compound(void))]; int t35[F(__is_compound(cvoid))]; } void is_pointer() { StructWithMembers x; int t01[T(__is_pointer(void*))]; int t02[T(__is_pointer(cvoid*))]; int t03[T(__is_pointer(cvoid*))]; int t04[T(__is_pointer(char*))]; int t05[T(__is_pointer(int*))]; int t06[T(__is_pointer(int**))]; int t07[T(__is_pointer(ClassType*))]; int t08[T(__is_pointer(Derives*))]; int t09[T(__is_pointer(Enum*))]; int t10[T(__is_pointer(IntArNB*))]; int t11[T(__is_pointer(Union*))]; int t12[T(__is_pointer(UnionAr*))]; int t13[T(__is_pointer(StructWithMembers*))]; int t14[T(__is_pointer(void (*)()))]; int t20[F(__is_pointer(void))]; int t21[F(__is_pointer(cvoid))]; int t22[F(__is_pointer(cvoid))]; int t23[F(__is_pointer(char))]; int t24[F(__is_pointer(int))]; int t25[F(__is_pointer(int))]; int t26[F(__is_pointer(ClassType))]; int t27[F(__is_pointer(Derives))]; int t28[F(__is_pointer(Enum))]; int t29[F(__is_pointer(IntArNB))]; int t30[F(__is_pointer(Union))]; int t31[F(__is_pointer(UnionAr))]; int t32[F(__is_pointer(StructWithMembers))]; int t33[F(__is_pointer(int StructWithMembers::*))]; int t34[F(__is_pointer(void (StructWithMembers::*) ()))]; } void is_member_object_pointer() { StructWithMembers x; int t01[T(__is_member_object_pointer(int StructWithMembers::*))]; int t10[F(__is_member_object_pointer(void (StructWithMembers::*) ()))]; int t11[F(__is_member_object_pointer(void*))]; int t12[F(__is_member_object_pointer(cvoid*))]; int t13[F(__is_member_object_pointer(cvoid*))]; int t14[F(__is_member_object_pointer(char*))]; int t15[F(__is_member_object_pointer(int*))]; int t16[F(__is_member_object_pointer(int**))]; int t17[F(__is_member_object_pointer(ClassType*))]; int t18[F(__is_member_object_pointer(Derives*))]; int t19[F(__is_member_object_pointer(Enum*))]; int t20[F(__is_member_object_pointer(IntArNB*))]; int t21[F(__is_member_object_pointer(Union*))]; int t22[F(__is_member_object_pointer(UnionAr*))]; int t23[F(__is_member_object_pointer(StructWithMembers*))]; int t24[F(__is_member_object_pointer(void))]; int t25[F(__is_member_object_pointer(cvoid))]; int t26[F(__is_member_object_pointer(cvoid))]; int t27[F(__is_member_object_pointer(char))]; int t28[F(__is_member_object_pointer(int))]; int t29[F(__is_member_object_pointer(int))]; int t30[F(__is_member_object_pointer(ClassType))]; int t31[F(__is_member_object_pointer(Derives))]; int t32[F(__is_member_object_pointer(Enum))]; int t33[F(__is_member_object_pointer(IntArNB))]; int t34[F(__is_member_object_pointer(Union))]; int t35[F(__is_member_object_pointer(UnionAr))]; int t36[F(__is_member_object_pointer(StructWithMembers))]; int t37[F(__is_member_object_pointer(void (*)()))]; } void is_member_function_pointer() { StructWithMembers x; int t01[T(__is_member_function_pointer(void (StructWithMembers::*) ()))]; int t10[F(__is_member_function_pointer(int StructWithMembers::*))]; int t11[F(__is_member_function_pointer(void*))]; int t12[F(__is_member_function_pointer(cvoid*))]; int t13[F(__is_member_function_pointer(cvoid*))]; int t14[F(__is_member_function_pointer(char*))]; int t15[F(__is_member_function_pointer(int*))]; int t16[F(__is_member_function_pointer(int**))]; int t17[F(__is_member_function_pointer(ClassType*))]; int t18[F(__is_member_function_pointer(Derives*))]; int t19[F(__is_member_function_pointer(Enum*))]; int t20[F(__is_member_function_pointer(IntArNB*))]; int t21[F(__is_member_function_pointer(Union*))]; int t22[F(__is_member_function_pointer(UnionAr*))]; int t23[F(__is_member_function_pointer(StructWithMembers*))]; int t24[F(__is_member_function_pointer(void))]; int t25[F(__is_member_function_pointer(cvoid))]; int t26[F(__is_member_function_pointer(cvoid))]; int t27[F(__is_member_function_pointer(char))]; int t28[F(__is_member_function_pointer(int))]; int t29[F(__is_member_function_pointer(int))]; int t30[F(__is_member_function_pointer(ClassType))]; int t31[F(__is_member_function_pointer(Derives))]; int t32[F(__is_member_function_pointer(Enum))]; int t33[F(__is_member_function_pointer(IntArNB))]; int t34[F(__is_member_function_pointer(Union))]; int t35[F(__is_member_function_pointer(UnionAr))]; int t36[F(__is_member_function_pointer(StructWithMembers))]; int t37[F(__is_member_function_pointer(void (*)()))]; } void is_member_pointer() { StructWithMembers x; int t01[T(__is_member_pointer(int StructWithMembers::*))]; int t02[T(__is_member_pointer(void (StructWithMembers::*) ()))]; int t10[F(__is_member_pointer(void*))]; int t11[F(__is_member_pointer(cvoid*))]; int t12[F(__is_member_pointer(cvoid*))]; int t13[F(__is_member_pointer(char*))]; int t14[F(__is_member_pointer(int*))]; int t15[F(__is_member_pointer(int**))]; int t16[F(__is_member_pointer(ClassType*))]; int t17[F(__is_member_pointer(Derives*))]; int t18[F(__is_member_pointer(Enum*))]; int t19[F(__is_member_pointer(IntArNB*))]; int t20[F(__is_member_pointer(Union*))]; int t21[F(__is_member_pointer(UnionAr*))]; int t22[F(__is_member_pointer(StructWithMembers*))]; int t23[F(__is_member_pointer(void))]; int t24[F(__is_member_pointer(cvoid))]; int t25[F(__is_member_pointer(cvoid))]; int t26[F(__is_member_pointer(char))]; int t27[F(__is_member_pointer(int))]; int t28[F(__is_member_pointer(int))]; int t29[F(__is_member_pointer(ClassType))]; int t30[F(__is_member_pointer(Derives))]; int t31[F(__is_member_pointer(Enum))]; int t32[F(__is_member_pointer(IntArNB))]; int t33[F(__is_member_pointer(Union))]; int t34[F(__is_member_pointer(UnionAr))]; int t35[F(__is_member_pointer(StructWithMembers))]; int t36[F(__is_member_pointer(void (*)()))]; } void is_const() { int t01[T(__is_const(cvoid))]; int t02[T(__is_const(const char))]; int t03[T(__is_const(const int))]; int t04[T(__is_const(const long))]; int t05[T(__is_const(const short))]; int t06[T(__is_const(const signed char))]; int t07[T(__is_const(const wchar_t))]; int t08[T(__is_const(const bool))]; int t09[T(__is_const(const float))]; int t10[T(__is_const(const double))]; int t11[T(__is_const(const long double))]; int t12[T(__is_const(const unsigned char))]; int t13[T(__is_const(const unsigned int))]; int t14[T(__is_const(const unsigned long long))]; int t15[T(__is_const(const unsigned long))]; int t16[T(__is_const(const unsigned short))]; int t17[T(__is_const(const void))]; int t18[T(__is_const(const ClassType))]; int t19[T(__is_const(const Derives))]; int t20[T(__is_const(const Enum))]; int t21[T(__is_const(const IntArNB))]; int t22[T(__is_const(const Union))]; int t23[T(__is_const(const UnionAr))]; int t30[F(__is_const(char))]; int t31[F(__is_const(int))]; int t32[F(__is_const(long))]; int t33[F(__is_const(short))]; int t34[F(__is_const(signed char))]; int t35[F(__is_const(wchar_t))]; int t36[F(__is_const(bool))]; int t37[F(__is_const(float))]; int t38[F(__is_const(double))]; int t39[F(__is_const(long double))]; int t40[F(__is_const(unsigned char))]; int t41[F(__is_const(unsigned int))]; int t42[F(__is_const(unsigned long long))]; int t43[F(__is_const(unsigned long))]; int t44[F(__is_const(unsigned short))]; int t45[F(__is_const(void))]; int t46[F(__is_const(ClassType))]; int t47[F(__is_const(Derives))]; int t48[F(__is_const(Enum))]; int t49[F(__is_const(IntArNB))]; int t50[F(__is_const(Union))]; int t51[F(__is_const(UnionAr))]; } void is_volatile() { int t02[T(__is_volatile(volatile char))]; int t03[T(__is_volatile(volatile int))]; int t04[T(__is_volatile(volatile long))]; int t05[T(__is_volatile(volatile short))]; int t06[T(__is_volatile(volatile signed char))]; int t07[T(__is_volatile(volatile wchar_t))]; int t08[T(__is_volatile(volatile bool))]; int t09[T(__is_volatile(volatile float))]; int t10[T(__is_volatile(volatile double))]; int t11[T(__is_volatile(volatile long double))]; int t12[T(__is_volatile(volatile unsigned char))]; int t13[T(__is_volatile(volatile unsigned int))]; int t14[T(__is_volatile(volatile unsigned long long))]; int t15[T(__is_volatile(volatile unsigned long))]; int t16[T(__is_volatile(volatile unsigned short))]; int t17[T(__is_volatile(volatile void))]; int t18[T(__is_volatile(volatile ClassType))]; int t19[T(__is_volatile(volatile Derives))]; int t20[T(__is_volatile(volatile Enum))]; int t21[T(__is_volatile(volatile IntArNB))]; int t22[T(__is_volatile(volatile Union))]; int t23[T(__is_volatile(volatile UnionAr))]; int t30[F(__is_volatile(char))]; int t31[F(__is_volatile(int))]; int t32[F(__is_volatile(long))]; int t33[F(__is_volatile(short))]; int t34[F(__is_volatile(signed char))]; int t35[F(__is_volatile(wchar_t))]; int t36[F(__is_volatile(bool))]; int t37[F(__is_volatile(float))]; int t38[F(__is_volatile(double))]; int t39[F(__is_volatile(long double))]; int t40[F(__is_volatile(unsigned char))]; int t41[F(__is_volatile(unsigned int))]; int t42[F(__is_volatile(unsigned long long))]; int t43[F(__is_volatile(unsigned long))]; int t44[F(__is_volatile(unsigned short))]; int t45[F(__is_volatile(void))]; int t46[F(__is_volatile(ClassType))]; int t47[F(__is_volatile(Derives))]; int t48[F(__is_volatile(Enum))]; int t49[F(__is_volatile(IntArNB))]; int t50[F(__is_volatile(Union))]; int t51[F(__is_volatile(UnionAr))]; } struct TrivialStruct { int member; }; struct NonTrivialStruct { int member; NonTrivialStruct() { member = 0; } }; struct SuperNonTrivialStruct { SuperNonTrivialStruct() { } ~SuperNonTrivialStruct() { } }; struct NonTCStruct { NonTCStruct(const NonTCStruct&) {} }; struct AllDefaulted { AllDefaulted() = default; AllDefaulted(const AllDefaulted &) = default; AllDefaulted(AllDefaulted &&) = default; AllDefaulted &operator=(const AllDefaulted &) = default; AllDefaulted &operator=(AllDefaulted &&) = default; ~AllDefaulted() = default; }; struct NoDefaultMoveAssignDueToUDCopyCtor { NoDefaultMoveAssignDueToUDCopyCtor(const NoDefaultMoveAssignDueToUDCopyCtor&); }; struct NoDefaultMoveAssignDueToUDCopyAssign { NoDefaultMoveAssignDueToUDCopyAssign& operator=( const NoDefaultMoveAssignDueToUDCopyAssign&); }; struct NoDefaultMoveAssignDueToDtor { ~NoDefaultMoveAssignDueToDtor(); }; struct AllDeleted { AllDeleted() = delete; AllDeleted(const AllDeleted &) = delete; AllDeleted(AllDeleted &&) = delete; AllDeleted &operator=(const AllDeleted &) = delete; AllDeleted &operator=(AllDeleted &&) = delete; ~AllDeleted() = delete; }; struct ExtDefaulted { ExtDefaulted(); ExtDefaulted(const ExtDefaulted &); ExtDefaulted(ExtDefaulted &&); ExtDefaulted &operator=(const ExtDefaulted &); ExtDefaulted &operator=(ExtDefaulted &&); ~ExtDefaulted(); }; // Despite being defaulted, these functions are not trivial. ExtDefaulted::ExtDefaulted() = default; ExtDefaulted::ExtDefaulted(const ExtDefaulted &) = default; ExtDefaulted::ExtDefaulted(ExtDefaulted &&) = default; ExtDefaulted &ExtDefaulted::operator=(const ExtDefaulted &) = default; ExtDefaulted &ExtDefaulted::operator=(ExtDefaulted &&) = default; ExtDefaulted::~ExtDefaulted() = default; void is_trivial2() { int t01[T(__is_trivial(char))]; int t02[T(__is_trivial(int))]; int t03[T(__is_trivial(long))]; int t04[T(__is_trivial(short))]; int t05[T(__is_trivial(signed char))]; int t06[T(__is_trivial(wchar_t))]; int t07[T(__is_trivial(bool))]; int t08[T(__is_trivial(float))]; int t09[T(__is_trivial(double))]; int t10[T(__is_trivial(long double))]; int t11[T(__is_trivial(unsigned char))]; int t12[T(__is_trivial(unsigned int))]; int t13[T(__is_trivial(unsigned long long))]; int t14[T(__is_trivial(unsigned long))]; int t15[T(__is_trivial(unsigned short))]; int t16[T(__is_trivial(ClassType))]; int t17[T(__is_trivial(Derives))]; int t18[T(__is_trivial(Enum))]; int t19[T(__is_trivial(IntAr))]; int t20[T(__is_trivial(Union))]; int t21[T(__is_trivial(UnionAr))]; int t22[T(__is_trivial(TrivialStruct))]; int t23[T(__is_trivial(AllDefaulted))]; int t24[T(__is_trivial(AllDeleted))]; int t30[F(__is_trivial(void))]; int t31[F(__is_trivial(NonTrivialStruct))]; int t32[F(__is_trivial(SuperNonTrivialStruct))]; int t33[F(__is_trivial(NonTCStruct))]; int t34[F(__is_trivial(ExtDefaulted))]; } void is_trivially_copyable2() { int t01[T(__is_trivially_copyable(char))]; int t02[T(__is_trivially_copyable(int))]; int t03[T(__is_trivially_copyable(long))]; int t04[T(__is_trivially_copyable(short))]; int t05[T(__is_trivially_copyable(signed char))]; int t06[T(__is_trivially_copyable(wchar_t))]; int t07[T(__is_trivially_copyable(bool))]; int t08[T(__is_trivially_copyable(float))]; int t09[T(__is_trivially_copyable(double))]; int t10[T(__is_trivially_copyable(long double))]; int t11[T(__is_trivially_copyable(unsigned char))]; int t12[T(__is_trivially_copyable(unsigned int))]; int t13[T(__is_trivially_copyable(unsigned long long))]; int t14[T(__is_trivially_copyable(unsigned long))]; int t15[T(__is_trivially_copyable(unsigned short))]; int t16[T(__is_trivially_copyable(ClassType))]; int t17[T(__is_trivially_copyable(Derives))]; int t18[T(__is_trivially_copyable(Enum))]; int t19[T(__is_trivially_copyable(IntAr))]; int t20[T(__is_trivially_copyable(Union))]; int t21[T(__is_trivially_copyable(UnionAr))]; int t22[T(__is_trivially_copyable(TrivialStruct))]; int t23[T(__is_trivially_copyable(NonTrivialStruct))]; int t24[T(__is_trivially_copyable(AllDefaulted))]; int t25[T(__is_trivially_copyable(AllDeleted))]; int t30[F(__is_trivially_copyable(void))]; int t31[F(__is_trivially_copyable(SuperNonTrivialStruct))]; int t32[F(__is_trivially_copyable(NonTCStruct))]; int t33[F(__is_trivially_copyable(ExtDefaulted))]; } struct CStruct { int one; int two; }; struct CEmptyStruct {}; struct CppEmptyStruct : CStruct {}; struct CppStructStandard : CEmptyStruct { int three; int four; }; struct CppStructNonStandardByBase : CStruct { int three; int four; }; struct CppStructNonStandardByVirt : CStruct { virtual void method() {} }; struct CppStructNonStandardByMemb : CStruct { CppStructNonStandardByVirt member; }; struct CppStructNonStandardByProt : CStruct { int five; protected: int six; }; struct CppStructNonStandardByVirtBase : virtual CStruct { }; struct CppStructNonStandardBySameBase : CEmptyStruct { CEmptyStruct member; }; struct CppStructNonStandardBy2ndVirtBase : CEmptyStruct { CEmptyStruct member; }; void is_standard_layout() { typedef const int ConstInt; typedef ConstInt ConstIntAr[4]; typedef CppStructStandard CppStructStandardAr[4]; int t01[T(__is_standard_layout(int))]; int t02[T(__is_standard_layout(ConstInt))]; int t03[T(__is_standard_layout(ConstIntAr))]; int t04[T(__is_standard_layout(CStruct))]; int t05[T(__is_standard_layout(CppStructStandard))]; int t06[T(__is_standard_layout(CppStructStandardAr))]; int t07[T(__is_standard_layout(Vector))]; int t08[T(__is_standard_layout(VectorExt))]; typedef CppStructNonStandardByBase CppStructNonStandardByBaseAr[4]; int t10[F(__is_standard_layout(CppStructNonStandardByVirt))]; int t11[F(__is_standard_layout(CppStructNonStandardByMemb))]; int t12[F(__is_standard_layout(CppStructNonStandardByProt))]; int t13[F(__is_standard_layout(CppStructNonStandardByVirtBase))]; int t14[F(__is_standard_layout(CppStructNonStandardByBase))]; int t15[F(__is_standard_layout(CppStructNonStandardByBaseAr))]; int t16[F(__is_standard_layout(CppStructNonStandardBySameBase))]; int t17[F(__is_standard_layout(CppStructNonStandardBy2ndVirtBase))]; } void is_signed() { //int t01[T(__is_signed(char))]; int t02[T(__is_signed(int))]; int t03[T(__is_signed(long))]; int t04[T(__is_signed(short))]; int t05[T(__is_signed(signed char))]; int t06[T(__is_signed(wchar_t))]; int t10[F(__is_signed(bool))]; int t11[F(__is_signed(cvoid))]; int t12[F(__is_signed(float))]; int t13[F(__is_signed(double))]; int t14[F(__is_signed(long double))]; int t15[F(__is_signed(unsigned char))]; int t16[F(__is_signed(unsigned int))]; int t17[F(__is_signed(unsigned long long))]; int t18[F(__is_signed(unsigned long))]; int t19[F(__is_signed(unsigned short))]; int t20[F(__is_signed(void))]; int t21[F(__is_signed(ClassType))]; int t22[F(__is_signed(Derives))]; int t23[F(__is_signed(Enum))]; int t24[F(__is_signed(IntArNB))]; int t25[F(__is_signed(Union))]; int t26[F(__is_signed(UnionAr))]; } void is_unsigned() { int t01[T(__is_unsigned(bool))]; int t02[T(__is_unsigned(unsigned char))]; int t03[T(__is_unsigned(unsigned short))]; int t04[T(__is_unsigned(unsigned int))]; int t05[T(__is_unsigned(unsigned long))]; int t06[T(__is_unsigned(unsigned long long))]; int t07[T(__is_unsigned(Enum))]; int t10[F(__is_unsigned(void))]; int t11[F(__is_unsigned(cvoid))]; int t12[F(__is_unsigned(float))]; int t13[F(__is_unsigned(double))]; int t14[F(__is_unsigned(long double))]; int t16[F(__is_unsigned(char))]; int t17[F(__is_unsigned(signed char))]; int t18[F(__is_unsigned(wchar_t))]; int t19[F(__is_unsigned(short))]; int t20[F(__is_unsigned(int))]; int t21[F(__is_unsigned(long))]; int t22[F(__is_unsigned(Union))]; int t23[F(__is_unsigned(UnionAr))]; int t24[F(__is_unsigned(Derives))]; int t25[F(__is_unsigned(ClassType))]; int t26[F(__is_unsigned(IntArNB))]; } typedef Int& IntRef; typedef const IntAr ConstIntAr; typedef ConstIntAr ConstIntArAr[4]; struct HasCopy { HasCopy(HasCopy& cp); }; struct HasMove { HasMove(HasMove&& cp); }; struct HasTemplateCons { HasVirt Annoying; template <typename T> HasTemplateCons(const T&); }; void has_trivial_default_constructor() { { int arr[T(__has_trivial_constructor(Int))]; } { int arr[T(__has_trivial_constructor(IntAr))]; } { int arr[T(__has_trivial_constructor(Union))]; } { int arr[T(__has_trivial_constructor(UnionAr))]; } { int arr[T(__has_trivial_constructor(POD))]; } { int arr[T(__has_trivial_constructor(Derives))]; } { int arr[T(__has_trivial_constructor(DerivesAr))]; } { int arr[T(__has_trivial_constructor(ConstIntAr))]; } { int arr[T(__has_trivial_constructor(ConstIntArAr))]; } { int arr[T(__has_trivial_constructor(HasDest))]; } { int arr[T(__has_trivial_constructor(HasPriv))]; } { int arr[T(__has_trivial_constructor(HasCopyAssign))]; } { int arr[T(__has_trivial_constructor(HasMoveAssign))]; } { int arr[T(__has_trivial_constructor(const Int))]; } { int arr[T(__has_trivial_constructor(AllDefaulted))]; } { int arr[T(__has_trivial_constructor(AllDeleted))]; } { int arr[F(__has_trivial_constructor(HasCons))]; } { int arr[F(__has_trivial_constructor(HasRef))]; } { int arr[F(__has_trivial_constructor(HasCopy))]; } { int arr[F(__has_trivial_constructor(IntRef))]; } { int arr[F(__has_trivial_constructor(VirtAr))]; } { int arr[F(__has_trivial_constructor(void))]; } { int arr[F(__has_trivial_constructor(cvoid))]; } { int arr[F(__has_trivial_constructor(HasTemplateCons))]; } { int arr[F(__has_trivial_constructor(AllPrivate))]; } { int arr[F(__has_trivial_constructor(ExtDefaulted))]; } } void has_trivial_move_constructor() { // n3376 12.8 [class.copy]/12 // A copy/move constructor for class X is trivial if it is not // user-provided, its declared parameter type is the same as // if it had been implicitly declared, and if // — class X has no virtual functions (10.3) and no virtual // base classes (10.1), and // — the constructor selected to copy/move each direct base // class subobject is trivial, and // — for each non-static data member of X that is of class // type (or array thereof), the constructor selected // to copy/move that member is trivial; // otherwise the copy/move constructor is non-trivial. { int arr[T(__has_trivial_move_constructor(POD))]; } { int arr[T(__has_trivial_move_constructor(Union))]; } { int arr[T(__has_trivial_move_constructor(HasCons))]; } { int arr[T(__has_trivial_move_constructor(HasStaticMemberMoveCtor))]; } { int arr[T(__has_trivial_move_constructor(AllDeleted))]; } { int arr[F(__has_trivial_move_constructor(HasVirt))]; } { int arr[F(__has_trivial_move_constructor(DerivesVirt))]; } { int arr[F(__has_trivial_move_constructor(HasMoveCtor))]; } { int arr[F(__has_trivial_move_constructor(DerivesHasMoveCtor))]; } { int arr[F(__has_trivial_move_constructor(HasMemberMoveCtor))]; } } void has_trivial_copy_constructor() { { int arr[T(__has_trivial_copy(Int))]; } { int arr[T(__has_trivial_copy(IntAr))]; } { int arr[T(__has_trivial_copy(Union))]; } { int arr[T(__has_trivial_copy(UnionAr))]; } { int arr[T(__has_trivial_copy(POD))]; } { int arr[T(__has_trivial_copy(Derives))]; } { int arr[T(__has_trivial_copy(ConstIntAr))]; } { int arr[T(__has_trivial_copy(ConstIntArAr))]; } { int arr[T(__has_trivial_copy(HasDest))]; } { int arr[T(__has_trivial_copy(HasPriv))]; } { int arr[T(__has_trivial_copy(HasCons))]; } { int arr[T(__has_trivial_copy(HasRef))]; } { int arr[T(__has_trivial_copy(HasMove))]; } { int arr[T(__has_trivial_copy(IntRef))]; } { int arr[T(__has_trivial_copy(HasCopyAssign))]; } { int arr[T(__has_trivial_copy(HasMoveAssign))]; } { int arr[T(__has_trivial_copy(const Int))]; } { int arr[T(__has_trivial_copy(AllDefaulted))]; } { int arr[T(__has_trivial_copy(AllDeleted))]; } { int arr[T(__has_trivial_copy(DerivesAr))]; } { int arr[T(__has_trivial_copy(DerivesHasRef))]; } { int arr[F(__has_trivial_copy(HasCopy))]; } { int arr[F(__has_trivial_copy(HasTemplateCons))]; } { int arr[F(__has_trivial_copy(VirtAr))]; } { int arr[F(__has_trivial_copy(void))]; } { int arr[F(__has_trivial_copy(cvoid))]; } { int arr[F(__has_trivial_copy(AllPrivate))]; } { int arr[F(__has_trivial_copy(ExtDefaulted))]; } } void has_trivial_copy_assignment() { { int arr[T(__has_trivial_assign(Int))]; } { int arr[T(__has_trivial_assign(IntAr))]; } { int arr[T(__has_trivial_assign(Union))]; } { int arr[T(__has_trivial_assign(UnionAr))]; } { int arr[T(__has_trivial_assign(POD))]; } { int arr[T(__has_trivial_assign(Derives))]; } { int arr[T(__has_trivial_assign(HasDest))]; } { int arr[T(__has_trivial_assign(HasPriv))]; } { int arr[T(__has_trivial_assign(HasCons))]; } { int arr[T(__has_trivial_assign(HasRef))]; } { int arr[T(__has_trivial_assign(HasCopy))]; } { int arr[T(__has_trivial_assign(HasMove))]; } { int arr[T(__has_trivial_assign(HasMoveAssign))]; } { int arr[T(__has_trivial_assign(AllDefaulted))]; } { int arr[T(__has_trivial_assign(AllDeleted))]; } { int arr[T(__has_trivial_assign(DerivesAr))]; } { int arr[T(__has_trivial_assign(DerivesHasRef))]; } { int arr[F(__has_trivial_assign(IntRef))]; } { int arr[F(__has_trivial_assign(HasCopyAssign))]; } { int arr[F(__has_trivial_assign(const Int))]; } { int arr[F(__has_trivial_assign(ConstIntAr))]; } { int arr[F(__has_trivial_assign(ConstIntArAr))]; } { int arr[F(__has_trivial_assign(VirtAr))]; } { int arr[F(__has_trivial_assign(void))]; } { int arr[F(__has_trivial_assign(cvoid))]; } { int arr[F(__has_trivial_assign(AllPrivate))]; } { int arr[F(__has_trivial_assign(ExtDefaulted))]; } } void has_trivial_destructor() { { int arr[T(__has_trivial_destructor(Int))]; } { int arr[T(__has_trivial_destructor(IntAr))]; } { int arr[T(__has_trivial_destructor(Union))]; } { int arr[T(__has_trivial_destructor(UnionAr))]; } { int arr[T(__has_trivial_destructor(POD))]; } { int arr[T(__has_trivial_destructor(Derives))]; } { int arr[T(__has_trivial_destructor(ConstIntAr))]; } { int arr[T(__has_trivial_destructor(ConstIntArAr))]; } { int arr[T(__has_trivial_destructor(HasPriv))]; } { int arr[T(__has_trivial_destructor(HasCons))]; } { int arr[T(__has_trivial_destructor(HasRef))]; } { int arr[T(__has_trivial_destructor(HasCopy))]; } { int arr[T(__has_trivial_destructor(HasMove))]; } { int arr[T(__has_trivial_destructor(IntRef))]; } { int arr[T(__has_trivial_destructor(HasCopyAssign))]; } { int arr[T(__has_trivial_destructor(HasMoveAssign))]; } { int arr[T(__has_trivial_destructor(const Int))]; } { int arr[T(__has_trivial_destructor(DerivesAr))]; } { int arr[T(__has_trivial_destructor(VirtAr))]; } { int arr[T(__has_trivial_destructor(AllDefaulted))]; } { int arr[T(__has_trivial_destructor(AllDeleted))]; } { int arr[T(__has_trivial_destructor(DerivesHasRef))]; } { int arr[F(__has_trivial_destructor(HasDest))]; } { int arr[F(__has_trivial_destructor(void))]; } { int arr[F(__has_trivial_destructor(cvoid))]; } { int arr[F(__has_trivial_destructor(AllPrivate))]; } { int arr[F(__has_trivial_destructor(ExtDefaulted))]; } } struct A { ~A() {} }; template<typename> struct B : A { }; void f() { { int arr[F(__has_trivial_destructor(A))]; } { int arr[F(__has_trivial_destructor(B<int>))]; } } class PR11110 { template <int> int operator=( int ); int operator=(PR11110); }; class UsingAssign; class UsingAssignBase { protected: UsingAssign &operator=(const UsingAssign&) throw(); }; class UsingAssign : public UsingAssignBase { public: using UsingAssignBase::operator=; }; void has_nothrow_assign() { { int arr[T(__has_nothrow_assign(Int))]; } { int arr[T(__has_nothrow_assign(IntAr))]; } { int arr[T(__has_nothrow_assign(Union))]; } { int arr[T(__has_nothrow_assign(UnionAr))]; } { int arr[T(__has_nothrow_assign(POD))]; } { int arr[T(__has_nothrow_assign(Derives))]; } { int arr[T(__has_nothrow_assign(HasDest))]; } { int arr[T(__has_nothrow_assign(HasPriv))]; } { int arr[T(__has_nothrow_assign(HasCons))]; } { int arr[T(__has_nothrow_assign(HasRef))]; } { int arr[T(__has_nothrow_assign(HasCopy))]; } { int arr[T(__has_nothrow_assign(HasMove))]; } { int arr[T(__has_nothrow_assign(HasMoveAssign))]; } { int arr[T(__has_nothrow_assign(HasNoThrowCopyAssign))]; } { int arr[T(__has_nothrow_assign(HasMultipleNoThrowCopyAssign))]; } { int arr[T(__has_nothrow_assign(HasVirtDest))]; } { int arr[T(__has_nothrow_assign(AllPrivate))]; } { int arr[T(__has_nothrow_assign(UsingAssign))]; } { int arr[T(__has_nothrow_assign(DerivesAr))]; } { int arr[F(__has_nothrow_assign(IntRef))]; } { int arr[F(__has_nothrow_assign(HasCopyAssign))]; } { int arr[F(__has_nothrow_assign(HasMultipleCopyAssign))]; } { int arr[F(__has_nothrow_assign(const Int))]; } { int arr[F(__has_nothrow_assign(ConstIntAr))]; } { int arr[F(__has_nothrow_assign(ConstIntArAr))]; } { int arr[F(__has_nothrow_assign(VirtAr))]; } { int arr[F(__has_nothrow_assign(void))]; } { int arr[F(__has_nothrow_assign(cvoid))]; } { int arr[F(__has_nothrow_assign(PR11110))]; } } void has_nothrow_move_assign() { { int arr[T(__has_nothrow_move_assign(Int))]; } { int arr[T(__has_nothrow_move_assign(Enum))]; } { int arr[T(__has_nothrow_move_assign(Int*))]; } { int arr[T(__has_nothrow_move_assign(Enum POD::*))]; } { int arr[T(__has_nothrow_move_assign(POD))]; } { int arr[T(__has_nothrow_move_assign(HasPriv))]; } { int arr[T(__has_nothrow_move_assign(HasNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(HasNoExceptNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(HasMemberNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(HasMemberNoExceptNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(AllDeleted))]; } { int arr[F(__has_nothrow_move_assign(HasThrowMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(HasNoExceptFalseMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(HasMemberThrowMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(HasMemberNoExceptFalseMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyCtor))]; } { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyAssign))]; } { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToDtor))]; } } void has_trivial_move_assign() { // n3376 12.8 [class.copy]/25 // A copy/move assignment operator for class X is trivial if it // is not user-provided, its declared parameter type is the same // as if it had been implicitly declared, and if: // — class X has no virtual functions (10.3) and no virtual base // classes (10.1), and // — the assignment operator selected to copy/move each direct // base class subobject is trivial, and // — for each non-static data member of X that is of class type // (or array thereof), the assignment operator // selected to copy/move that member is trivial; { int arr[T(__has_trivial_move_assign(Int))]; } { int arr[T(__has_trivial_move_assign(HasStaticMemberMoveAssign))]; } { int arr[T(__has_trivial_move_assign(AllDeleted))]; } { int arr[F(__has_trivial_move_assign(HasVirt))]; } { int arr[F(__has_trivial_move_assign(DerivesVirt))]; } { int arr[F(__has_trivial_move_assign(HasMoveAssign))]; } { int arr[F(__has_trivial_move_assign(DerivesHasMoveAssign))]; } { int arr[F(__has_trivial_move_assign(HasMemberMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyCtor))]; } { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyAssign))]; } } void has_nothrow_copy() { { int arr[T(__has_nothrow_copy(Int))]; } { int arr[T(__has_nothrow_copy(IntAr))]; } { int arr[T(__has_nothrow_copy(Union))]; } { int arr[T(__has_nothrow_copy(UnionAr))]; } { int arr[T(__has_nothrow_copy(POD))]; } { int arr[T(__has_nothrow_copy(const Int))]; } { int arr[T(__has_nothrow_copy(ConstIntAr))]; } { int arr[T(__has_nothrow_copy(ConstIntArAr))]; } { int arr[T(__has_nothrow_copy(Derives))]; } { int arr[T(__has_nothrow_copy(IntRef))]; } { int arr[T(__has_nothrow_copy(HasDest))]; } { int arr[T(__has_nothrow_copy(HasPriv))]; } { int arr[T(__has_nothrow_copy(HasCons))]; } { int arr[T(__has_nothrow_copy(HasRef))]; } { int arr[T(__has_nothrow_copy(HasMove))]; } { int arr[T(__has_nothrow_copy(HasCopyAssign))]; } { int arr[T(__has_nothrow_copy(HasMoveAssign))]; } { int arr[T(__has_nothrow_copy(HasNoThrowCopy))]; } { int arr[T(__has_nothrow_copy(HasMultipleNoThrowCopy))]; } { int arr[T(__has_nothrow_copy(HasVirtDest))]; } { int arr[T(__has_nothrow_copy(HasTemplateCons))]; } { int arr[T(__has_nothrow_copy(AllPrivate))]; } { int arr[T(__has_nothrow_copy(DerivesAr))]; } { int arr[F(__has_nothrow_copy(HasCopy))]; } { int arr[F(__has_nothrow_copy(HasMultipleCopy))]; } { int arr[F(__has_nothrow_copy(VirtAr))]; } { int arr[F(__has_nothrow_copy(void))]; } { int arr[F(__has_nothrow_copy(cvoid))]; } } void has_nothrow_constructor() { { int arr[T(__has_nothrow_constructor(Int))]; } { int arr[T(__has_nothrow_constructor(IntAr))]; } { int arr[T(__has_nothrow_constructor(Union))]; } { int arr[T(__has_nothrow_constructor(UnionAr))]; } { int arr[T(__has_nothrow_constructor(POD))]; } { int arr[T(__has_nothrow_constructor(Derives))]; } { int arr[T(__has_nothrow_constructor(DerivesAr))]; } { int arr[T(__has_nothrow_constructor(ConstIntAr))]; } { int arr[T(__has_nothrow_constructor(ConstIntArAr))]; } { int arr[T(__has_nothrow_constructor(HasDest))]; } { int arr[T(__has_nothrow_constructor(HasPriv))]; } { int arr[T(__has_nothrow_constructor(HasCopyAssign))]; } { int arr[T(__has_nothrow_constructor(const Int))]; } { int arr[T(__has_nothrow_constructor(HasNoThrowConstructor))]; } { int arr[T(__has_nothrow_constructor(HasVirtDest))]; } // { int arr[T(__has_nothrow_constructor(VirtAr))]; } // not implemented { int arr[T(__has_nothrow_constructor(AllPrivate))]; } { int arr[F(__has_nothrow_constructor(HasCons))]; } { int arr[F(__has_nothrow_constructor(HasRef))]; } { int arr[F(__has_nothrow_constructor(HasCopy))]; } { int arr[F(__has_nothrow_constructor(HasMove))]; } { int arr[F(__has_nothrow_constructor(HasNoThrowConstructorWithArgs))]; } { int arr[F(__has_nothrow_constructor(IntRef))]; } { int arr[F(__has_nothrow_constructor(void))]; } { int arr[F(__has_nothrow_constructor(cvoid))]; } { int arr[F(__has_nothrow_constructor(HasTemplateCons))]; } } void has_virtual_destructor() { { int arr[F(__has_virtual_destructor(Int))]; } { int arr[F(__has_virtual_destructor(IntAr))]; } { int arr[F(__has_virtual_destructor(Union))]; } { int arr[F(__has_virtual_destructor(UnionAr))]; } { int arr[F(__has_virtual_destructor(POD))]; } { int arr[F(__has_virtual_destructor(Derives))]; } { int arr[F(__has_virtual_destructor(DerivesAr))]; } { int arr[F(__has_virtual_destructor(const Int))]; } { int arr[F(__has_virtual_destructor(ConstIntAr))]; } { int arr[F(__has_virtual_destructor(ConstIntArAr))]; } { int arr[F(__has_virtual_destructor(HasDest))]; } { int arr[F(__has_virtual_destructor(HasPriv))]; } { int arr[F(__has_virtual_destructor(HasCons))]; } { int arr[F(__has_virtual_destructor(HasRef))]; } { int arr[F(__has_virtual_destructor(HasCopy))]; } { int arr[F(__has_virtual_destructor(HasMove))]; } { int arr[F(__has_virtual_destructor(HasCopyAssign))]; } { int arr[F(__has_virtual_destructor(HasMoveAssign))]; } { int arr[F(__has_virtual_destructor(IntRef))]; } { int arr[F(__has_virtual_destructor(VirtAr))]; } { int arr[T(__has_virtual_destructor(HasVirtDest))]; } { int arr[T(__has_virtual_destructor(DerivedVirtDest))]; } { int arr[F(__has_virtual_destructor(VirtDestAr))]; } { int arr[F(__has_virtual_destructor(void))]; } { int arr[F(__has_virtual_destructor(cvoid))]; } { int arr[F(__has_virtual_destructor(AllPrivate))]; } } class Base {}; class Derived : Base {}; class Derived2a : Derived {}; class Derived2b : Derived {}; class Derived3 : virtual Derived2a, virtual Derived2b {}; template<typename T> struct BaseA { T a; }; template<typename T> struct DerivedB : BaseA<T> { }; template<typename T> struct CrazyDerived : T { }; class class_forward; // expected-note {{forward declaration of 'class_forward'}} template <typename Base, typename Derived> void isBaseOfT() { int t[T(__is_base_of(Base, Derived))]; }; template <typename Base, typename Derived> void isBaseOfF() { int t[F(__is_base_of(Base, Derived))]; }; template <class T> class DerivedTemp : Base {}; template <class T> class NonderivedTemp {}; template <class T> class UndefinedTemp; // expected-note {{declared here}} void is_base_of() { { int arr[T(__is_base_of(Base, Derived))]; } { int arr[T(__is_base_of(const Base, Derived))]; } { int arr[F(__is_base_of(Derived, Base))]; } { int arr[F(__is_base_of(Derived, int))]; } { int arr[T(__is_base_of(Base, Base))]; } { int arr[T(__is_base_of(Base, Derived3))]; } { int arr[T(__is_base_of(Derived, Derived3))]; } { int arr[T(__is_base_of(Derived2b, Derived3))]; } { int arr[T(__is_base_of(Derived2a, Derived3))]; } { int arr[T(__is_base_of(BaseA<int>, DerivedB<int>))]; } { int arr[F(__is_base_of(DerivedB<int>, BaseA<int>))]; } { int arr[T(__is_base_of(Base, CrazyDerived<Base>))]; } { int arr[F(__is_base_of(Union, Union))]; } { int arr[T(__is_base_of(Empty, Empty))]; } { int arr[T(__is_base_of(class_forward, class_forward))]; } { int arr[F(__is_base_of(Empty, class_forward))]; } // expected-error {{incomplete type 'class_forward' used in type trait expression}} { int arr[F(__is_base_of(Base&, Derived&))]; } int t18[F(__is_base_of(Base[10], Derived[10]))]; { int arr[F(__is_base_of(int, int))]; } { int arr[F(__is_base_of(long, int))]; } { int arr[T(__is_base_of(Base, DerivedTemp<int>))]; } { int arr[F(__is_base_of(Base, NonderivedTemp<int>))]; } { int arr[F(__is_base_of(Base, UndefinedTemp<int>))]; } // expected-error {{implicit instantiation of undefined template 'UndefinedTemp<int>'}} isBaseOfT<Base, Derived>(); isBaseOfF<Derived, Base>(); isBaseOfT<Base, CrazyDerived<Base> >(); isBaseOfF<CrazyDerived<Base>, Base>(); isBaseOfT<BaseA<int>, DerivedB<int> >(); isBaseOfF<DerivedB<int>, BaseA<int> >(); } template<class T, class U> class TemplateClass {}; template<class T> using TemplateAlias = TemplateClass<T, int>; typedef class Base BaseTypedef; void is_same() { int t01[T(__is_same(Base, Base))]; int t02[T(__is_same(Base, BaseTypedef))]; int t03[T(__is_same(TemplateClass<int, int>, TemplateAlias<int>))]; int t10[F(__is_same(Base, const Base))]; int t11[F(__is_same(Base, Base&))]; int t12[F(__is_same(Base, Derived))]; } struct IntWrapper { int value; IntWrapper(int _value) : value(_value) {} operator int() const { return value; } }; struct FloatWrapper { float value; FloatWrapper(float _value) : value(_value) {} FloatWrapper(const IntWrapper& obj) : value(static_cast<float>(obj.value)) {} operator float() const { return value; } operator IntWrapper() const { return IntWrapper(static_cast<int>(value)); } }; void is_convertible() { int t01[T(__is_convertible(IntWrapper, IntWrapper))]; int t02[T(__is_convertible(IntWrapper, const IntWrapper))]; int t03[T(__is_convertible(IntWrapper, int))]; int t04[T(__is_convertible(int, IntWrapper))]; int t05[T(__is_convertible(IntWrapper, FloatWrapper))]; int t06[T(__is_convertible(FloatWrapper, IntWrapper))]; int t07[T(__is_convertible(FloatWrapper, float))]; int t08[T(__is_convertible(float, FloatWrapper))]; } struct FromInt { FromInt(int); }; struct ToInt { operator int(); }; typedef void Function(); void is_convertible_to(); class PrivateCopy { PrivateCopy(const PrivateCopy&); friend void is_convertible_to(); }; template<typename T> struct X0 { template<typename U> X0(const X0<U>&); }; struct Abstract { virtual void f() = 0; }; void is_convertible_to() { { int arr[T(__is_convertible_to(Int, Int))]; } { int arr[F(__is_convertible_to(Int, IntAr))]; } { int arr[F(__is_convertible_to(IntAr, IntAr))]; } { int arr[T(__is_convertible_to(void, void))]; } { int arr[T(__is_convertible_to(cvoid, void))]; } { int arr[T(__is_convertible_to(void, cvoid))]; } { int arr[T(__is_convertible_to(cvoid, cvoid))]; } { int arr[T(__is_convertible_to(int, FromInt))]; } { int arr[T(__is_convertible_to(long, FromInt))]; } { int arr[T(__is_convertible_to(double, FromInt))]; } { int arr[T(__is_convertible_to(const int, FromInt))]; } { int arr[T(__is_convertible_to(const int&, FromInt))]; } { int arr[T(__is_convertible_to(ToInt, int))]; } { int arr[T(__is_convertible_to(ToInt, const int&))]; } { int arr[T(__is_convertible_to(ToInt, long))]; } { int arr[F(__is_convertible_to(ToInt, int&))]; } { int arr[F(__is_convertible_to(ToInt, FromInt))]; } { int arr[T(__is_convertible_to(IntAr&, IntAr&))]; } { int arr[T(__is_convertible_to(IntAr&, const IntAr&))]; } { int arr[F(__is_convertible_to(const IntAr&, IntAr&))]; } { int arr[F(__is_convertible_to(Function, Function))]; } { int arr[F(__is_convertible_to(PrivateCopy, PrivateCopy))]; } { int arr[T(__is_convertible_to(X0<int>, X0<float>))]; } { int arr[F(__is_convertible_to(Abstract, Abstract))]; } } namespace is_convertible_to_instantiate { // Make sure we don't try to instantiate the constructor. template<int x> class A { A(int) { int a[x]; } }; int x = __is_convertible_to(int, A<-1>); } void is_trivial() { { int arr[T(__is_trivial(int))]; } { int arr[T(__is_trivial(Enum))]; } { int arr[T(__is_trivial(POD))]; } { int arr[T(__is_trivial(Int))]; } { int arr[T(__is_trivial(IntAr))]; } { int arr[T(__is_trivial(IntArNB))]; } { int arr[T(__is_trivial(Statics))]; } { int arr[T(__is_trivial(Empty))]; } { int arr[T(__is_trivial(EmptyUnion))]; } { int arr[T(__is_trivial(Union))]; } { int arr[T(__is_trivial(Derives))]; } { int arr[T(__is_trivial(DerivesAr))]; } { int arr[T(__is_trivial(DerivesArNB))]; } { int arr[T(__is_trivial(DerivesEmpty))]; } { int arr[T(__is_trivial(HasFunc))]; } { int arr[T(__is_trivial(HasOp))]; } { int arr[T(__is_trivial(HasConv))]; } { int arr[T(__is_trivial(HasAssign))]; } { int arr[T(__is_trivial(HasAnonymousUnion))]; } { int arr[T(__is_trivial(HasPriv))]; } { int arr[T(__is_trivial(HasProt))]; } { int arr[T(__is_trivial(DerivesHasPriv))]; } { int arr[T(__is_trivial(DerivesHasProt))]; } { int arr[T(__is_trivial(Vector))]; } { int arr[T(__is_trivial(VectorExt))]; } { int arr[F(__is_trivial(HasCons))]; } { int arr[F(__is_trivial(HasCopyAssign))]; } { int arr[F(__is_trivial(HasMoveAssign))]; } { int arr[F(__is_trivial(HasDest))]; } { int arr[F(__is_trivial(HasRef))]; } { int arr[F(__is_trivial(HasNonPOD))]; } { int arr[F(__is_trivial(HasVirt))]; } { int arr[F(__is_trivial(DerivesHasCons))]; } { int arr[F(__is_trivial(DerivesHasCopyAssign))]; } { int arr[F(__is_trivial(DerivesHasMoveAssign))]; } { int arr[F(__is_trivial(DerivesHasDest))]; } { int arr[F(__is_trivial(DerivesHasRef))]; } { int arr[F(__is_trivial(DerivesHasVirt))]; } { int arr[F(__is_trivial(void))]; } { int arr[F(__is_trivial(cvoid))]; } } void trivial_checks() { { int arr[T(__is_trivially_copyable(int))]; } { int arr[T(__is_trivially_copyable(Enum))]; } { int arr[T(__is_trivially_copyable(POD))]; } { int arr[T(__is_trivially_copyable(Int))]; } { int arr[T(__is_trivially_copyable(IntAr))]; } { int arr[T(__is_trivially_copyable(IntArNB))]; } { int arr[T(__is_trivially_copyable(Statics))]; } { int arr[T(__is_trivially_copyable(Empty))]; } { int arr[T(__is_trivially_copyable(EmptyUnion))]; } { int arr[T(__is_trivially_copyable(Union))]; } { int arr[T(__is_trivially_copyable(Derives))]; } { int arr[T(__is_trivially_copyable(DerivesAr))]; } { int arr[T(__is_trivially_copyable(DerivesArNB))]; } { int arr[T(__is_trivially_copyable(DerivesEmpty))]; } { int arr[T(__is_trivially_copyable(HasFunc))]; } { int arr[T(__is_trivially_copyable(HasOp))]; } { int arr[T(__is_trivially_copyable(HasConv))]; } { int arr[T(__is_trivially_copyable(HasAssign))]; } { int arr[T(__is_trivially_copyable(HasAnonymousUnion))]; } { int arr[T(__is_trivially_copyable(HasPriv))]; } { int arr[T(__is_trivially_copyable(HasProt))]; } { int arr[T(__is_trivially_copyable(DerivesHasPriv))]; } { int arr[T(__is_trivially_copyable(DerivesHasProt))]; } { int arr[T(__is_trivially_copyable(Vector))]; } { int arr[T(__is_trivially_copyable(VectorExt))]; } { int arr[T(__is_trivially_copyable(HasCons))]; } { int arr[T(__is_trivially_copyable(HasRef))]; } { int arr[T(__is_trivially_copyable(HasNonPOD))]; } { int arr[T(__is_trivially_copyable(DerivesHasCons))]; } { int arr[T(__is_trivially_copyable(DerivesHasRef))]; } { int arr[F(__is_trivially_copyable(HasCopyAssign))]; } { int arr[F(__is_trivially_copyable(HasMoveAssign))]; } { int arr[F(__is_trivially_copyable(HasDest))]; } { int arr[F(__is_trivially_copyable(HasVirt))]; } { int arr[F(__is_trivially_copyable(DerivesHasCopyAssign))]; } { int arr[F(__is_trivially_copyable(DerivesHasMoveAssign))]; } { int arr[F(__is_trivially_copyable(DerivesHasDest))]; } { int arr[F(__is_trivially_copyable(DerivesHasVirt))]; } { int arr[F(__is_trivially_copyable(void))]; } { int arr[F(__is_trivially_copyable(cvoid))]; } { int arr[T((__is_trivially_constructible(int)))]; } { int arr[T((__is_trivially_constructible(int, int)))]; } { int arr[T((__is_trivially_constructible(int, float)))]; } { int arr[T((__is_trivially_constructible(int, int&)))]; } { int arr[T((__is_trivially_constructible(int, const int&)))]; } { int arr[T((__is_trivially_constructible(int, int)))]; } { int arr[T((__is_trivially_constructible(HasCopyAssign, HasCopyAssign)))]; } { int arr[T((__is_trivially_constructible(HasCopyAssign, const HasCopyAssign&)))]; } { int arr[T((__is_trivially_constructible(HasCopyAssign, HasCopyAssign&&)))]; } { int arr[T((__is_trivially_constructible(HasCopyAssign)))]; } { int arr[T((__is_trivially_constructible(NonTrivialDefault, const NonTrivialDefault&)))]; } { int arr[T((__is_trivially_constructible(NonTrivialDefault, NonTrivialDefault&&)))]; } { int arr[T((__is_trivially_constructible(AllDefaulted)))]; } { int arr[T((__is_trivially_constructible(AllDefaulted, const AllDefaulted &)))]; } { int arr[T((__is_trivially_constructible(AllDefaulted, AllDefaulted &&)))]; } { int arr[F((__is_trivially_constructible(int, int*)))]; } { int arr[F((__is_trivially_constructible(NonTrivialDefault)))]; } { int arr[F((__is_trivially_constructible(ThreeArgCtor, int*, char*, int&)))]; } { int arr[F((__is_trivially_constructible(AllDeleted)))]; } { int arr[F((__is_trivially_constructible(AllDeleted, const AllDeleted &)))]; } { int arr[F((__is_trivially_constructible(AllDeleted, AllDeleted &&)))]; } { int arr[F((__is_trivially_constructible(ExtDefaulted)))]; } { int arr[F((__is_trivially_constructible(ExtDefaulted, const ExtDefaulted &)))]; } { int arr[F((__is_trivially_constructible(ExtDefaulted, ExtDefaulted &&)))]; } { int arr[T((__is_trivially_assignable(int&, int)))]; } { int arr[T((__is_trivially_assignable(int&, int&)))]; } { int arr[T((__is_trivially_assignable(int&, int&&)))]; } { int arr[T((__is_trivially_assignable(int&, const int&)))]; } { int arr[T((__is_trivially_assignable(POD&, POD)))]; } { int arr[T((__is_trivially_assignable(POD&, POD&)))]; } { int arr[T((__is_trivially_assignable(POD&, POD&&)))]; } { int arr[T((__is_trivially_assignable(POD&, const POD&)))]; } { int arr[T((__is_trivially_assignable(int*&, int*)))]; } { int arr[T((__is_trivially_assignable(AllDefaulted, const AllDefaulted &)))]; } { int arr[T((__is_trivially_assignable(AllDefaulted, AllDefaulted &&)))]; } { int arr[F((__is_trivially_assignable(int*&, float*)))]; } { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign)))]; } { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign&)))]; } { int arr[F((__is_trivially_assignable(HasCopyAssign&, const HasCopyAssign&)))]; } { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign&&)))]; } { int arr[F((__is_trivially_assignable(TrivialMoveButNotCopy&, TrivialMoveButNotCopy&)))]; } { int arr[F((__is_trivially_assignable(TrivialMoveButNotCopy&, const TrivialMoveButNotCopy&)))]; } { int arr[F((__is_trivially_assignable(AllDeleted, const AllDeleted &)))]; } { int arr[F((__is_trivially_assignable(AllDeleted, AllDeleted &&)))]; } { int arr[F((__is_trivially_assignable(ExtDefaulted, const ExtDefaulted &)))]; } { int arr[F((__is_trivially_assignable(ExtDefaulted, ExtDefaulted &&)))]; } { int arr[T((__is_trivially_assignable(HasDefaultTrivialCopyAssign&, HasDefaultTrivialCopyAssign&)))]; } { int arr[T((__is_trivially_assignable(HasDefaultTrivialCopyAssign&, const HasDefaultTrivialCopyAssign&)))]; } { int arr[T((__is_trivially_assignable(TrivialMoveButNotCopy&, TrivialMoveButNotCopy)))]; } { int arr[T((__is_trivially_assignable(TrivialMoveButNotCopy&, TrivialMoveButNotCopy&&)))]; } } // Instantiation of __is_trivially_constructible template<typename T, typename ...Args> struct is_trivially_constructible { static const bool value = __is_trivially_constructible(T, Args...); }; void is_trivially_constructible_test() { { int arr[T((is_trivially_constructible<int>::value))]; } { int arr[T((is_trivially_constructible<int, int>::value))]; } { int arr[T((is_trivially_constructible<int, float>::value))]; } { int arr[T((is_trivially_constructible<int, int&>::value))]; } { int arr[T((is_trivially_constructible<int, const int&>::value))]; } { int arr[T((is_trivially_constructible<int, int>::value))]; } { int arr[T((is_trivially_constructible<HasCopyAssign, HasCopyAssign>::value))]; } { int arr[T((is_trivially_constructible<HasCopyAssign, const HasCopyAssign&>::value))]; } { int arr[T((is_trivially_constructible<HasCopyAssign, HasCopyAssign&&>::value))]; } { int arr[T((is_trivially_constructible<HasCopyAssign>::value))]; } { int arr[T((is_trivially_constructible<NonTrivialDefault, const NonTrivialDefault&>::value))]; } { int arr[T((is_trivially_constructible<NonTrivialDefault, NonTrivialDefault&&>::value))]; } { int arr[F((is_trivially_constructible<int, int*>::value))]; } { int arr[F((is_trivially_constructible<NonTrivialDefault>::value))]; } { int arr[F((is_trivially_constructible<ThreeArgCtor, int*, char*, int&>::value))]; } } void array_rank() { int t01[T(__array_rank(IntAr) == 1)]; int t02[T(__array_rank(ConstIntArAr) == 2)]; } void array_extent() { int t01[T(__array_extent(IntAr, 0) == 10)]; int t02[T(__array_extent(ConstIntArAr, 0) == 4)]; int t03[T(__array_extent(ConstIntArAr, 1) == 10)]; }
{'content_hash': '310e6a6c85e910692e03f167be3ac95a', 'timestamp': '', 'source': 'github', 'line_count': 1925, 'max_line_length': 145, 'avg_line_length': 37.17818181818182, 'alnum_prop': 0.6406773977196513, 'repo_name': 'indashnet/InDashNet.Open.UN2000', 'id': 'aa18ff4e67afb278c181777b559b5073901861d4', 'size': '71709', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'android/external/clang/test/SemaCXX/type-traits.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
package org.apache.hc.core5.http.io.entity; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.util.Args; /** * A streamed, non-repeatable entity that obtains its content from an {@link InputStream}. * * @since 4.0 */ public class InputStreamEntity extends AbstractHttpEntity { private final InputStream content; private final long length; public InputStreamEntity( final InputStream inStream, final long length, final ContentType contentType, final String contentEncoding) { super(contentType, contentEncoding); this.content = Args.notNull(inStream, "Source input stream"); this.length = length; } public InputStreamEntity(final InputStream inStream, final long length, final ContentType contentType) { this(inStream, length, contentType, null); } public InputStreamEntity(final InputStream inStream, final ContentType contentType) { this(inStream, -1, contentType, null); } @Override public final boolean isRepeatable() { return false; } /** * @return the content length or {@code -1} if unknown */ @Override public final long getContentLength() { return this.length; } @Override public final InputStream getContent() throws IOException { return this.content; } /** * Writes bytes from the {@code InputStream} this entity was constructed * with to an {@code OutputStream}. The content length * determines how many bytes are written. If the length is unknown ({@code -1}), the * stream will be completely consumed (to the end of the stream). * */ @Override public final void writeTo(final OutputStream outStream) throws IOException { Args.notNull(outStream, "Output stream"); try (final InputStream inStream = this.content) { final byte[] buffer = new byte[OUTPUT_BUFFER_SIZE]; int readLen; if (this.length < 0) { // consume until EOF while ((readLen = inStream.read(buffer)) != -1) { outStream.write(buffer, 0, readLen); } } else { // consume no more than length long remaining = this.length; while (remaining > 0) { readLen = inStream.read(buffer, 0, (int) Math.min(OUTPUT_BUFFER_SIZE, remaining)); if (readLen == -1) { break; } outStream.write(buffer, 0, readLen); remaining -= readLen; } } } } @Override public final boolean isStreaming() { return true; } @Override public final void close() throws IOException { content.close(); } }
{'content_hash': '688112cfd060b37d71addbf6906507b0', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 121, 'avg_line_length': 30.112244897959183, 'alnum_prop': 0.6018298881735005, 'repo_name': 'apache/httpcomponents-core', 'id': '596632e70e10f40d1c96b99522360424afcedfdf', 'size': '4134', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/InputStreamEntity.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '844'}, {'name': 'Dockerfile', 'bytes': '3530'}, {'name': 'Java', 'bytes': '5276772'}]}
/* ONLY USED FOR ODBC Version 2 -DODBCV2 * * Re-define everything to work (more-or-less) in an ODBC V2 environment * Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot * have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row) * */ #define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */ #define SQL_NULL_HANDLE 0 #define SQL_HANDLE_STMT 1 #define SQL_HANDLE_DBC 2 #define SQL_HANDLE_ENV 3 #define SQL_NO_DATA SQL_NO_DATA_FOUND #ifndef SQL_SUCCEEDED #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) #endif #undef SQLSetEnvAttr #define SQLSetEnvAttr(henv, Attribute, Value, StringLength) (0) #undef SQLAllocHandle #define SQLAllocHandle(type, parent, hndl) \ ( (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \ : (type == SQL_HANDLE_ENV) ? SQLAllocEnv(hndl) \ : SQLAllocConnect(parent, hndl) \ ) #undef SQLFreeHandle #define SQLFreeHandle(type, hndl) \ ( (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \ : (type == SQL_HANDLE_ENV) ? SQLFreeEnv(hndl) \ : SQLFreeConnect(hndl) \ ) #undef SQLGetDiagRec #define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \ SQLError( (type == SQL_HANDLE_ENV) ? h : NULL, \ (type == SQL_HANDLE_DBC) ? h : NULL, \ (type == SQL_HANDLE_STMT) ? h : NULL, \ state, native, buffer, bufsize, reslen) #undef SQLCloseCursor #define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE) #undef SQLGetConnectAttr #define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \ SQLGetConnectOption(hdbc, fOption, ValuePtr) #undef SQLSetConnectAttr #define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \ SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr) #undef SQLSetStmtAttr #define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL; #undef SQLEndTran #define SQLEndTran(hType, hdbc,type) SQLTransact(henv, hdbc, type) #undef SQLFetchScroll #define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL; #define SQL_DESC_TYPE SQL_COLUMN_TYPE #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE #define SQL_DESC_OCTET_LENGTH SQL_COLUMN_LENGTH #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED #undef SQLColAttribute #define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n) #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT #define SQL_ATTR_CONNECTION_TIMEOUT 113 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER #define SQL_ATTR_DISCONNECT_BEHAVIOR 114 #define SQL_ATTR_ENLIST_IN_DTC 1207 #define SQL_ATTR_ENLIST_IN_XA 1208 #define SQL_ATTR_CONNECTION_DEAD 1209 #define SQL_CD_TRUE 1L /* Connection is closed/dead */ #define SQL_CD_FALSE 0L /* Connection is open/available */ #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE #define SQL_ATTR_TRACE SQL_OPT_TRACE #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION #define SQL_ATTR_CURSOR_SCROLLABLE -1 #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ #define SQL_FALSE 0 #define SQL_TRUE 1
{'content_hash': 'dff73df701b69956472c329594571b63', 'timestamp': '', 'source': 'github', 'line_count': 105, 'max_line_length': 101, 'avg_line_length': 38.36190476190476, 'alnum_prop': 0.6531777557100298, 'repo_name': 'erwinwolff/log4cxx-win32', 'id': '5c77f1b454b57837996ed9593385aac6e742d61d', 'size': '4840', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'apr-util/include/private/apr_dbd_odbc_v2.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Awk', 'bytes': '18639'}, {'name': 'C', 'bytes': '12797267'}, {'name': 'C++', 'bytes': '2885268'}, {'name': 'CSS', 'bytes': '13982'}, {'name': 'Java', 'bytes': '2899'}, {'name': 'Perl', 'bytes': '37887'}, {'name': 'Python', 'bytes': '7014'}, {'name': 'Shell', 'bytes': '221558'}, {'name': 'XSLT', 'bytes': '9232'}]}
package operations; import nes.CPU; class NoOperationImplicit extends Operation { NoOperationImplicit(AddressingMode addressingMode, byte opcode, int numBytes, int cycles) { super(addressingMode, opcode, numBytes, cycles); } /** * Do nothing other than incrementing the PC and cycleCount. */ @Override public void execute(CPU cpu) { cpu.PC.incrementBy(numBytes); cpu.cycleCount += cycles; } } public class NoOperation extends Instruction { public NoOperation() { this.assemblyInstructionName = "NOP"; this.addOperation(new NoOperationImplicit(AddressingMode.Implicit, (byte) 0xEA, 1, 2)); } }
{'content_hash': '09c269ed04fab46c6e6c921b8afdace6', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 95, 'avg_line_length': 25.22222222222222, 'alnum_prop': 0.6813509544787077, 'repo_name': 'rap2363/WhiteRaven', 'id': 'e3c1237ef7df69b8b3bc1a35785a5f1d4cfa6365', 'size': '681', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/operations/NoOperation.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '232464'}]}
local Editor = {} -- ---------------------------------------------------------------------- -- Fonts -- ---------------------------------------------------------------------- local defaultFont if system.IsWindows() then defaultFont = "Courier New" elseif system.IsOSX() then defaultFont = "Monaco" else defaultFont = "DejaVu Sans Mono" end Editor.FontConVar = CreateClientConVar("wire_expression2_editor_font", defaultFont, true, false) Editor.FontSizeConVar = CreateClientConVar("wire_expression2_editor_font_size", 16, true, false) Editor.FontAntialiasingConvar = CreateClientConVar("wire_expression2_editor_font_antialiasing", 0, true, false) Editor.BlockCommentStyleConVar = CreateClientConVar("wire_expression2_editor_block_comment_style", 1, true, false) Editor.NewTabOnOpen = CreateClientConVar("wire_expression2_new_tab_on_open", "1", true, false) Editor.ops_sync_subscribe = CreateClientConVar("wire_expression_ops_sync_subscribe",0,true,false) Editor.Fonts = {} -- Font Description -- Windows Editor.Fonts["Courier New"] = "Windows standard font" Editor.Fonts["DejaVu Sans Mono"] = "" Editor.Fonts["Consolas"] = "" Editor.Fonts["Fixedsys"] = "" Editor.Fonts["Lucida Console"] = "" -- Mac Editor.Fonts["Monaco"] = "Mac standard font" surface.CreateFont("DefaultBold", { font = "Tahoma", size = 12, weight = 700, antialias = true, additive = false, }) Editor.CreatedFonts = {} function Editor:SetEditorFont(editor) if not self.CurrentFont then self:ChangeFont(self.FontConVar:GetString(), self.FontSizeConVar:GetInt()) return end editor.CurrentFont = self.CurrentFont editor.FontWidth = self.FontWidth editor.FontHeight = self.FontHeight end function Editor:ChangeFont(FontName, Size) if not FontName or FontName == "" or not Size then return end local antialias = self.FontAntialiasingConvar:GetBool() local antialias_suffix = antialias and "_AA" or "" -- If font is not already created, create it. if not self.CreatedFonts[FontName .. "_" .. Size .. antialias_suffix] then local fontTable = { font = FontName, size = Size, weight = 400, antialias = antialias, additive = false, } surface.CreateFont("Expression2_" .. FontName .. "_" .. Size .. antialias_suffix, fontTable) fontTable.weight = 700 surface.CreateFont("Expression2_" .. FontName .. "_" .. Size .. "_Bold" .. antialias_suffix, fontTable) self.CreatedFonts[FontName .. "_" .. Size .. antialias_suffix] = true end self.CurrentFont = "Expression2_" .. FontName .. "_" .. Size .. antialias_suffix surface.SetFont(self.CurrentFont) self.FontWidth, self.FontHeight = surface.GetTextSize(" ") for i = 1, self:GetNumTabs() do self:SetEditorFont(self:GetEditor(i)) end end ------------------------------------------------------------------------ -- Colors ------------------------------------------------------------------------ local colors = { -- Table copied from TextEditor, used for saving colors to convars. ["directive"] = Color(240, 240, 160), -- yellow ["number"] = Color(240, 160, 160), -- light red ["function"] = Color(160, 160, 240), -- blue ["notfound"] = Color(240, 96, 96), -- dark red ["variable"] = Color(160, 240, 160), -- light green ["string"] = Color(128, 128, 128), -- grey ["keyword"] = Color(160, 240, 240), -- turquoise ["operator"] = Color(224, 224, 224), -- white ["comment"] = Color(128, 128, 128), -- grey ["ppcommand"] = Color(240, 96, 240), -- purple ["ppcommandargs"] = Color(128, 128, 128), -- same as comment ["typename"] = Color(240, 160, 96), -- orange ["constant"] = Color(240, 160, 240), -- pink ["userfunction"] = Color(102, 122, 102), -- dark grayish-green ["dblclickhighlight"] = Color(0, 100, 0) -- dark green } local colors_defaults = {} local colors_convars = {} for k, v in pairs(colors) do colors_defaults[k] = Color(v.r, v.g, v.b) -- Copy to save defaults colors_convars[k] = CreateClientConVar("wire_expression2_editor_color_" .. k, v.r .. "_" .. v.g .. "_" .. v.b, true, false) end function Editor:LoadSyntaxColors() for k, v in pairs(colors_convars) do local r, g, b = v:GetString():match("(%d+)_(%d+)_(%d+)") local def = colors_defaults[k] colors[k] = Color(tonumber(r) or def.r, tonumber(g) or def.g, tonumber(b) or def.b) end for i = 1, self:GetNumTabs() do self:GetEditor(i):SetSyntaxColors(colors) end end function Editor:SetSyntaxColor(colorname, colr) if not colors[colorname] then return end colors[colorname] = colr RunConsoleCommand("wire_expression2_editor_color_" .. colorname, colr.r .. "_" .. colr.g .. "_" .. colr.b) for i = 1, self:GetNumTabs() do self:GetEditor(i):SetSyntaxColor(colorname, colr) end end ------------------------------------------------------------------------ local invalid_filename_chars = { ["*"] = "", ["?"] = "", [">"] = "", ["<"] = "", ["|"] = "", ["\\"] = "", ['"'] = "", [" "] = "_", } -- overwritten commands function Editor:Init() -- don't use any of the default DFrame UI components for _, v in pairs(self:GetChildren()) do v:Remove() end self.Title = "" self.subTitle = "" self.LastClick = 0 self.GuiClick = 0 self.SimpleGUI = false self.Location = "" self.C = {} self.Components = {} -- Load border colors, position, & size self:LoadEditorSettings() local fontTable = { font = "default", size = 11, weight = 300, antialias = false, additive = false, } surface.CreateFont("E2SmallFont", fontTable) self.logo = surface.GetTextureID("vgui/e2logo") self:InitComponents() -- This turns off the engine drawing self:SetPaintBackgroundEnabled(false) self:SetPaintBorderEnabled(false) self:SetV(false) self:InitShutdownHook() end local size = CreateClientConVar("wire_expression2_editor_size", "800_600", true, false) local pos = CreateClientConVar("wire_expression2_editor_pos", "-1_-1", true, false) function Editor:LoadEditorSettings() -- Position & Size local w, h = size:GetString():match("(%d+)_(%d+)") w = tonumber(w) h = tonumber(h) self:SetSize(w, h) local x, y = pos:GetString():match("(%-?%d+)_(%-?%d+)") x = tonumber(x) y = tonumber(y) if x == -1 and y == -1 then self:Center() else self:SetPos(x, y) end if x < 0 or y < 0 or x + w > ScrW() or y + h > ScrH() then -- If the editor is outside the screen, reset it local width, height = math.min(surface.ScreenWidth() - 200, 800), math.min(surface.ScreenHeight() - 200, 620) self:SetPos((surface.ScreenWidth() - width) / 2, (surface.ScreenHeight() - height) / 2) self:SetSize(width, height) self:SaveEditorSettings() end end function Editor:SaveEditorSettings() -- Position & Size local w, h = self:GetSize() RunConsoleCommand("wire_expression2_editor_size", w .. "_" .. h) local x, y = self:GetPos() RunConsoleCommand("wire_expression2_editor_pos", x .. "_" .. y) end function Editor:PaintOver() surface.SetFont("DefaultBold") surface.SetTextColor(255, 255, 255, 255) surface.SetTextPos(10, 6) surface.DrawText(self.Title .. self.subTitle) --[[ if(self.E2) then surface.SetTexture(self.logo) surface.SetDrawColor( 255, 255, 255, 128 ) surface.DrawTexturedRect( w-148, h-158, 128, 128) end ]] -- surface.SetDrawColor(255, 255, 255, 255) surface.SetTextPos(0, 0) surface.SetFont("Default") return true end function Editor:PerformLayout() local w, h = self:GetSize() for i = 1, #self.Components do local c = self.Components[i] local c_x, c_y, c_w, c_h = c.Bounds.x, c.Bounds.y, c.Bounds.w, c.Bounds.h if (c_x < 0) then c_x = w + c_x end if (c_y < 0) then c_y = h + c_y end if (c_w < 0) then c_w = w + c_w - c_x end if (c_h < 0) then c_h = h + c_h - c_y end c:SetPos(c_x, c_y) c:SetSize(c_w, c_h) end end function Editor:OnMousePressed(mousecode) if mousecode ~= 107 then return end -- do nothing if mouseclick is other than left-click if not self.pressed then self.pressed = true self.p_x, self.p_y = self:GetPos() self.p_w, self.p_h = self:GetSize() self.p_mx = gui.MouseX() self.p_my = gui.MouseY() self.p_mode = self:getMode() if self.p_mode == "drag" then if self.GuiClick > CurTime() - 0.2 then self:fullscreen() self.pressed = false self.GuiClick = 0 else self.GuiClick = CurTime() end end end end function Editor:OnMouseReleased(mousecode) if mousecode ~= 107 then return end -- do nothing if mouseclick is other than left-click self.pressed = false end function Editor:Think() if self.fs then return end if self.pressed then if not input.IsMouseDown(MOUSE_LEFT) then -- needs this if you let go of the mouse outside the panel self.pressed = false end local movedX = gui.MouseX() - self.p_mx local movedY = gui.MouseY() - self.p_my if self.p_mode == "drag" then local x = self.p_x + movedX local y = self.p_y + movedY if (x < 10 and x > -10) then x = 0 end if (y < 10 and y > -10) then y = 0 end if (x + self.p_w < surface.ScreenWidth() + 10 and x + self.p_w > surface.ScreenWidth() - 10) then x = surface.ScreenWidth() - self.p_w end if (y + self.p_h < surface.ScreenHeight() + 10 and y + self.p_h > surface.ScreenHeight() - 10) then y = surface.ScreenHeight() - self.p_h end self:SetPos(x, y) end if self.p_mode == "sizeBR" then local w = self.p_w + movedX local h = self.p_h + movedY if (self.p_x + w < surface.ScreenWidth() + 10 and self.p_x + w > surface.ScreenWidth() - 10) then w = surface.ScreenWidth() - self.p_x end if (self.p_y + h < surface.ScreenHeight() + 10 and self.p_y + h > surface.ScreenHeight() - 10) then h = surface.ScreenHeight() - self.p_y end if (w < 300) then w = 300 end if (h < 200) then h = 200 end self:SetSize(w, h) end if self.p_mode == "sizeR" then local w = self.p_w + movedX if (w < 300) then w = 300 end self:SetWide(w) end if self.p_mode == "sizeB" then local h = self.p_h + movedY if (h < 200) then h = 200 end self:SetTall(h) end end if not self.pressed then local cursor = "arrow" local mode = self:getMode() if (mode == "sizeBR") then cursor = "sizenwse" elseif (mode == "sizeR") then cursor = "sizewe" elseif (mode == "sizeB") then cursor = "sizens" end if cursor ~= self.cursor then self.cursor = cursor self:SetCursor(self.cursor) end end local x, y = self:GetPos() local w, h = self:GetSize() if w < 518 then w = 518 end if h < 200 then h = 200 end if x < 0 then x = 0 end if y < 0 then y = 0 end if x + w > surface.ScreenWidth() then x = surface.ScreenWidth() - w end if y + h > surface.ScreenHeight() then y = surface.ScreenHeight() - h end if y < 0 then y = 0 end if x < 0 then x = 0 end if w > surface.ScreenWidth() then w = surface.ScreenWidth() end if h > surface.ScreenHeight() then h = surface.ScreenHeight() end self:SetPos(x, y) self:SetSize(w, h) end -- special functions function Editor:fullscreen() if self.fs then self:SetPos(self.preX, self.preY) self:SetSize(self.preW, self.preH) self.fs = false else self.preX, self.preY = self:GetPos() self.preW, self.preH = self:GetSize() self:SetPos(0, 0) self:SetSize(surface.ScreenWidth(), surface.ScreenHeight()) self.fs = true end end function Editor:getMode() local x, y = self:GetPos() local w, h = self:GetSize() local ix = gui.MouseX() - x local iy = gui.MouseY() - y if (ix < 0 or ix > w or iy < 0 or iy > h) then return end -- if the mouse is outside the box if (iy < 22) then return "drag" end if (iy > h - 10) then if (ix > w - 20) then return "sizeBR" end return "sizeB" end if (ix > w - 10) then if (iy > h - 20) then return "sizeBR" end return "sizeR" end end function Editor:addComponent(panel, x, y, w, h) assert(not panel.Bounds) panel.Bounds = { x = x, y = y, w = w, h = h } self.Components[#self.Components + 1] = panel return panel end -- TODO: Fix this function local function extractNameFromCode(str) return str:match("@name ([^\r\n]+)") end local function getPreferredTitles(Line, code) local title local tabtext local str = Line if str and str ~= "" then title = str tabtext = str end str = extractNameFromCode(code) if str and str ~= "" then if not title then title = str end tabtext = str end return title, tabtext end function Editor:GetLastTab() return self.LastTab end function Editor:SetLastTab(Tab) self.LastTab = Tab end function Editor:GetActiveTab() return self.C.TabHolder:GetActiveTab() end function Editor:GetNumTabs() return #self.C.TabHolder.Items end function Editor:SetActiveTab(val) if self:GetActiveTab() == val then val:GetPanel():RequestFocus() return end self:SetLastTab(self:GetActiveTab()) if isnumber(val) then self.C.TabHolder:SetActiveTab(self.C.TabHolder.Items[val].Tab) self:GetCurrentEditor():RequestFocus() elseif val and val:IsValid() then self.C.TabHolder:SetActiveTab(val) val:GetPanel():RequestFocus() end if self.E2 then self:Validate() end self:UpdateActiveTabTitle() end function Editor:UpdateActiveTabTitle() local title, tabtext = getPreferredTitles(self:GetChosenFile(), self:GetCode()) if title then self:SubTitle("Editing: " .. title) else self:SubTitle() end if tabtext then if self:GetActiveTab():GetText() ~= tabtext then self:GetActiveTab():SetText(tabtext) self.C.TabHolder.tabScroller:InvalidateLayout() end end end function Editor:GetActiveTabIndex() local tab = self:GetActiveTab() for k, v in pairs(self.C.TabHolder.Items) do if tab == v.Tab then return k end end return -1 end function Editor:SetActiveTabIndex(index) local tab = self.C.TabHolder.Items[index].Tab if not tab then return end self:SetActiveTab(tab) end local function extractNameFromFilePath(str) local found = str:reverse():find("/", 1, true) if found then return str:Right(found - 1) else return str end end function Editor:SetEditorMode(mode_name) self.EditorMode = mode_name for i = 1, self:GetNumTabs() do self:GetEditor(i):SetMode(mode_name) end end function Editor:GetEditorMode() return self.EditorMode end local old function Editor:FixTabFadeTime() if old ~= nil then return end -- It's already being fixed old = self.C.TabHolder:GetFadeTime() self.C.TabHolder:SetFadeTime(0) timer.Simple(old, function() self.C.TabHolder:SetFadeTime(old) old = nil end) end function Editor:CreateTab(chosenfile) local editor = vgui.Create("Expression2Editor") editor.parentpanel = self local sheet = self.C.TabHolder:AddSheet(extractNameFromFilePath(chosenfile), editor) self:SetEditorFont(editor) editor.chosenfile = chosenfile sheet.Tab.OnMousePressed = function(pnl, keycode, ...) if keycode == MOUSE_MIDDLE then --self:FixTabFadeTime() self:CloseTab(pnl) return elseif keycode == MOUSE_RIGHT then local menu = DermaMenu() menu:AddOption("Close", function() --self:FixTabFadeTime() self:CloseTab(pnl) end) menu:AddOption("Close all others", function() self:FixTabFadeTime() self:SetActiveTab(pnl) for i = self:GetNumTabs(), 1, -1 do if self.C.TabHolder.Items[i] ~= sheet then self:CloseTab(i) end end end) menu:AddSpacer() menu:AddOption("Save", function() self:FixTabFadeTime() local old = self:GetLastTab() local currentTab = self:GetActiveTab() self:SetActiveTab(pnl) self:SaveFile(self:GetChosenFile(), false) self:SetActiveTab(currentTab) self:SetLastTab(old) end) menu:AddOption("Save As", function() self:FixTabFadeTime() self:SetActiveTab(pnl) self:SaveFile(self:GetChosenFile(), false, true) end) menu:AddOption("Reload", function() self:FixTabFadeTime() local old = self:GetLastTab() self:SetActiveTab(pnl) self:LoadFile(editor.chosenfile, false) self:SetActiveTab(self:GetLastTab()) self:SetLastTab(old) end) menu:AddSpacer() menu:AddOption("Copy file path to clipboard", function() if editor.chosenfile and editor.chosenfile ~= "" then SetClipboardText(editor.chosenfile) end end) menu:AddOption("Copy all file paths to clipboard", function() local str = "" for i = 1, self:GetNumTabs() do local chosenfile = self:GetEditor(i).chosenfile if chosenfile and chosenfile ~= "" then str = str .. chosenfile .. ";" end end str = str:sub(1, -2) SetClipboardText(str) end) menu:Open() return end self:SetActiveTab(pnl) end editor.OnTextChanged = function(panel) timer.Create("e2autosave", 5, 1, function() self:AutoSave() end) hook.Run("WireEditorText", self, editor) end editor.OnShortcut = function(_, code) if code == KEY_S then self:SaveFile(self:GetChosenFile()) if self.E2 then self:Validate() end else local mode = GetConVar("wire_expression2_autocomplete_controlstyle"):GetInt() local enabled = GetConVar("wire_expression2_autocomplete"):GetBool() if mode == 1 and enabled then if code == KEY_B then self:Validate(true) elseif code == KEY_SPACE then local ed = self:GetCurrentEditor() if (ed.AC_Panel and ed.AC_Panel:IsVisible()) then ed:AC_Use(ed.AC_Suggestions[1]) end end elseif code == KEY_SPACE then self:Validate(true) end end end editor:RequestFocus() editor:SetMode(self:GetEditorMode()) self:OnTabCreated(sheet) -- Call a function that you can override to do custom stuff to each tab. return sheet end function Editor:OnTabCreated(sheet) end -- This function is made to be overwritten function Editor:GetNextAvailableTab() local activetab = self:GetActiveTab() for _, v in pairs(self.C.TabHolder.Items) do if v.Tab and v.Tab:IsValid() and v.Tab ~= activetab then return v.Tab end end end function Editor:NewTab() local sheet = self:CreateTab("generic") self:SetActiveTab(sheet.Tab) if self.E2 then self:NewScript(true) end end function Editor:CloseTab(_tab) local activetab, sheetindex if _tab then if isnumber(_tab) then local temp = self.C.TabHolder.Items[_tab] if temp then activetab = temp.Tab sheetindex = _tab else return end else activetab = _tab -- Find the sheet index for k, v in pairs(self.C.TabHolder.Items) do if activetab == v.Tab then sheetindex = k break end end end else activetab = self:GetActiveTab() -- Find the sheet index for k, v in pairs(self.C.TabHolder.Items) do if activetab == v.Tab then sheetindex = k break end end end self:AutoSave() -- There's only one tab open, no need to actually close any tabs if self:GetNumTabs() == 1 then activetab:SetText("generic") self.C.TabHolder:InvalidateLayout() self:NewScript(true) return end -- Find the panel (for the scroller) local tabscroller_sheetindex for k, v in pairs(self.C.TabHolder.tabScroller.Panels) do if v == activetab then tabscroller_sheetindex = k break end end self:FixTabFadeTime() if activetab == self:GetActiveTab() then -- We're about to close the current tab if self:GetLastTab() and self:GetLastTab():IsValid() then -- If the previous tab was saved if activetab == self:GetLastTab() then -- If the previous tab is equal to the current tab local othertab = self:GetNextAvailableTab() -- Find another tab if othertab and othertab:IsValid() then -- If that other tab is valid, use it self:SetActiveTab(othertab) self:SetLastTab() else -- Reset the current tab (backup) self:GetActiveTab():SetText("generic") self.C.TabHolder:InvalidateLayout() self:NewScript(true) return end else -- Change to the previous tab self:SetActiveTab(self:GetLastTab()) self:SetLastTab() end else -- If the previous tab wasn't saved local othertab = self:GetNextAvailableTab() -- Find another tab if othertab and othertab:IsValid() then -- If that other tab is valid, use it self:SetActiveTab(othertab) else -- Reset the current tab (backup) self:GetActiveTab():SetText("generic") self.C.TabHolder:InvalidateLayout() self:NewScript(true) return end end end self:OnTabClosed(activetab) -- Call a function that you can override to do custom stuff to each tab. activetab:GetPanel():Remove() activetab:Remove() table.remove(self.C.TabHolder.Items, sheetindex) table.remove(self.C.TabHolder.tabScroller.Panels, tabscroller_sheetindex) self.C.TabHolder.tabScroller:InvalidateLayout() local w, h = self.C.TabHolder:GetSize() self.C.TabHolder:SetSize(w + 1, h) -- +1 so it updates end function Editor:OnTabClosed(sheet) end -- This function is made to be overwritten -- initialization commands function Editor:InitComponents() self.Components = {} self.C = {} local function PaintFlatButton(panel, w, h) if not (panel:IsHovered() or panel:IsDown()) then return end derma.SkinHook("Paint", "Button", panel, w, h) end local DMenuButton = vgui.RegisterTable({ Init = function(panel) panel:SetText("") panel:SetSize(24, 20) panel:Dock(LEFT) end, Paint = PaintFlatButton, DoClick = function(panel) local name = panel:GetName() local f = name and name ~= "" and self[name] or nil if f then f(self) end end }, "DButton") -- addComponent( panel, x, y, w, h ) -- if x, y, w, h is minus, it will stay relative to right or buttom border self.C.Close = self:addComponent(vgui.Create("DButton", self), -45-4, 0, 45, 22) -- Close button self.C.Inf = self:addComponent(vgui.CreateFromTable(DMenuButton, self), -45-4-26, 0, 24, 22) -- Info button self.C.ConBut = self:addComponent(vgui.CreateFromTable(DMenuButton, self), -45-4-24-26, 0, 24, 22) -- Control panel open/close self.C.Divider = vgui.Create("DHorizontalDivider", self) self.C.Browser = vgui.Create("wire_expression2_browser", self.C.Divider) -- Expression browser self.C.MainPane = vgui.Create("DPanel", self.C.Divider) self.C.Menu = vgui.Create("DPanel", self.C.MainPane) self.C.Val = vgui.Create("Wire.IssueViewer", self.C.MainPane) -- Validation line self.C.TabHolder = vgui.Create("DPropertySheet", self.C.MainPane) self.C.TabHolder:SetPadding(1) self.C.Btoggle = vgui.CreateFromTable(DMenuButton, self.C.Menu) -- Toggle Browser being shown self.C.Sav = vgui.CreateFromTable(DMenuButton, self.C.Menu) -- Save button self.C.NewTab = vgui.CreateFromTable(DMenuButton, self.C.Menu, "NewTab") -- New tab button self.C.CloseTab = vgui.CreateFromTable(DMenuButton, self.C.Menu, "CloseTab") -- Close tab button self.C.Reload = vgui.CreateFromTable(DMenuButton, self.C.Menu) -- Reload tab button self.C.SaE = vgui.Create("DButton", self.C.Menu) -- Save & Exit button self.C.SavAs = vgui.Create("DButton", self.C.Menu) -- Save As button self.C.Control = self:addComponent(vgui.Create("Panel", self), -350, 52, 342, -32) -- Control Panel self.C.Credit = self:addComponent(vgui.Create("DTextEntry", self), -160, 52, 150, 150) -- Credit box self.C.Credit:SetEditable(false) self:CreateTab("generic") -- extra component options self.C.Divider:SetLeft(self.C.Browser) self.C.Divider:SetRight(self.C.MainPane) self.C.Divider:Dock(FILL) self.C.Divider:SetDividerWidth(4) self.C.Divider:SetCookieName("wire_expression2_editor_divider") self.C.Divider:SetLeftMin(0) local DoNothing = function() end self.C.MainPane.Paint = DoNothing --self.C.Menu.Paint = DoNothing self.C.Menu:Dock(TOP) self.C.TabHolder:Dock(FILL) self.C.Val:Dock(BOTTOM) self.C.TabHolder:SetPadding(1) self.C.Menu:SetHeight(24) self.C.Menu:DockPadding(2,2,2,2) self.C.Val:SetHeight(self.C.Val.CollapseSize) self.C.SaE:SetSize(80, 20) self.C.SaE:Dock(RIGHT) self.C.SavAs:SetSize(51, 20) self.C.SavAs:Dock(RIGHT) self.C.Inf:Dock(NODOCK) self.C.ConBut:Dock(NODOCK) self.C.Close:SetText("r") self.C.Close:SetFont("Marlett") self.C.Close.DoClick = function(btn) self:Close() end self.C.ConBut:SetImage("icon16/wrench.png") self.C.ConBut:SetText("") self.C.ConBut.Paint = PaintFlatButton self.C.ConBut.DoClick = function() self.C.Control:SetVisible(not self.C.Control:IsVisible()) end self.C.Inf:SetImage("icon16/information.png") self.C.Inf.Paint = PaintFlatButton self.C.Inf.DoClick = function(btn) self.C.Credit:SetVisible(not self.C.Credit:IsVisible()) end self.C.Sav:SetImage("icon16/disk.png") self.C.Sav.DoClick = function(button) self:SaveFile(self:GetChosenFile()) end self.C.Sav:SetToolTip( "Save" ) self.C.NewTab:SetImage("icon16/page_white_add.png") self.C.NewTab.DoClick = function(button) self:NewTab() end self.C.NewTab:SetToolTip( "New tab" ) self.C.CloseTab:SetImage("icon16/page_white_delete.png") self.C.CloseTab.DoClick = function(button) self:CloseTab() end self.C.CloseTab:SetToolTip( "Close tab" ) self.C.Reload:SetImage("icon16/page_refresh.png") self.C.Reload:SetToolTip( "Refresh file" ) self.C.Reload.DoClick = function(button) self:LoadFile(self:GetChosenFile(), false) end self.C.SaE:SetText("Save and Exit") self.C.SaE.DoClick = function(button) self:SaveFile(self:GetChosenFile(), true) end self.C.SavAs:SetText("Save As") self.C.SavAs.DoClick = function(button) self:SaveFile(self:GetChosenFile(), false, true) end self.C.Browser:AddRightClick(self.C.Browser.filemenu, 4, "Save to", function() Derma_Query("Overwrite this file?", "Save To", "Overwrite", function() self:SaveFile(self.C.Browser.File.FileDir) end, "Cancel") end) self.C.Browser.OnFileOpen = function(_, filepath, newtab) self:Open(filepath, nil, newtab) end self.C.Val:SetText(" Click to validate...") self.C.Val.UpdateColours = function(button, skin) return button:SetTextStyleColor(skin.Colours.Button.Down) end self.C.Val.bgcolor = Color(255, 255, 255) self.C.Val.Paint = function(button) local w, h = button:GetSize() draw.RoundedBox(1, 0, 0, w, h, button.bgcolor) if button.Hovered then draw.RoundedBox(0, 1, 1, w - 2, h - 2, Color(0, 0, 0, 128)) end end self.C.Val.OnMousePressed = function(panel, btn) if btn == MOUSE_RIGHT then local menu = DermaMenu() menu:AddOption("Copy to clipboard", function() SetClipboardText(self.C.Val:GetValue()) end) menu:Open() else self:Validate(true) end end self.C.Val.OnIssueClicked = function(panel, issue) if issue.line ~= nil and issue.char ~= nil then self:GetCurrentEditor():SetCaret({issue.line, issue.char}) end end self.C.Btoggle:SetImage("icon16/application_side_contract.png") function self.C.Btoggle.DoClick(button) if button.hide then self.C.Divider:LoadCookies() else self.C.Divider:SetLeftWidth(0) end self.C.Divider:InvalidateLayout() button:InvalidateLayout() end local oldBtoggleLayout = self.C.Btoggle.PerformLayout function self.C.Btoggle.PerformLayout(button) oldBtoggleLayout(button) if self.C.Divider:GetLeftWidth() > 0 then button.hide = false button:SetImage("icon16/application_side_contract.png") else button.hide = true button:SetImage("icon16/application_side_expand.png") end end self.C.Credit:SetTextColor(Color(0, 0, 0, 255)) self.C.Credit:SetText("\t\tCREDITS\n\n\tEditor by: \tSyranide and Shandolum\n\n\tTabs (and more) added by Divran.\n\n\tFixed for GMod13 By Ninja101") -- Sure why not ;) self.C.Credit:SetMultiline(true) self.C.Credit:SetVisible(false) self:InitControlPanel(self.C.Control) -- making it seperate for better overview self.C.Control:SetVisible(false) if self.E2 then self:Validate() end end -- code1 contains the code that is not to be marked local code1 = "@name \n@inputs \n@outputs \n@persist \n@trigger \n@strict\n\n" -- code2 contains the code that is to be marked, so it can simply be overwritten or deleted. local code2 = [[#[ Documentation and examples are available at: https://github.com/wiremod/wire/wiki/Expression-2 ^ Read what @strict and other directives do here ^ Discord is available at https://discord.gg/H8UKY3Y Reddit is available at https://www.reddit.com/r/wiremod Report any bugs you find here https://github.com/wiremod/wire/issues ]#]] local defaultcode = code1 .. code2 .. "\n" function Editor:AutoSave() local buffer = self:GetCode() if self.savebuffer == buffer or buffer == defaultcode or buffer == "" then return end self.savebuffer = buffer file.Write(self.Location .. "/_autosave_.txt", buffer) end function Editor:AddControlPanelTab(label, icon, tooltip) local frame = self.C.Control local panel = vgui.Create("DPanel") local ret = frame.TabHolder:AddSheet(label, panel, icon, false, false, tooltip) local old = ret.Tab.OnMousePressed function ret.Tab.OnMousePressed(...) timer.Simple(0.1,function() frame:ResizeAll() end) -- timers solve everything old(...) end ret.Panel:SetBackgroundColor(Color(96, 96, 96, 255)) return ret end function Editor:InitControlPanel(frame) -- Add a property sheet to hold the tabs local tabholder = vgui.Create("DPropertySheet", frame) tabholder:SetPos(2, 4) frame.TabHolder = tabholder -- They need to be resized one at a time... dirty fix incoming (If you know of a nicer way to do this, don't hesitate to fix it.) local function callNext(t, n) local obj = t[n] local pnl = obj[1] if pnl and pnl:IsValid() then local x, y = obj[2], obj[3] pnl:SetPos(x, y) local w, h = pnl:GetParent():GetSize() local wofs, hofs = w - x * 2, h - y * 2 pnl:SetSize(wofs, hofs) end n = n + 1 if n <= #t then timer.Simple(0, function() callNext(t, n) end) end end function frame:ResizeAll() timer.Simple(0, function() callNext(self.ResizeObjects, 1) end) end -- Resize them at the right times local oldFrameSetSize = frame.SetSize function frame:SetSize(...) self:ResizeAll() oldFrameSetSize(self, ...) end local oldFrameSetVisible = frame.SetVisible function frame:SetVisible(...) self:ResizeAll() oldFrameSetVisible(self, ...) end -- Function to add more objects to resize automatically frame.ResizeObjects = {} function frame:AddResizeObject(...) self.ResizeObjects[#self.ResizeObjects + 1] = { ... } end -- Our first object to auto resize is the tabholder. This sets it to position 2,4 and with a width and height offset of w-4, h-8. frame:AddResizeObject(tabholder, 2, 4) -- ------------------------------------------- EDITOR TAB local sheet = self:AddControlPanelTab("Editor", "icon16/wrench.png", "Options for the editor itself.") -- WINDOW BORDER COLORS local dlist = vgui.Create("DPanelList", sheet.Panel) dlist.Paint = function() end frame:AddResizeObject(dlist, 4, 4) dlist:EnableVerticalScrollbar(true) -- Color Mixer PANEL - Houses label, combobox, mixer, reset button & reset all button. local mixPanel = vgui.Create( "panel" ) mixPanel:SetTall( 240 ) dlist:AddItem( mixPanel ) do -- Label local label = vgui.Create( "DLabel", mixPanel ) label:Dock( TOP ) label:SetText( "Syntax Colors" ) label:SizeToContents() -- Dropdown box of convars to change ( affects editor colors ) local box = vgui.Create( "DComboBox", mixPanel ) box:Dock( TOP ) box:SetValue( "Color feature" ) local active = nil -- Mixer local mixer = vgui.Create( "DColorMixer", mixPanel ) mixer:Dock( FILL ) mixer:SetPalette( true ) mixer:SetAlphaBar( true ) mixer:SetWangs( true ) mixer.ValueChanged = function ( _, clr ) self:SetSyntaxColor( active, clr ) end for k, _ in pairs( colors_convars ) do box:AddChoice( k ) end box.OnSelect = function ( self, index, value, data ) -- DComboBox doesn't have a method for getting active value ( to my knowledge ) -- Therefore, cache it, we're in a local scope so we're fine. active = value mixer:SetColor( colors[ active ] or Color( 255, 255, 255 ) ) end -- Reset ALL button local rAll = vgui.Create( "DButton", mixPanel ) rAll:Dock( BOTTOM ) rAll:SetText( "Reset ALL to Default" ) rAll.DoClick = function () for k, v in pairs( colors_defaults ) do self:SetSyntaxColor( k, v ) end mixer:SetColor( colors_defaults[ active ] ) end -- Reset to default button local reset = vgui.Create( "DButton", mixPanel ) reset:Dock( BOTTOM ) reset:SetText( "Set to Default" ) reset.DoClick = function () self:SetSyntaxColor( active, colors_defaults[ active ] ) mixer:SetColor( colors_defaults[ active ] ) end -- Select a convar to be displayed automatically box:ChooseOptionID( 1 ) end --- - FONTS local FontLabel = vgui.Create("DLabel") dlist:AddItem(FontLabel) FontLabel:SetText("Font: Font Size:") FontLabel:SizeToContents() FontLabel:SetPos(10, 0) local temp = vgui.Create("Panel") temp:SetTall(25) dlist:AddItem(temp) local FontSelect = vgui.Create("DComboBox", temp) -- dlist:AddItem( FontSelect ) FontSelect.OnSelect = function(panel, index, value) if value == "Custom..." then Derma_StringRequestNoBlur("Enter custom font:", "", "", function(value) self:ChangeFont(value, self.FontSizeConVar:GetInt()) RunConsoleCommand("wire_expression2_editor_font", value) end) else value = value:gsub(" %b()", "") -- Remove description self:ChangeFont(value, self.FontSizeConVar:GetInt()) RunConsoleCommand("wire_expression2_editor_font", value) end end for k, v in pairs(self.Fonts) do FontSelect:AddChoice(k .. (v ~= "" and " (" .. v .. ")" or "")) end FontSelect:AddChoice("Custom...") FontSelect:SetSize(240 - 50 - 4, 20) local FontSizeSelect = vgui.Create("DComboBox", temp) FontSizeSelect.OnSelect = function(panel, index, value) value = value:gsub(" %b()", "") self:ChangeFont(self.FontConVar:GetString(), tonumber(value)) RunConsoleCommand("wire_expression2_editor_font_size", value) end for i = 11, 26 do FontSizeSelect:AddChoice(i .. (i == 16 and " (Default)" or "")) end FontSizeSelect:SetPos(FontSelect:GetWide() + 4, 0) FontSizeSelect:SetSize(50, 20) local AntialiasEditor = vgui.Create("DCheckBoxLabel") dlist:AddItem(AntialiasEditor) AntialiasEditor:SetConVar("wire_expression2_editor_font_antialiasing") AntialiasEditor:SetText("Enable antialiasing") AntialiasEditor:SizeToContents() AntialiasEditor:SetTooltip("Enables antialiasing of the editor's text.") AntialiasEditor.OnChange = function(check, val) self:ChangeFont(self.FontConVar:GetString(), self.FontSizeConVar:GetInt()) end local label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Auto completion options") label:SizeToContents() local AutoComplete = vgui.Create("DCheckBoxLabel") dlist:AddItem(AutoComplete) AutoComplete:SetConVar("wire_expression2_autocomplete") AutoComplete:SetText("Auto Completion") AutoComplete:SizeToContents() AutoComplete:SetTooltip("Enable/disable auto completion in the E2 editor.") local AutoCompleteExtra = vgui.Create("DCheckBoxLabel") dlist:AddItem(AutoCompleteExtra) AutoCompleteExtra:SetConVar("wire_expression2_autocomplete_moreinfo") AutoCompleteExtra:SetText("More Info (for AC)") AutoCompleteExtra:SizeToContents() AutoCompleteExtra:SetTooltip("Enable/disable additional information for auto completion.") label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Auto completion control style") label:SizeToContents() local AutoCompleteControlOptions = vgui.Create("DComboBox") dlist:AddItem(AutoCompleteControlOptions) local modes = {} modes["Default"] = { 0, "Current mode:\nTab/CTRL+Tab to choose item;\nEnter/Space to use;\nArrow keys to abort." } modes["Visual C# Style"] = { 1, "Current mode:\nCtrl+Space to use the top match;\nArrow keys to choose item;\nTab/Enter/Space to use;\nCode validation hotkey (ctrl+space) moved to ctrl+b." } modes["Scroller"] = { 2, "Current mode:\nMouse scroller to choose item;\nMiddle mouse to use." } modes["Scroller w/ Enter"] = { 3, "Current mode:\nMouse scroller to choose item;\nEnter to use." } modes["Eclipse Style"] = { 4, "Current mode:\nEnter to use top match;\nTab to enter auto completion menu;\nArrow keys to choose item;\nEnter to use;\nSpace to abort." } modes["Atom/IntelliJ style"] = { 5, "Current mode:\nTab/Enter to use;\nArrow keys to choose." } -- modes["Qt Creator Style"] = { 6, "Current mode:\nCtrl+Space to enter auto completion menu;\nSpace to abort; Enter to use top match." } <-- probably wrong. I'll check about adding Qt style later. for k, _ in pairs(modes) do AutoCompleteControlOptions:AddChoice(k) end modes[0] = modes["Default"][2] modes[1] = modes["Visual C# Style"][2] modes[2] = modes["Scroller"][2] modes[3] = modes["Scroller w/ Enter"][2] modes[4] = modes["Eclipse Style"][2] modes[5] = modes["Atom/IntelliJ style"][2] AutoCompleteControlOptions:SetToolTip(modes[GetConVar("wire_expression2_autocomplete_controlstyle"):GetInt()]) AutoCompleteControlOptions.OnSelect = function(panel, index, value) panel:SetToolTip(modes[value][2]) RunConsoleCommand("wire_expression2_autocomplete_controlstyle", modes[value][1]) end local HighightOnUse = vgui.Create("DCheckBoxLabel") dlist:AddItem(HighightOnUse) HighightOnUse:SetConVar("wire_expression2_autocomplete_highlight_after_use") HighightOnUse:SetText("Highlight word after AC use.") HighightOnUse:SizeToContents() HighightOnUse:SetTooltip("Enable/Disable highlighting of the entire word after using auto completion.\nIn E2, this is only for variables/constants, not functions.") label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Other options") label:SizeToContents() local NewTabOnOpen = vgui.Create("DCheckBoxLabel") dlist:AddItem(NewTabOnOpen) NewTabOnOpen:SetConVar("wire_expression2_new_tab_on_open") NewTabOnOpen:SetText("New tab on open") NewTabOnOpen:SizeToContents() NewTabOnOpen:SetTooltip("Enable/disable loaded files opening in a new tab.\nIf disabled, loaded files will be opened in the current tab.") local SaveTabsOnClose = vgui.Create("DCheckBoxLabel") dlist:AddItem(SaveTabsOnClose) SaveTabsOnClose:SetConVar("wire_expression2_editor_savetabs") SaveTabsOnClose:SetText("Save tabs on close") SaveTabsOnClose:SizeToContents() SaveTabsOnClose:SetTooltip("Save the currently opened tab file paths on shutdown.\nOnly saves tabs whose files are saved.") local OpenOldTabs = vgui.Create("DCheckBoxLabel") dlist:AddItem(OpenOldTabs) OpenOldTabs:SetConVar("wire_expression2_editor_openoldtabs") OpenOldTabs:SetText("Open old tabs on load") OpenOldTabs:SizeToContents() OpenOldTabs:SetTooltip("Open the tabs from the last session on load.\nOnly tabs whose files were saved before disconnecting from the server are stored.") local DisplayCaretPos = vgui.Create("DCheckBoxLabel") dlist:AddItem(DisplayCaretPos) DisplayCaretPos:SetConVar("wire_expression2_editor_display_caret_pos") DisplayCaretPos:SetText("Show Caret Position") DisplayCaretPos:SizeToContents() DisplayCaretPos:SetTooltip("Shows the position of the caret.") local HighlightOnDoubleClick = vgui.Create("DCheckBoxLabel") dlist:AddItem(HighlightOnDoubleClick) HighlightOnDoubleClick:SetConVar("wire_expression2_editor_highlight_on_double_click") HighlightOnDoubleClick:SetText("Highlight copies of selected word") HighlightOnDoubleClick:SizeToContents() HighlightOnDoubleClick:SetTooltip("Find all identical words and highlight them after a double-click.") local WorldClicker = vgui.Create("DCheckBoxLabel") dlist:AddItem(WorldClicker) WorldClicker:SetConVar("wire_expression2_editor_worldclicker") WorldClicker:SetText("Enable Clicking Outside Editor") WorldClicker:SizeToContents() function WorldClicker.OnChange(pnl, bVal) self:GetParent():SetWorldClicker(bVal) end --------------------------------------------- EXPRESSION 2 TAB sheet = self:AddControlPanelTab("Expression 2", "icon16/computer.png", "Options for Expression 2.") dlist = vgui.Create("DPanelList", sheet.Panel) dlist.Paint = function() end frame:AddResizeObject(dlist, 2, 2) dlist:EnableVerticalScrollbar(true) label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Clientside expression 2 options") label:SizeToContents() local AutoIndent = vgui.Create("DCheckBoxLabel") dlist:AddItem(AutoIndent) AutoIndent:SetConVar("wire_expression2_autoindent") AutoIndent:SetText("Auto indenting") AutoIndent:SizeToContents() AutoIndent:SetTooltip("Enable/disable auto indenting.") local Concmd = vgui.Create("DCheckBoxLabel") dlist:AddItem(Concmd) Concmd:SetConVar("wire_expression2_concmd") Concmd:SetText("concmd") Concmd:SizeToContents() Concmd:SetTooltip("Allow/disallow the E2 from running console commands on you.") label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Concmd whitelist") label:SizeToContents() local ConcmdWhitelist = vgui.Create("DTextEntry") dlist:AddItem(ConcmdWhitelist) ConcmdWhitelist:SetConVar("wire_expression2_concmd_whitelist") ConcmdWhitelist:SetTooltip("Separate the commands with commas.") local Convar = vgui.Create("DCheckBoxLabel") dlist:AddItem(Convar) Convar:SetConVar("wire_expression2_convar") Convar:SetText("convar") Convar:SizeToContents() Convar:SetTooltip("Allow/disallow the E2 from getting convar values from your player.") label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Convar whitelist") label:SizeToContents() local ConvarWhitelist = vgui.Create("DTextEntry") dlist:AddItem(ConvarWhitelist) ConvarWhitelist:SetConVar("wire_expression2_convar_whitelist") ConvarWhitelist:SetTooltip("Separate the convars with commas.") label = vgui.Create("DLabel") dlist:AddItem(label) label:SetText("Expression 2 block comment style") label:SizeToContents() local BlockCommentStyle = vgui.Create("DComboBox") dlist:AddItem(BlockCommentStyle) local blockCommentModes = {} blockCommentModes["New (alt 1)"] = { 0, [[Current mode: #[ Text here Text here ]#]] } blockCommentModes["New (alt 2)"] = { 1, [[Current mode: #[Text here Text here]# ]] } blockCommentModes["Old"] = { 2, [[Current mode: #Text here #Text here]] } for k, _ in pairs(blockCommentModes) do BlockCommentStyle:AddChoice(k) end blockCommentModes[0] = blockCommentModes["New (alt 1)"][2] blockCommentModes[1] = blockCommentModes["New (alt 2)"][2] blockCommentModes[2] = blockCommentModes["Old"][2] BlockCommentStyle:SetToolTip(blockCommentModes[self.BlockCommentStyleConVar:GetInt()]) BlockCommentStyle.OnSelect = function(panel, index, value) panel:SetToolTip(blockCommentModes[value][2]) RunConsoleCommand("wire_expression2_editor_block_comment_style", blockCommentModes[value][1]) end local ops_sync_checkbox = vgui.Create("DCheckBoxLabel") dlist:AddItem(ops_sync_checkbox) ops_sync_checkbox:SetConVar("wire_expression_ops_sync_subscribe") ops_sync_checkbox:SetText("ops/cpu usage syncing for remote uploader (Admin only)") ops_sync_checkbox:SizeToContents() ops_sync_checkbox:SetTooltip("Opt into live ops/cpu usage for all E2s on the server via the remote uploader tab. If you're not admin, this checkbox does nothing.") -- ------------------------------------------- REMOTE UPDATER TAB sheet = self:AddControlPanelTab("Remote Updater", "icon16/world.png", "Manage your E2s from far away.") dlist = vgui.Create("DPanelList", sheet.Panel) dlist.Paint = function() end frame:AddResizeObject(dlist, 2, 2) dlist:EnableVerticalScrollbar(true) dlist:SetSpacing(2) local dlist2 = vgui.Create("DPanelList") dlist:AddItem(dlist2) dlist2:EnableVerticalScrollbar(true) -- frame:AddResizeObject( dlist2, 2,2 ) -- dlist2:SetTall( 444 ) dlist2:SetSpacing(1) local painted = 0 local opened = false dlist2.Paint = function() painted = SysTime() + 0.05 end timer.Create( "wire_expression2_ops_sync_check", 0, 0, function() if painted > SysTime() and not opened then opened = true if Editor.ops_sync_subscribe:GetBool() then RunConsoleCommand("wire_expression_ops_sync","1") end elseif painted < SysTime() and opened then opened = false RunConsoleCommand("wire_expression_ops_sync","0") end end) local UpdateList = vgui.Create("DButton") UpdateList:SetText("Update List (Show only yours)") dlist:AddItem(UpdateList) UpdateList.DoClick = function(pnl, showall) local E2s = ents.FindByClass("gmod_wire_expression2") dlist2:Clear() local size = 0 for _, v in ipairs(E2s) do local ply = v:GetNWEntity("player", NULL) if IsValid(ply) and ply == LocalPlayer() or showall then local nick if not ply or not ply:IsValid() then nick = "Unknown" else nick = ply:Nick() end local name = v:GetNWString("name", "generic") local singleline = string.match( name, "(.-)\n" ) if singleline then name = singleline .. "..." end local max = 20 if #name > max then name = string.sub(name,1,max) .. "..." end local panel = vgui.Create("DPanel") panel:SetTall((LocalPlayer():IsAdmin() and 74 or 47)) panel.Paint = function(panel) local w, h = panel:GetSize() draw.RoundedBox(1, 0, 0, w, h, Color(65, 105, 255, 100)) end dlist2:AddItem(panel) size = size + panel:GetTall() + 1 local label = vgui.Create("DLabel", panel) local idx = v:EntIndex() local ownerStr if CPPI and v:CPPIGetOwner():GetName() ~= nick then ownerStr = string.format("Owner: %s | Code Author: %s", v:CPPIGetOwner():GetName(), nick) else ownerStr = "Owner: " .. nick end local str = string.format("Name: %s\nEntity ID: '%d'\n%s", name, idx, ownerStr) if LocalPlayer():IsAdmin() then str = string.format("Name: %s\nEntity ID: '%d'\n%i ops, %i%% %s\ncpu time: %ius\n%s", name, idx, 0, 0, "", 0, ownerStr) end label:SetText(str) label:SizeToContents() label:SetWide(280) label:SetWrap(true) label:SetPos(4, 4) label:SetTextColor(Color(255, 255, 255, 255)) if LocalPlayer():IsAdmin() then local hardquota = GetConVar("wire_expression2_quotahard") local softquota = GetConVar("wire_expression2_quotasoft") function label:Think() if not IsValid(v) then label.Think = function() end return end local data = v:GetOverlayData() if data then local prfbench = data.prfbench local prfcount = data.prfcount local timebench = data.timebench local e2_hardquota = hardquota:GetInt() local e2_softquota = softquota:GetInt() local hardtext = (prfcount / e2_hardquota > 0.33) and "(+" .. tostring(math.Round(prfcount / e2_hardquota * 100)) .. "%)" or "" label:SetText(string.format( "Name: %s\nEntity ID: '%d'\n%i ops, %i%% %s\ncpu time: %ius\n%s", name, idx, prfbench, prfbench / e2_softquota * 100, hardtext, timebench * 1000000, ownerStr )) end end end do local btn = vgui.Create("DButton", panel) btn:SetText("Upload") btn:SetSize(57, 18) timer.Simple(0, function() btn:SetPos(panel:GetWide() - btn:GetWide() * 2 - 6, 4) end) btn.DoClick = function(pnl) WireLib.Expression2Upload(v) end end do local btn = vgui.Create("DButton", panel) btn:SetText("Download") btn:SetSize(57, 18) timer.Simple(0, function() btn:SetPos(panel:GetWide() - btn:GetWide() - 4, 4) end) btn.DoClick = function(pnl) RunConsoleCommand("wire_expression_requestcode", v:EntIndex()) end end do local btn = vgui.Create("DButton", panel) btn:SetText("Halt execution") btn:SetSize(75, 18) timer.Simple(0, function() btn:SetPos(panel:GetWide() - btn:GetWide() - 4, 24) end) btn.DoClick = function(pnl) RunConsoleCommand("wire_expression_forcehalt", v:EntIndex()) end local btn2 = vgui.Create("DButton", panel) btn2:SetText("Reset") btn2:SetSize(39, 18) timer.Simple(0, function() btn2:SetPos(panel:GetWide() - btn2:GetWide() - btn:GetWide() - 6, 24) end) btn2.DoClick = function(pnl) RunConsoleCommand("wire_expression_reset", v:EntIndex()) end end end end dlist2:SetTall(size + 2) dlist:InvalidateLayout() end local UpdateList2 = vgui.Create("DButton") UpdateList2:SetText("Update List (Show all)") dlist:AddItem(UpdateList2) UpdateList2.DoClick = function(pnl) UpdateList:DoClick(true) end end -- used with color-circles function Editor:TranslateValues(panel, x, y) x = x - 0.5 y = y - 0.5 local angle = math.atan2(x, y) local length = math.sqrt(x * x + y * y) length = math.Clamp(length, 0, 0.5) x = 0.5 + math.sin(angle) * length y = 0.5 + math.cos(angle) * length panel:SetHue(math.deg(angle) + 270) panel:SetSaturation(length * 2) panel:SetRGB(HSVToColor(panel:GetHue(), panel:GetSaturation(), 1)) panel:SetFrameColor() return x, y end -- options function Editor:NewScript(incurrent) if not incurrent and self.NewTabOnOpen:GetBool() then self:NewTab() else self:AutoSave() self:ChosenFile() -- Set title self:GetActiveTab():SetText("generic") self.C.TabHolder:InvalidateLayout() if self.E2 then -- add both code1 and code2 to the editor self:SetCode(defaultcode) local ed = self:GetCurrentEditor() -- mark only code2 ed.Start = ed:MovePosition({ 1, 1 }, code1:len()) ed.Caret = ed:MovePosition({ 1, 1 }, defaultcode:len()) else self:SetCode("") end end end local wire_expression2_editor_savetabs = CreateClientConVar("wire_expression2_editor_savetabs", "1", true, false) local id = 0 function Editor:InitShutdownHook() id = id + 1 -- save code when shutting down hook.Add("ShutDown", "wire_expression2_ShutDown" .. id, function() -- if wire_expression2_editor == nil then return end local buffer = self:GetCode() if buffer == defaultcode then return end file.Write(self.Location .. "/_shutdown_.txt", buffer) if wire_expression2_editor_savetabs:GetBool() then self:SaveTabs() end end) end function Editor:SaveTabs() local strtabs = "" local tabs = {} for i=1, self:GetNumTabs() do local chosenfile = self:GetEditor(i).chosenfile if chosenfile and chosenfile ~= "" and not tabs[chosenfile] then strtabs = strtabs .. chosenfile .. ";" tabs[chosenfile] = true -- Prevent duplicates end end strtabs = strtabs:sub(1, -2) file.Write(self.Location .. "/_tabs_.txt", strtabs) end local wire_expression2_editor_openoldtabs = CreateClientConVar("wire_expression2_editor_openoldtabs", "1", true, false) function Editor:OpenOldTabs() if not file.Exists(self.Location .. "/_tabs_.txt", "DATA") then return end -- Read file local tabs = file.Read(self.Location .. "/_tabs_.txt") if not tabs or tabs == "" then return end -- Explode around ; tabs = string.Explode(";", tabs) if not tabs or #tabs == 0 then return end -- Temporarily remove fade time self:FixTabFadeTime() local is_first = true for _, v in pairs(tabs) do if v and v ~= "" then if (file.Exists(v, "DATA")) then -- Open it in a new tab self:LoadFile(v, true) -- If this is the first loop, close the initial tab. if (is_first) then timer.Simple(0, function() self:CloseTab(1) end) is_first = false end end end end end function Editor:Validate(gotoerror) local header_color, header_text = nil, nil local problems_errors, problems_warnings = {}, {} if self.EditorType == "E2" then local errors, _, warnings = wire_expression2_validate(self:GetCode()) if not errors then if warnings then header_color = Color(163, 130, 64, 255) local nwarnings = #warnings local warning = warnings[1] if gotoerror then header_text = "Warning (1/" .. nwarnings .. "): " .. warning.message self:GetCurrentEditor():SetCaret { warning.line, warning.char } else header_text = "Validated with " .. nwarnings .. " warning(s)." end problems_warnings = warnings else header_color = Color(0, 110, 20, 255) header_text ="Validation successful" end else header_color = Color(110, 0, 20, 255) header_text = ("" .. errors) local row, col = errors:match("at line ([0-9]+), char ([0-9]+)$") if not row then row, col = errors:match("at line ([0-9]+)$"), 1 end problems_errors = {{message = string.Explode(" at line", errors)[1], line = row, char = col}} if gotoerror then if row then self:GetCurrentEditor():SetCaret({ tonumber(row), tonumber(col) }) end end end elseif self.EditorType == "CPU" or self.EditorType == "GPU" or self.EditorType == "SPU" then header_color = Color(64, 64, 64, 180) header_text = "Recompiling..." CPULib.Validate(self, self:GetCode(), self:GetChosenFile()) end self.C.Val:Update(problems_errors, problems_warnings, header_text, header_color) return true end function Editor:SetValidatorStatus(text, r, g, b, a) self.C.Val:SetBGColor(r or 0, g or 180, b or 0, a or 180) self.C.Val:SetText(" " .. text) end function Editor:SubTitle(sub) if not sub then self.subTitle = "" else self.subTitle = " - " .. sub end end local wire_expression2_editor_worldclicker = CreateClientConVar("wire_expression2_editor_worldclicker", "0", true, false) function Editor:SetV(bool) if bool then self:MakePopup() self:InvalidateLayout(true) if self.E2 then self:Validate() end end self:SetVisible(bool) self:SetKeyBoardInputEnabled(bool) self:GetParent():SetWorldClicker(wire_expression2_editor_worldclicker:GetBool() and bool) -- Enable this on the background so we can update E2's without closing the editor if CanRunConsoleCommand() then RunConsoleCommand("wire_expression2_event", bool and "editor_open" or "editor_close") if not e2_function_data_received and bool then -- Request the E2 functions RunConsoleCommand("wire_expression2_sendfunctions") end end end function Editor:GetChosenFile() return self:GetCurrentEditor().chosenfile end function Editor:ChosenFile(Line) self:GetCurrentEditor().chosenfile = Line if Line then self:SubTitle("Editing: " .. Line) else self:SubTitle() end end function Editor:FindOpenFile(FilePath) for i = 1, self:GetNumTabs() do local ed = self:GetEditor(i) if ed.chosenfile == FilePath then return ed end end end function Editor:ExtractName() if not self.E2 then self.savefilefn = "filename" return end local code = self:GetCode() local name = extractNameFromCode(code) if name and name ~= "" then Expression2SetName(name) self.savefilefn = name else Expression2SetName(nil) self.savefilefn = "filename" end end function Editor:SetCode(code) self:GetCurrentEditor():SetText(code) self.savebuffer = self:GetCode() if self.E2 then self:Validate() end self:ExtractName() end function Editor:GetEditor(n) if self.C.TabHolder.Items[n] then return self.C.TabHolder.Items[n].Panel end end function Editor:GetCurrentEditor() return self:GetActiveTab():GetPanel() end function Editor:GetCode() return self:GetCurrentEditor():GetValue() end function Editor:Open(Line, code, forcenewtab) if self:IsVisible() and not Line and not code then self:Close() end hook.Run("WireEditorOpen", self, Line, code, forcenewtab) self:SetV(true) if self.chip then self.C.SaE:SetText("Upload & Exit") else self.C.SaE:SetText("Save and Exit") end if code then if not forcenewtab then for i = 1, self:GetNumTabs() do if self:GetEditor(i).chosenfile == Line then self:SetActiveTab(i) self:SetCode(code) return elseif self:GetEditor(i):GetValue() == code then self:SetActiveTab(i) return end end end local _, tabtext = getPreferredTitles(Line, code) local tab if self.NewTabOnOpen:GetBool() or forcenewtab then tab = self:CreateTab(tabtext).Tab else tab = self:GetActiveTab() tab:SetText(tabtext) self.C.TabHolder:InvalidateLayout() end self:SetActiveTab(tab) self:ChosenFile() self:SetCode(code) if Line then self:SubTitle("Editing: " .. Line) end return end if Line then self:LoadFile(Line, forcenewtab) return end end function Editor:SaveFile(Line, close, SaveAs) self:ExtractName() if close and self.chip then if not self:Validate(true) then return end WireLib.Expression2Upload(self.chip, self:GetCode()) self:Close() return end if not Line or SaveAs or Line == self.Location .. "/" .. ".txt" then local str if self.C.Browser.File then str = self.C.Browser.File.FileDir -- Get FileDir if str and str ~= "" then -- Check if not nil -- Remove "expression2/" or "cpuchip/" etc local n, _ = str:find("/", 1, true) str = str:sub(n + 1, -1) if str and str ~= "" then -- Check if not nil if str:Right(4) == ".txt" then -- If it's a file str = string.GetPathFromFilename(str):Left(-2) -- Get the file path instead if not str or str == "" then str = nil end end else str = nil end else str = nil end end Derma_StringRequestNoBlur("Save to New File", "", (str ~= nil and str .. "/" or "") .. self.savefilefn, function(strTextOut) strTextOut = string.gsub(strTextOut, ".", invalid_filename_chars) local save_location = self.Location .. "/" .. strTextOut .. ".txt" if file.Exists(save_location, "DATA") then Derma_QueryNoBlur("The file '" .. strTextOut .. "' already exists. Do you want to overwrite it?", "File already exists", "Yes", function() self:SaveFile(save_location, close) end, "No", function() end) else self:SaveFile(save_location, close) end self:UpdateActiveTabTitle() end) return end if string.GetFileFromFilename(Line) == ".txt" then surface.PlaySound("buttons/button10.wav") GAMEMODE:AddNotify("Failed to save file without filename!", NOTIFY_ERROR, 7) return end local path = string.GetPathFromFilename(Line) if not file.IsDir(path, "DATA") then file.CreateDir(path) end file.Write(Line, self:GetCode()) local f = file.Open(Line, "r", "DATA") if f then f:Close() local panel = self.C.Val timer.Simple(0, function() panel.SetText(panel, " Saved as " .. Line) end) surface.PlaySound("ambient/water/drip3.wav") if not self.chip then self:ChosenFile(Line) end if close then if self.E2 then GAMEMODE:AddNotify("Expression saved as " .. Line .. ".", NOTIFY_GENERIC, 7) else GAMEMODE:AddNotify("Source code saved as " .. Line .. ".", NOTIFY_GENERIC, 7) end self:Close() end else surface.PlaySound("buttons/button10.wav") GAMEMODE:AddNotify("Failed to save file as " .. Line .. ".", NOTIFY_ERROR, 7) end end function Editor:LoadFile(Line, forcenewtab) if not Line or file.IsDir(Line, "DATA") then return end local f = file.Open(Line, "r", "DATA") if not f then ErrorNoHalt("Erroring opening file: " .. Line) else local str = f:Read(f:Size()) or "" f:Close() self:AutoSave() if not forcenewtab then for i = 1, self:GetNumTabs() do if self:GetEditor(i).chosenfile == Line then self:SetActiveTab(i) if forcenewtab ~= nil then self:SetCode(str) end return elseif self:GetEditor(i):GetValue() == str then self:SetActiveTab(i) return end end end local _, tabtext = getPreferredTitles(Line, str) local tab if self.NewTabOnOpen:GetBool() or forcenewtab then tab = self:CreateTab(tabtext).Tab else tab = self:GetActiveTab() tab:SetText(tabtext) self.C.TabHolder:InvalidateLayout() end self:SetActiveTab(tab) self:ChosenFile(Line) self:SetCode(str) end end function Editor:Close() timer.Stop("e2autosave") self:AutoSave() self:Validate() self:ExtractName() self:SetV(false) self.chip = false self:SaveEditorSettings() hook.Run("WireEditorClose", self) end function Editor:Setup(nTitle, nLocation, nEditorType) self.Title = nTitle self.Location = nLocation self.EditorType = nEditorType self.C.Browser:Setup(nLocation) local textEditorModes = { CPU = "ZCPU", GPU = "ZCPU", SPU = "ZCPU", E2 = "E2", [""] = "Default" } local helpModes = { CPU = E2Helper.UseCPU, GPU = E2Helper.UseCPU, SPU = E2Helper.UseCPU, E2 = E2Helper.UseE2 } self:SetEditorMode(textEditorModes[nEditorType or ""]) local helpMode = helpModes[nEditorType or ""] if helpMode then -- Add "E2Helper" button local E2Help = vgui.Create("Button", self.C.Menu) E2Help:SetSize(58, 20) E2Help:Dock(RIGHT) E2Help:SetText("E2Helper") E2Help.DoClick = function() E2Helper.Show() helpMode(nEditorType) E2Helper.Update() end self.C.E2Help = E2Help end local useValidator = nEditorType ~= nil local useSoundBrowser = nEditorType == "SPU" or nEditorType == "E2" local useDebugger = nEditorType == "CPU" if not useValidator then self.C.Val:SetVisible(false) end if useSoundBrowser then -- Add "Sound Browser" button local SoundBrw = vgui.Create("Button", self.C.Menu) SoundBrw:SetSize(85, 20) SoundBrw:Dock(RIGHT) SoundBrw:SetText("Sound Browser") SoundBrw.DoClick = function() RunConsoleCommand("wire_sound_browser_open") end self.C.SoundBrw = SoundBrw end if useDebugger then -- Add "step forward" button local DebugForward = self:addComponent(vgui.Create("Button", self), -306, 31, -226, 20) DebugForward:SetText("Step Forward") DebugForward.Font = "E2SmallFont" DebugForward.DoClick = function() local currentPosition = CPULib.Debugger.PositionByPointer[CPULib.Debugger.Variables.IP] if currentPosition then local linePointers = CPULib.Debugger.PointersByLine[currentPosition.Line .. ":" .. currentPosition.File] if linePointers then -- Run till end of line RunConsoleCommand("wire_cpulib_debugstep", linePointers[2]) else -- Run just once RunConsoleCommand("wire_cpulib_debugstep") end else -- Run just once RunConsoleCommand("wire_cpulib_debugstep") end -- Reset interrupt text CPULib.InterruptText = nil end self.C.DebugForward = DebugForward -- Add "reset" button local DebugReset = self:addComponent(vgui.Create("Button", self), -346, 31, -306, 20) DebugReset:SetText("Reset") DebugReset.DoClick = function() RunConsoleCommand("wire_cpulib_debugreset") -- Reset interrupt text CPULib.InterruptText = nil end self.C.DebugReset = DebugReset -- Add "run" button local DebugRun = self:addComponent(vgui.Create("Button", self), -381, 31, -346, 20) DebugRun:SetText("Run") DebugRun.DoClick = function() RunConsoleCommand("wire_cpulib_debugrun") end self.C.DebugRun = DebugRun end if nEditorType == "E2" then self.E2 = true end self:NewScript(true) -- Opens initial tab, in case OpenOldTabs is disabled or fails. if wire_expression2_editor_openoldtabs:GetBool() then self:OpenOldTabs() end self:LoadSyntaxColors() self:InvalidateLayout() end vgui.Register("Expression2EditorFrame", Editor, "DFrame")
{'content_hash': 'f529a1f0787c2757a7e39137ad8e4988', 'timestamp': '', 'source': 'github', 'line_count': 2065, 'max_line_length': 200, 'avg_line_length': 30.16271186440678, 'alnum_prop': 0.6944578235879652, 'repo_name': 'wiremod/wire', 'id': '696ac74903409de5a7591f479ab875e9b4ed829f', 'size': '62286', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lua/wire/client/text_editor/wire_expression2_editor.lua', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Lua', 'bytes': '3691993'}, {'name': 'Shell', 'bytes': '3782'}]}
<!DOCTYPE html> <html> <head> <title>Company Page</title> <link rel="stylesheet" type="text/css" href="./dhtml/codebase/dhtmlx.css" /> <link rel="stylesheet" type="text/css" href="./dhtml/codebase/dhtmlx_custom.css" /> <link rel="stylesheet" type="text/css" href="./css/basestyle.css" /> <!--script type="text/javascript" src="https://js.stripe.com/v1/stripe-debug.js"></script--> <script type="text/javascript" src="https://js.stripe.com/v1/"></script> <script type="text/javascript" src="./scripts/GlobalObjects.js"></script> <script type="text/javascript" src="./scripts/baselayout.js"></script> <!-- Page Scoped Functions --> <script type="text/javascript"> //page globals var stripeKey = 'pk_live_9NvWvLsGtDzElv0Dwa00K8iL'; //var stripeKey = 'pk_test_jATyIxjgV5UEkOtTNFj4Xcrt'; var companyLayout, gridCell, listGrid, workarea; var companyEditForm, companyBillingForm; var formData = [ { type: "settings", position: "label-left", labelWidth: 165 }, { type: "input", name: 'inputName', label: 'Name' }, { type: "input", name: 'inputAddress', label: 'Address 1' }, { type: "input", name: 'inputAddress2', label: 'Address 2' }, { type: "input", name: 'inputCity', label: 'City' }, { type: "input", name: 'inputState', label: 'State' }, { type: "input", name: 'inputCountry', label: 'Country' }, { type: "input", name: 'inputZip', label: 'Postal Code' }, { type: "newcolumn", offset: 20 }, { type: "input", name: 'inputPhone', label: 'Phone Number' }, { type: "input", name: 'inputContact', label: 'Contact' }, { type: "input", name: 'inputWebsite', label: 'Website' }, { type: "select", name: 'deliveryNetwork', label: 'Inventory Source', options: [ { text: "AppNexus", value: "AppNexus", selected: false }, { text: "DFP", value: "GoogleDFP", selected: false } ] }, { type: "hidden", name: 'inputType', value: '' }, { type: "hidden", name: 'localVersion', value: '' }, { type: "button", name: "saveButton", value: 'Save' }, { type: "button", name: "cancelButton", value: 'Cancel' }, { type: "button", name: "billingButton", value: 'Billing Info' } ]; var billingFormData = [ { type: "settings", position: "label-left", labelWidth: 165 }, { type: "input", name: 'number', label: 'Card Number' }, { type: "input", name: 'cvc', label: 'CVC' }, { type: "input", name: 'exp_month', size: '2', label: 'Expiration Month' }, { type: "input", name: 'exp_year', size: '4', label: 'Expiration Year' }, { type: "hidden", name: 'inputType', value: '' }, { type: "button", name: "submitButton", value: 'Submit' } ]; //utilities function getCompanyDetails(companyId) { workarea.progressOn(); var returnJSON = new $RCAjax($RCAPI.URI.CompanyGet.format(companyId), '', 'GET', null, null, false, null, routeErrors) return returnJSON; } function companySave(editCell, companyForm) { editCell.progressOn(); var companyJSON = createCompanyJSON(companyForm); // Agencies are POSTed to the company namespace, Advertisers to the sub-namespace var companyCreateUri = companyJSON.ExternalType.toLowerCase() == "agency" ? $RCAPI.URI.AgencyCreate : $RCAPI.URI.AdvertiserCreate.format($RCUI.querystring["agency"]); var companyOutputJSON = companyJSONCall("POST", false, companyCreateUri, JSON.stringify(companyJSON)); if (companyOutputJSON.Company.ExternalType.toLowerCase() == "advertiser") { var companyJSON = { ParentEntity: $RCUI.querystring["agency"], ChildEntity: companyOutputJSON.Company.ExternalEntityId, AssociationName: "AgencyAdvertiser", AssociationType: "Child" }; companyJSONCall("POST", false, $RCAPI.URI.CompanyAssociate.format($RCUI.querystring["agency"]), JSON.stringify(companyJSON)); } windowClose(gridCell); } function companyUpdate(editCell, companyForm) { editCell.progressOn(); var companyOutputJSON = companyJSONCall("PUT", false, $RCAPI.URI.CompanyUpdate.format(listGrid.cells(getSelectRowIdFromGrid(), 6).getValue()), JSON.stringify(createUpdateCompanyJSON(companyForm))); editCell.progressOff(); windowClose(gridCell); } //TODO merge with companySave function. function companyJSONCall(messageType, async, url, data) { var companyAjax = new $RCAjax(url, data, messageType, null, null, async, null, routePostErrors); return companyAjax.responseData; } function getCompanyList(companyId) { var companyAjax = new $RCAjax($RCAPI.URI.CompanyGetByUser, '', 'GET', null, null, false, null, routeGetErrors); return companyAjax.responseData; } function submitBillingInfo(editCell, billingInfoForm) { editCell.progressOn(); var billingInfo = { number : parseInt(billingInfoForm.getItemValue("number")), cvc: billingInfoForm.getItemValue("cvc"), exp_month: parseInt(billingInfoForm.getItemValue("exp_month")), exp_year: parseInt(billingInfoForm.getItemValue("exp_year")) }; function responseHandler(status, response) { processBillingResponse(status, response); windowClose(editCell); } Stripe.setPublishableKey(stripeKey); Stripe.createToken(billingInfo, responseHandler); } function processBillingResponse(status, response) { if (response.error) { alert("Failed to submit billing info. " + response.error.message); } else { var token = response['id']; var url = $RCAPI.URI.BillingInfoUpdate.format(listGrid.cells(getSelectRowIdFromGrid(), 6).getValue()); var message = { BillingInfoToken: token }; var companyAjax = new $RCAjax(url, JSON.stringify(message), "POST", null, null, false, null, routePostErrors); var responseData = companyAjax.responseData; } } function routePostErrors(data, errorType, errorText) { switch (data.status) { case 401: authExpiration(); break; default: getCompanyListFailure(data, errorType, errorText); break; }; } function routeGetErrors(data, errorType, errorText, resource) { switch (data.status) { case 202: getCompanyListPending(data, errorType, errorText); break; case 401: authExpiration(); break; default: getCompanyListFailure(data, errorType, errorText); break; }; } function getCompanyListFailure(data, errorType, errorText) { alert(errorType + ' - ' + errorText + ' - ' + JSON.stringify(data)); } function authExpiration(data, errorType, errorText) { alert('Auth Expiration - ' + errorType + ' - ' + errorText + ' - ' + JSON.stringify(data)); } function getCompanyListPending(data, errorType, errorText) { alert('202 - ' + errorType + ' - ' + errorText + ' - ' + JSON.stringify(data)); } function createUpdateCompanyJSON(companyForm) { var updateJSON = createCompanyJSON(companyForm); updateJSON.LocalVersion = companyEditForm.getItemValue('localVersion'); return updateJSON; } function createCompanyJSON(companyForm) { return { 'ExternalName': companyForm.getItemValue("inputName"), 'ExternalType': companyForm.getItemValue("inputType"), 'Properties': { 'Address': companyForm.getItemValue("inputAddress"), 'Address2': companyForm.getItemValue("inputAddress2"), 'City': companyForm.getItemValue("inputCity"), 'State': companyForm.getItemValue("inputState"), 'Country': companyForm.getItemValue("inputCountry"), 'PostalCode': companyForm.getItemValue("inputZip"), 'Phone': companyForm.getItemValue("inputPhone"), 'Contact': companyForm.getItemValue("inputContact"), 'Website': companyForm.getItemValue("inputWebsite"), 'DeliveryNetwork': companyForm.getItemValue("deliveryNetwork") } }; } function CompanyJsonToGridArray(companyJson) { var gridArray = new Array(); // Filter to only agencies on the first view, then advertisers on the second. This may need to change when there is more than agency to advertiser relationships. var companyDisplayType = $RCUI.querystring['agency'] == undefined ? 'Agency' : 'Advertiser'; for (var item in companyJson) { if (companyJson[item].ExternalType == companyDisplayType) { var tmpArr = [] tmpArr.push(false); tmpArr.push(companyJson[item].ExternalName); tmpArr.push(companyJson[item].Properties.City); tmpArr.push(companyJson[item].Properties.State); tmpArr.push(companyJson[item].Properties.Contact); tmpArr.push(companyJson[item].Properties.Phone); tmpArr.push(companyJson[item].ExternalEntityId); tmpArr.push(companyJson[item].ExternalType); gridArray.push(tmpArr); } } return gridArray; } //navigation routines function navToCompany(rowId) { var companyType = listGrid.cells(rowId, 7).getValue().toLowerCase(); $RCUI.breadCrumbs.add(listGrid.cells(rowId, 1).getValue(), companyType, listGrid.cells(rowId, 6).getValue()); if (companyType == 'agency') { location.href = 'company.html?agency=' + listGrid.cells(rowId, 6).getValue(); } else { location.href = 'campaign.html?agency=' + $RCUI.querystring['agency'] + '&advertiser=' + listGrid.cells(rowId, 6).getValue(); } } //Function to render page inside of the workarea as created by the basepage.js function thisPageRender() { // add company layout to workarea companyLayout = workarea.attachLayout('2E', 'dhx_web') var wizardNav = companyLayout.cells('a'); wizardNav.hideHeader(); wizardNav.setHeight('28'); wizardNav.fixSize(1, 1); var wizardToolbar = wizardNav.attachToolbar(); wizardToolbar.setSkin('dhx_web'); wizardToolbar.attachEvent('onClick', onCompanyClick); var menuResource = window.ApnxApp ? 'ApnxMenu' : $RCUI.querystring["agency"] ? 'AgencyMenu' : 'DefaultMenu'; var menu = $RCUI.resources('Company', menuResource); for (var menuItem in menu) { wizardToolbar.addButton(menuItem.toString(), menuItem, menu[menuItem].DisplayText); }; gridCell = companyLayout.cells('b'); gridCell.hideHeader(); gridCell.progressOn(); var companyId = $RCUI.querystring["agency"]; if (window.ApnxApp && (companyId == undefined || companyId == null)) { var companyList = getCompanyList(''); if (companyList.Companies != undefined && companyList.Companies.length > 0) { var agencies = jsonPath(companyList, '$.Companies[?(@.ExternalType.toLowerCase() == "agency")]'); $RCUI.querystring["agency"] = agencies[0].ExternalEntityId; } } loadCompanyGrid(companyId, gridCell); } //display routines function loadCompanyGrid(companyId, layoutCell) { //Advertiser List Grid formatting and population listGrid = layoutCell.attachGrid(); listGrid.setHeader(",Company Name,City,State,Contact,Phone,Id,Type"); listGrid.setColAlign("center,left,left,left,left,left,left"); listGrid.setInitWidths("35,250,175,50,175,100,*,*"); listGrid.setColSorting("str,str,str,str,str,str,str,str,str"); listGrid.setColTypes("ra,ro,ro,ro,ro,ro,ro,ro"); listGrid.setColumnsVisibility("false,false,false,false,false,false,true,true"); listGrid.enableRowsHover(true, "highlight"); listGrid.attachEvent('onRowSelect', navToCompany); listGrid.init(); listGrid.setSkin("dhx_web"); if ($RCUI.querystring["agency"]) { var agencyJSON = new $RCAjax($RCAPI.URI.CompanyGet.format($RCUI.querystring["agency"]) + '?Flags=WithAssociations', '', 'GET', null, null, false, null, routeGetErrors); var companyList = []; var assocAdvertisers; try { assocAdvertisers = agencyJSON.responseData.Company.Associations.AgencyAdvertiser; } catch (err) { // Just keep on truckin } if (assocAdvertisers != undefined) { //make sure there are advertisers first //TO DO should make these ASYNC for (var association in assocAdvertisers) { var targetEntityId = assocAdvertisers[association].TargetEntityId; if (targetEntityId != undefined){ var returnJSON = new $RCAjax($RCAPI.URI.CompanyGet.format(targetEntityId), '', 'GET', null, null, false, null, routeGetErrors) companyList.push(returnJSON.responseData.Company); } else{ //this should mean there is only one association var returnJSON = new $RCAjax($RCAPI.URI.CompanyGet.format(assocAdvertisers.TargetEntityId), '', 'GET', null, null, false, null, routeGetErrors) companyList.push(returnJSON.responseData.Company); break; } } } listGrid.parse(CompanyJsonToGridArray(companyList), "jsarray"); } else { listGrid.parse(CompanyJsonToGridArray(getCompanyList(companyId).Companies), "jsarray"); } listGrid.sortRows(1); layoutCell.progressOff(); } function formOnButtonClick(buttonId) { switch (buttonId) { case 'saveButton': companySave(gridCell, companyEditForm); window.location = '\/company.html'; break; case 'cancelButton': windowClose(gridCell); break; default: return; } } function formUpdateOnButtonClick(buttonId) { switch (buttonId) { case 'saveButton': companyUpdate(gridCell, companyEditForm); window.location = '\/company.html'; break; case 'cancelButton': windowClose(gridCell); break; case 'billingButton': showBillingWindow(gridCell, 'BillingInfo'); break; default: return; } } function billingFormOnButtonClick(buttonId) { switch (buttonId) { case 'submitButton': submitBillingInfo(gridCell, companyBillingForm); break; default: return; } } function windowClose(editCell) { editCell.progressOff(); window.location = '\/company.html'; } function onCompanyClick(button) { if (!preNavigationCheck()) { return false; } var menuResource = window.ApnxApp ? 'ApnxMenu' : $RCUI.querystring["agency"] ? 'AgencyMenu' : 'DefaultMenu'; var menu = $RCUI.resources('Company', menuResource); var action = ''; if (button < menu.length) { action = menu[button].Action; } else { alert('Navigation Error'); } switch (action) { case 'Agency': showEditWindow(gridCell, 'Agency'); break; case 'UpdateAgency': showUpdateWindow(gridCell, 'Agency'); break; case 'Advertiser': if (window.ApnxApp) { showApnxImportWindow(gridCell, 'Advertiser'); } else { showEditWindow(gridCell, 'Advertiser'); } break; case 'UpdateAdvertiser': showUpdateWindow(gridCell, 'Advertiser'); break; case 'User': window.location = '\/user.html'; break; default: alert('Unhandled Navigation'); } } function getSelectRowIdFromGrid() { for (var count = 1; count <= listGrid.getRowsNum(); count++) { var isChecked = listGrid.cells(count, 0).isChecked(); if (isChecked == true) { return count; } } return -1; } function showForm(companyWorkArea){ companyEditForm = companyWorkArea.attachForm(); companyWorkArea.fixSize(1, 0); companyWorkArea.setHeight('225'); companyWorkArea.fixSize(1, 1); companyEditForm.setSkin = "dhx_web"; companyEditForm.loadStruct(formData, 'json'); } function showUpdateWindow(companyWorkArea, hiddenValue) { var rowId = getSelectRowIdFromGrid(); if (rowId < 0) { alert("Select the Update radio button for the Company you want to update."); return; } var companyJSON = new $RCAjax($RCAPI.URI.CompanyGet.format(listGrid.cells(rowId, 6).getValue()), '', 'GET', null, null, false, null, routeGetErrors).responseData.Company; showForm(companyWorkArea); companyEditForm.attachEvent("onButtonClick", formUpdateOnButtonClick); companyEditForm.setItemValue('inputName', companyJSON.ExternalName); companyEditForm.setItemValue('inputAddress', companyJSON.Properties.Address); companyEditForm.setItemValue('inputAddress2', companyJSON.Properties.Address2); companyEditForm.setItemValue('inputCity', companyJSON.Properties.City); companyEditForm.setItemValue('inputState', companyJSON.Properties.State); companyEditForm.setItemValue('inputCountry', companyJSON.Properties.Country); companyEditForm.setItemValue('inputZip', companyJSON.Properties.PostalCode); companyEditForm.setItemValue('inputPhone', companyJSON.Properties.Phone); companyEditForm.setItemValue('inputContact', companyJSON.Properties.Contact); companyEditForm.setItemValue('inputWebsite', companyJSON.Properties.Website); companyEditForm.setItemValue('localVersion', companyJSON.LocalVersion); companyEditForm.setItemValue('inputType', hiddenValue); companyEditForm.setItemValue('deliveryNetwork', companyJSON.Properties.DeliveryNetwork); } function showBillingForm(companyWorkArea) { companyBillingForm = companyWorkArea.attachForm(); companyWorkArea.fixSize(1, 0); companyWorkArea.setHeight('225'); companyWorkArea.fixSize(1, 1); companyBillingForm.setSkin = "dhx_web"; companyBillingForm.loadStruct(billingFormData, 'json'); } function showBillingWindow(companyWorkArea, hiddenValue) { showBillingForm(companyWorkArea); companyBillingForm.attachEvent("onButtonClick", billingFormOnButtonClick); companyBillingForm.setItemValue('inputType', hiddenValue); } function showEditWindow(companyWorkArea, hiddenValue) { var deliveryNetwork = ''; if (hiddenValue == 'Advertiser') { var agencyJSON = new $RCAjax($RCAPI.URI.CompanyGet.format($RCUI.querystring["agency"]), '', 'GET', null, null, false, null, routeGetErrors); deliveryNetwork = agencyJSON.responseData.Company.Properties.DeliveryNetwork; } showForm(companyWorkArea); companyEditForm.attachEvent("onButtonClick", formOnButtonClick); companyEditForm.setItemValue('inputType', hiddenValue); companyEditForm.setItemValue("deliveryNetwork", deliveryNetwork); } // AppNexus App advertiser import fuctions function apnxAdvertiserImport(editCell, importGrid) { var advertiserId = importGrid.getSelectedRowId(); if (advertiserId == null) { alert("Please select an advertiser."); return false; } editCell.progressOn(); var advertiserCompanyJSON = { 'ExternalName': importGrid.cells(advertiserId, 0).getValue(), 'ExternalType': 'Advertiser', 'Properties': { 'DeliveryNetwork': 'AppNexus', 'APNXAdvertiserId': advertiserId } }; var companyCreateUri = $RCAPI.URI.AdvertiserCreate.format($RCUI.querystring["agency"]); var companyOutputJSON = companyJSONCall("POST", false, companyCreateUri, JSON.stringify(advertiserCompanyJSON)); var companyJSON = { ParentEntity: $RCUI.querystring["agency"], ChildEntity: companyOutputJSON.Company.ExternalEntityId, AssociationName: "AgencyAdvertiser", AssociationType: "Child" }; companyJSONCall("POST", false, $RCAPI.URI.CompanyAssociate.format($RCUI.querystring["agency"]), JSON.stringify(companyJSON)); windowClose(gridCell); return true; } function formApnxImportOnButtonClick(buttonId, importGrid) { switch (buttonId) { case 'importButton': if (apnxAdvertiserImport(gridCell, importGrid)) { window.location = '\/company.html'; } break; case 'cancelButton': windowClose(gridCell); break; default: return; } } function showApnxImportWindow(companyWorkArea, hiddenValue) { // Display the AppNexus advertiser import form companyWorkArea.attachObject('apnxFormArea'); var advertiserImportGrid = new dhtmlXGridObject("apnxGrid"); advertiserImportGrid.setHeader("Advertiser"); advertiserImportGrid.setColAlign("left"); advertiserImportGrid.setInitWidths("*"); advertiserImportGrid.setColSorting("str"); advertiserImportGrid.setColTypes("ro"); advertiserImportGrid.enableRowsHover(true, "highlight"); advertiserImportGrid.init(); advertiserImportGrid.loadXML('./api/data/apnxadvertisers.xml'); var advertiserImportForm = new dhtmlXForm("apnxForm"); var apnxImportForm = [ { type: "button", name: "importButton", value: 'Import' }, { type: "button", name: "cancelButton", value: 'Cancel' } ]; companyWorkArea.fixSize(1, 0); companyWorkArea.setHeight('225'); companyWorkArea.fixSize(1, 1); advertiserImportForm.setSkin = "dhx_web"; advertiserImportForm.loadStruct(apnxImportForm, 'json'); var onButtonClick = function (buttonId) { formApnxImportOnButtonClick(buttonId, advertiserImportGrid); }; advertiserImportForm.attachEvent("onButtonClick", onButtonClick); } </script> </head> <body onload="pageRender(thisPageRender);"> <div id="apnxFormArea" style="display:none;width:100%;height:100%;overflow:scroll"> <div id="apnxGrid" style="border:1px black;width:300px;height:300px;">hi</div> <div id="apnxForm" style="border:1px black;width:300px;height:300px;"/> </div> </body> </html>
{'content_hash': '45f5525c660969fde1df1679002e272f', 'timestamp': '', 'source': 'github', 'line_count': 557, 'max_line_length': 205, 'avg_line_length': 43.17235188509874, 'alnum_prop': 0.6013639955087953, 'repo_name': 'chinnurtb/OpenAdStack', 'id': '8c3a18797d8ff5e391da03b4ed5c449d86b23ad3', 'size': '24047', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'WebLayer/WebLayer/Company.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<?php namespace Magento\Widget\Controller\Adminhtml\Widget; class BuildWidget extends \Magento\Backend\App\Action { /** * @var \Magento\Widget\Model\Widget */ protected $_widget; /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Widget\Model\Widget $widget */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Widget\Model\Widget $widget ) { $this->_widget = $widget; parent::__construct($context); } /** * Format widget pseudo-code for inserting into wysiwyg editor * * @return void */ public function execute() { $type = $this->getRequest()->getPost('widget_type'); $params = $this->getRequest()->getPost('parameters', []); $asIs = $this->getRequest()->getPost('as_is'); $html = $this->_widget->getWidgetDeclaration($type, $params, $asIs); $this->getResponse()->setBody($html); } }
{'content_hash': '1f8598af69d8d9dc6c64fe2b46b73c96', 'timestamp': '', 'source': 'github', 'line_count': 37, 'max_line_length': 76, 'avg_line_length': 27.16216216216216, 'alnum_prop': 0.5970149253731343, 'repo_name': 'webadvancedservicescom/magento', 'id': '90a36082c5f93b1e287021cb578c42912d9c4493', 'size': '1098', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/code/Magento/Widget/Controller/Adminhtml/Widget/BuildWidget.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '16380'}, {'name': 'CSS', 'bytes': '2592299'}, {'name': 'HTML', 'bytes': '9192193'}, {'name': 'JavaScript', 'bytes': '2874762'}, {'name': 'PHP', 'bytes': '41399372'}, {'name': 'Shell', 'bytes': '3084'}, {'name': 'VCL', 'bytes': '3547'}, {'name': 'XSLT', 'bytes': '19817'}]}
module Calculations module V3 module Steps module AssignPoints def self.calculate!(calculator) calculator.event_categories.reject(&:rejected?).each do |category| category.unrejected_results.each do |result| result.unrejected_source_results.each do |source_result| points_for_place = points_for_place( source_result, calculator.rules.points_for_place, calculator.rules.place_by, result.numeric_place, category.results.size ) source_result.points = points_for_place * last_event_multiplier(source_result, calculator.rules) * field_size_multiplier(source_result, calculator.rules) * multiplier(source_result) / source_result.team_size end end end calculator.event_categories end def self.points_for_place(source_result, points_for_place, place_by, result_place, results_size) return 0 unless source_result.placed? if place_by == "place" return 0 if result_place == Float::INFINITY return 100.0 * ((results_size - result_place) + 1) / results_size end return points_for_place if points_for_place.is_a?(Numeric) return source_result.points if points_for_place.nil? points_for_place[source_result.numeric_place - 1] || 0 end def self.field_size_multiplier(source_result, rules) if rules.field_size_bonus? && source_result.field_size >= 75 1.5 else 1.0 end end def self.last_event_multiplier(source_result, rules) if rules.double_points_for_last_event? && last_event?(source_result) 2 else 1 end end def self.last_event?(source_result) raise(ArgumentError, "source_result.date required to check for last event") unless source_result.date raise(ArgumentError, "source_result.parent_end_date required to check for last event") unless source_result.parent_end_date # Only one event in series return if source_result.date == source_result.parent_date source_result.date == source_result.parent_end_date end def self.multiplier(source_result) raise(ArgumentError, "event required to assign points") unless source_result.event source_result.event.multiplier.to_f end end end end end
{'content_hash': '139e9041d73964a53ac94fb293f87667', 'timestamp': '', 'source': 'github', 'line_count': 78, 'max_line_length': 133, 'avg_line_length': 35.15384615384615, 'alnum_prop': 0.5667396061269147, 'repo_name': 'scottwillson/racing_on_rails', 'id': 'bd6b595bd30adbc277bb98c617a09baefbc06e8f', 'size': '2773', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'app/models/calculations/v3/steps/assign_points.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '226196'}, {'name': 'JavaScript', 'bytes': '34338'}, {'name': 'Ruby', 'bytes': '1980148'}, {'name': 'SCSS', 'bytes': '20026'}, {'name': 'Shell', 'bytes': '508'}]}
class CitiesController < ApplicationController before_action :set_city, only: [:show, :edit, :update, :destroy] # GET /cities # GET /cities.json def index @cities = City.all end # GET /cities/1 # GET /cities/1.json def show end # GET /cities/new def new @city = City.new end # GET /cities/1/edit def edit end # POST /cities # POST /cities.json def create @city = City.new(city_params) respond_to do |format| if @city.save format.html { redirect_to @city, notice: 'City was successfully created.' } format.json { render action: 'show', status: :created, location: @city } else format.html { render action: 'new' } format.json { render json: @city.errors, status: :unprocessable_entity } end end end # PATCH/PUT /cities/1 # PATCH/PUT /cities/1.json def update respond_to do |format| if @city.update(city_params) format.html { redirect_to @city, notice: 'City was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @city.errors, status: :unprocessable_entity } end end end # DELETE /cities/1 # DELETE /cities/1.json def destroy @city.destroy respond_to do |format| format.html { redirect_to cities_url } format.json { head :no_content } end end private # Use callbacks to share common setup or constraints between actions. def set_city @city = City.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. def city_params params.require(:city).permit(:province_id, :name, :location) end end
{'content_hash': 'bc11b543cc37cf6e43c97aae34c770ed', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 88, 'avg_line_length': 23.905405405405407, 'alnum_prop': 0.6291690220463538, 'repo_name': 'RecNSWanderStream/catfish', 'id': '772648e843e6b0a73111e2ff2f660e6c82cc65dd', 'size': '1769', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/controllers/cities_controller.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '39898'}, {'name': 'CoffeeScript', 'bytes': '2743'}, {'name': 'JavaScript', 'bytes': '87257'}, {'name': 'Ruby', 'bytes': '87238'}]}
package moves import ( "errors" "github.com/jkomoros/boardgame" "github.com/jkomoros/boardgame/moves/interfaces" ) type sourceDestinationStacker interface { interfaces.SourceStacker interfaces.DestinationStacker } //MoveCountComponents is a move that will move components, one at a time, from //SourceStack() to DestinationStack() until TargetCount() components have been //moved. It is like DealComponents or CollectComponnets, except instead of //working on a certain stack for each player, it operates on two fixed stacks. //Other MoveComponents-style moves derive from this. When using it you must //implement interfaces.SourceStacker and interfaces.DestinationStacker //to encode which stacks to use. You may also want to override TargetCount() //if you want to move more than one component. // //In practice it is most common to just use this move (and its subclasses) //directly, and pass configuration for SourceStack, DestinationStack, and //TargetCount with WithSourceProperty, WithDestinationProperty, and //WithTargetCount to auto.Config. // //boardgame:codegen type MoveCountComponents struct { ApplyCountTimes } //ValidConfiguration checks to make sure that SourceStack and DestinationStack //both exist and return non-nil stacks. func (m *MoveCountComponents) ValidConfiguration(exampleState boardgame.State) error { if err := m.ApplyCountTimes.ValidConfiguration(exampleState); err != nil { return err } theSourceDestinationStacker, ok := m.TopLevelStruct().(sourceDestinationStacker) if !ok { return errors.New("embeddingMove doesn't have Source/Destination stacker") } if theSourceDestinationStacker.DestinationStack(exampleState) == nil { return errors.New("DestinationStack returned nil") } if theSourceDestinationStacker.SourceStack(exampleState) == nil { return errors.New("SourceStack returned nil") } return nil } //SourceStack by default just returns the property on GameState with the name //passed to DefaultConfig by WithSourceProperty. If that is not sufficient, //override this in your embedding struct. func (m *MoveCountComponents) SourceStack(state boardgame.State) boardgame.Stack { config := m.CustomConfiguration() stackName, ok := config[configPropSourceProperty] if !ok { return nil } strStackName, ok := stackName.(string) if !ok { return nil } stack, err := state.GameState().ReadSetter().StackProp(strStackName) if err != nil { return nil } return stack } //DestinationStack by default just returns the property on GameState with the //name passed to DefaultConfig by WithDestinationProperty. If that is not sufficient, //override this in your embedding struct. func (m *MoveCountComponents) DestinationStack(state boardgame.State) boardgame.Stack { config := m.CustomConfiguration() stackName, ok := config[configPropDestinationProperty] if !ok { return nil } strStackName, ok := stackName.(string) if !ok { return nil } stack, err := state.GameState().ReadSetter().StackProp(strStackName) if err != nil { return nil } return stack } //stacks returns the source and desitnation so you don't have to do the cast. func (m *MoveCountComponents) stacks(state boardgame.ImmutableState) (source, destination boardgame.Stack) { //TODO: this is a total hack mState := state.(boardgame.State) stacker, ok := m.TopLevelStruct().(sourceDestinationStacker) if !ok { return nil, nil } return stacker.SourceStack(mState), stacker.DestinationStack(mState) } func (m *MoveCountComponents) stackNames(state boardgame.ImmutableState) (starter, destination string) { var sourceStack boardgame.ImmutableStack var destinationStack boardgame.ImmutableStack if state != nil { sourceStack, destinationStack = m.stacks(state) } return stackName(m, configPropSourceProperty, sourceStack, state), stackName(m, configPropDestinationProperty, destinationStack, state) } //Legal checks that source and destiantion stacks exist, that enough components //to move exist. func (m *MoveCountComponents) Legal(state boardgame.ImmutableState, proposer boardgame.PlayerIndex) error { if err := m.ApplyCountTimes.Legal(state, proposer); err != nil { return err } source, destination := m.stacks(state) if source == nil { return errors.New("Source was nil") } if destination == nil { return errors.New("Destination was nil") } if source.NumComponents() < 1 { return errors.New("the stack to draw from doesn't have any components to move") } if destination.SlotsRemaining() < 1 { return errors.New("the destination stack doesn't have any slots to move the component to") } return nil } //Apply by default moves one component from SourceStack() to //DestinationStack(). You likely do not need to override this method. func (m *MoveCountComponents) Apply(state boardgame.State) error { source, destination := m.stacks(state) if source == nil { return errors.New("Source was nil") } if destination == nil { return errors.New("Destination was nil") } first := source.First() if first == nil { return errors.New("unexpected error: no first object to move") } return first.MoveToNextSlot(destination) } //FallbackName returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveCountComponents) FallbackName(g *boardgame.GameManager) string { source, destination := m.stackNames(g.ExampleState()) return "Move " + targetCountString(m.TopLevelStruct()) + " Components From " + source + " To " + destination } //FallbackHelpText returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveCountComponents) FallbackHelpText() string { source, destination := m.stackNames(nil) return "Moves " + targetCountString(m.TopLevelStruct()) + " components from " + source + " to " + destination } //MoveComponentsUntilCountReached is a move that will move components, one at //a time, from SourceStack() to DestinationStack() until the target stack is //up to having TargetCount components in it. See also //MoveComponentsUntilCountLeft for a slightly different end condition. // //boardgame:codegen type MoveComponentsUntilCountReached struct { MoveCountComponents } //Count returns the number of components in DestinationStack(). func (m *MoveComponentsUntilCountReached) Count(state boardgame.ImmutableState) int { _, targetStack := m.stacks(state) if targetStack == nil { return 0 } return targetStack.NumComponents() } //FallbackName returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveComponentsUntilCountReached) FallbackName(g *boardgame.GameManager) string { source, destination := m.stackNames(g.ExampleState()) return "Move Components From " + source + " Until " + destination + " Has " + targetCountString(m.TopLevelStruct()) } //FallbackHelpText returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveComponentsUntilCountReached) FallbackHelpText() string { source, destination := m.stackNames(nil) return "Moves components from " + source + " to " + destination + " until " + destination + " has " + targetCountString(m.TopLevelStruct()) } //MoveComponentsUntilCountLeft is a move that will move components, one at a //time, from SourceStack() to DestinationStack() until the source stack is //down to having TargetCount components in it. Its primary difference from //MoveComponentsUntilCountReached is that its target is based on reducing the //size of SourceStack to a target size. // //boardgame:codegen type MoveComponentsUntilCountLeft struct { MoveCountComponents } //Count returns the number of components in the SourceStack(). func (m *MoveComponentsUntilCountLeft) Count(state boardgame.ImmutableState) int { targetStack, _ := m.stacks(state) if targetStack == nil { return 0 } return targetStack.NumComponents() } //FallbackName returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveComponentsUntilCountLeft) FallbackName(g *boardgame.GameManager) string { source, destination := m.stackNames(g.ExampleState()) return "Move Components To " + destination + " Until " + source + " Has " + targetCountString(m.TopLevelStruct()) } //FallbackHelpText returns a string based on the names of the player //stack name, game stack name, and target count. func (m *MoveComponentsUntilCountLeft) FallbackHelpText() string { source, destination := m.stackNames(nil) return "Moves components from " + source + " to " + destination + " until " + source + " has " + targetCountString(m.TopLevelStruct()) + " left" } //MoveAllComponents is simply a MoveComponentsUntilCountLeft that overrides //TargetCount() to return 0. It's effectively the equivalent of //stack.MoveAllTo, just broken into individual moves. A simple convenience //since that combination is common. // //boardgame:codegen type MoveAllComponents struct { MoveComponentsUntilCountLeft } //TargetCount returns 0, no matter what was passed with WithTargetCount. This //is the primary behavior of this move, compared to //MoveComponentsUntilCountLeft. func (m *MoveAllComponents) TargetCount(state boardgame.ImmutableState) int { return 0 } //FallbackName returns "Move All Components From SOURCESTACKNAME To //DESTINATIONSTACKNAME" func (m *MoveAllComponents) FallbackName(g *boardgame.GameManager) string { source, destination := m.stackNames(g.ExampleState()) return "Move All Components From " + source + " To " + destination } //FallbackHelpText returns "Moves all components from SOURCESTACKNAME to //DESTINATIONSTACKNAME" func (m *MoveAllComponents) FallbackHelpText() string { source, destination := m.stackNames(nil) return "Moves all components from " + source + " to " + destination }
{'content_hash': '007d2c26f0bdfdefb2242e6be620f3f1', 'timestamp': '', 'source': 'github', 'line_count': 320, 'max_line_length': 145, 'avg_line_length': 30.8, 'alnum_prop': 0.7607548701298701, 'repo_name': 'jkomoros/boardgame', 'id': '3b0e8bfe50224c8a4aee4ed5a3e3456117ba0634', 'size': '9856', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'moves/move_components.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '2075210'}, {'name': 'HTML', 'bytes': '4089'}, {'name': 'JavaScript', 'bytes': '214737'}, {'name': 'TSQL', 'bytes': '1883'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Axis2/C: Member List</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> <h1>axis2_svc_skeleton Member List</h1>This is the complete list of members for <a class="el" href="structaxis2__svc__skeleton.html">axis2_svc_skeleton</a>, including all inherited members.<p><table> <tr class="memlist"><td><a class="el" href="structaxis2__svc__skeleton.html#599e6715f5ab52169b173654a4baff55">func_array</a></td><td><a class="el" href="structaxis2__svc__skeleton.html">axis2_svc_skeleton</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="structaxis2__svc__skeleton.html#94510b1f879d2402c1402142d75f948c">ops</a></td><td><a class="el" href="structaxis2__svc__skeleton.html">axis2_svc_skeleton</a></td><td></td></tr> </table><hr size="1"><address style="text-align: right;"><small>Generated on Fri Apr 17 11:49:48 2009 for Axis2/C by&nbsp; <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address> </body> </html>
{'content_hash': '9652671838db836e34f4cd1b90bcc0bd', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 229, 'avg_line_length': 54.857142857142854, 'alnum_prop': 0.6358506944444444, 'repo_name': 'loentar/axis2c-unofficial', 'id': '1481084ec00da8b815685ece0c13d7161bac1e40', 'size': '2304', 'binary': False, 'copies': '1', 'ref': 'refs/heads/axis2c-1.6.0', 'path': 'xdocs/api/html/structaxis2__svc__skeleton-members.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '622'}, {'name': 'C', 'bytes': '5488171'}, {'name': 'C++', 'bytes': '903476'}, {'name': 'CSS', 'bytes': '27555'}, {'name': 'HTML', 'bytes': '11535854'}, {'name': 'JavaScript', 'bytes': '3212'}, {'name': 'Makefile', 'bytes': '58149'}, {'name': 'Objective-C', 'bytes': '3919'}, {'name': 'PHP', 'bytes': '10231'}, {'name': 'Perl', 'bytes': '2977'}, {'name': 'Shell', 'bytes': '12296'}]}
use mockall::*; // mock! should allow doc comments in all reasonable positions. This test // ensures that the code will compile. mockall_derive has a unit test to ensure // that the doc comments are correctly placed. trait Tr { fn bar(&self); } mock!{ /// Struct docs pub Foo { /// Method docs fn foo(&self); } /// Trait docs impl Tr for Foo { /// Trait method docs fn bar(&self); } }
{'content_hash': '308088b530d970073a7de692cdb87b2d', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 80, 'avg_line_length': 20.454545454545453, 'alnum_prop': 0.5911111111111111, 'repo_name': 'asomers/mockall', 'id': '59173ca538ec70c26c55077cba444adf8d7bc1ee', 'size': '507', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'mockall/tests/mock_docs.rs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Rust', 'bytes': '425438'}, {'name': 'Shell', 'bytes': '893'}]}
package androidx.appsearch.platformstorage.converter; import android.app.appsearch.AppSearchManager; import android.os.Build; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.annotation.RestrictTo; import androidx.appsearch.platformstorage.PlatformStorage; import androidx.core.util.Preconditions; /** * Translates a Jetpack {@link androidx.appsearch.platformstorage.PlatformStorage.SearchContext} * into a platform {@link android.app.appsearch.AppSearchManager.SearchContext}. * @hide */ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(Build.VERSION_CODES.S) public final class SearchContextToPlatformConverter { private SearchContextToPlatformConverter() {} /** * Translates a Jetpack {@link androidx.appsearch.platformstorage.PlatformStorage.SearchContext} * into a platform {@link android.app.appsearch.AppSearchManager.SearchContext}. */ @NonNull public static AppSearchManager.SearchContext toPlatformSearchContext( @NonNull PlatformStorage.SearchContext jetpackSearchContext) { Preconditions.checkNotNull(jetpackSearchContext); return new AppSearchManager.SearchContext.Builder(jetpackSearchContext.getDatabaseName()) .build(); } }
{'content_hash': 'cf90661c509f4c22045f9cfde57a88b7', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 100, 'avg_line_length': 36.57142857142857, 'alnum_prop': 0.784375, 'repo_name': 'AndroidX/androidx', 'id': '49b0564691e06b646061e1f76921f55a0ef703e9', 'size': '1895', 'binary': False, 'copies': '3', 'ref': 'refs/heads/androidx-main', 'path': 'appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchContextToPlatformConverter.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AIDL', 'bytes': '263978'}, {'name': 'ANTLR', 'bytes': '19860'}, {'name': 'C', 'bytes': '4764'}, {'name': 'C++', 'bytes': '9020585'}, {'name': 'CMake', 'bytes': '11999'}, {'name': 'HTML', 'bytes': '21175'}, {'name': 'Java', 'bytes': '59499889'}, {'name': 'JavaScript', 'bytes': '1343'}, {'name': 'Kotlin', 'bytes': '66123157'}, {'name': 'Python', 'bytes': '292398'}, {'name': 'Shell', 'bytes': '167367'}, {'name': 'Swift', 'bytes': '3153'}, {'name': 'TypeScript', 'bytes': '7599'}]}