text
stringlengths
2
1.04M
meta
dict
from flask import g, Blueprint, request from flask.ext.login import login_required, login_user from social.actions import do_auth, do_complete, do_disconnect from social.apps.flask_app.utils import strategy social_auth = Blueprint('social', __name__) @social_auth.route('/login/<string:backend>/', methods=('GET', 'POST')) @strategy('social.complete') def auth(backend): return do_auth(g.strategy) @social_auth.route('/complete/<string:backend>/', methods=('GET', 'POST')) @strategy('social.complete') def complete(backend, *args, **kwargs): """Authentication complete view, override this view if transaction management doesn't suit your needs.""" return do_complete(g.strategy, login=do_login, user=g.user, *args, **kwargs) @social_auth.route('/disconnect/<string:backend>/', methods=('POST',)) @social_auth.route('/disconnect/<string:backend>/<int:association_id>/', methods=('POST',)) @login_required @strategy() def disconnect(backend, association_id=None): """Disconnects given backend from current logged in user.""" return do_disconnect(g.strategy, g.user, association_id) def do_login(strategy, user, social_user): return login_user(user, remember=request.cookies.get('remember') or request.args.get('remember') or request.form.get('remember') or False)
{ "content_hash": "7c20e36a5515e0d32761d640c5cf59f3", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 75, "avg_line_length": 36.333333333333336, "alnum_prop": 0.666196189131969, "repo_name": "tutumcloud/python-social-auth", "id": "d12e28358c8bbfcc04842757da5db4c7b233de39", "size": "1417", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "social/apps/flask_app/routes.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "54" }, { "name": "Makefile", "bytes": "4630" }, { "name": "Python", "bytes": "554662" }, { "name": "Shell", "bytes": "67" } ], "symlink_target": "" }
{- | Module : Bio.Motions.Format.DumpSerialisation Description : Dump to proto message serialisation License : Apache Stability : experimental Portability : unportable -} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} module Bio.Motions.Format.DumpSerialisation where import Data.Maybe import qualified Data.Vector.Unboxed as U import qualified Data.Sequence as S import Linear import Text.ProtocolBuffers.Basic import qualified Bio.Motions.Format.Proto.Header as ProtoHeader import qualified Bio.Motions.Format.Proto.Keyframe as ProtoKeyframe import qualified Bio.Motions.Format.Proto.Keyframe.Binder as ProtoBinder import qualified Bio.Motions.Format.Proto.Callback as ProtoCallback import Bio.Motions.Format.Proto.Delta import Bio.Motions.Format.Proto.Keyframe.Chain import Bio.Motions.Format.Proto.Point import Bio.Motions.Format.Proto.Header.ChainDescription.BeadDescription.Binding import Bio.Motions.Format.Proto.Header.ChainDescription.BeadDescription import Bio.Motions.Format.Proto.Header.ChainDescription import Bio.Motions.Representation.Dump import Bio.Motions.Types import Bio.Motions.Callback.Class import Bio.Motions.Callback.Serialisation serialiseMove :: Move -> Callbacks -> StepCounter -> Delta serialiseMove Move{..} cbs counter = Delta { from = Just $ makePoint moveFrom , disp = Just $ makePoint moveDiff , callbacks = S.fromList $ serialiseCallbacks cbs , step_counter = Just counter } getHeader :: String -- ^Simulation name -> String -- ^Simulation description -> [String] -- ^Binder types names -> [String] -- ^Chain names -> Dump -- ^Simulation state -> ProtoHeader.Header getHeader simulationName simulationDescription binderTypesNames chainNames Dump{..} = ProtoHeader.Header { simulation_name = Just $ uFromString simulationName , simulation_description = Just $ uFromString simulationDescription , binders_types_count = Just $ fromIntegral $ countBinderTypes dumpChains , chains = S.fromList $ zipWith headerSerialiseChain chainNames dumpChains , binder_types_names = S.fromList $ map uFromString binderTypesNames } getKeyframe :: Dump -> Callbacks -> StepCounter -> ProtoKeyframe.Keyframe getKeyframe Dump{..} cbs counter = ProtoKeyframe.Keyframe { binders = S.fromList $ serialiseBinders dumpBinders , chains = S.fromList $ map keyframeSerialiseChain dumpChains , callbacks = S.fromList $ serialiseCallbacks cbs , step_counter = Just counter } headerSerialiseChain :: String -> [DumpBeadInfo] -> ChainDescription headerSerialiseChain name beads = ChainDescription { chain_name = Just $ uFromString name , beads = S.fromList [BeadDescription $ S.fromList $ serialiseEnergyVector dumpBeadEV | DumpBeadInfo{..} <- beads] } countBinderTypes :: [[DumpBeadInfo]] -> Int countBinderTypes ((DumpBeadInfo{..}:_):_) = U.length $ getEnergyVector dumpBeadEV countBinderTypes _ = error "No chains, or empty chain" keyframeSerialiseChain :: [DumpBeadInfo] -> Chain keyframeSerialiseChain beads = Chain{bead_positions = S.fromList [makePoint dumpBeadPosition | DumpBeadInfo{..} <- beads]} serialiseBinders :: [BinderInfo] -> [ProtoBinder.Binder] serialiseBinders binderInfos = [ProtoBinder.Binder (Just $ fromIntegral binderType) (Just $ makePoint pos) | BinderInfo pos (BinderType binderType) <- binderInfos] serialiseEnergyVector :: EnergyVector -> [Binding] serialiseEnergyVector (EnergyVector ev) = [Binding (Just index) (Just (fromIntegral force)) | (index, force) <- zip [0..] $ U.toList ev] makePoint :: Vec3 -> Point makePoint p = Point{..} where V3 x y z = Just . fromIntegral <$> p serialiseCallbacks :: Callbacks -> [ProtoCallback.Callback] serialiseCallbacks (a, b) = catMaybes (ser a ++ ser b) where ser = map (\(CallbackResult x) -> serialiseCallback (getCallbackName x) x)
{ "content_hash": "2fc8e7e9d60388e4ad30a113d5fd863a", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 118, "avg_line_length": 39.386138613861384, "alnum_prop": 0.7410759175465058, "repo_name": "Motions/motions", "id": "1388bdf104bc20cb7568377fef08890f1b99d8ac", "size": "3978", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Bio/Motions/Format/DumpSerialisation.hs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Haskell", "bytes": "264604" } ], "symlink_target": "" }
module Azure::Network::Mgmt::V2019_12_01 module Models # # Backend Address Pool of an application gateway. # class ApplicationGatewayBackendAddressPool < SubResource include MsRestAzure # @return [Array<NetworkInterfaceIPConfiguration>] Collection of # references to IPs defined in network interfaces. attr_accessor :backend_ipconfigurations # @return [Array<ApplicationGatewayBackendAddress>] Backend addresses. attr_accessor :backend_addresses # @return [ProvisioningState] The provisioning state of the backend # address pool resource. Possible values include: 'Succeeded', # 'Updating', 'Deleting', 'Failed' attr_accessor :provisioning_state # @return [String] Name of the backend address pool that is unique within # an Application Gateway. attr_accessor :name # @return [String] A unique read-only string that changes whenever the # resource is updated. attr_accessor :etag # @return [String] Type of the resource. attr_accessor :type # # Mapper for ApplicationGatewayBackendAddressPool class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'ApplicationGatewayBackendAddressPool', type: { name: 'Composite', class_name: 'ApplicationGatewayBackendAddressPool', model_properties: { id: { client_side_validation: true, required: false, serialized_name: 'id', type: { name: 'String' } }, backend_ipconfigurations: { client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.backendIPConfigurations', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'NetworkInterfaceIPConfigurationElementType', type: { name: 'Composite', class_name: 'NetworkInterfaceIPConfiguration' } } } }, backend_addresses: { client_side_validation: true, required: false, serialized_name: 'properties.backendAddresses', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'ApplicationGatewayBackendAddressElementType', type: { name: 'Composite', class_name: 'ApplicationGatewayBackendAddress' } } } }, provisioning_state: { client_side_validation: true, required: false, read_only: true, serialized_name: 'properties.provisioningState', type: { name: 'String' } }, name: { client_side_validation: true, required: false, serialized_name: 'name', type: { name: 'String' } }, etag: { client_side_validation: true, required: false, read_only: true, serialized_name: 'etag', type: { name: 'String' } }, type: { client_side_validation: true, required: false, read_only: true, serialized_name: 'type', type: { name: 'String' } } } } } end end end end
{ "content_hash": "b145cdad5763ba7648851f8f611660cc", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 85, "avg_line_length": 32.725190839694655, "alnum_prop": 0.47539071611849776, "repo_name": "Azure/azure-sdk-for-ruby", "id": "18f5f802e891755def591d17a455a2eda0a95f20", "size": "4451", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "management/azure_mgmt_network/lib/2019-12-01/generated/azure_mgmt_network/models/application_gateway_backend_address_pool.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "345216400" }, { "name": "Shell", "bytes": "305" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2013 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.bluetoothlegatt" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="18" android:targetSdkVersion="25" /> <!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle --> <!-- Declare this required feature if you want to make the app available to BLE-capable devices only. If you want to make your app available to devices that don't support BLE, you should omit this in the manifest. Instead, determine BLE capability by using PackageManager.hasSystemFeature(FEATURE_BLUETOOTH_LE) --> <uses-feature android:name="android.hardware.bluetooth_le" android:required="true" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-feature android:name="android.hardware.camera" /> <meta-data android:name="android.support.VERSION" android:value="25.3.1" /> <!-- Include required permissions for Google Mobile Ads to run --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Optional permission for Analytics to run. --> <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- Permissions required for GCM --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <permission android:name="com.example.android.bluetoothlegatt.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="com.example.android.bluetoothlegatt.permission.C2D_MESSAGE" /> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <application android:name="android.support.multidex.MultiDexApplication" android:icon="@drawable/logo" android:label="@string/app_name" android:largeHeap="true" android:theme="@style/AppTheme" > <activity android:name="com.example.android.milestone.bluetoothGattBLE.DeviceScanActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Holo.Light" /> <activity android:name="com.example.android.milestone.bluetoothGattBLE.DeviceControlActivity" android:theme="@android:style/Theme.Holo.Light" /> <service android:name="com.example.android.milestone.bluetoothGattBLE.BluetoothLeService" android:enabled="true" android:theme="@android:style/Theme.Holo.Light" /> <activity android:name="com.example.android.milestone.Splash" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.example.android.milestone.MainActivity" android:label="@string/title_activity_test" /> <activity android:name="com.example.android.milestone.MenuActivity" /> <activity android:name="com.example.android.milestone.SendActivity" /> <activity android:name="com.example.android.milestone.RegisterActivity" /> <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" /> <activity android:name="com.google.android.gms.appinvite.PreviewActivity" android:exported="true" android:theme="@style/Theme.AppInvite.Preview" > <intent-filter> <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity" android:excludeFromRecents="true" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <!-- Service handling Google Sign-In user revocation. For apps that do not integrate with Google Sign-In, this service will never be started. --> <service android:name="com.google.android.gms.auth.api.signin.RevocationBoundService" android:exported="true" android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" /> <receiver android:name="com.google.android.gms.cast.framework.media.MediaIntentReceiver" /> <service android:name="com.google.android.gms.cast.framework.media.MediaNotificationService" /> <service android:name="com.google.android.gms.cast.framework.ReconnectionService" /> <!-- FirebaseMessagingService performs security checks at runtime, no need for explicit permissions despite exported="true" --> <service android:name="com.google.firebase.messaging.FirebaseMessagingService" android:exported="true" > <intent-filter android:priority="-500" > <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="com.google.android.gms.tagmanager.TagManagerService" android:enabled="true" android:exported="false" /> <activity android:name="com.google.android.gms.tagmanager.TagManagerPreviewActivity" android:exported="true" android:noHistory="true" > <!-- optional, removes the previewActivity from the activity stack. --> <intent-filter> <data android:scheme="tagmanager.c.com.example.android.bluetoothlegatt" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity> <receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver" android:enabled="true" android:exported="false" > </receiver> <receiver android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" android:enabled="true" android:exported="true" android:permission="android.permission.INSTALL_PACKAGES" > <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> <service android:name="com.google.android.gms.measurement.AppMeasurementService" android:enabled="true" android:exported="false" /> <service android:name="com.google.android.gms.measurement.AppMeasurementJobService" android:enabled="true" android:exported="false" android:permission="android.permission.BIND_JOB_SERVICE" /> <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.example.android.bluetoothlegatt" /> </intent-filter> </receiver> <!-- Internal (not exported) receiver used by the app to start its own exported services without risk of being spoofed. --> <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" /> <!-- FirebaseInstanceIdService performs security checks at runtime, no need for explicit permissions despite exported="true" --> <service android:name="com.google.firebase.iid.FirebaseInstanceIdService" android:exported="true" > <intent-filter android:priority="-500" > <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> <provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:authorities="com.example.android.bluetoothlegatt.firebaseinitprovider" android:exported="false" android:initOrder="100" /> <activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> </manifest>
{ "content_hash": "b1c95e44f20c86249fbc631b451b4569", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 129, "avg_line_length": 44.91596638655462, "alnum_prop": 0.6572497661365763, "repo_name": "Milestone2/Remote-Medical-Assistant-App", "id": "6a9583dc3b853d5ea32335a7c44bd9cd56b81073", "size": "10690", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Application/build/intermediates/manifests/full/debug/AndroidManifest.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1637546" } ], "symlink_target": "" }
<?xml version="1.0"?> <block_scheme scheme="1.0"> <settings> <default_language>en</default_language> </settings> <layout edition="ULTIMATE,MULTIVENDOR"> <name>Widget mode</name> <width>16</width> <layout_width>fluid</layout_width> <min_width>280</min_width> <max_width>3000</max_width> <style_id>Modern</style_id> </layout> <location dispatch="default" is_default="1" layout_id="2" object_ids="" position="10" lang_code="en" name="Default" title="" meta_description="" meta_keywords=""> <containers> <container container_id="193" location_id="49" position="TOP_PANEL" width="16" user_class="top-grid" status="D" /> <container container_id="194" location_id="49" position="HEADER" width="16" user_class="header-widget-grid" status="A"> <grid width="16" user_class="search-widget-block-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[template]]></type> <properties> <template><![CDATA[blocks/static_templates/search.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Search]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[top-search]]></user_class> <order><![CDATA[2]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Поиск]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="top-logo-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="LEFT" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[languages]]></type> <properties> <template><![CDATA[blocks/languages.tpl]]></template> <text><![CDATA[]]></text> <format><![CDATA[name]]></format> <dropdown_limit><![CDATA[0]]></dropdown_limit> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Languages]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[top-languages]]></user_class> <order><![CDATA[2]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Языки]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[currencies]]></type> <properties> <template><![CDATA[blocks/currencies.tpl]]></template> <text><![CDATA[]]></text> <format><![CDATA[symbol]]></format> <dropdown_limit><![CDATA[3]]></dropdown_limit> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Currencies]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[top-currencies]]></user_class> <order><![CDATA[3]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Валюта]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="cart-content-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="RIGHT" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[cart_content]]></type> <properties> <template><![CDATA[blocks/cart_content.tpl]]></template> <display_bottom_buttons><![CDATA[Y]]></display_bottom_buttons> <display_delete_icons><![CDATA[Y]]></display_delete_icons> <products_links_type><![CDATA[thumb]]></products_links_type> <generate_block_title><![CDATA[Y]]></generate_block_title> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Cart content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[top-cart-content]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Корзина]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[my_account]]></type> <properties> <template><![CDATA[blocks/my_account.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[My Account]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/onclick_dropdown.tpl]]></wrapper> <user_class><![CDATA[top-my-account]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Мой профиль]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="16" user_class="top-menu-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[categories]]></type> <properties> <template><![CDATA[blocks/categories/categories_dropdown_horizontal.tpl]]></template> <dropdown_second_level_elements><![CDATA[12]]></dropdown_second_level_elements> <dropdown_third_level_elements><![CDATA[6]]></dropdown_third_level_elements> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Top menu]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[full_tree_cat]]></filling> <parent_element_id><![CDATA[0]]></parent_element_id> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[top-menu]]></user_class> <order><![CDATA[2]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Меню верхней части]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[full_tree_cat]]></filling> <parent_element_id><![CDATA[0]]></parent_element_id> </items> </content> </item> </contents> </block> </blocks> </grid> </container> <container container_id="195" location_id="49" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="196" location_id="49" position="FOOTER" width="16" user_class="ty-footer-grid" status="D" /> </containers> </location> <location dispatch="profiles.success_add" is_default="0" layout_id="2" object_ids="" position="90" lang_code="en" name="Successful registration" title="" meta_description="" meta_keywords=""> <containers> <container container_id="239" location_id="60" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="238" location_id="60" position="HEADER" width="16" user_class="" status="A" /> <container container_id="237" location_id="60" position="TOP_PANEL" width="16" user_class="" status="A" /> <container container_id="240" location_id="60" position="FOOTER" width="16" user_class="" status="A" /> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Успешная регистрация</name> </translation> </translations> </location> <location dispatch="no_page" is_default="0" layout_id="2" object_ids="" position="160" lang_code="en" name="404" title="Page not found" meta_description="" meta_keywords=""> <containers> <container container_id="235" location_id="59" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[template]]></type> <properties> <template><![CDATA[blocks/static_templates/404.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[404]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[404]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="234" location_id="59" position="HEADER" width="16" user_class="" status="A" /> <container container_id="233" location_id="59" position="TOP_PANEL" width="16" user_class="" status="A" /> <container container_id="236" location_id="59" position="FOOTER" width="16" user_class="" status="A" /> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[Page not found]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>404</name> </translation> </translations> </location> <location dispatch="auth" is_default="0" layout_id="2" object_ids="" position="70" lang_code="en" name="Auth" title="" meta_description="" meta_keywords=""> <containers> <container container_id="231" location_id="58" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="main-content-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="auth-information-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[template]]></type> <properties> <template><![CDATA[blocks/static_templates/auth_info.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Auth information]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Информация для авторизации]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="230" location_id="58" position="HEADER" width="16" user_class="" status="A" /> <container container_id="229" location_id="58" position="TOP_PANEL" width="16" user_class="" status="A" /> <container container_id="232" location_id="58" position="FOOTER" width="16" user_class="" status="A" /> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Страница авторизации</name> </translation> </translations> </location> <location dispatch="profiles" is_default="0" layout_id="2" object_ids="" position="80" lang_code="en" name="Profiles" title="" meta_description="" meta_keywords=""> <containers> <container container_id="227" location_id="57" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="main-content-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[2]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="8" user_class="profile-information-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[template]]></type> <properties> <template><![CDATA[blocks/static_templates/profile_info.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Profile information]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Личная информация]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="226" location_id="57" position="HEADER" width="16" user_class="" status="A" /> <container container_id="225" location_id="57" position="TOP_PANEL" width="16" user_class="" status="A" /> <container container_id="228" location_id="57" position="FOOTER" width="16" user_class="" status="A" /> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Страница личной информации</name> </translation> </translations> </location> <location dispatch="index.index" is_default="0" layout_id="2" object_ids="" position="20" lang_code="en" name="Homepage" title="Shopping Cart Software &amp; Ecommerce Software Solutions by CS-Cart" meta_description="Secure and full-featured Online Shopping Cart Software with the complete set of powerful ecommerce options to create your own online store with minimum efforts involved." meta_keywords="shopping cart, software, ecommerce software, online store"> <containers> <container container_id="223" location_id="56" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[banners]]></type> <properties> <template><![CDATA[addons/banners/blocks/carousel.tpl]]></template> <navigation><![CDATA[D]]></navigation> <delay><![CDATA[7]]></delay> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main banners]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[newest]]></filling> <period><![CDATA[A]]></period> <last_days><![CDATA[10]]></last_days> <limit><![CDATA[3]]></limit> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[homepage-banners]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главные баннеры]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[newest]]></filling> <period><![CDATA[A]]></period> <last_days><![CDATA[10]]></last_days> <limit><![CDATA[3]]></limit> </items> </content> </item> </contents> </block> <block> <type><![CDATA[products]]></type> <properties> <template><![CDATA[blocks/products/products_scroller.tpl]]></template> <show_price><![CDATA[N]]></show_price> <enable_quick_view><![CDATA[N]]></enable_quick_view> <not_scroll_automatically><![CDATA[Y]]></not_scroll_automatically> <speed><![CDATA[400]]></speed> <scroll_per_page><![CDATA[Y]]></scroll_per_page> <pause_delay><![CDATA[3]]></pause_delay> <item_quantity><![CDATA[4]]></item_quantity> <thumbnail_width><![CDATA[160]]></thumbnail_width> <hide_add_to_cart_button><![CDATA[Y]]></hide_add_to_cart_button> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Hot deals]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[newest]]></filling> <period><![CDATA[A]]></period> <last_days><![CDATA[10]]></last_days> <limit><![CDATA[6]]></limit> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[homepage-hotdeals]]></user_class> <order><![CDATA[2]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Горячие предложения]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[newest]]></filling> <period><![CDATA[A]]></period> <last_days><![CDATA[10]]></last_days> <limit><![CDATA[6]]></limit> </items> </content> </item> </contents> </block> <block> <type><![CDATA[products]]></type> <properties> <template><![CDATA[blocks/products/products_multicolumns.tpl]]></template> <item_number><![CDATA[N]]></item_number> <number_of_columns><![CDATA[4]]></number_of_columns> <hide_add_to_cart_button><![CDATA[Y]]></hide_add_to_cart_button> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[On Sale]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[on_sale]]></filling> <limit><![CDATA[8]]></limit> <cid><![CDATA[]]></cid> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[homepage-on-sale]]></user_class> <order><![CDATA[3]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Распродажа]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[on_sale]]></filling> <limit><![CDATA[8]]></limit> <cid><![CDATA[]]></cid> </items> </content> </item> </contents> </block> <block> <type><![CDATA[our_brands]]></type> <properties> <template><![CDATA[blocks/our_brands.tpl]]></template> <not_scroll_automatically><![CDATA[Y]]></not_scroll_automatically> <speed><![CDATA[400]]></speed> <scroll_per_page><![CDATA[Y]]></scroll_per_page> <pause_delay><![CDATA[3]]></pause_delay> <item_quantity><![CDATA[7]]></item_quantity> <thumbnail_width><![CDATA[75]]></thumbnail_width> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Our brands]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[homepage-our-brands]]></user_class> <order><![CDATA[4]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Бренды]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[smarty_block]]></type> <properties> <template><![CDATA[blocks/smarty_block.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Benefits & Guarantees]]></name> <object_type><![CDATA[]]></object_type> <content> <content><![CDATA[<div class="ty-benefits-guarantees clearfix"> <ul class="ty-benefits-guarantees__list"> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=6"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-low-price"></i> <h4 class="ty-benefits-guarantees__title"><strong>Low price</strong> Guarantee</h4> </a> </li> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=5"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-free-shipping"></i> <h4 class="ty-benefits-guarantees__title"><strong>Free</strong> shipping</h4> <p class="ty-benefits-guarantees__txt">Orders $19 and up.</p> </a> </li> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=4"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-free-returns"></i> <h4 class="ty-benefits-guarantees__title"><strong>Free</strong> returns</h4> </a> </li> </ul> </div>]]></content> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[homepage-benefits-guarantees]]></user_class> <order><![CDATA[5]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Выгода и Гарантии]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <content><![CDATA[<div class="ty-benefits-guarantees clearfix"> <ul class="ty-benefits-guarantees__list"> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=6"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-low-price"></i> <h4 class="ty-benefits-guarantees__title"><strong>Low price</strong> Guarantee</h4> </a> </li> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=5"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-free-shipping"></i> <h4 class="ty-benefits-guarantees__title"><strong>Free</strong> shipping</h4> <p class="ty-benefits-guarantees__txt">Orders $19 and up.</p> </a> </li> <li class="ty-benefits-guarantees__item"> <a class="ty-benefits-guarantees__a" href="{"pages.view?page_id=4"|fn_url}"> <i class="ty-benefits-guarantees__icon ty-benefits-free-returns"></i> <h4 class="ty-benefits-guarantees__title"><strong>Free</strong> returns</h4> </a> </li> </ul> </div>]]></content> </content> </item> </contents> </block> </blocks> </grid> </container> <container container_id="222" location_id="56" position="HEADER" width="16" user_class="" status="A" /> <container container_id="221" location_id="56" position="TOP_PANEL" width="16" user_class="" status="A" /> <container container_id="224" location_id="56" position="FOOTER" width="16" user_class="" status="A" /> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[Интернет магазин, программное обеспечение для электронной коммерции]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[Защищенное и многофункциональное программное обеспечение для создания интернет-магазина, включающие в себя большое количество возможностей для электронной коммерции.]]></meta_description> <name>Домашняя страница</name> </translation> </translations> </location> <location dispatch="checkout.complete" is_default="0" layout_id="2" object_ids="" position="100" lang_code="en" name="Order landing page" title="" meta_description="" meta_keywords=""> <containers> <container container_id="219" location_id="55" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="218" location_id="55" position="HEADER" width="16" user_class="" status="A" /> <container container_id="217" location_id="55" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="220" location_id="55" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Целевая страница оформления заказа</name> </translation> </translations> </location> <location dispatch="checkout" is_default="0" layout_id="2" object_ids="" position="60" lang_code="en" name="Checkout" title="" meta_description="" meta_keywords=""> <containers> <container container_id="215" location_id="54" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="12" user_class="main-content-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="4" user_class="side-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[checkout]]></type> <properties> <template><![CDATA[blocks/checkout/summary.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Order summary]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[ty-order-summary]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Сумма заказа]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[checkout]]></type> <properties> <template><![CDATA[blocks/checkout/products_in_cart.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Products in your order]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[order-products]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Товаров в Вашем заказе]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[checkout]]></type> <properties> <template><![CDATA[blocks/checkout/order_info.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Order information]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[order-information]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Информация о заказе]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="214" location_id="54" position="HEADER" width="16" user_class="" status="A" /> <container container_id="213" location_id="54" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="216" location_id="54" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Оформить заказ</name> </translation> </translations> </location> <location dispatch="checkout.cart" is_default="0" layout_id="2" object_ids="" position="50" lang_code="en" name="Cart" title="" meta_description="" meta_keywords=""> <containers> <container container_id="211" location_id="53" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="210" location_id="53" position="HEADER" width="16" user_class="" status="A" /> <container container_id="209" location_id="53" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="212" location_id="53" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Корзина</name> </translation> </translations> </location> <location dispatch="pages.view" is_default="0" layout_id="2" object_ids="" position="110" lang_code="en" name="Pages" title="" meta_description="" meta_keywords=""> <containers> <container container_id="206" location_id="52" position="HEADER" width="16" user_class="" status="A" /> <container container_id="207" location_id="52" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="4" user_class="side-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[my_account]]></type> <properties> <template><![CDATA[blocks/my_account.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[My Account]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Мой профиль]]></translation> </translations> <contents /> </block> <block> <type><![CDATA[products]]></type> <properties> <template><![CDATA[blocks/products/products_small_items.tpl]]></template> <item_number><![CDATA[N]]></item_number> <hide_add_to_cart_button><![CDATA[Y]]></hide_add_to_cart_button> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Recently Viewed]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[recent_products]]></filling> <limit><![CDATA[3]]></limit> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[1]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Недавно просмотренные]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[recent_products]]></filling> <limit><![CDATA[3]]></limit> </items> </content> </item> </contents> </block> </blocks> </grid> <grid width="12" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="205" location_id="52" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="208" location_id="52" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Страницы</name> </translation> </translations> </location> <location dispatch="categories.view" is_default="0" layout_id="2" object_ids="" position="40" lang_code="en" name="Categories" title="" meta_description="" meta_keywords=""> <containers> <container container_id="202" location_id="51" position="HEADER" width="16" user_class="" status="A" /> <container container_id="203" location_id="51" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="4" user_class="side-grid" status="A" offset="0" omega="0" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0"> <blocks> <block> <type><![CDATA[product_filters]]></type> <properties> <template><![CDATA[blocks/product_filters/original.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Product filters]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[manually]]></filling> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Фильтры товаров]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[manually]]></filling> </items> </content> </item> </contents> </block> <block> <type><![CDATA[products]]></type> <properties> <template><![CDATA[blocks/products/products_small_items.tpl]]></template> <item_number><![CDATA[N]]></item_number> <hide_add_to_cart_button><![CDATA[Y]]></hide_add_to_cart_button> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Recently Viewed]]></name> <object_type><![CDATA[]]></object_type> <content> <items> <filling><![CDATA[recent_products]]></filling> <limit><![CDATA[3]]></limit> </items> </content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/sidebox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Недавно просмотренные]]></translation> </translations> <contents> <item> <object_id><![CDATA[0]]></object_id> <object_type><![CDATA[]]></object_type> <lang_code><![CDATA[ru]]></lang_code> <content> <items> <filling><![CDATA[recent_products]]></filling> <limit><![CDATA[3]]></limit> </items> </content> </item> </contents> </block> </blocks> </grid> <grid width="12" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[blocks/wrappers/mainbox_general.tpl]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="201" location_id="51" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="204" location_id="51" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Категории</name> </translation> </translations> </location> <location dispatch="products.view" is_default="0" layout_id="2" object_ids="" position="30" lang_code="en" name="Products" title="" meta_description="" meta_keywords=""> <containers> <container container_id="200" location_id="50" position="FOOTER" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> <container container_id="198" location_id="50" position="HEADER" width="16" user_class="" status="A" /> <container container_id="199" location_id="50" position="CONTENT" width="16" user_class="content-grid" status="A"> <grid width="16" user_class="breadcrumbs-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[breadcrumbs]]></type> <properties> <template><![CDATA[common/breadcrumbs.tpl]]></template> </properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Breadcrumbs]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Строка навигации]]></translation> </translations> <contents /> </block> </blocks> </grid> <grid width="16" user_class="main-content-grid" status="A" offset="0" omega="1" alpha="1" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="1"> <blocks> <block> <type><![CDATA[main]]></type> <properties><![CDATA[]]></properties> <lang_code><![CDATA[en]]></lang_code> <name><![CDATA[Main Content]]></name> <object_type><![CDATA[]]></object_type> <content><![CDATA[]]></content> <object_ids><![CDATA[]]></object_ids> <wrapper><![CDATA[]]></wrapper> <user_class><![CDATA[]]></user_class> <order><![CDATA[0]]></order> <status><![CDATA[A]]></status> <translations> <translation lang_code="ru"><![CDATA[Главное содержимое]]></translation> </translations> <contents /> </block> </blocks> </grid> </container> <container container_id="197" location_id="50" position="TOP_PANEL" width="16" user_class="" status="A"> <grid width="16" user_class="" status="A" offset="0" omega="0" alpha="0" wrapper="" content_align="FULL_WIDTH" html_element="div" clear="0" /> </container> </containers> <translations> <translation lang_code="ru"> <meta_keywords><![CDATA[]]></meta_keywords> <page_title><![CDATA[]]></page_title> <meta_description><![CDATA[]]></meta_description> <name>Товары</name> </translation> </translations> </location> </block_scheme>
{ "content_hash": "7a132b7d95f691c19ce0500853cae91b", "timestamp": "", "source": "github", "line_count": 1325, "max_line_length": 465, "avg_line_length": 60.929811320754716, "alnum_prop": 0.40496952881137593, "repo_name": "sandymariscal22/BrandsCsCart", "id": "f37347d8fe8ab51de2bef81f7ed311033c8d32f4", "size": "81675", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public_html/design/themes/responsive/layouts/layouts_widget_mode.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1718867" }, { "name": "JavaScript", "bytes": "1967152" }, { "name": "PHP", "bytes": "15449884" }, { "name": "Python", "bytes": "38608" } ], "symlink_target": "" }
FactoryGirl.define do factory :book do title "MyString" end end
{ "content_hash": "503dc0b6e807d12ceea5bf541ad3f1d0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 21, "avg_line_length": 14.4, "alnum_prop": 0.7083333333333334, "repo_name": "rosylilly/dicer", "id": "0e17ee2d321cfd6e24547adf00a3da5e067036cd", "size": "142", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/rails-3.2/spec/factories/books.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "916" }, { "name": "JavaScript", "bytes": "1822" }, { "name": "Ruby", "bytes": "87840" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Boost.Geometry (aka GGL, Generic Geometry Library)</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head> <table cellpadding="2" width="100%"> <tbody> <tr> <td valign="top"> <img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200"> &nbsp;&nbsp; </td> <td valign="top" align="right"> <a href="http://www.boost.org"> <img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0"> </a> </td> </tr> </tbody> </table> <!-- 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><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceboost.html">boost</a></li><li class="navelem"><a class="el" href="namespaceboost_1_1geometry.html">geometry</a></li><li class="navelem"><a class="el" href="namespaceboost_1_1geometry_1_1resolve__variant.html">resolve_variant</a></li><li class="navelem"><a class="el" href="structboost_1_1geometry_1_1resolve__variant_1_1correct.html">correct</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="structboost_1_1geometry_1_1resolve__variant_1_1correct-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">boost::geometry::resolve_variant::correct&lt; Geometry &gt; Struct Template Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:ae0a9084e73651c26d0ba72e8217fbab5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1geometry_1_1resolve__variant_1_1correct.html#ae0a9084e73651c26d0ba72e8217fbab5">apply</a> (Geometry &amp;geometry)</td></tr> <tr class="separator:ae0a9084e73651c26d0ba72e8217fbab5"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ae0a9084e73651c26d0ba72e8217fbab5"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Geometry &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="structboost_1_1geometry_1_1resolve__variant_1_1correct.html">boost::geometry::resolve_variant::correct</a>&lt; Geometry &gt;::apply </td> <td>(</td> <td class="paramtype">Geometry &amp;&#160;</td> <td class="paramname"><em>geometry</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> </div><!-- contents --> <hr size="1"> <table width="100%"> <tbody> <tr> <td align="left"><small> <p>April 2, 2011</p> </small></td> <td align="right"> <small> Copyright &copy; 2007-2011 Barend Gehrels, Amsterdam, the Netherlands<br> Copyright &copy; 2008-2011 Bruno Lalande, Paris, France<br> Copyright &copy; 2009-2010 Mateusz Loskot, London, UK<br> </small> </td> </tr> </tbody> </table> <address style="text-align: right;"><small> Documentation is generated by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> </small></address> </body> </html>
{ "content_hash": "5e3c83b2ca5d14bf8c0d1caa61c2d307", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 406, "avg_line_length": 41.4375, "alnum_prop": 0.6569704804998923, "repo_name": "FFMG/myoddweb.piger", "id": "8c07725bcb7302a58f702786c983d0f1dc42b018", "size": "4641", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "myodd/boost/libs/geometry/doc/doxy/doxygen_output/html_by_doxygen/structboost_1_1geometry_1_1resolve__variant_1_1correct.html", "mode": "33188", "license": "mit", "language": [ { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "399228" }, { "name": "Batchfile", "bytes": "93889" }, { "name": "C", "bytes": "32256857" }, { "name": "C#", "bytes": "197461" }, { "name": "C++", "bytes": "200544641" }, { "name": "CMake", "bytes": "192771" }, { "name": "CSS", "bytes": "441704" }, { "name": "CWeb", "bytes": "174166" }, { "name": "Common Lisp", "bytes": "24481" }, { "name": "Cuda", "bytes": "52444" }, { "name": "DIGITAL Command Language", "bytes": "33549" }, { "name": "DTrace", "bytes": "2157" }, { "name": "Fortran", "bytes": "1856" }, { "name": "HTML", "bytes": "181677643" }, { "name": "IDL", "bytes": "14" }, { "name": "Inno Setup", "bytes": "9647" }, { "name": "JavaScript", "bytes": "705756" }, { "name": "Lex", "bytes": "1231" }, { "name": "Lua", "bytes": "3332" }, { "name": "M4", "bytes": "259214" }, { "name": "Makefile", "bytes": "1262318" }, { "name": "Max", "bytes": "36857" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "Objective-C", "bytes": "2167778" }, { "name": "Objective-C++", "bytes": "630" }, { "name": "PHP", "bytes": "59030" }, { "name": "PLSQL", "bytes": "22886" }, { "name": "Pascal", "bytes": "75208" }, { "name": "Perl", "bytes": "42080" }, { "name": "PostScript", "bytes": "13803" }, { "name": "PowerShell", "bytes": "11781" }, { "name": "Python", "bytes": "30377308" }, { "name": "QML", "bytes": "593" }, { "name": "QMake", "bytes": "16692" }, { "name": "Rebol", "bytes": "354" }, { "name": "Rich Text Format", "bytes": "6743" }, { "name": "Roff", "bytes": "55661" }, { "name": "Ruby", "bytes": "5532" }, { "name": "SAS", "bytes": "1847" }, { "name": "Shell", "bytes": "783974" }, { "name": "TSQL", "bytes": "1201" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "32117" }, { "name": "Visual Basic", "bytes": "70" }, { "name": "XSLT", "bytes": "552736" }, { "name": "Yacc", "bytes": "19623" } ], "symlink_target": "" }
<html> <head> <link rel="stylesheet" href="assets/css/redesign/slider.css" type="text/css" /> </head> <body> <div class="slider-wrap"> <div class="slider" id="slider"> <div class="holder"> <div class="slide" id="slide-0"><span class="temp">74°</span></div> <div class="slide" id="slide-1"><span class="temp">64°</span></div> <div class="slide" id="slide-2"><span class="temp">82°</span></div> </div> </div> <nav class="slider-nav"> <a href="#slide-0" class="active">Slide 0</a> <a href="#slide-1">Slide 1</a> <a href="#slide-2">Slide 2</a> </nav> </div> </body> <script type="text/javascript" src="assets/js/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="assets/js/redesign/slider.js"></script> </html>
{ "content_hash": "b9ed562c456f7e3ad52cb00e11db3725", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 87, "avg_line_length": 39.91304347826087, "alnum_prop": 0.514161220043573, "repo_name": "tiorica/brunoz", "id": "0bfc83af03a95e2e671241873301c423e3cbc174", "size": "921", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/pages/slider.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1034" }, { "name": "CSS", "bytes": "103052" }, { "name": "HTML", "bytes": "5633" }, { "name": "JavaScript", "bytes": "12664" }, { "name": "PHP", "bytes": "1801428" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Mon Feb 08 23:29:08 EST 2010 --> <TITLE> B-Index </TITLE> <META NAME="date" CONTENT="2010-02-08"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="B-Index"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-1.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-2.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 ========= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">R</A> <A HREF="index-17.html">S</A> <A HREF="index-18.html">T</A> <A HREF="index-19.html">U</A> <A HREF="index-20.html">V</A> <A HREF="index-21.html">W</A> <A HREF="index-22.html">X</A> <A HREF="index-23.html">Y</A> <HR> <A NAME="_B_"><!-- --></A><H2> <B>B</B></H2> <DL> <DT><A HREF="../splar/core/heuristics/FTAverageOrderTraversalHeuristic.html#balanceWeights(java.util.Map)"><B>balanceWeights(Map&lt;String, List&lt;String&gt;&gt;)</B></A> - Method in class splar.core.heuristics.<A HREF="../splar/core/heuristics/FTAverageOrderTraversalHeuristic.html" title="class in splar.core.heuristics">FTAverageOrderTraversalHeuristic</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/ReasoningWithBDD.html#bddBuildingTime"><B>bddBuildingTime</B></A> - Variable in class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/ReasoningWithBDD.html" title="class in splar.plugins.reasoners.bdd.javabdd">ReasoningWithBDD</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#bddCacheSize"><B>bddCacheSize</B></A> - Variable in class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd"><B>BDDConfigurationEngine</B></A> - Class in <A HREF="../splar/plugins/configuration/bdd/javabdd/package-summary.html">splar.plugins.configuration.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#BDDConfigurationEngine(java.lang.String, java.lang.String, java.lang.String)"><B>BDDConfigurationEngine(String, String, String)</B></A> - Constructor for class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>CONSTRUCTOR <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#BDDConfigurationEngine(java.lang.String)"><B>BDDConfigurationEngine(String)</B></A> - Constructor for class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>CONSTRUCTOR <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#BDDConfigurationEngine(java.lang.String, int, int)"><B>BDDConfigurationEngine(String, int, int)</B></A> - Constructor for class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>CONSTRUCTOR <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#BDDConfigurationEngine(splar.core.fm.FeatureModel)"><B>BDDConfigurationEngine(FeatureModel)</B></A> - Constructor for class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>CONSTRUCTOR <DT><A HREF="../splar/plugins/configuration/tests/bdd/javabdd/BDDConfigurationEngineTest.html" title="class in splar.plugins.configuration.tests.bdd.javabdd"><B>BDDConfigurationEngineTest</B></A> - Class in <A HREF="../splar/plugins/configuration/tests/bdd/javabdd/package-summary.html">splar.plugins.configuration.tests.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/configuration/tests/bdd/javabdd/BDDConfigurationEngineTest.html#BDDConfigurationEngineTest()"><B>BDDConfigurationEngineTest()</B></A> - Constructor for class splar.plugins.configuration.tests.bdd.javabdd.<A HREF="../splar/plugins/configuration/tests/bdd/javabdd/BDDConfigurationEngineTest.html" title="class in splar.plugins.configuration.tests.bdd.javabdd">BDDConfigurationEngineTest</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDExceededBuildingTimeException.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDExceededBuildingTimeException</B></A> - Exception in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDExceededBuildingTimeException.html#BDDExceededBuildingTimeException(java.lang.String, java.lang.String)"><B>BDDExceededBuildingTimeException(String, String)</B></A> - Constructor for exception splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDExceededBuildingTimeException.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDExceededBuildingTimeException</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/ReasoningWithBDD.html#bddFactory"><B>bddFactory</B></A> - Variable in class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/ReasoningWithBDD.html" title="class in splar.plugins.reasoners.bdd.javabdd">ReasoningWithBDD</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDGenerationStatistics.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDGenerationStatistics</B></A> - Class in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDGenerationStatistics.html#BDDGenerationStatistics(int)"><B>BDDGenerationStatistics(int)</B></A> - Constructor for class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDGenerationStatistics.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDGenerationStatistics</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html#bddNodeNum"><B>bddNodeNum</B></A> - Variable in class splar.plugins.configuration.bdd.javabdd.<A HREF="../splar/plugins/configuration/bdd/javabdd/BDDConfigurationEngine.html" title="class in splar.plugins.configuration.bdd.javabdd">BDDConfigurationEngine</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversal.html#bddPath"><B>bddPath</B></A> - Variable in class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversal.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDTraversal</A> <DD>&nbsp; <DT><A HREF="../splar/samples/BDDReasoningExample.html" title="class in splar.samples"><B>BDDReasoningExample</B></A> - Class in <A HREF="../splar/samples/package-summary.html">splar.samples</A><DD>SPLAR library - Feature Model Reasoning and Configuration API SPLOT portal - Software Product Lines Online Tools (www.splot-research.org) ***************************************************************************<DT><A HREF="../splar/samples/BDDReasoningExample.html#BDDReasoningExample()"><B>BDDReasoningExample()</B></A> - Constructor for class splar.samples.<A HREF="../splar/samples/BDDReasoningExample.html" title="class in splar.samples">BDDReasoningExample</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDSolutionsIterator</B></A>&lt;<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator.html" title="type parameter in BDDSolutionsIterator">T</A>&gt; - Class in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator.html#BDDSolutionsIterator(net.sf.javabdd.BDD, java.lang.String[])"><B>BDDSolutionsIterator(BDD, String[])</B></A> - Constructor for class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDSolutionsIterator</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator2.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDSolutionsIterator2</B></A>&lt;<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator2.html" title="type parameter in BDDSolutionsIterator2">T</A>&gt; - Class in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator2.html#BDDSolutionsIterator2(net.sf.javabdd.BDD, java.lang.String[])"><B>BDDSolutionsIterator2(BDD, String[])</B></A> - Constructor for class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDSolutionsIterator2.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDSolutionsIterator2</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversal.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDTraversal</B></A> - Class in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversal.html#BDDTraversal()"><B>BDDTraversal()</B></A> - Constructor for class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversal.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDTraversal</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversalNodeDFS.html" title="class in splar.plugins.reasoners.bdd.javabdd"><B>BDDTraversalNodeDFS</B></A> - Class in <A HREF="../splar/plugins/reasoners/bdd/javabdd/package-summary.html">splar.plugins.reasoners.bdd.javabdd</A><DD>&nbsp;<DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversalNodeDFS.html#BDDTraversalNodeDFS()"><B>BDDTraversalNodeDFS()</B></A> - Constructor for class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/BDDTraversalNodeDFS.html" title="class in splar.plugins.reasoners.bdd.javabdd">BDDTraversalNodeDFS</A> <DD>&nbsp; <DT><A HREF="../splar/plugins/reasoners/bdd/javabdd/FTReasoningWithBDD.html#BEST_VARIABLE_ORDER"><B>BEST_VARIABLE_ORDER</B></A> - Static variable in class splar.plugins.reasoners.bdd.javabdd.<A HREF="../splar/plugins/reasoners/bdd/javabdd/FTReasoningWithBDD.html" title="class in splar.plugins.reasoners.bdd.javabdd">FTReasoningWithBDD</A> <DD>&nbsp; <DT><A HREF="../splar/core/fm/FTTraversals.html#bfs(splar.core.fm.FeatureTreeNode, splar.core.fm.FTTraversalNodeSelector)"><B>bfs(FeatureTreeNode, FTTraversalNodeSelector)</B></A> - Static method in class splar.core.fm.<A HREF="../splar/core/fm/FTTraversals.html" title="class in splar.core.fm">FTTraversals</A> <DD>&nbsp; <DT><A HREF="../splar/core/constraints/BooleanVariable.html" title="class in splar.core.constraints"><B>BooleanVariable</B></A> - Class in <A HREF="../splar/core/constraints/package-summary.html">splar.core.constraints</A><DD>&nbsp;<DT><A HREF="../splar/core/constraints/BooleanVariable.html#BooleanVariable(java.lang.String)"><B>BooleanVariable(String)</B></A> - Constructor for class splar.core.constraints.<A HREF="../splar/core/constraints/BooleanVariable.html" title="class in splar.core.constraints">BooleanVariable</A> <DD>&nbsp; <DT><A HREF="../splar/core/constraints/BooleanVariable.html#BooleanVariable(java.lang.String, int)"><B>BooleanVariable(String, int)</B></A> - Constructor for class splar.core.constraints.<A HREF="../splar/core/constraints/BooleanVariable.html" title="class in splar.core.constraints">BooleanVariable</A> <DD>&nbsp; <DT><A HREF="../splar/core/constraints/BooleanVariableInterface.html" title="interface in splar.core.constraints"><B>BooleanVariableInterface</B></A> - Interface in <A HREF="../splar/core/constraints/package-summary.html">splar.core.constraints</A><DD>&nbsp;<DT><A HREF="../splar/apps/generator/FMGeneratorGUI.html#buildGUI()"><B>buildGUI()</B></A> - Method in class splar.apps.generator.<A HREF="../splar/apps/generator/FMGeneratorGUI.html" title="class in splar.apps.generator">FMGeneratorGUI</A> <DD>&nbsp; <DT><A HREF="../splar/core/constraints/PropositionalFormula.html#buildHyperGraph()"><B>buildHyperGraph()</B></A> - Method in class splar.core.constraints.<A HREF="../splar/core/constraints/PropositionalFormula.html" title="class in splar.core.constraints">PropositionalFormula</A> <DD>&nbsp; </DL> <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"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-1.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-2.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 ======= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">R</A> <A HREF="index-17.html">S</A> <A HREF="index-18.html">T</A> <A HREF="index-19.html">U</A> <A HREF="index-20.html">V</A> <A HREF="index-21.html">W</A> <A HREF="index-22.html">X</A> <A HREF="index-23.html">Y</A> <HR> </BODY> </HTML>
{ "content_hash": "7d2ba6ff8a118cb00c804705d458b940", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 685, "avg_line_length": 87.07834101382488, "alnum_prop": 0.7224280270956817, "repo_name": "axel-halin/Thesis-JHipster", "id": "58c0e9feefc83da20e80d8c986368ecbc8f82220", "size": "18896", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dependencies/SPLAR/doc/index-files/index-2.html", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "10012" }, { "name": "CSS", "bytes": "140785" }, { "name": "Groovy", "bytes": "648" }, { "name": "HTML", "bytes": "69438" }, { "name": "Java", "bytes": "489408" }, { "name": "JavaScript", "bytes": "116875" }, { "name": "Matlab", "bytes": "6354" }, { "name": "Shell", "bytes": "14300" } ], "symlink_target": "" }
import PropTypes from 'prop-types'; import React, { useContext } from 'react'; import { TextDirectionContext } from './TextDirectionContext'; function Text({ as: BaseComponent = 'span', children, dir = 'auto', ...rest }) { const context = useContext(TextDirectionContext); const textProps = {}; const value = { ...context, }; if (!context) { textProps.dir = dir; value.direction = dir; } else { const { direction: parentDirection, getTextDirection } = context; if (getTextDirection && getTextDirection.current) { const text = getTextFromChildren(children); const override = getTextDirection.current(text); if (parentDirection !== override) { textProps.dir = override; value.direction = override; } else if (parentDirection === 'auto') { textProps.dir = override; } } else if (parentDirection !== dir) { textProps.dir = dir; value.direction = dir; } else if (parentDirection === 'auto') { textProps.dir = dir; } } return ( <TextDirectionContext.Provider value={value}> <BaseComponent {...rest} {...textProps}> {children} </BaseComponent> </TextDirectionContext.Provider> ); } Text.propTypes = { /** * Provide a custom element type used to render the outermost node */ as: PropTypes.oneOfType([ PropTypes.func, PropTypes.string, PropTypes.elementType, ]), /** * Provide child elements or text to be rendered inside of this component */ children: PropTypes.node.isRequired, /** * Specify the text direction to be used for this component and any of its * children */ dir: PropTypes.oneOf(['ltr', 'rtl', 'auto']), }; function getTextFromChildren(children) { if (typeof children === 'string') { return children; } const text = React.Children.map(children, (child) => { if (typeof child === 'string') { return child; } return null; }).filter((text) => { return text !== null; }); if (text.length === 1) { return text[0]; } return text; } export { Text };
{ "content_hash": "660b4ab04ebaf8e422a9f3d7a98ee019", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 80, "avg_line_length": 23.4, "alnum_prop": 0.6201329534662868, "repo_name": "carbon-design-system/carbon-components", "id": "d2b25c670248687db1e1b2f43aad24afc293c13e", "size": "2283", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/react/src/components/Text/Text.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "552528" }, { "name": "HCL", "bytes": "1049" }, { "name": "HTML", "bytes": "226209" }, { "name": "JavaScript", "bytes": "2220621" }, { "name": "Shell", "bytes": "2502" }, { "name": "Vue", "bytes": "2591" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <title>index</title> <meta name="description" content="" /> <meta name="author" content="Charlie" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script src='http://code.jquery.com/jquery.js'></script> <script src="index.js"></script> </head> <body> <div> <!-- Header --> <header> <h1>Object Function Basics</h1> </header> <!-- Main Content Div --> <div> <p id='test01'> </p> <p id='test02'> </p> <p id='test03'> </p> </div> <!-- Footer --> <footer> <p>&copy; Copyright by Charlie</p> </footer> </div> </body> </html>
{ "content_hash": "f18273ec7ddba050f08934abcbfafb8c", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 86, "avg_line_length": 27.925, "alnum_prop": 0.4601611459265891, "repo_name": "donlee888/JsObjects", "id": "0bed29168fb05ad599dbed6ccd4a2056ceec0b2b", "size": "1117", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "JavaScript/Objects/ObjectFunctionBasics02/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "856096" }, { "name": "Java", "bytes": "10014" }, { "name": "JavaScript", "bytes": "9362649" }, { "name": "Python", "bytes": "100882" }, { "name": "Ruby", "bytes": "2648" }, { "name": "Shell", "bytes": "51772" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "b1cb46b1881ecd7c29611ebb567a7619", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "2d61beab6082f10cfb9a885f509f259853ccd1c6", "size": "189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Protozoa/Granuloreticulosea/Foraminiferida/Textulariidae/Textularia/Textularia porrecta/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.fuzz.indicator.style; import android.support.annotation.NonNull; import android.text.Spannable; import com.fuzz.indicator.cell.CutoutTextCell; /** * Interface to be implemented by spans used in {@link CutoutTextCell}. * * These are designed to be translated (in a 2-dimensional plane) above * their associated {@link android.text.Spannable Spannables}. * * @author Philip Cohn-Cort (Fuzz) */ public interface MigratorySpan { /** * Consider a Spannable sequence which has a defined start and end. * The MigratoryRange returned by this method represents some portion * of indices within that sequence. Implementations are asked to * <i>NOT</i> modify the parameter within this method. * <p> * Sample caller code may be as follows: * <pre> * MigratorySpan ms; * Spannable target; * * //... * * MigratoryRange&lt;Integer&gt; bounds = ms.getCoverage(target); * * int start = bounds.getLower(); * int end = bounds.getUpper(); * * target.setSpan(ms, start, end, ms.preferredFlags(0)); * </pre> * </p> * * @return a range which can be used to figure out what * characters in the Spannable are covered. * @param enclosingSequence the sequence of characters wherein this span */ @NonNull MigratoryRange<Integer> getCoverage(Spannable enclosingSequence); /** * Whatever is returned here should be a valid argument into * {@link android.text.Spannable#setSpan(Object, int, int, int)}'s * {@code flags} argument. Feel free to return the parameter directly * if they don't need to change. * * @return a combination of valid span-laying-out flags * @param previousFlags flags used for the previous layout - will * be 0 if not currently attached to a * {@link android.text.Spannable Spannable} */ int preferredFlags(int previousFlags); }
{ "content_hash": "674bde875a42cd7fcfbe7b7ccaa3cfb2", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 79, "avg_line_length": 33.46666666666667, "alnum_prop": 0.648406374501992, "repo_name": "Cliabhach/CutoutViewIndicator", "id": "9222c2a7d15e0b5608bf6fda6a75247a9c158603", "size": "2608", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "indicator/src/main/java/com/fuzz/indicator/style/MigratorySpan.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "272297" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <recipeml version="0.5"> <recipe> <head> <title>Walnut Salad - Country Living</title> <categories> <cat>.cl</cat> <cat>Salads</cat></categories> <yield>4</yield></head> <ingredients> <ing> <amt> <qty>1</qty> <unit>pound</unit></amt> <item>Mesclun; (see Note)</item></ing> <ing> <amt> <qty>1/2</qty> <unit>cups</unit></amt> <item>Walnuts; toasted</item></ing> <ing> <amt> <qty>3</qty> <unit>tablespoons</unit></amt> <item>Walnut oil</item></ing> <ing> <amt> <qty>2</qty> <unit>tablespoons</unit></amt> <item>Lemon juice</item></ing> <ing> <amt> <qty>1</qty> <unit>teaspoon</unit></amt> <item>Honey</item></ing> <ing> <amt> <qty>1/4</qty> <unit>teaspoons</unit></amt> <item>Salt</item></ing> <ing> <amt> <qty>1/8</qty> <unit>teaspoons</unit></amt> <item>Ground black pepper</item></ing></ingredients> <directions> <step> Place mesclun and walnuts in large bowl. In small bowl, whisk together walnut oil, lemon juice, honey, salt, and pepper to make dressing. Toss mesclun and walnuts with dressing and divide onto salad plates. Note: Mesclun, a combination of baby leaf lettuces and greens, is generally sold in gourmet stores or at farmers' markets. If it is not available, make your own by mixing together any combination of the following greens: red and/or green-leaf lettuce, endive, radicchio, lamb's lettuce (mache), escarole, Boston lettuce, spinach, and/or arugula. Nutrition information per serving-protein: 3 grams; fat: 18 grams; carbohy- drate: 8 grams; fiber: 2 grams; sodium: 146 milligrams; cholesterol: 0; calo- ries: 198. Country Living/Feb/94 Scanned &amp; fixed by DP &amp; GG Posted to recipelu-digest Volume 01 Number 649 by GramWag@aol.com on Jan 31, 1998 </step></directions></recipe></recipeml>
{ "content_hash": "497957b5ad51393c868332da677aa082", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 84, "avg_line_length": 32.74626865671642, "alnum_prop": 0.5701914311759344, "repo_name": "coogle/coogle-recipes", "id": "7d4988e8a9459a32353e9a24c6f0e386682915c0", "size": "2194", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "extras/recipes/Walnut_Salad_-_Country_Living.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Blade", "bytes": "70365" }, { "name": "CSS", "bytes": "2508" }, { "name": "HTML", "bytes": "1294" }, { "name": "JavaScript", "bytes": "1133" }, { "name": "PHP", "bytes": "130922" }, { "name": "Puppet", "bytes": "23814" }, { "name": "SCSS", "bytes": "1015" }, { "name": "Shell", "bytes": "3538" }, { "name": "Vue", "bytes": "559" } ], "symlink_target": "" }
<?php namespace Eros\FrontendBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Eros\FrontendBundle\Util\Util; class DefaultController extends Controller { /** * @Route("/index",name="_frontend_index") * @Template() */ public function indexAction() { $user = $this->container->get('security.context')->getToken()->getUser(); $user_id= $user->GetId(); /*return $this->render('ErosFrontendBundle:Default:index2.html.twig', array('name' => $nombre));*/ /*if (null == $ciudad) { $ciudad = $this->container->getParameter('cupon.ciudad_por_defecto'); return new RedirectResponse($this->generateUrl('portada', array('ciudad' => $ciudad))); }*/ $em = $this->getDoctrine()->getEntityManager(); $hoy = new \DateTime('today'); $empresas = $em->getRepository('ErosFrontendBundle:User')->findEmpresasByPreferencias($user_id); $i=0; foreach($empresas as $empresa){ //Le asignamos 40 puntos que es lo que se le asigna a las empresas que tienen articulos en comun con tus preferencias //Posible cambio sumar mas puntos si coincide mas de una preferencia... $empresa->setPreferencia(40); $arrEmpresa[$empresa->GetId()] = $empresa; } //Sacamos todas las empesas, pero deberia ser desde el principio de la accion solo las que tengan eventos,promociones u ofertas activas, trayendo tambien las subcategorias $empresas = $em->getRepository('ErosFrontendBundle:Empresas')->findEmpresasWithPromociones(); $user = $em->getRepository('ErosFrontendBundle:User')->find($user_id); // Acceder al servicio $utilidades = $this->get('eros.utilidades'); // Utilizar directamente un m�todo del servicio foreach($empresas as $empresa){ //Le asignamos 40 puntos que es lo que se le asigna a las empresas que tienen articulos en comun con tus preferencias //Posible cambio sumar mas puntos si coincide mas de una preferencia... $distancia = $utilidades->getDistancia($user->GetLocalidad(),$empresa->GetLocalidad()); $dist_km = round($distancia/1000); if($dist_km<10) $empresa->setPreferencia((array_key_exists($empresa->GetId(),$arrEmpresa) ? $arrEmpresa[$empresa->GetId()]->GetPreferencia() : 0) + 40); else if($dist_km<50) $empresa->setPreferencia((array_key_exists($empresa->GetId(),$arrEmpresa) ? $arrEmpresa[$empresa->GetId()]->GetPreferencia() : 0) + 35); else if($dist_km<100) $empresa->setPreferencia((array_key_exists($empresa->GetId(),$arrEmpresa) ? $arrEmpresa[$empresa->GetId()]->GetPreferencia() : 0) + 30); else if($dist_km<300) $empresa->setPreferencia((array_key_exists($empresa->GetId(),$arrEmpresa) ? $arrEmpresa[$empresa->GetId()]->GetPreferencia() : 0) + 20); else if($dist_km>=300) $empresa->setPreferencia((array_key_exists($empresa->GetId(),$arrEmpresa) ? $arrEmpresa[$empresa->GetId()]->GetPreferencia() : 0) + 10); $arrEmpresa[$empresa->GetId()] = $empresa; } $promocion = $em->getRepository('ErosFrontendBundle:CliPromociones')->findBy(array('empresa' => '1')); return $this->render('ErosFrontendBundle:Default:index.html.twig', array('ofertas' => $promocion)); } /** * @Route("/cart/",name="_cart_layout") * @Template() */ public function cartAction() { $em = $this->get('doctrine.orm.entity_manager'); $user= $this->get('security.context')->getToken()->getUser(); if($this->get('security.context')->isGranted('ROLE_USER')){ $items = $em->getRepository('Eros\CartBundle\Entity\UsrPedidos')->CountItemsByUser($user->GetId()); $precio = $em->getRepository('Eros\CartBundle\Entity\UsrPedidos')->SumarPrecioByUser($user->GetId()); }else{ $session = $this->getRequest()->getSession(); $items = substr_count($session->get('pedidos'), '{'); $pedidos_array = explode('{', $session->get('pedidos')); $precio = 0; for($i=0;$i<count($pedidos_array);$i++){ $trozos_pedido = explode(',',$pedidos_array[$i]); if(count($trozos_pedido)>1){ $precio_tmp = $trozos_pedido[3]; $nelementos_tmp = $trozos_pedido[2]; $precio += $precio_tmp * $nelementos_tmp; } } } return array('items'=>$items,'precio'=>$precio); } /** * @Route("/portada/",name="_portada") * @Template() */ public function portadaAction() { return $this->render('ErosFrontendBundle:Default:portada.html.twig'); } /** * @Route("/select/",name="_select") */ public function selectAction() { return $this->render('ErosFrontendBundle:Default:select.html.twig'); } }
{ "content_hash": "e779ecf54372b78f99f3ab4cd8441784", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 173, "avg_line_length": 42.833333333333336, "alnum_prop": 0.64079459348761, "repo_name": "uthopiko/Eros", "id": "cbc397e5f9a86c01dab5533cce5a7e5b48a9a467", "size": "4885", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Eros/FrontendBundle/Controller/DefaultController.php", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2262761" }, { "name": "PHP", "bytes": "311234" }, { "name": "Perl", "bytes": "2209" }, { "name": "Shell", "bytes": "3540" } ], "symlink_target": "" }
<!-- <link rel="stylesheet" type="text/css" href="<?= base_url()?>assets/MDB/css/bootstrap.min.css"> --> </head> <header> <img id="non-printable" src="<?php echo base_url();?>assets/images/EVSU_banner.png" height="100" class="img-responsive" alt="EVSU | College of Engineering | On the Job Training Monitoring and Grading System"> </header> <nav class="navbar navbar-inverse" id="nav2"> <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" aria-expanded="false" > <span class="sr-only" >Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- <img src="/EVSU_OJT/assets/images/EVSU_logo.png" width="50" height="50"> --> <a class="navbar-brand" href="#"></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"> </ul> <ul class="nav navbar-nav navbar-right"> <li class="#"><a href="<?php echo base_url();?>"><span class="fa fa-home"></span> Home </a></li> <li><a href="#about" data-toggle="modal" data-target="#myModal_about" id="#about"><span class="fa fa-info-circle"></span> About</a></li> <li><a href="#contact_us"><span class="fa fa-envelope"></span> Contact Us</a></li> <li><a href="<?php echo base_url();?>Login/supervisor_chat_message"><span class="fa fa-comments"></span> Chat Us</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle text-capitalize" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="fa fa-user"></span><?php if (isset($_SESSION['username'])) { ?> <?php echo $_SESSION['fname'].' '.$_SESSION['lname']; $user = $_SESSION['username']; $course = $_SESSION['course']; $fname = $_SESSION['fname']; $lname = $_SESSION['lname']; $stud_num = $_SESSION['stud_num']; $stud_id = $_SESSION['stud_num']; }?><span class="caret"></span> <ul class="dropdown-menu"> <li><a style="color: #000;" href="#"><span class="fa fa-cog"></span> Settings</a></li> <li><a style="color: #000;" href="<?php echo base_url();?>Member/logout/<?= md5($_SESSION['username']);?>"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div id="mySidenav" class="sidenav " > <a href="javascript:void(0)" class="closebtn avatarBody" onclick="closeNav()" style="position: absolute; float: left;">×</a> <div class="panel-heading avatar1" style="padding-bottom: 25px"> <h3 style="color: #000; font-weight: bold;">Welcome!</h3> <!-- <span class="fa fa-user-circle fa-5x" style="color: #000;"></span> --> <img data-toggle="modal" data-target="#myModal_add_admin" src="<?php echo base_url();?>assets/images/avatar_img.jpg" style="height:90px;width:90px" alt="avatar" > </div> <?php $dataqwe = $this->Login_user_model->getcnameqwe($stud_id) ?> <!-- <?php echo $dataqwe['cname']; ?> --> <span class="text-capitalize nav_span col-sm-12">Student Number: <?php echo $stud_num; ?></span> <span class="text-capitalize nav_span col-sm-12">Name: <?php echo $_SESSION['fname'].' '.$_SESSION['lname']; ?></span> <span class="text-capitalize nav_span col-sm-12">Course: <?php echo $course; ?></span> <span class="text-capitalize nav_span col-sm-12">Username: <?php echo $user; ?></span> <span class=" nav_span col-sm-12">Agency Assigned: <?php echo $dataqwe['cname'] ?></span> <div class="add_admin_cdr"> <button type="button" class="btn btn-primary col-sm-2 btnProfile" data-toggle="modal" data-target="#myModal_edit"><span class="fa fa-user-plus"></span> Edit Profile</button> <button type="button" class="btn btn-primary col-sm-2 btnProfile" data-toggle="modal" data-target="#myModal_cdr"><span class="fa fa-cloud-upload"></span> Upload File</button> <!-- <button onclick="window.location='<?php echo base_url();?>Student/journal';" type="button" class="btn btn-primary col-sm-2 btnProfile"><span class="fa fa-newspaper-o"></span> Journal</button> --> <button onclick="window.location='<?php echo base_url();?>Student/grades';" type="button" class="btn btn-primary col-sm-2 btnProfile"><span class="fa fa-calculator"></span> Grades</button> <button style="font-size: 14px;" onclick="window.location='<?= base_url(); ?>Login/PTPgrades?studID=<?= $stud_id ?>/'" type="button" class="btn btn-primary col-sm-2 btnProfile"><span class="fa fa-thumbs-up"></span> Rate Your Self</button> </div> </div> <div id="main"> <span style="font-size:30px;cursor:pointer;float: left; z-index: 1; background: #c9302c;" onclick="openNav()" class="btn_nav btn btn-md btn-circle btn_circle"> <span id="#non-printable" style="color: #fff" class="fa fa-tasks"></span> </span> <body class="img-responsive" style=" background:url('<?php echo base_url();?>assets/images/background.png') no-repeat; background-size: 100% 90%; padding: 0px 0px 0px 0px" > <div class="container" style="font-size:14pt; margin-top: 10px; margin-bottom: 12px;"> <?= $this->session->flashdata('message') ?> <div class="container"> <div class="" style="margin: 10px;" > <div style="margin: 30px 0px 20px 0px"> <div class="" style="text-align: center;"> <div id="non-printable"> <button type="button" onclick="window.location='<?= base_url();?>Login/student_profile_page';" style=" margin:0px 30px 50px 0px; border-radius: 120px; box-shadow: 0 9px 18px 0 rgba(0, 0, 0, 0.21), 0 3px 10px 0 rgba(0, 0, 0, 0.19); float: right; position: fixed; z-index: 1; right: 0; bottom: 0;background: #db4437" class="btn btn-sm"><span style="color: #fff; font-size: 40px; padding-top: 5px; padding-bottom: 5px;" class="fa fa-hand-o-left"></span> </button> </div> <div> <p class="" style="text-align: center; font-size: 18px;"> Republic of the Philippines<br> EASTERN VISAYAS STATE UNIVERSITY<br> Tacloban City </p> </div> <div style="margin-top: 30px; font-size: 15px; " > <b>TRAINEE'S EVALUATION RECORD</b> </div> </div> <?php $studentID = $_GET['studID']; $info = $this->Login_user_model->get_stud_info($studentID); $hash = $info['hash']; ?> <div class="row" style="margin-top: 60px;"> <div class="col-md-8" > <div class="form-group"> <label class="control-label col-md-7 text-capitalize" style="font-weight: normal; text-align: center; font-size: 15px; margin-left: -25px;" ><?php echo $info['lname'].', '.$info['fname']; ?> </label> </div> <div class="form-group"> <label class="control-label col-md-6" style="text-align: center; font-size: 15px; border-top: 1px solid #000;">Trainee's Name </label> </div> </div> <div class="" style="float: right; margin: -20px 90px 0px 0px;"> <label class="control-label col-sm-12" style="font-size: 15px; border-bottom: 1px solid #000; ">Rating Systems</label> </div> </div> <div class="row" style="font-size: 15px;margin:40px 0px 0px 10px;"> <div class="form-group"> <label class="control-label col-sm-7">Name of Agency: <?= $info['cname']?></label> </div> <div> <label class="control-label col-sm-7 text-capitalize">Agency Address: <?= $info['agency_address']?></label> </div> <div class="" style="float: right;margin:-100px 50px 0px 0px;"> <p> <span style="margin-right: 50px;">1.0-1.5</span><span>Excellent</span><br> <span style="margin-right: 50px;">1.6-2.0</span><span>Very Good</span><br> <span style="margin-right: 50px;">2.1-2.5</span><span>Good</span><br> <span style="margin-right: 50px;">2.6-3.0</span><span>Fair</span><br> <span style="margin-right: 50px;">3.1-4.0</span><span>Poor</span><br> <span style="margin-right: 50px;">4.1-5.0</span><span>Very Poor</span><br> </p> </div> </div> </div> <!-- <?php $info = $this->Login_user_model->get_stud_data($studentID) ?> --> <div style="font-" class="table_grades"> <form action="<?php echo base_url();?>Login/compute_grades_PTP" method="post"> <table class="table table-bordered table-hover" class="table_grades"> <?php $studData = $this->Login_user_model->get_gradesPTP($hash);?> <thead> <tr> <th style="padding-bottom: 15px;text-align: center;">TRAINER'S CHARACTERISTICS</th> <th width="100">RATING<br>(1.0 - 5.0)</th> <!-- <th>Action</th> --> </tr> </thead> <?php foreach ($this->Login_user_model->get_criteria() as $criteria) { ?> <tbody> <tr> <td> <p><?= $criteria['c1']?></p> </td> <td> <input type="hidden" name="hash" value="<?= $hash ?>"> <input type="hidden" name="fullname" value="<?php echo $info['lname'].', '.$info['fname']; ?>"> <input type="hidden" name="stud_id" value="<?= $studentID?>"> <input type="hidden" name="graded_by" value="<?= $stud_id ?>"> <input type="number" name="answer_1" step="any" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c2']?></p> </td> <td> <input type="number" max="5" min="1" step=".1" name="answer_2" value="" class="col-sm-12 form-control" required> </td> </tr> <tr> <td> <p><?= $criteria['c3']?></p> </td> <td> <input type="number" name="answer_3" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c4']?></p> </td> <td> <input type="number" name="answer_4" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required > </td> </tr> <tr> <td> <p><?= $criteria['c5']?></p> </td> <td> <input type="number" name="answer_5" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c6']?></p> </td> <td> <input type="number" name="answer_6" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c7']?></p> </td> <td> <input type="number" name="answer_7" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c8']?> </p> </td> <td> <input type="number" name="answer_8" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c9']?></p> </td> <td> <input type="number" name="answer_9" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> <tr> <td> <p><?= $criteria['c10']?></p> </td> <td> <input type="number" name="answer_10" max="5" min="1" step=".1" class="col-sm-12 form-control" value="" required> </td> </tr> </tbody> <?php } ?> </table> <div> <button type="submit" class="btn btn-primary btnCompGrades" style="float: right;" id="grades"><span class="fa fa-calculator"></span> Compute Grades</button><br> <?php $data = $this->Login_user_model->get_gradesPTP($hash);?> <div id="total" style="float: right; margin-right: -190px; margin-top: 50px;"> <label class="label-control">Total Grades:</label><br> <input type="text" class="col-sm-3 form-control" value=""> </div> </div> </form> <?php if (isset($_SESSION['username'])) { ?> <div class="row"> <div class="col-sm-6" style="margin-top: 35px;"> <label style="margin-left: 35px;">Evaluated by:</label> <div style="margin-top: 30px" align="center"> <label class="col-sm-4 text-capitalize" style="font-weight: normal; border-bottom: 1px solid #000; width: 120;"><?php echo $_SESSION['fname'].' '.$_SESSION['lname']; ?></label><br> </div> </div> <?php } ?> <!-- <div class="col-sm-6" style="float: right; clear:left; margin-top: -125px;"> <label >Noted by:</label> <div style="margin-top: 75px"> <label style="col-sm-7" style="border-top: 1px solid #000;width="";text-align: center; ">Follow-Up Instructor</label> </div> </div> --> </div> </div> <div style="margin-left: 10px; margin-top: 50px;"> <button id="printables" class="btn btn-primary btnPrint" onClick="window.print()"><span class="glyphicon glyphicon-print"></span> Print this page</button> </div> <!-- Modal Edit --> <div class="modal fade" id="myModal_edit" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header edit_profile_modal"> <button type="button" class="close" data-dismiss="modal">&times;</button> <div class=""> <h2><span class="fa fa-edit"></span> Edit Profile</h2> </div> </div> <div class="modal-body" id="login_reg"> <div class="container"> <div class="col-sm-6 " id="login_user"> <div id="" class=""> <div class=""> <form class="form-horizontal" action="<?php echo base_url();?>Login/update_student_pass" method="POST"> <input type="hidden" name="stud_id" value="<?= $_SESSION['stud_num']; ?>"> <div class="form-group"> <label class="col-sm-3 control-label">New Password</label> <div class="col-sm-8"> <input type="password" name="password" class="form-control" placeholder="New Password" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">Confirm Password</label> <div class="col-sm-8"> <input type="password" name="password" class="form-control" placeholder="Comfirm Password" required> </div> </div> <div class="pull-right" style="margin-right: 50px; margin-bottom: 20px; "> <button type="submit" class="btn btn-info btn-xm signin_button"><span class="glyphicon glyphicon-share"></span> Update</button> </div> </form> </div> </div> </div> </div> <div > <div class="modal-footer" style="margin-right: 30px;"> <button type="button" class="btn btn-primary" data-dismiss="modal" >Close</button> </div> </div> </div> </div> </div> </div> <!--Modal --> </div> </div> </div> </div> <script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.min.js"></script> <div class="container"> </div>
{ "content_hash": "f2ea618d611c7f13fbb1b606557c410e", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 453, "avg_line_length": 41.87887323943662, "alnum_prop": 0.5927221362749714, "repo_name": "blankcode01/EVSU-COE_OJT", "id": "2c904d0d1933e719490bfd6df13e4261c9cbaf1f", "size": "14868", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/User/evsu_PTP_page.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "503" }, { "name": "CSS", "bytes": "423335" }, { "name": "HTML", "bytes": "5633" }, { "name": "JavaScript", "bytes": "267175" }, { "name": "PHP", "bytes": "2726462" } ], "symlink_target": "" }
package dagger2.internal.codegen; import com.google.common.base.Function; /** * A formatter which transforms an instance of a particular type into a string * representation. * * @param <T> the type of the object to be transformed. * @author Christian Gruber * @since 2.0 */ abstract class Formatter<T> implements Function<T, String> { /** * Performs the transformation of an object into a string representation. */ public abstract String format(T object); /** * Performs the transformation of an object into a string representation in * conformity with the {@link Function}{@code <T, String>} contract, delegating * to {@link #format(Object)}. * * @deprecated Call {@link #format(T)} instead. This method exists to make * formatters easy to use when functions are required, but shouldn't be called directly. */ @SuppressWarnings("javadoc") @Deprecated @Override final public String apply(T object) { return format(object); } }
{ "content_hash": "8ae78884b001cca598ce100444c7cd6d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 90, "avg_line_length": 28.970588235294116, "alnum_prop": 0.7076142131979696, "repo_name": "goinstant/dagger", "id": "ad6d8c2ea94e8c68f1a381281f0e3fdf16ae4beb", "size": "1580", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "compiler/src/main/java/dagger2/internal/codegen/Formatter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1267736" }, { "name": "Shell", "bytes": "2962" } ], "symlink_target": "" }
If you would like to contribute to the development of OpenStack, you must follow the steps in this page: http://docs.openstack.org/infra/manual/developers.html If you already have a good understanding of how the system works and your OpenStack accounts are set up, you can skip to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool: http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/labs
{ "content_hash": "434d02e233dcd4c0c01bfa0186ee5286", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 38.11764705882353, "alnum_prop": 0.7978395061728395, "repo_name": "openstack/training-labs", "id": "8d0fc61f89613d22ba5c1f21a4c96c6a9892dc0b", "size": "648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CONTRIBUTING.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "12885" }, { "name": "JavaScript", "bytes": "476" }, { "name": "Python", "bytes": "153158" }, { "name": "Shell", "bytes": "345944" } ], "symlink_target": "" }
const { declareEmptyArrayVariable } = require('./utils') const lifecyles = ['afterAll', 'beforeAll', 'afterEach', 'beforeEach'] module.exports = (programBody, t) => { lifecyles.forEach(lifecycle => { const varName = `__skpm_${lifecycle}s__` // var __skpm_afterAlls__ = [] declareEmptyArrayVariable(programBody, t, varName) /** * * var afterAll = function (fn) => { * function withLogs() { * console.log = __hookedLogs * return fn() * } * __skpm_afterAlls__.push(withLogs) * } */ programBody.insertBefore( t.variableDeclaration('var', [ t.variableDeclarator( t.identifier(lifecycle), t.functionExpression( null, [t.identifier('fn')], t.blockStatement([ t.functionDeclaration( t.identifier('withLogs'), [], t.blockStatement([ t.expressionStatement( t.assignmentExpression( '=', t.memberExpression( t.identifier('console'), t.identifier('log') ), t.identifier('__hookedLogs') ) ), t.returnStatement(t.callExpression(t.identifier('fn'), [])), ]) ), t.expressionStatement( t.callExpression( t.memberExpression( t.identifier(varName), t.identifier('push') ), [t.identifier('withLogs')] ) ), ]) ) ), ]) ) }) }
{ "content_hash": "c9b108855c0788584781ee13f528aa8e", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 28.64516129032258, "alnum_prop": 0.43186936936936937, "repo_name": "skpm/skpm", "id": "c377f6d61014fefec4f79917b006c3f608153034", "size": "1776", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/test-runner/lib/utils/loader-hacks/hooks/lifecycles.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "172504" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more ~ contributor license agreements. See the NOTICE file distributed with ~ this work for additional information regarding copyright ownership. ~ The ASF licenses this file to You under the Apache License, Version 2.0 ~ (the "License"); you may not use this file except in compliance with ~ the License. You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.apache.zeppelin</groupId> <artifactId>spark-scala-parent</artifactId> <version>0.9.0-SNAPSHOT</version> <relativePath>../spark-scala-parent/pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.zeppelin</groupId> <artifactId>spark-scala-2.10</artifactId> <version>0.9.0-SNAPSHOT</version> <packaging>jar</packaging> <name>Zeppelin: Spark Interpreter Scala_2.10</name> <properties> <spark.version>2.2.0</spark.version> <scala.version>2.10.5</scala.version> <scala.binary.version>2.10</scala.binary.version> <scala.compile.version>${scala.version}</scala.compile.version> </properties> </project>
{ "content_hash": "640c9847d82a2d084d2c458ab6699628", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 108, "avg_line_length": 42.54761904761905, "alnum_prop": 0.7157246782316732, "repo_name": "datalayer/zeppelin-datalayer", "id": "a2004435427faa3bdd1e15c94544bdbf554caece", "size": "1787", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spark/scala-2.10/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "833190" }, { "name": "HTML", "bytes": "9067" }, { "name": "JavaScript", "bytes": "716879" }, { "name": "Shell", "bytes": "6259" }, { "name": "TypeScript", "bytes": "902654" } ], "symlink_target": "" }
namespace blink { WorkerInternals::~WorkerInternals() = default; WorkerInternals::WorkerInternals() = default; OriginTrialsTest* WorkerInternals::originTrialsTest() const { return MakeGarbageCollected<OriginTrialsTest>(); } void WorkerInternals::countFeature(ScriptState* script_state, uint32_t feature, ExceptionState& exception_state) { if (static_cast<int32_t>(WebFeature::kNumberOfFeatures) <= feature) { exception_state.ThrowTypeError( "The given feature does not exist in WebFeature."); return; } UseCounter::Count(ExecutionContext::From(script_state), static_cast<WebFeature>(feature)); } void WorkerInternals::countDeprecation(ScriptState* script_state, uint32_t feature, ExceptionState& exception_state) { if (static_cast<int32_t>(WebFeature::kNumberOfFeatures) <= feature) { exception_state.ThrowTypeError( "The given feature does not exist in WebFeature."); return; } Deprecation::CountDeprecation(ExecutionContext::From(script_state), static_cast<WebFeature>(feature)); } void WorkerInternals::collectGarbage(ScriptState* script_state) { script_state->GetIsolate()->RequestGarbageCollectionForTesting( v8::Isolate::kFullGarbageCollection); } } // namespace blink
{ "content_hash": "194613b3384c75aff43eaffa82f05c2c", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 73, "avg_line_length": 35.925, "alnum_prop": 0.6534446764091858, "repo_name": "nwjs/chromium.src", "id": "c56bd6e15828be60170861869af39462aece5a49", "size": "2125", "binary": false, "copies": "2", "ref": "refs/heads/nw70", "path": "third_party/blink/renderer/core/testing/worker_internals.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
Shindo.tests('Excon Connection') do env_init with_rackup('basic.ru') do tests('#socket connects, sets data[:remote_ip]').returns('127.0.0.1') do connection = Excon::Connection.new( :host => '127.0.0.1', :hostname => '127.0.0.1', :nonblock => false, :port => 9292, :scheme => 'http', :ssl_verify_peer => false ) connection.send(:socket) # creates/connects socket connection.data[:remote_ip] end tests("persistent connections") do connection = Excon.new('http://127.0.0.1:9292', persistent: true) response_body = connection.request(path: '/foo', method: 'get').body test("successful uninterrupted request") do connection.request(path: '/foo', method: 'get').body == 'foo' end begin # simulate an interrupted connection which leaves data behind Timeout::timeout(0.0000000001) do connection.request(path: '/foo', method: 'get') end rescue Timeout::Error nil end test("resets connection after interrupt") do response = connection.request(path: '/bar', method: 'get') response.body == 'bar' end end end tests("inspect redaction") do cases = [ ['user & pass', 'http://user1:pass1@foo.com/', 'Basic dXNlcjE6cGFzczE='], ['email & pass', 'http://foo%40bar.com:pass1@foo.com/', 'Basic Zm9vQGJhci5jb206cGFzczE='], ['user no pass', 'http://three_user@foo.com/', 'Basic dGhyZWVfdXNlcjo='], ['pass no user', 'http://:derppass@foo.com/', 'Basic OmRlcnBwYXNz'] ] cases.each do |desc,url,auth_header| conn = Excon.new(url, :proxy => url) test("authorization/proxy-authorization headers concealed for #{desc}") do !conn.inspect.include?(auth_header) end if conn.data[:password] test("password param concealed for #{desc}") do !conn.inspect.include?(conn.data[:password]) end test("password param not mutated for #{desc}") do conn.data[:password] == URI.parse(url).password end end if conn.data[:proxy] && conn.data[:proxy][:password] test("proxy password param concealed for proxy: #{desc}") do !conn.inspect.include?(conn.data[:proxy][:password]) end test("proxy password param not mutated for proxy: #{desc}") do conn.data[:proxy][:password] == URI.parse(url).password end end end end env_restore end
{ "content_hash": "233d97c279e4015b355b8c92dcf4d716", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 96, "avg_line_length": 32.41772151898734, "alnum_prop": 0.5833658727059742, "repo_name": "excon/excon", "id": "6d663cc34544955c8caf4ba88c3548bbc5f8ed4d", "size": "2561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/connection_tests.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "302109" } ], "symlink_target": "" }
.. Copyright (c) 2014-present PlatformIO <contact@platformio.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. .. _board_ststm32_disco_f750n8: STM32F7508-DK ============= .. contents:: Hardware -------- Platform :ref:`platform_ststm32`: The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. .. list-table:: * - **Microcontroller** - STM32F750N8H6 * - **Frequency** - 216MHz * - **Flash** - 64KB * - **RAM** - 340KB * - **Vendor** - `ST <https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-discovery-kits/stm32f7508-dk.html?utm_source=platformio.org&utm_medium=docs>`__ Configuration ------------- Please use ``disco_f750n8`` ID for :ref:`projectconf_env_board` option in :ref:`projectconf`: .. code-block:: ini [env:disco_f750n8] platform = ststm32 board = disco_f750n8 You can override default STM32F7508-DK settings per build environment using ``board_***`` option, where ``***`` is a JSON object path from board manifest `disco_f750n8.json <https://github.com/platformio/platform-ststm32/blob/master/boards/disco_f750n8.json>`_. For example, ``board_build.mcu``, ``board_build.f_cpu``, etc. .. code-block:: ini [env:disco_f750n8] platform = ststm32 board = disco_f750n8 ; change microcontroller board_build.mcu = stm32f750n8h6 ; change MCU frequency board_build.f_cpu = 216000000L Uploading --------- STM32F7508-DK supports the following uploading protocols: * ``blackmagic`` * ``cmsis-dap`` * ``jlink`` * ``stlink`` Default protocol is ``stlink`` You can change upload protocol using :ref:`projectconf_upload_protocol` option: .. code-block:: ini [env:disco_f750n8] platform = ststm32 board = disco_f750n8 upload_protocol = stlink Debugging --------- :ref:`piodebug` - "1-click" solution for debugging with a zero configuration. .. warning:: You will need to install debug tool drivers depending on your system. Please click on compatible debug tool below for the further instructions and configuration information. You can switch between debugging :ref:`debugging_tools` using :ref:`projectconf_debug_tool` option in :ref:`projectconf`. STM32F7508-DK has on-board debug probe and **IS READY** for debugging. You don't need to use/buy external debug probe. .. list-table:: :header-rows: 1 * - Compatible Tools - On-board - Default * - :ref:`debugging_tool_blackmagic` - - * - :ref:`debugging_tool_cmsis-dap` - - * - :ref:`debugging_tool_jlink` - - * - :ref:`debugging_tool_stlink` - Yes - Yes Frameworks ---------- .. list-table:: :header-rows: 1 * - Name - Description * - :ref:`framework_cmsis` - The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for the Cortex-M processor series and specifies debugger interfaces. The CMSIS enables consistent and simple software interfaces to the processor for interface peripherals, real-time operating systems, and middleware. It simplifies software re-use, reducing the learning curve for new microcontroller developers and cutting the time-to-market for devices * - :ref:`framework_libopencm3` - The libOpenCM3 framework aims to create a free and open-source firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC, Atmel SAM3, Energy Micro EFM32 and others * - :ref:`framework_stm32cube` - STM32Cube embedded software libraries, including: The HAL hardware abstraction layer, enabling portability between different STM32 devices via standardized API calls; The Low-Layer (LL) APIs, a light-weight, optimized, expert oriented set of APIs designed for both performance and runtime efficiency
{ "content_hash": "ebf739046fec013d09253ad81173e54f", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 480, "avg_line_length": 34.13138686131387, "alnum_prop": 0.7170658682634731, "repo_name": "platformio/platformio-docs", "id": "223d093c23c527f91b5ec3e1b28f0750066a1ac8", "size": "4676", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "boards/ststm32/disco_f750n8.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "795" }, { "name": "CSS", "bytes": "12271" }, { "name": "HTML", "bytes": "7850" }, { "name": "Makefile", "bytes": "634" }, { "name": "Python", "bytes": "13798" } ], "symlink_target": "" }
.. _tutorial-views: Step 5: The View Functions ========================== Now that the database connections are working, we can start writing the view functions. We will need four of them: Show Entries ------------ This view shows all the entries stored in the database. It listens on the root of the application and will select title and text from the database. The one with the highest id (the newest entry) will be on top. The rows returned from the cursor look a bit like dictionaries because we are using the :class:`sqlite3.Row` row factory. The view function will pass the entries to the :file:`show_entries.html` template and return the rendered one:: @app.route('/') def show_entries(): db = get_db() cur = db.execute('select title, text from entries order by id desc') entries = cur.fetchall() return render_template('show_entries.html', entries=entries) Add New Entry ------------- This view lets the user add new entries if they are logged in. This only responds to ``POST`` requests; the actual form is shown on the `show_entries` page. If everything worked out well, we will :func:`~flask.flash` an information message to the next request and redirect back to the `show_entries` page:: @app.route('/add', methods=['POST']) def add_entry(): if not session.get('logged_in'): abort(401) db = get_db() db.execute('insert into entries (title, text) values (?, ?)', [request.form['title'], request.form['text']]) db.commit() flash('New entry was successfully posted') return redirect(url_for('show_entries')) Note that we check that the user is logged in here (the `logged_in` key is present in the session and ``True``). .. admonition:: Security Note Be sure to use question marks when building SQL statements, as done in the example above. Otherwise, your app will be vulnerable to SQL injection when you use string formatting to build SQL statements. See :ref:`sqlite3` for more. Login and Logout ---------------- These functions are used to sign the user in and out. Login checks the username and password against the ones from the configuration and sets the `logged_in` key for the session. If the user logged in successfully, that key is set to ``True``, and the user is redirected back to the `show_entries` page. In addition, a message is flashed that informs the user that he or she was logged in successfully. If an error occurred, the template is notified about that, and the user is asked again:: @app.route('/login', methods=['GET', 'POST']) def login(): error = None if request.method == 'POST': if request.form['username'] != app.config['USERNAME']: error = 'Invalid username' elif request.form['password'] != app.config['PASSWORD']: error = 'Invalid password' else: session['logged_in'] = True flash('You were logged in') return redirect(url_for('show_entries')) return render_template('login.html', error=error) The `logout` function, on the other hand, removes that key from the session again. We use a neat trick here: if you use the :meth:`~dict.pop` method of the dict and pass a second parameter to it (the default), the method will delete the key from the dictionary if present or do nothing when that key is not in there. This is helpful because now we don't have to check if the user was logged in. :: @app.route('/logout') def logout(): session.pop('logged_in', None) flash('You were logged out') return redirect(url_for('show_entries')) Continue with :ref:`tutorial-templates`.
{ "content_hash": "9da8193af94738368a45e6f3b718b69a", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 79, "avg_line_length": 38.41836734693877, "alnum_prop": 0.6661354581673307, "repo_name": "garaden/flask", "id": "8ecc41a2a20300a4992444c90ac7dbaa847e42b9", "size": "3765", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/tutorial/views.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "18" }, { "name": "HTML", "bytes": "404" }, { "name": "Makefile", "bytes": "1586" }, { "name": "Python", "bytes": "442743" } ], "symlink_target": "" }
<?php namespace Multidimensional\Cakephpify\Model\Table; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; /** * AccessTokens Model * * @method \Shopify\Model\Entity\AccessToken get($primaryKey, $options = []) * @method \Shopify\Model\Entity\AccessToken newEntity($data = null, array $options = []) * @method \Shopify\Model\Entity\AccessToken[] newEntities(array $data, array $options = []) * @method \Shopify\Model\Entity\AccessToken|bool save(\Cake\Datasource\EntityInterface $entity, $options = []) * @method \Shopify\Model\Entity\AccessToken patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) * @method \Shopify\Model\Entity\AccessToken[] patchEntities($entities, array $data, array $options = []) * @method \Shopify\Model\Entity\AccessToken findOrCreate($search, callable $callback = null) */ class AccessTokensTable extends Table { /** * Initialize method * * @param array $config The configuration for the Table. * @return void */ public function initialize(array $config) { parent::initialize($config); //$this->table('access_tokens'); $this->displayField('token'); //$this->primaryKey('id'); $this->belongsTo( 'Shops', [ 'className' => 'Multidimensional/Cakephpify.Shops'] ); } /** * Default validation rules. * * @param \Cake\Validation\Validator $validator Validator instance. * @return \Cake\Validation\Validator */ public function validationDefault(Validator $validator) { $validator ->integer('id') ->allowEmpty('id', 'create'); $validator ->requirePresence('api_key', 'create') ->notEmpty('api_key'); $validator ->requirePresence('shop_id', 'create') ->notEmpty('shop_id'); $validator ->requirePresence('token', 'create') ->notEmpty('token') ->add('token', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']); $validator ->dateTime('created_at') ->requirePresence('created_at', 'create') ->notEmpty('created_at'); $validator ->dateTime('updated_at') ->requirePresence('updated_at', 'create') ->notEmpty('updated_at'); $validator ->dateTime('expired_at') ->allowEmpty('expired_at'); return $validator; } /** * Returns a rules checker object that will be used for validating * application integrity. * * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. * @return \Cake\ORM\RulesChecker */ public function buildRules(RulesChecker $rules) { $rules->add($rules->isUnique(['token'])); return $rules; } }
{ "content_hash": "dabce4c377c1a85885b361b22c0f7917", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 132, "avg_line_length": 29.36, "alnum_prop": 0.5950272479564033, "repo_name": "multidimension-al/cakephpify", "id": "80cf41a494ce9fdc06d72d2b6c95d14fa228c41d", "size": "3984", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Model/Table/AccessTokensTable.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "126996" } ], "symlink_target": "" }
/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32L0xx_HAL_RCC_H #define __STM32L0xx_HAL_RCC_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l0xx_hal_def.h" /** @addtogroup STM32L0xx_HAL_Driver * @{ */ /** @addtogroup RCC * @{ */ /** @addtogroup RCC_Private_Constants * @{ */ /** @defgroup RCC_Timeout RCC Timeout * @{ */ /* Disable Backup domain write protection state change timeout */ #define RCC_DBP_TIMEOUT_VALUE (100U) /* 100 ms */ /* LSE state change timeout */ #define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT #define CLOCKSWITCH_TIMEOUT_VALUE (5000U) /* 5 s */ #define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT #define MSI_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #define HSI_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #define HSI48_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #define LSI_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #define PLL_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #if defined(RCC_HSI48_SUPPORT) #define HSI48_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1) */ #endif /* RCC_HSI48_SUPPORT */ /** * @} */ /** @defgroup RCC_BitAddress_AliasRegion BitAddress AliasRegion * @brief RCC registers bit address in the alias region * @{ */ #define RCC_OFFSET (RCC_BASE - PERIPH_BASE) /* --- CR Register ---*/ /* Alias word address of HSION bit */ #define RCC_CR_OFFSET (RCC_OFFSET + 0x00U) /* --- CFGR Register ---*/ /* Alias word address of I2SSRC bit */ #define RCC_CFGR_OFFSET (RCC_OFFSET + 0x08U) /* --- CSR Register ---*/ #define RCC_CSR_OFFSET (RCC_OFFSET + 0x74U) /* CR register byte 3 (Bits[23:16]) base address */ #define RCC_CR_BYTE2_ADDRESS (0x40023802U) /* CIER register byte 0 (Bits[0:8]) base address */ #define CIER_BYTE0_ADDRESS ((uint32_t)(RCC_BASE + 0x10U + 0x00U)) /** * @} */ /* Defines used for Flags */ #define CR_REG_INDEX ((uint8_t)1) #define CSR_REG_INDEX ((uint8_t)2) #define CRRCR_REG_INDEX ((uint8_t)3) #define RCC_FLAG_MASK ((uint8_t)0x1F) /** * @} */ /** @addtogroup RCC_Private_Macros * @{ */ #if defined(RCC_HSI48_SUPPORT) #define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI48) == RCC_OSCILLATORTYPE_HSI48) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI)) #define IS_RCC_HSI48(__HSI48__) (((__HSI48__) == RCC_HSI48_OFF) || ((__HSI48__) == RCC_HSI48_ON)) #else #define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) || \ (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI)) #endif /* RCC_HSI48_SUPPORT */ #define IS_RCC_PLLSOURCE(__SOURCE__) (((__SOURCE__) == RCC_PLLSOURCE_HSI) || \ ((__SOURCE__) == RCC_PLLSOURCE_HSE)) #define IS_RCC_HSE(__HSE__) (((__HSE__) == RCC_HSE_OFF) || ((__HSE__) == RCC_HSE_ON) || \ ((__HSE__) == RCC_HSE_BYPASS)) #define IS_RCC_LSE(__LSE__) (((__LSE__) == RCC_LSE_OFF) || ((__LSE__) == RCC_LSE_ON) || \ ((__LSE__) == RCC_LSE_BYPASS)) #if defined(RCC_CR_HSIOUTEN) #define IS_RCC_HSI(__HSI__) (((__HSI__) == RCC_HSI_OFF) || ((__HSI__) == RCC_HSI_ON) || \ ((__HSI__) == RCC_HSI_DIV4) || ((__HSI__) == RCC_HSI_OUTEN )) #else #define IS_RCC_HSI(__HSI__) (((__HSI__) == RCC_HSI_OFF) || ((__HSI__) == RCC_HSI_ON) || \ ((__HSI__) == RCC_HSI_DIV4)) #endif /* RCC_CR_HSIOUTEN */ #define IS_RCC_CALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= 0x1F) #define IS_RCC_MSICALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= 0xFF) #define IS_RCC_MSI_CLOCK_RANGE(__RANGE__) (((__RANGE__) == RCC_MSIRANGE_0) || \ ((__RANGE__) == RCC_MSIRANGE_1) || \ ((__RANGE__) == RCC_MSIRANGE_2) || \ ((__RANGE__) == RCC_MSIRANGE_3) || \ ((__RANGE__) == RCC_MSIRANGE_4) || \ ((__RANGE__) == RCC_MSIRANGE_5) || \ ((__RANGE__) == RCC_MSIRANGE_6)) #define IS_RCC_LSI(__LSI__) (((__LSI__) == RCC_LSI_OFF) || ((__LSI__) == RCC_LSI_ON)) #define IS_RCC_MSI(__MSI__) (((__MSI__) == RCC_MSI_OFF) || ((__MSI__) == RCC_MSI_ON)) #define IS_RCC_PLL(__PLL__) (((__PLL__) == RCC_PLL_NONE) || ((__PLL__) == RCC_PLL_OFF) || \ ((__PLL__) == RCC_PLL_ON)) #define IS_RCC_PLL_DIV(__DIV__) (((__DIV__) == RCC_PLL_DIV2) || \ ((__DIV__) == RCC_PLL_DIV3) || ((__DIV__) == RCC_PLL_DIV4)) #define IS_RCC_PLL_MUL(__MUL__) (((__MUL__) == RCC_PLL_MUL3) || ((__MUL__) == RCC_PLL_MUL4) || \ ((__MUL__) == RCC_PLL_MUL6) || ((__MUL__) == RCC_PLL_MUL8) || \ ((__MUL__) == RCC_PLL_MUL12) || ((__MUL__) == RCC_PLL_MUL16) || \ ((__MUL__) == RCC_PLL_MUL24) || ((__MUL__) == RCC_PLL_MUL32) || \ ((__MUL__) == RCC_PLL_MUL48)) #define IS_RCC_CLOCKTYPE(CLK) ((((CLK) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK) || \ (((CLK) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK) || \ (((CLK) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) || \ (((CLK) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)) #define IS_RCC_SYSCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_MSI) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_HSI) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_HSE) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_PLLCLK)) #define IS_RCC_SYSCLKSOURCE_STATUS(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_MSI) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_HSI) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_HSE) || \ ((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_PLLCLK)) #define IS_RCC_HCLK(__HCLK__) (((__HCLK__) == RCC_SYSCLK_DIV1) || ((__HCLK__) == RCC_SYSCLK_DIV2) || \ ((__HCLK__) == RCC_SYSCLK_DIV4) || ((__HCLK__) == RCC_SYSCLK_DIV8) || \ ((__HCLK__) == RCC_SYSCLK_DIV16) || ((__HCLK__) == RCC_SYSCLK_DIV64) || \ ((__HCLK__) == RCC_SYSCLK_DIV128) || ((__HCLK__) == RCC_SYSCLK_DIV256) || \ ((__HCLK__) == RCC_SYSCLK_DIV512)) #define IS_RCC_PCLK(__PCLK__) (((__PCLK__) == RCC_HCLK_DIV1) || ((__PCLK__) == RCC_HCLK_DIV2) || \ ((__PCLK__) == RCC_HCLK_DIV4) || ((__PCLK__) == RCC_HCLK_DIV8) || \ ((__PCLK__) == RCC_HCLK_DIV16)) #if defined(STM32L031xx) || defined(STM32L041xx) || defined(STM32L073xx) || defined(STM32L083xx) \ || defined(STM32L072xx) || defined(STM32L082xx) || defined(STM32L071xx) || defined(STM32L081xx) #define IS_RCC_MCO(__MCO__) (((__MCO__) == RCC_MCO1) || ((__MCO__) == RCC_MCO2) || ((__MCO__) == RCC_MCO3)) #else #define IS_RCC_MCO(__MCO__) (((__MCO__) == RCC_MCO1) || ((__MCO__) == RCC_MCO2)) #endif #define IS_RCC_MCODIV(__DIV__) (((__DIV__) == RCC_MCODIV_1) || ((__DIV__) == RCC_MCODIV_2) || \ ((__DIV__) == RCC_MCODIV_4) || ((__DIV__) == RCC_MCODIV_8) || \ ((__DIV__) == RCC_MCODIV_16)) #if defined(RCC_CFGR_MCOSEL_HSI48) #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || ((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \ ((__SOURCE__) == RCC_MCO1SOURCE_HSI) || ((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \ ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \ ((__SOURCE__) == RCC_MCO1SOURCE_LSI) || ((__SOURCE__) == RCC_MCO1SOURCE_LSE) || \ ((__SOURCE__) == RCC_MCO1SOURCE_HSI48)) #else #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || ((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \ ((__SOURCE__) == RCC_MCO1SOURCE_HSI) || ((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \ ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \ ((__SOURCE__) == RCC_MCO1SOURCE_LSI) || ((__SOURCE__) == RCC_MCO1SOURCE_LSE)) #endif /* RCC_CFGR_MCOSEL_HSI48 */ #define IS_RCC_RTCCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_RTCCLKSOURCE_NO_CLK) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_LSE) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_LSI) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV2) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV4) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV8) || \ ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV16)) /** * @} */ /* Exported types ------------------------------------------------------------*/ /** @defgroup RCC_Exported_Types RCC Exported Types * @{ */ /** * @brief RCC PLL configuration structure definition */ typedef struct { uint32_t PLLState; /*!< PLLState: The new state of the PLL. This parameter can be a value of @ref RCC_PLL_Config */ uint32_t PLLSource; /*!< PLLSource: PLL entry clock source. This parameter must be a value of @ref RCC_PLL_Clock_Source */ uint32_t PLLMUL; /*!< PLLMUL: Multiplication factor for PLL VCO input clock This parameter must be a value of @ref RCC_PLL_Multiplication_Factor*/ uint32_t PLLDIV; /*!< PLLDIV: Division factor for PLL VCO input clock This parameter must be a value of @ref RCC_PLL_Division_Factor*/ } RCC_PLLInitTypeDef; /** * @brief RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition */ typedef struct { uint32_t OscillatorType; /*!< The oscillators to be configured. This parameter can be a value of @ref RCC_Oscillator_Type */ uint32_t HSEState; /*!< The new state of the HSE. This parameter can be a value of @ref RCC_HSE_Config */ uint32_t LSEState; /*!< The new state of the LSE. This parameter can be a value of @ref RCC_LSE_Config */ uint32_t HSIState; /*!< The new state of the HSI. This parameter can be a value of @ref RCC_HSI_Config */ uint32_t HSICalibrationValue; /*!< The HSI calibration trimming value (default is RCC_HSICALIBRATION_DEFAULT). This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F */ uint32_t LSIState; /*!< The new state of the LSI. This parameter can be a value of @ref RCC_LSI_Config */ #if defined(RCC_HSI48_SUPPORT) uint32_t HSI48State; /*!< The new state of the HSI48. This parameter can be a value of @ref RCC_HSI48_Config */ #endif /* RCC_HSI48_SUPPORT */ uint32_t MSIState; /*!< The new state of the MSI. This parameter can be a value of @ref RCC_MSI_Config */ uint32_t MSICalibrationValue; /*!< The MSI calibration trimming value. (default is RCC_MSICALIBRATION_DEFAULT). This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */ uint32_t MSIClockRange; /*!< The MSI frequency range. This parameter can be a value of @ref RCC_MSI_Clock_Range */ RCC_PLLInitTypeDef PLL; /*!< PLL structure parameters */ } RCC_OscInitTypeDef; /** * @brief RCC System, AHB and APB busses clock configuration structure definition */ typedef struct { uint32_t ClockType; /*!< The clock to be configured. This parameter can be a value of @ref RCC_System_Clock_Type */ uint32_t SYSCLKSource; /*!< The clock source (SYSCLKS) used as system clock. This parameter can be a value of @ref RCC_System_Clock_Source */ uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK). This parameter can be a value of @ref RCC_AHB_Clock_Source */ uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK). This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */ uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK). This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */ } RCC_ClkInitTypeDef; /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup RCC_Exported_Constants RCC Exported Constants * @{ */ /** @defgroup RCC_PLL_Clock_Source PLL Clock Source * @{ */ #define RCC_PLLSOURCE_HSI RCC_CFGR_PLLSRC_HSI /*!< HSI clock selected as PLL entry clock source */ #define RCC_PLLSOURCE_HSE RCC_CFGR_PLLSRC_HSE /*!< HSE clock selected as PLL entry clock source */ /** * @} */ /** @defgroup RCC_Oscillator_Type Oscillator Type * @{ */ #define RCC_OSCILLATORTYPE_NONE ((uint32_t)0x00000000) #define RCC_OSCILLATORTYPE_HSE ((uint32_t)0x00000001) #define RCC_OSCILLATORTYPE_HSI ((uint32_t)0x00000002) #define RCC_OSCILLATORTYPE_LSE ((uint32_t)0x00000004) #define RCC_OSCILLATORTYPE_LSI ((uint32_t)0x00000008) #define RCC_OSCILLATORTYPE_MSI ((uint32_t)0x00000010) #if defined(RCC_HSI48_SUPPORT) #define RCC_OSCILLATORTYPE_HSI48 ((uint32_t)0x00000020) #endif /* RCC_HSI48_SUPPORT */ /** * @} */ /** @defgroup RCC_HSE_Config HSE Config * @{ */ #define RCC_HSE_OFF ((uint32_t)0x00000000) /*!< HSE clock deactivation */ #define RCC_HSE_ON RCC_CR_HSEON /*!< HSE clock activation */ #define RCC_HSE_BYPASS ((uint32_t)(RCC_CR_HSEBYP | RCC_CR_HSEON)) /*!< External clock source for HSE clock */ /** * @} */ /** @defgroup RCC_LSE_Config LSE Config * @{ */ #define RCC_LSE_OFF ((uint32_t)0x00000000) /*!< LSE clock deactivation */ #define RCC_LSE_ON RCC_CSR_LSEON /*!< LSE clock activation */ #define RCC_LSE_BYPASS ((uint32_t)(RCC_CSR_LSEBYP | RCC_CSR_LSEON)) /*!< External clock source for LSE clock */ /** * @} */ /** @defgroup RCC_HSI_Config HSI Config * @{ */ #define RCC_HSI_OFF ((uint32_t)0x00000000) /*!< HSI clock deactivation */ #define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */ #define RCC_HSI_DIV4 (RCC_CR_HSIDIVEN | RCC_CR_HSION) /*!< HSI_DIV4 clock activation */ #if defined(RCC_CR_HSIOUTEN) #define RCC_HSI_OUTEN RCC_CR_HSIOUTEN /*!< HSI_OUTEN clock activation */ #endif /* RCC_CR_HSIOUTEN */ #define RCC_HSICALIBRATION_DEFAULT ((uint32_t)0x10) /* Default HSI calibration trimming value */ /** * @} */ /** @defgroup RCC_MSI_Clock_Range MSI Clock Range * @{ */ #define RCC_MSIRANGE_0 RCC_ICSCR_MSIRANGE_0 /*!< MSI = 65.536 KHz */ #define RCC_MSIRANGE_1 RCC_ICSCR_MSIRANGE_1 /*!< MSI = 131.072 KHz */ #define RCC_MSIRANGE_2 RCC_ICSCR_MSIRANGE_2 /*!< MSI = 262.144 KHz */ #define RCC_MSIRANGE_3 RCC_ICSCR_MSIRANGE_3 /*!< MSI = 524.288 KHz */ #define RCC_MSIRANGE_4 RCC_ICSCR_MSIRANGE_4 /*!< MSI = 1.048 MHz */ #define RCC_MSIRANGE_5 RCC_ICSCR_MSIRANGE_5 /*!< MSI = 2.097 MHz */ #define RCC_MSIRANGE_6 RCC_ICSCR_MSIRANGE_6 /*!< MSI = 4.194 MHz */ /** * @} */ /** @defgroup RCC_LSI_Config LSI Config * @{ */ #define RCC_LSI_OFF ((uint32_t)0x00000000) /*!< LSI clock deactivation */ #define RCC_LSI_ON RCC_CSR_LSION /*!< LSI clock activation */ /** * @} */ /** @defgroup RCC_MSI_Config MSI Config * @{ */ #define RCC_MSI_OFF ((uint32_t)0x00000000) #define RCC_MSI_ON ((uint32_t)0x00000001) #define RCC_MSICALIBRATION_DEFAULT ((uint32_t)0x00000000U) /* Default MSI calibration trimming value */ /** * @} */ #if defined(RCC_HSI48_SUPPORT) /** @defgroup RCC_HSI48_Config HSI48 Config * @{ */ #define RCC_HSI48_OFF ((uint8_t)0x00) #define RCC_HSI48_ON ((uint8_t)0x01) /** * @} */ #endif /* RCC_HSI48_SUPPORT */ /** @defgroup RCC_PLL_Config PLL Config * @{ */ #define RCC_PLL_NONE ((uint32_t)0x00000000) /*!< PLL is not configured */ #define RCC_PLL_OFF ((uint32_t)0x00000001) /*!< PLL deactivation */ #define RCC_PLL_ON ((uint32_t)0x00000002) /*!< PLL activation */ /** * @} */ /** @defgroup RCC_System_Clock_Type System Clock Type * @{ */ #define RCC_CLOCKTYPE_SYSCLK ((uint32_t)0x00000001) /*!< SYSCLK to configure */ #define RCC_CLOCKTYPE_HCLK ((uint32_t)0x00000002) /*!< HCLK to configure */ #define RCC_CLOCKTYPE_PCLK1 ((uint32_t)0x00000004) /*!< PCLK1 to configure */ #define RCC_CLOCKTYPE_PCLK2 ((uint32_t)0x00000008) /*!< PCLK2 to configure */ /** * @} */ /** @defgroup RCC_System_Clock_Source System Clock Source * @{ */ #define RCC_SYSCLKSOURCE_MSI RCC_CFGR_SW_MSI /*!< MSI selected as system clock */ #define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selected as system clock */ #define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selected as system clock */ #define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL /*!< PLL selected as system clock */ /** * @} */ /** @defgroup RCC_System_Clock_Source_Status System Clock Source Status * @{ */ #define RCC_SYSCLKSOURCE_STATUS_MSI RCC_CFGR_SWS_MSI /*!< MSI used as system clock */ #define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */ #define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */ #define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL /*!< PLL used as system clock */ /** * @} */ /** @defgroup RCC_AHB_Clock_Source AHB Clock Source * @{ */ #define RCC_SYSCLK_DIV1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */ #define RCC_SYSCLK_DIV2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */ #define RCC_SYSCLK_DIV4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */ #define RCC_SYSCLK_DIV8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */ #define RCC_SYSCLK_DIV16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */ #define RCC_SYSCLK_DIV64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */ #define RCC_SYSCLK_DIV128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */ #define RCC_SYSCLK_DIV256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */ #define RCC_SYSCLK_DIV512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */ /** * @} */ /** @defgroup RCC_APB1_APB2_Clock_Source APB1 APB2 Clock Source * @{ */ #define RCC_HCLK_DIV1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */ #define RCC_HCLK_DIV2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */ #define RCC_HCLK_DIV4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */ #define RCC_HCLK_DIV8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */ #define RCC_HCLK_DIV16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */ /** * @} */ /** @defgroup RCC_HAL_EC_RTC_HSE_DIV RTC HSE Prescaler * @{ */ #define RCC_RTC_HSE_DIV_2 (uint32_t)0x00000000U /*!< HSE is divided by 2 for RTC clock */ #define RCC_RTC_HSE_DIV_4 RCC_CR_RTCPRE_0 /*!< HSE is divided by 4 for RTC clock */ #define RCC_RTC_HSE_DIV_8 RCC_CR_RTCPRE_1 /*!< HSE is divided by 8 for RTC clock */ #define RCC_RTC_HSE_DIV_16 RCC_CR_RTCPRE /*!< HSE is divided by 16 for RTC clock */ /** * @} */ /** @defgroup RCC_RTC_LCD_Clock_Source RTC LCD Clock Source * @{ */ #define RCC_RTCCLKSOURCE_NO_CLK ((uint32_t)0x00000000) /*!< No clock */ #define RCC_RTCCLKSOURCE_LSE RCC_CSR_RTCSEL_LSE /*!< LSE oscillator clock used as RTC clock */ #define RCC_RTCCLKSOURCE_LSI RCC_CSR_RTCSEL_LSI /*!< LSI oscillator clock used as RTC clock */ #define RCC_RTCCLKSOURCE_HSE_DIVX RCC_CSR_RTCSEL_HSE /*!< HSE oscillator clock divided by X used as RTC clock */ #define RCC_RTCCLKSOURCE_HSE_DIV2 (RCC_RTC_HSE_DIV_2 | RCC_CSR_RTCSEL_HSE) /*!< HSE oscillator clock divided by 2 used as RTC clock */ #define RCC_RTCCLKSOURCE_HSE_DIV4 (RCC_RTC_HSE_DIV_4 | RCC_CSR_RTCSEL_HSE) /*!< HSE oscillator clock divided by 4 used as RTC clock */ #define RCC_RTCCLKSOURCE_HSE_DIV8 (RCC_RTC_HSE_DIV_8 | RCC_CSR_RTCSEL_HSE) /*!< HSE oscillator clock divided by 8 used as RTC clock */ #define RCC_RTCCLKSOURCE_HSE_DIV16 (RCC_RTC_HSE_DIV_16 | RCC_CSR_RTCSEL_HSE) /*!< HSE oscillator clock divided by 16 used as RTC clock */ /** * @} */ /** @defgroup RCC_PLL_Division_Factor PLL Division Factor * @{ */ #define RCC_PLL_DIV2 RCC_CFGR_PLLDIV2 #define RCC_PLL_DIV3 RCC_CFGR_PLLDIV3 #define RCC_PLL_DIV4 RCC_CFGR_PLLDIV4 /** * @} */ /** @defgroup RCC_PLL_Multiplication_Factor PLL Multiplication Factor * @{ */ #define RCC_PLL_MUL3 RCC_CFGR_PLLMUL3 #define RCC_PLL_MUL4 RCC_CFGR_PLLMUL4 #define RCC_PLL_MUL6 RCC_CFGR_PLLMUL6 #define RCC_PLL_MUL8 RCC_CFGR_PLLMUL8 #define RCC_PLL_MUL12 RCC_CFGR_PLLMUL12 #define RCC_PLL_MUL16 RCC_CFGR_PLLMUL16 #define RCC_PLL_MUL24 RCC_CFGR_PLLMUL24 #define RCC_PLL_MUL32 RCC_CFGR_PLLMUL32 #define RCC_PLL_MUL48 RCC_CFGR_PLLMUL48 /** * @} */ /** @defgroup RCC_MCO_Index MCO Index * @{ */ #define RCC_MCO1 ((uint32_t)0x00000000) #define RCC_MCO2 ((uint32_t)0x00000001) #if defined(STM32L031xx) || defined(STM32L041xx) || defined(STM32L073xx) || defined(STM32L083xx) \ || defined(STM32L072xx) || defined(STM32L082xx) || defined(STM32L071xx) || defined(STM32L081xx) #define RCC_MCO3 ((uint32_t)0x00000002) #endif /** * @} */ /** @defgroup RCC_MCOx_Clock_Prescaler MCO Clock Prescaler * @{ */ #define RCC_MCODIV_1 RCC_CFGR_MCO_PRE_1 #define RCC_MCODIV_2 RCC_CFGR_MCO_PRE_2 #define RCC_MCODIV_4 RCC_CFGR_MCO_PRE_4 #define RCC_MCODIV_8 RCC_CFGR_MCO_PRE_8 #define RCC_MCODIV_16 RCC_CFGR_MCO_PRE_16 /** * @} */ /** @defgroup RCC_MCO1_Clock_Source MCO1 Clock Source * @{ */ #define RCC_MCO1SOURCE_NOCLOCK RCC_CFGR_MCO_NOCLOCK #define RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCO_SYSCLK #define RCC_MCO1SOURCE_MSI RCC_CFGR_MCO_MSI #define RCC_MCO1SOURCE_HSI RCC_CFGR_MCO_HSI #define RCC_MCO1SOURCE_LSE RCC_CFGR_MCO_LSE #define RCC_MCO1SOURCE_LSI RCC_CFGR_MCO_LSI #define RCC_MCO1SOURCE_HSE RCC_CFGR_MCO_HSE #define RCC_MCO1SOURCE_PLLCLK RCC_CFGR_MCO_PLL #if defined(RCC_CFGR_MCOSEL_HSI48) #define RCC_MCO1SOURCE_HSI48 RCC_CFGR_MCO_HSI48 #endif /* RCC_CFGR_MCOSEL_HSI48 */ /** * @} */ /** @defgroup RCC_Interrupt Interrupts * @{ */ #define RCC_IT_LSIRDY RCC_CIFR_LSIRDYF /*!< LSI Ready Interrupt flag */ #define RCC_IT_LSERDY RCC_CIFR_LSERDYF /*!< LSE Ready Interrupt flag */ #define RCC_IT_HSIRDY RCC_CIFR_HSIRDYF /*!< HSI Ready Interrupt flag */ #define RCC_IT_HSERDY RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */ #define RCC_IT_PLLRDY RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */ #define RCC_IT_MSIRDY RCC_CIFR_MSIRDYF /*!< MSI Ready Interrupt flag */ #define RCC_IT_LSECSS RCC_CIFR_CSSLSEF /*!< LSE Clock Security System Interrupt flag */ #if defined(RCC_HSECSS_SUPPORT) #define RCC_IT_CSS RCC_CIFR_CSSHSEF /*!< Clock Security System Interrupt flag */ #endif /* RCC_HSECSS_SUPPORT */ #if defined(RCC_HSI48_SUPPORT) #define RCC_IT_HSI48RDY RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */ #endif /* RCC_HSI48_SUPPORT */ /** * @} */ /** @defgroup RCC_Flag Flags * Elements values convention: XXXYYYYYb * - YYYYY : Flag position in the register * - XXX : Register index * - 001: CR register * - 010: CSR register * - 011: CRRCR register (*) * (*) Applicable only for STM32L052xx, STM32L053xx, (...), STM32L073xx & STM32L082xx * @{ */ /* Flags in the CR register */ #define RCC_FLAG_HSIRDY ((uint8_t)((CR_REG_INDEX << 5) | 2)) /*!< Internal High Speed clock ready flag */ #define RCC_FLAG_HSIDIV ((uint8_t)((CR_REG_INDEX << 5) | 4)) /*!< HSI16 divider flag */ #define RCC_FLAG_MSIRDY ((uint8_t)((CR_REG_INDEX << 5) | 9)) /*!< MSI clock ready flag */ #define RCC_FLAG_HSERDY ((uint8_t)((CR_REG_INDEX << 5) | 17)) /*!< External High Speed clock ready flag */ #define RCC_FLAG_PLLRDY ((uint8_t)((CR_REG_INDEX << 5) | 25)) /*!< PLL clock ready flag */ /* Flags in the CSR register */ #define RCC_FLAG_LSIRDY ((uint8_t)((CSR_REG_INDEX << 5) | 1)) /*!< Internal Low Speed oscillator Ready */ #define RCC_FLAG_LSERDY ((uint8_t)((CSR_REG_INDEX << 5) | 9)) /*!< External Low Speed oscillator Ready */ #define RCC_FLAG_LSECSS ((uint8_t)((CSR_REG_INDEX << 5) | 14)) /*!< CSS on LSE failure Detection */ #define RCC_FLAG_OBLRST ((uint8_t)((CSR_REG_INDEX << 5) | 25)) /*!< Options bytes loading reset flag */ #define RCC_FLAG_PINRST ((uint8_t)((CSR_REG_INDEX << 5) | 26)) /*!< PIN reset flag */ #define RCC_FLAG_PORRST ((uint8_t)((CSR_REG_INDEX << 5) | 27)) /*!< POR/PDR reset flag */ #define RCC_FLAG_SFTRST ((uint8_t)((CSR_REG_INDEX << 5) | 28)) /*!< Software Reset flag */ #define RCC_FLAG_IWDGRST ((uint8_t)((CSR_REG_INDEX << 5) | 29)) /*!< Independent Watchdog reset flag */ #define RCC_FLAG_WWDGRST ((uint8_t)((CSR_REG_INDEX << 5) | 30)) /*!< Window watchdog reset flag */ #define RCC_FLAG_LPWRRST ((uint8_t)((CSR_REG_INDEX << 5) | 31)) /*!< Low-Power reset flag */ #if defined(RCC_CSR_FWRSTF) #define RCC_FLAG_FWRST ((uint8_t)((CSR_REG_INDEX << 5) | 8)) /*!< RCC flag FW reset */ #endif /* RCC_CSR_FWRSTF */ /* Flags in the CRRCR register */ #if defined(RCC_HSI48_SUPPORT) #define RCC_FLAG_HSI48RDY ((uint8_t)((CRRCR_REG_INDEX << 5) | 1)) /*!< HSI48 clock ready flag */ #endif /* RCC_HSI48_SUPPORT */ /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /** @defgroup RCC_Exported_Macros RCC Exported Macros * @{ */ /** @defgroup RCC_AHB_Peripheral_Clock_Enable_Disable AHB Peripheral Clock Enable Disable * @brief Enable or disable the AHB peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_DMA1_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_MIF_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->AHBENR, RCC_AHBENR_MIFEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_MIFEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_CRC_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_DMA1_CLK_DISABLE() CLEAR_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN) #define __HAL_RCC_MIF_CLK_DISABLE() CLEAR_BIT(RCC->AHBENR, RCC_AHBENR_MIFEN) #define __HAL_RCC_CRC_CLK_DISABLE() CLEAR_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN) /** * @} */ /** @defgroup RCC_IOPORT_Clock_Enable_Disable IOPORT Peripheral Clock Enable Disable * @brief Enable or disable the IOPORT peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_GPIOA_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_GPIOB_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOBEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOBEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_GPIOC_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOCEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOCEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_GPIOH_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOHEN);\ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOHEN);\ UNUSED(tmpreg); \ } while(0) #define __HAL_RCC_GPIOA_CLK_DISABLE() CLEAR_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN) #define __HAL_RCC_GPIOB_CLK_DISABLE() CLEAR_BIT(RCC->IOPENR, RCC_IOPENR_GPIOBEN) #define __HAL_RCC_GPIOC_CLK_DISABLE() CLEAR_BIT(RCC->IOPENR, RCC_IOPENR_GPIOCEN) #define __HAL_RCC_GPIOH_CLK_DISABLE() CLEAR_BIT(RCC->IOPENR, RCC_IOPENR_GPIOHEN) /** * @} */ /** @defgroup RCC_APB1_Clock_Enable_Disable APB1 Peripheral Clock Enable Disable * @brief Enable or disable the Low Speed APB (APB1) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_WWDG_CLK_ENABLE() SET_BIT(RCC->APB1ENR, (RCC_APB1ENR_WWDGEN)) #define __HAL_RCC_PWR_CLK_ENABLE() SET_BIT(RCC->APB1ENR, (RCC_APB1ENR_PWREN)) #define __HAL_RCC_WWDG_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR, (RCC_APB1ENR_WWDGEN)) #define __HAL_RCC_PWR_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR, (RCC_APB1ENR_PWREN)) /** * @} */ /** @defgroup RCC_APB2_Clock_Enable_Disable APB2 Peripheral Clock Enable Disable * @brief Enable or disable the High Speed APB (APB2) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_SYSCFG_CLK_ENABLE() SET_BIT(RCC->APB2ENR, (RCC_APB2ENR_SYSCFGEN)) #define __HAL_RCC_DBGMCU_CLK_ENABLE() SET_BIT(RCC->APB2ENR, (RCC_APB2ENR_DBGMCUEN)) #define __HAL_RCC_SYSCFG_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, (RCC_APB2ENR_SYSCFGEN)) #define __HAL_RCC_DBGMCU_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, (RCC_APB2ENR_DBGMCUEN)) /** * @} */ /** @defgroup RCC_AHB_Peripheral_Clock_Enable_Disable_Status AHB Peripheral Clock Enabled or Disabled Status * @brief Check whether the AHB peripheral clock is enabled or not. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_DMA1_IS_CLK_ENABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN) != RESET) #define __HAL_RCC_MIF_IS_CLK_ENABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_MIFEN) != RESET) #define __HAL_RCC_CRC_IS_CLK_ENABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN) != RESET) #define __HAL_RCC_DMA1_IS_CLK_DISABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN) == RESET) #define __HAL_RCC_MIF_IS_CLK_DISABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_MIFEN) == RESET) #define __HAL_RCC_CRC_IS_CLK_DISABLED() (READ_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN) == RESET) /** * @} */ /** @defgroup RCC_IOPORT_Peripheral_Clock_Enable_Disable_Status IOPORT Peripheral Clock Enabled or Disabled Status * @brief Check whether the IOPORT peripheral clock is enabled or not. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_GPIOA_IS_CLK_ENABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN) != RESET) #define __HAL_RCC_GPIOB_IS_CLK_ENABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOBEN) != RESET) #define __HAL_RCC_GPIOC_IS_CLK_ENABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOCEN) != RESET) #define __HAL_RCC_GPIOH_IS_CLK_ENABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOHEN) != RESET) #define __HAL_RCC_GPIOA_IS_CLK_DISABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN) == RESET) #define __HAL_RCC_GPIOB_IS_CLK_DISABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOBEN) == RESET) #define __HAL_RCC_GPIOC_IS_CLK_DISABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOCEN) == RESET) #define __HAL_RCC_GPIOH_IS_CLK_DISABLED() (READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOHEN) == RESET) /** * @} */ /** @defgroup RCC_APB1_Clock_Enable_Disable_Status APB1 Peripheral Clock Enabled or Disabled Status * @brief Check whether the APB1 peripheral clock is enabled or not. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_WWDG_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN) != RESET) #define __HAL_RCC_PWR_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN) != RESET) #define __HAL_RCC_WWDG_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN) == RESET) #define __HAL_RCC_PWR_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN) == RESET) /** * @} */ /** @defgroup RCC_APB2_Clock_Enable_Disable_Status APB2 Peripheral Clock Enabled or Disabled Status * @brief Check whether the APB2 peripheral clock is enabled or not. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. * @{ */ #define __HAL_RCC_SYSCFG_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN) != RESET) #define __HAL_RCC_DBGMCU_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DBGMCUEN) != RESET) #define __HAL_RCC_SYSCFG_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN) == RESET) #define __HAL_RCC_DBGMCU_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DBGMCUEN) == RESET) /** * @} */ /** @defgroup RCC_AHB_Force_Release_Reset AHB Peripheral Force Release Reset * @brief Force or release AHB peripheral reset. * @{ */ #define __HAL_RCC_AHB_FORCE_RESET() (RCC->AHBRSTR = 0xFFFFFFFFU) #define __HAL_RCC_DMA1_FORCE_RESET() SET_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_DMA1RST)) #define __HAL_RCC_MIF_FORCE_RESET() SET_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_MIFRST)) #define __HAL_RCC_CRC_FORCE_RESET() SET_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_CRCRST)) #define __HAL_RCC_AHB_RELEASE_RESET() (RCC->AHBRSTR = 0x00000000U) #define __HAL_RCC_CRC_RELEASE_RESET() CLEAR_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_CRCRST)) #define __HAL_RCC_DMA1_RELEASE_RESET() CLEAR_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_DMA1RST)) #define __HAL_RCC_MIF_RELEASE_RESET() CLEAR_BIT(RCC->AHBRSTR, (RCC_AHBRSTR_MIFRST)) /** * @} */ /** @defgroup RCC_IOPORT_Force_Release_Reset IOPORT Peripheral Force Release Reset * @brief Force or release IOPORT peripheral reset. * @{ */ #define __HAL_RCC_IOP_FORCE_RESET() (RCC->IOPRSTR = 0xFFFFFFFFU) #define __HAL_RCC_GPIOA_FORCE_RESET() SET_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOARST)) #define __HAL_RCC_GPIOB_FORCE_RESET() SET_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOBRST)) #define __HAL_RCC_GPIOC_FORCE_RESET() SET_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOCRST)) #define __HAL_RCC_GPIOH_FORCE_RESET() SET_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOHRST)) #define __HAL_RCC_IOP_RELEASE_RESET() (RCC->IOPRSTR = 0x00000000U) #define __HAL_RCC_GPIOA_RELEASE_RESET() CLEAR_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOARST)) #define __HAL_RCC_GPIOB_RELEASE_RESET() CLEAR_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOBRST)) #define __HAL_RCC_GPIOC_RELEASE_RESET() CLEAR_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOCRST)) #define __HAL_RCC_GPIOH_RELEASE_RESET() CLEAR_BIT(RCC->IOPRSTR, (RCC_IOPRSTR_GPIOHRST)) /** * @} */ /** @defgroup RCC_APB1_Force_Release_Reset APB1 Peripheral Force Release Reset * @brief Force or release APB1 peripheral reset. * @{ */ #define __HAL_RCC_APB1_FORCE_RESET() (RCC->APB1RSTR = 0xFFFFFFFFU) #define __HAL_RCC_WWDG_FORCE_RESET() SET_BIT(RCC->APB1RSTR, (RCC_APB1RSTR_WWDGRST)) #define __HAL_RCC_PWR_FORCE_RESET() SET_BIT(RCC->APB1RSTR, (RCC_APB1RSTR_PWRRST)) #define __HAL_RCC_APB1_RELEASE_RESET() (RCC->APB1RSTR = 0x00000000U) #define __HAL_RCC_WWDG_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR, (RCC_APB1RSTR_WWDGRST)) #define __HAL_RCC_PWR_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR, (RCC_APB1RSTR_PWRRST)) /** * @} */ /** @defgroup RCC_APB2_Force_Release_Reset APB2 Peripheral Force Release Reset * @brief Force or release APB2 peripheral reset. * @{ */ #define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0xFFFFFFFFU) #define __HAL_RCC_DBGMCU_FORCE_RESET() SET_BIT(RCC->APB2RSTR, (RCC_APB2RSTR_DBGMCURST)) #define __HAL_RCC_SYSCFG_FORCE_RESET() SET_BIT(RCC->APB2RSTR, (RCC_APB2RSTR_SYSCFGRST)) #define __HAL_RCC_APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00000000U) #define __HAL_RCC_DBGMCU_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, (RCC_APB2RSTR_DBGMCURST)) #define __HAL_RCC_SYSCFG_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, (RCC_APB2RSTR_SYSCFGRST)) /** * @} */ /** @defgroup RCC_AHB_Clock_Sleep_Enable_Disable AHB Peripheral Clock Sleep Enable Disable * @brief Enable or disable the AHB peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral activated clocks remain enabled during SLEEP mode. * @{ */ #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_CRCSMEN)) #define __HAL_RCC_MIF_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_MIFSMEN)) #define __HAL_RCC_SRAM_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_SRAMSMEN)) #define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_DMA1SMEN)) #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_CRCSMEN)) #define __HAL_RCC_MIF_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_MIFSMEN)) #define __HAL_RCC_SRAM_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_SRAMSMEN)) #define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHBSMENR, (RCC_AHBSMENR_DMA1SMEN)) /** * @} */ /** @defgroup RCC_IOPORT_Clock_Sleep_Enable_Disable IOPORT Peripheral Clock Sleep Enable Disable * @brief Enable or disable the IOPORT peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral activated clocks remain enabled during SLEEP mode. * @{ */ #define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() SET_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOASMEN)) #define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() SET_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOBSMEN)) #define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() SET_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOCSMEN)) #define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() SET_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOHSMEN)) #define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOASMEN)) #define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOBSMEN)) #define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOCSMEN)) #define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->IOPSMENR, (RCC_IOPSMENR_GPIOHSMEN)) /** * @} */ /** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable APB1 Peripheral Clock Sleep Enable Disable * @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral activated clocks remain enabled during SLEEP mode. * @{ */ #define __HAL_RCC_WWDG_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR, (RCC_APB1SMENR_WWDGSMEN)) #define __HAL_RCC_PWR_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR, (RCC_APB1SMENR_PWRSMEN)) #define __HAL_RCC_WWDG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR, (RCC_APB1SMENR_WWDGSMEN)) #define __HAL_RCC_PWR_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR, (RCC_APB1SMENR_PWRSMEN)) /** * @} */ /** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable APB2 Peripheral Clock Sleep Enable Disable * @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral activated clocks remain enabled during SLEEP mode. * @{ */ #define __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, (RCC_APB2SMENR_SYSCFGSMEN)) #define __HAL_RCC_DBGMCU_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, (RCC_APB2SMENR_DBGMCUSMEN)) #define __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, (RCC_APB2SMENR_SYSCFGSMEN)) #define __HAL_RCC_DBGMCU_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, (RCC_APB2SMENR_DBGMCUSMEN)) /** * @} */ /** @defgroup RCC_AHB_Clock_Sleep_Enable_Disable_Status AHB Peripheral Clock Sleep Enabled or Disabled Status * @brief Check whether the AHB peripheral clock during Low Power (Sleep) mode is enabled or not. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. * @{ */ #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_CRCSMEN) != RESET) #define __HAL_RCC_MIF_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_MIFSMEN) != RESET) #define __HAL_RCC_SRAM_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_SRAMSMEN) != RESET) #define __HAL_RCC_DMA1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_DMA1SMEN) != RESET) #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_CRCSMEN) == RESET) #define __HAL_RCC_MIF_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_MIFSMEN) == RESET) #define __HAL_RCC_SRAM_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_SRAMSMEN) == RESET) #define __HAL_RCC_DMA1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHBSMENR, RCC_AHBSMENR_DMA1SMEN) == RESET) /** * @} */ /** @defgroup RCC_IOPORT_Clock_Sleep_Enable_Disable_Status IOPORT Peripheral Clock Sleep Enabled or Disabled Status * @brief Check whether the IOPORT peripheral clock during Low Power (Sleep) mode is enabled or not. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. * @{ */ #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOASMEN) != RESET) #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOBSMEN) != RESET) #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOCSMEN) != RESET) #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOHSMEN) != RESET) #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOASMEN) == RESET) #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOBSMEN) == RESET) #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOCSMEN) == RESET) #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->IOPSMENR, RCC_IOPSMENR_GPIOHSMEN) == RESET) /** * @} */ /** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable_Status APB1 Peripheral Clock Sleep Enabled or Disabled Status * @brief Check whether the APB1 peripheral clock during Low Power (Sleep) mode is enabled or not. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. * @{ */ #define __HAL_RCC_WWDG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR, RCC_APB1SMENR_WWDGSMEN) != RESET) #define __HAL_RCC_PWR_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR, RCC_APB1SMENR_PWRSMEN) != RESET) #define __HAL_RCC_WWDG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR, RCC_APB1SMENR_WWDGSMEN) == RESET) #define __HAL_RCC_PWR_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR, RCC_APB1SMENR_PWRSMEN) == RESET) /** * @} */ /** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable_Status APB2 Peripheral Clock Sleep Enabled or Disabled Status * @brief Check whether the APB2 peripheral clock during Low Power (Sleep) mode is enabled or not. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. * @{ */ #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN) != RESET) #define __HAL_RCC_DBGMCU_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DBGMCUSMEN) != RESET) #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN) == RESET) #define __HAL_RCC_DBGMCU_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DBGMCUSMEN) == RESET) /** * @} */ /** @defgroup RCC_HSI_Configuration HSI Configuration * @{ */ /** @brief Macro to enable or disable the Internal High Speed oscillator (HSI). * @note After enabling the HSI, the application software should wait on * HSIRDY flag to be set indicating that HSI clock is stable and can * be used to clock the PLL and/or system clock. * @note HSI can not be stopped if it is used directly or through the PLL * as system clock. In this case, you have to select another source * of the system clock then stop the HSI. * @note The HSI is stopped by hardware when entering STOP and STANDBY modes. * @param __STATE__ specifies the new state of the HSI. * This parameter can be one of the following values: * @arg @ref RCC_HSI_OFF turn OFF the HSI oscillator * @arg @ref RCC_HSI_ON turn ON the HSI oscillator * @arg @ref RCC_HSI_DIV4 turn ON the HSI oscillator and divide it by 4 * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator * clock cycles. */ #define __HAL_RCC_HSI_CONFIG(__STATE__) \ MODIFY_REG(RCC->CR, RCC_CR_HSION | RCC_CR_HSIDIVEN , (uint32_t)(__STATE__)) /** @brief Macros to enable or disable the Internal High Speed oscillator (HSI). * @note The HSI is stopped by hardware when entering STOP and STANDBY modes. * It is used (enabled by hardware) as system clock source after startup * from Reset, wakeup from STOP and STANDBY mode, or in case of failure * of the HSE used directly or indirectly as system clock (if the Clock * Security System CSS is enabled). * @note HSI can not be stopped if it is used as system clock source. In this case, * you have to select another source of the system clock then stop the HSI. * @note After enabling the HSI, the application software should wait on HSIRDY * flag to be set indicating that HSI clock is stable and can be used as * system clock source. * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator * clock cycles. */ #define __HAL_RCC_HSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSION) #define __HAL_RCC_HSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSION) /** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value. * @note The calibration is used to compensate for the variations in voltage * and temperature that influence the frequency of the internal HSI RC. * @param _HSICALIBRATIONVALUE_ specifies the calibration trimming value. * (default is RCC_HSICALIBRATION_DEFAULT). * This parameter must be a number between 0 and 0x1F. */ #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(_HSICALIBRATIONVALUE_) \ (MODIFY_REG(RCC->ICSCR, RCC_ICSCR_HSITRIM, (uint32_t)(_HSICALIBRATIONVALUE_) << 8)) /** * @} */ /** @defgroup RCC_LSI_Configuration LSI Configuration * @{ */ /** @brief Macro to enable the Internal Low Speed oscillator (LSI). * @note After enabling the LSI, the application software should wait on * LSIRDY flag to be set indicating that LSI clock is stable and can * be used to clock the IWDG and/or the RTC. */ #define __HAL_RCC_LSI_ENABLE() SET_BIT(RCC->CSR, RCC_CSR_LSION) /** @brief Macro to disable the Internal Low Speed oscillator (LSI). * @note LSI can not be disabled if the IWDG is running. * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator * clock cycles. */ #define __HAL_RCC_LSI_DISABLE() CLEAR_BIT(RCC->CSR, RCC_CSR_LSION) /** * @} */ /** @defgroup RCC_HSE_Configuration HSE Configuration * @{ */ /** * @brief Macro to configure the External High Speed oscillator (HSE). * @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not * supported by this macro. User should request a transition to HSE Off * first and then HSE On or HSE Bypass. * @note After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application * software should wait on HSERDY flag to be set indicating that HSE clock * is stable and can be used to clock the PLL and/or system clock. * @note HSE state can not be changed if it is used directly or through the * PLL as system clock. In this case, you have to select another source * of the system clock then change the HSE state (ex. disable it). * @note The HSE is stopped by hardware when entering STOP and STANDBY modes. * @note This function reset the CSSON bit, so if the clock security system(CSS) * was previously enabled you have to enable it again after calling this * function. * @param __STATE__ specifies the new state of the HSE. * This parameter can be one of the following values: * @arg @ref RCC_HSE_OFF turn OFF the HSE oscillator, HSERDY flag goes low after * 6 HSE oscillator clock cycles. * @arg @ref RCC_HSE_ON turn ON the HSE oscillator * @arg @ref RCC_HSE_BYPASS HSE oscillator bypassed with external clock */ #define __HAL_RCC_HSE_CONFIG(__STATE__) \ do{ \ __IO uint32_t tmpreg; \ if ((__STATE__) == RCC_HSE_ON) \ { \ SET_BIT(RCC->CR, RCC_CR_HSEON); \ } \ else if ((__STATE__) == RCC_HSE_BYPASS) \ { \ SET_BIT(RCC->CR, RCC_CR_HSEBYP); \ SET_BIT(RCC->CR, RCC_CR_HSEON); \ } \ else \ { \ CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \ /* Delay after an RCC peripheral clock */ \ tmpreg = READ_BIT(RCC->CR, RCC_CR_HSEON); \ UNUSED(tmpreg); \ CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \ } \ }while(0) /** * @} */ /** @defgroup RCC_LSE_Configuration LSE Configuration * @{ */ /** * @brief Macro to configure the External Low Speed oscillator (LSE). * @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro. * @note As the LSE is in the Backup domain and write access is denied to * this domain after reset, you have to enable write access using * @ref HAL_PWR_EnableBkUpAccess() function before to configure the LSE * (to be done once after reset). * @note After enabling the LSE (RCC_LSE_ON or RCC_LSE_BYPASS), the application * software should wait on LSERDY flag to be set indicating that LSE clock * is stable and can be used to clock the RTC. * @param __STATE__ specifies the new state of the LSE. * This parameter can be one of the following values: * @arg @ref RCC_LSE_OFF turn OFF the LSE oscillator, LSERDY flag goes low after * 6 LSE oscillator clock cycles. * @arg @ref RCC_LSE_ON turn ON the LSE oscillator. * @arg @ref RCC_LSE_BYPASS LSE oscillator bypassed with external clock. */ #define __HAL_RCC_LSE_CONFIG(__STATE__) \ do{ \ if ((__STATE__) == RCC_LSE_ON) \ { \ SET_BIT(RCC->CSR, RCC_CSR_LSEON); \ } \ else if ((__STATE__) == RCC_LSE_OFF) \ { \ CLEAR_BIT(RCC->CSR, RCC_CSR_LSEON); \ CLEAR_BIT(RCC->CSR, RCC_CSR_LSEBYP); \ } \ else if ((__STATE__) == RCC_LSE_BYPASS) \ { \ SET_BIT(RCC->CSR, RCC_CSR_LSEBYP); \ SET_BIT(RCC->CSR, RCC_CSR_LSEON); \ } \ else \ { \ CLEAR_BIT(RCC->CSR, RCC_CSR_LSEON); \ CLEAR_BIT(RCC->CSR, RCC_CSR_LSEBYP); \ } \ }while(0) /** * @} */ /** @defgroup RCC_MSI_Configuration MSI Configuration * @{ */ /** @brief Macro to enable Internal Multi Speed oscillator (MSI). * @note After enabling the MSI, the application software should wait on MSIRDY * flag to be set indicating that MSI clock is stable and can be used as * system clock source. */ #define __HAL_RCC_MSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_MSION) /** @brief Macro to disable the Internal Multi Speed oscillator (MSI). * @note The MSI is stopped by hardware when entering STOP and STANDBY modes. * It is used (enabled by hardware) as system clock source after startup * from Reset, wakeup from STOP and STANDBY mode, or in case of failure * of the HSE used directly or indirectly as system clock (if the Clock * Security System CSS is enabled). * @note MSI can not be stopped if it is used as system clock source. In this case, * you have to select another source of the system clock then stop the MSI. * @note When the MSI is stopped, MSIRDY flag goes low after 6 MSI oscillator * clock cycles. */ #define __HAL_RCC_MSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_MSION) /** @brief Macro adjusts Internal Multi Speed oscillator (MSI) calibration value. * @note The calibration is used to compensate for the variations in voltage * and temperature that influence the frequency of the internal MSI RC. * Refer to the Application Note AN3300 for more details on how to * calibrate the MSI. * @param _MSICALIBRATIONVALUE_ specifies the calibration trimming value. * (default is RCC_MSICALIBRATION_DEFAULT). * This parameter must be a number between 0 and 0xFF. */ #define __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(_MSICALIBRATIONVALUE_) \ (MODIFY_REG(RCC->ICSCR, RCC_ICSCR_MSITRIM, (uint32_t)(_MSICALIBRATIONVALUE_) << 24)) /* @brief Macro to configures the Internal Multi Speed oscillator (MSI) clock range. * @note After restart from Reset or wakeup from STANDBY, the MSI clock is * around 2.097 MHz. The MSI clock does not change after wake-up from * STOP mode. * @note The MSI clock range can be modified on the fly. * @param _MSIRANGEVALUE_ specifies the MSI Clock range. * This parameter must be one of the following values: * @arg @ref RCC_MSIRANGE_0 MSI clock is around 65.536 KHz * @arg @ref RCC_MSIRANGE_1 MSI clock is around 131.072 KHz * @arg @ref RCC_MSIRANGE_2 MSI clock is around 262.144 KHz * @arg @ref RCC_MSIRANGE_3 MSI clock is around 524.288 KHz * @arg @ref RCC_MSIRANGE_4 MSI clock is around 1.048 MHz * @arg @ref RCC_MSIRANGE_5 MSI clock is around 2.097 MHz (default after Reset or wake-up from STANDBY) * @arg @ref RCC_MSIRANGE_6 MSI clock is around 4.194 MHz */ #define __HAL_RCC_MSI_RANGE_CONFIG(_MSIRANGEVALUE_) (MODIFY_REG(RCC->ICSCR, \ RCC_ICSCR_MSIRANGE, (uint32_t)(_MSIRANGEVALUE_))) /** @brief Macro to get the Internal Multi Speed oscillator (MSI) clock range in run mode * @retval MSI clock range. * This parameter must be one of the following values: * @arg @ref RCC_MSIRANGE_0 MSI clock is around 65.536 KHz * @arg @ref RCC_MSIRANGE_1 MSI clock is around 131.072 KHz * @arg @ref RCC_MSIRANGE_2 MSI clock is around 262.144 KHz * @arg @ref RCC_MSIRANGE_3 MSI clock is around 524.288 KHz * @arg @ref RCC_MSIRANGE_4 MSI clock is around 1.048 MHz * @arg @ref RCC_MSIRANGE_5 MSI clock is around 2.097 MHz (default after Reset or wake-up from STANDBY) * @arg @ref RCC_MSIRANGE_6 MSI clock is around 4.194 MHz */ #define __HAL_RCC_GET_MSI_RANGE() (uint32_t)(READ_BIT(RCC->ICSCR, RCC_ICSCR_MSIRANGE)) /** * @} */ /** @defgroup RCC_PLL_Configuration PLL Configuration * @{ */ /** @brief Macro to enable the main PLL. * @note After enabling the main PLL, the application software should wait on * PLLRDY flag to be set indicating that PLL clock is stable and can * be used as system clock source. * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes. */ #define __HAL_RCC_PLL_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLLON) /** @brief Macro to disable the main PLL. * @note The main PLL can not be disabled if it is used as system clock source */ #define __HAL_RCC_PLL_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLLON) /** @brief Macro to configure the main PLL clock source, multiplication and division factors. * @note This function must be used only when the main PLL is disabled. * * @param __RCC_PLLSOURCE__ specifies the PLL entry clock source. * This parameter can be one of the following values: * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry * @param __PLLMUL__ specifies the multiplication factor for PLL VCO output clock * This parameter can be one of the following values: * @arg @ref RCC_PLL_MUL3 PLLVCO = PLL clock entry x 3 * @arg @ref RCC_PLL_MUL4 PLLVCO = PLL clock entry x 4 * @arg @ref RCC_PLL_MUL6 PLLVCO = PLL clock entry x 6 * @arg @ref RCC_PLL_MUL8 PLLVCO = PLL clock entry x 8 * @arg @ref RCC_PLL_MUL12 PLLVCO = PLL clock entry x 12 * @arg @ref RCC_PLL_MUL16 PLLVCO = PLL clock entry x 16 * @arg @ref RCC_PLL_MUL24 PLLVCO = PLL clock entry x 24 * @arg @ref RCC_PLL_MUL32 PLLVCO = PLL clock entry x 32 * @arg @ref RCC_PLL_MUL48 PLLVCO = PLL clock entry x 48 * @note The PLL VCO clock frequency must not exceed 96 MHz when the product is in * Range 1, 48 MHz when the product is in Range 2 and 24 MHz when the product is * in Range 3. * * @param __PLLDIV__ specifies the division factor for PLL VCO input clock * This parameter can be one of the following values: * @arg @ref RCC_PLL_DIV2 PLL clock output = PLLVCO / 2 * @arg @ref RCC_PLL_DIV3 PLL clock output = PLLVCO / 3 * @arg @ref RCC_PLL_DIV4 PLL clock output = PLLVCO / 4 * */ #define __HAL_RCC_PLL_CONFIG(__RCC_PLLSOURCE__, __PLLMUL__, __PLLDIV__)\ MODIFY_REG(RCC->CFGR, (RCC_CFGR_PLLSRC|RCC_CFGR_PLLMUL|RCC_CFGR_PLLDIV),((__RCC_PLLSOURCE__) | (__PLLMUL__) | (__PLLDIV__))) /** @brief Get oscillator clock selected as PLL input clock * @retval The clock source used for PLL entry. The returned value can be one * of the following: * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL input clock * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL input clock */ #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLSRC))) /** * @} */ /** @defgroup RCC_Get_Clock_source Get Clock source * @{ */ /** * @brief Macro to configure the system clock source. * @param __SYSCLKSOURCE__ specifies the system clock source. * This parameter can be one of the following values: * @arg @ref RCC_SYSCLKSOURCE_MSI MSI oscillator is used as system clock source. * @arg @ref RCC_SYSCLKSOURCE_HSI HSI oscillator is used as system clock source. * @arg @ref RCC_SYSCLKSOURCE_HSE HSE oscillator is used as system clock source. * @arg @ref RCC_SYSCLKSOURCE_PLLCLK PLL output is used as system clock source. */ #define __HAL_RCC_SYSCLK_CONFIG(__SYSCLKSOURCE__) \ MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__SYSCLKSOURCE__)) /** @brief Macro to get the clock source used as system clock. * @retval The clock source used as system clock. The returned value can be one * of the following: * @arg @ref RCC_SYSCLKSOURCE_STATUS_MSI MSI used as system clock * @arg @ref RCC_SYSCLKSOURCE_STATUS_HSI HSI used as system clock * @arg @ref RCC_SYSCLKSOURCE_STATUS_HSE HSE used as system clock * @arg @ref RCC_SYSCLKSOURCE_STATUS_PLLCLK PLL used as system clock */ #define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR,RCC_CFGR_SWS))) /** * @} */ /** @defgroup RCCEx_MCOx_Clock_Config RCC Extended MCOx Clock Config * @{ */ /** @brief Macro to configure the MCO clock. * @param __MCOCLKSOURCE__ specifies the MCO clock source. * This parameter can be one of the following values: * @arg @ref RCC_MCO1SOURCE_NOCLOCK No clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_SYSCLK System Clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_HSI HSI oscillator clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_MSI MSI oscillator clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_HSE HSE oscillator clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_PLLCLK PLL clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_LSI LSI clock selected as MCO clock * @arg @ref RCC_MCO1SOURCE_LSE LSE clock selected as MCO clock @if STM32L052xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L053xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L062xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L063xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L072xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L073xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L082xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @elseif STM32L083xx * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO clock @endif * @param __MCODIV__ specifies the MCO clock prescaler. * This parameter can be one of the following values: * @arg @ref RCC_MCODIV_1 MCO clock source is divided by 1 * @arg @ref RCC_MCODIV_2 MCO clock source is divided by 2 * @arg @ref RCC_MCODIV_4 MCO clock source is divided by 4 * @arg @ref RCC_MCODIV_8 MCO clock source is divided by 8 * @arg @ref RCC_MCODIV_16 MCO clock source is divided by 16 */ #define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \ MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCOSEL | RCC_CFGR_MCO_PRE), ((__MCOCLKSOURCE__) | (__MCODIV__))) /** * @} */ /** @defgroup RCC_RTC_Clock_Configuration RCC RTC Clock Configuration * @{ */ /** @brief Macro to configure the RTC clock (RTCCLK). * @note As the RTC clock configuration bits are in the Backup domain and write * access is denied to this domain after reset, you have to enable write * access using the Power Backup Access macro before to configure * the RTC clock source (to be done once after reset). * @note Once the RTC clock is configured it cannot be changed unless the * Backup domain is reset using @ref __HAL_RCC_BACKUPRESET_FORCE() macro, or by * a Power On Reset (POR). * @note RTC prescaler cannot be modified if HSE is enabled (HSEON = 1). * * @param __RTC_CLKSOURCE__ specifies the RTC clock source. * This parameter can be one of the following values: * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV2 HSE divided by 2 selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV4 HSE divided by 4 selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV8 HSE divided by 8 selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV16 HSE divided by 16 selected as RTC clock * @note If the LSE or LSI is used as RTC clock source, the RTC continues to * work in STOP and STANDBY modes, and can be used as wakeup source. * However, when the HSE clock is used as RTC clock source, the RTC * cannot be used in STOP and STANDBY modes. * @note The maximum input clock frequency for RTC is 1MHz (when using HSE as * RTC clock source). */ #define __HAL_RCC_RTC_CLKPRESCALER(__RTC_CLKSOURCE__) do { \ if(((__RTC_CLKSOURCE__) & RCC_CSR_RTCSEL_HSE) == RCC_CSR_RTCSEL_HSE) \ { \ MODIFY_REG(RCC->CR, RCC_CR_RTCPRE, ((__RTC_CLKSOURCE__) & RCC_CR_RTCPRE)); \ } \ } while (0) #define __HAL_RCC_RTC_CONFIG(__RTC_CLKSOURCE__) do { \ __HAL_RCC_RTC_CLKPRESCALER(__RTC_CLKSOURCE__); \ RCC->CSR |= ((__RTC_CLKSOURCE__) & RCC_CSR_RTCSEL); \ } while (0) /** @brief Macro to get the RTC clock source. * @retval The clock source can be one of the following values: * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock * @arg @ref RCC_RTCCLKSOURCE_HSE_DIVX HSE divided by X selected as RTC clock (X can be retrieved thanks to @ref __HAL_RCC_GET_RTC_HSE_PRESCALER() */ #define __HAL_RCC_GET_RTC_SOURCE() (READ_BIT(RCC->CSR, RCC_CSR_RTCSEL)) /** * @brief Get the RTC and LCD HSE clock divider (RTCCLK / LCDCLK). * * @retval Returned value can be one of the following values: * @arg @ref RCC_RTC_HSE_DIV_2 HSE divided by 2 selected as RTC clock * @arg @ref RCC_RTC_HSE_DIV_4 HSE divided by 4 selected as RTC clock * @arg @ref RCC_RTC_HSE_DIV_8 HSE divided by 8 selected as RTC clock * @arg @ref RCC_RTC_HSE_DIV_16 HSE divided by 16 selected as RTC clock * */ #define __HAL_RCC_GET_RTC_HSE_PRESCALER() ((uint32_t)(READ_BIT(RCC->CR, RCC_CR_RTCPRE))) /** @brief Macro to enable the the RTC clock. * @note These macros must be used only after the RTC clock source was selected. */ #define __HAL_RCC_RTC_ENABLE() SET_BIT(RCC->CSR, RCC_CSR_RTCEN) /** @brief Macro to disable the the RTC clock. * @note These macros must be used only after the RTC clock source was selected. */ #define __HAL_RCC_RTC_DISABLE() CLEAR_BIT(RCC->CSR, RCC_CSR_RTCEN) /** @brief Macro to force the Backup domain reset. * @note This function resets the RTC peripheral (including the backup registers) * and the RTC clock source selection in RCC_CSR register. * @note The BKPSRAM is not affected by this reset. */ #define __HAL_RCC_BACKUPRESET_FORCE() SET_BIT(RCC->CSR, RCC_CSR_RTCRST) /** @brief Macros to release the Backup domain reset. */ #define __HAL_RCC_BACKUPRESET_RELEASE() CLEAR_BIT(RCC->CSR, RCC_CSR_RTCRST) /** * @} */ /** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management * @brief macros to manage the specified RCC Flags and interrupts. * @{ */ /** @brief Enable RCC interrupt. * @note The CSS interrupt doesn't have an enable bit; once the CSS is enabled * and if the HSE clock fails, the CSS interrupt occurs and an NMI is * automatically generated. The NMI will be executed indefinitely, and * since NMI has higher priority than any other IRQ (and main program) * the application will be stacked in the NMI ISR unless the CSS interrupt * pending bit is cleared. * @param __INTERRUPT__ specifies the RCC interrupt sources to be enabled. * This parameter can be any combination of the following values: * @arg @ref RCC_IT_LSIRDY LSI ready interrupt * @arg @ref RCC_IT_LSERDY LSE ready interrupt * @arg @ref RCC_IT_HSIRDY HSI ready interrupt * @arg @ref RCC_IT_HSERDY HSE ready interrupt * @arg @ref RCC_IT_PLLRDY main PLL ready interrupt * @arg @ref RCC_IT_MSIRDY MSI ready interrupt * @arg @ref RCC_IT_LSECSS LSE CSS interrupt * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt (not available on all devices) */ #define __HAL_RCC_ENABLE_IT(__INTERRUPT__) SET_BIT(RCC->CIER, (__INTERRUPT__)) /** @brief Disable RCC interrupt. * @note The CSS interrupt doesn't have an enable bit; once the CSS is enabled * and if the HSE clock fails, the CSS interrupt occurs and an NMI is * automatically generated. The NMI will be executed indefinitely, and * since NMI has higher priority than any other IRQ (and main program) * the application will be stacked in the NMI ISR unless the CSS interrupt * pending bit is cleared. * @param __INTERRUPT__ specifies the RCC interrupt sources to be disabled. * This parameter can be any combination of the following values: * @arg @ref RCC_IT_LSIRDY LSI ready interrupt * @arg @ref RCC_IT_LSERDY LSE ready interrupt * @arg @ref RCC_IT_HSIRDY HSI ready interrupt * @arg @ref RCC_IT_HSERDY HSE ready interrupt * @arg @ref RCC_IT_PLLRDY main PLL ready interrupt * @arg @ref RCC_IT_MSIRDY MSI ready interrupt * @arg @ref RCC_IT_LSECSS LSE CSS interrupt * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt (not available on all devices) */ #define __HAL_RCC_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(RCC->CIER, (__INTERRUPT__)) /** @brief Clear the RCC's interrupt pending bits. * @param __INTERRUPT__ specifies the interrupt pending bit to clear. * This parameter can be any combination of the following values: * @arg @ref RCC_IT_LSIRDY LSI ready interrupt. * @arg @ref RCC_IT_LSERDY LSE ready interrupt. * @arg @ref RCC_IT_HSIRDY HSI ready interrupt. * @arg @ref RCC_IT_HSERDY HSE ready interrupt. * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt. * @arg @ref RCC_IT_MSIRDY MSI ready interrupt * @arg @ref RCC_IT_LSECSS LSE CSS interrupt * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt (not available on all devices) * @arg @ref RCC_IT_CSS Clock Security System interrupt */ #define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (RCC->CICR = (__INTERRUPT__)) /** @brief Check the RCC's interrupt has occurred or not. * @param __INTERRUPT__ specifies the RCC interrupt source to check. * This parameter can be one of the following values: * @arg @ref RCC_IT_LSIRDY LSI ready interrupt * @arg @ref RCC_IT_LSERDY LSE ready interrupt * @arg @ref RCC_IT_HSIRDY HSI ready interrupt * @arg @ref RCC_IT_HSERDY HSE ready interrupt * @arg @ref RCC_IT_PLLRDY PLL ready interrupt * @arg @ref RCC_IT_MSIRDY MSI ready interrupt * @arg @ref RCC_IT_LSECSS LSE CSS interrupt * @arg @ref RCC_IT_CSS Clock Security System interrupt * @retval The new state of __INTERRUPT__ (TRUE or FALSE). */ #define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIFR & (__INTERRUPT__)) == (__INTERRUPT__)) /** @brief Set RMVF bit to clear the reset flags. * The reset flags are RCC_FLAG_PINRST, RCC_FLAG_PORRST, RCC_FLAG_SFTRST, * RCC_FLAG_OBLRST, RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST, RCC_FLAG_LPWRRST */ #define __HAL_RCC_CLEAR_RESET_FLAGS() (RCC->CSR |= RCC_CSR_RMVF) /** @brief Check RCC flag is set or not. * @param __FLAG__ specifies the flag to check. * This parameter can be one of the following values: * @arg @ref RCC_FLAG_HSIRDY HSI oscillator clock ready * @arg @ref RCC_FLAG_HSI48RDY HSI48 oscillator clock ready (not available on all devices) * @arg @ref RCC_FLAG_HSIDIV HSI16 divider flag * @arg @ref RCC_FLAG_MSIRDY MSI oscillator clock ready * @arg @ref RCC_FLAG_HSERDY HSE oscillator clock ready * @arg @ref RCC_FLAG_PLLRDY PLL clock ready * @arg @ref RCC_FLAG_LSECSS LSE oscillator clock CSS detected * @arg @ref RCC_FLAG_LSERDY LSE oscillator clock ready * @arg @ref RCC_FLAG_FWRST Firewall reset * @arg @ref RCC_FLAG_LSIRDY LSI oscillator clock ready * @arg @ref RCC_FLAG_OBLRST Option Byte Loader (OBL) reset * @arg @ref RCC_FLAG_PINRST Pin reset * @arg @ref RCC_FLAG_PORRST POR/PDR reset * @arg @ref RCC_FLAG_SFTRST Software reset * @arg @ref RCC_FLAG_IWDGRST Independent Watchdog reset * @arg @ref RCC_FLAG_WWDGRST Window Watchdog reset * @arg @ref RCC_FLAG_LPWRRST Low Power reset * @retval The new state of __FLAG__ (TRUE or FALSE). */ #if defined(RCC_HSI48_SUPPORT) #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((((__FLAG__) >> 5) == CR_REG_INDEX)? RCC->CR :((((__FLAG__) >> 5) == CSR_REG_INDEX) ? RCC->CSR :RCC->CRRCR)))) & ((uint32_t)1 << ((__FLAG__) & RCC_FLAG_MASK))) != 0 ) ? 1 : 0 ) #else #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((((__FLAG__) >> 5) == CR_REG_INDEX)? RCC->CR : RCC->CSR))) & ((uint32_t)1 << ((__FLAG__) & RCC_FLAG_MASK))) != 0 ) ? 1 : 0 ) #endif /* RCC_HSI48_SUPPORT */ /** * @} */ /** * @} */ /* Include RCC HAL Extension module */ #include "stm32l0xx_hal_rcc_ex.h" /* Exported functions --------------------------------------------------------*/ /** @addtogroup RCC_Exported_Functions * @{ */ /** @addtogroup RCC_Exported_Functions_Group1 * @{ */ /* Initialization and de-initialization functions ******************************/ void HAL_RCC_DeInit(void); HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct); HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency); /** * @} */ /** @addtogroup RCC_Exported_Functions_Group2 * @{ */ /* Peripheral Control functions ************************************************/ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv); #if defined(RCC_HSECSS_SUPPORT) void HAL_RCC_EnableCSS(void); /* CSS NMI IRQ handler */ void HAL_RCC_NMI_IRQHandler(void); /* User Callbacks in non blocking mode (IT mode) */ void HAL_RCC_CSSCallback(void); #endif /* RCC_HSECSS_SUPPORT */ uint32_t HAL_RCC_GetSysClockFreq(void); uint32_t HAL_RCC_GetHCLKFreq(void); uint32_t HAL_RCC_GetPCLK1Freq(void); uint32_t HAL_RCC_GetPCLK2Freq(void); void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct); void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency); /** * @} */ /** * @} */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* __STM32L0xx_HAL_RCC_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "content_hash": "712572d7cbcdbe767d0de41c7f470707", "timestamp": "", "source": "github", "line_count": 1721, "max_line_length": 221, "avg_line_length": 50.00581057524695, "alnum_prop": 0.5699744364396933, "repo_name": "Project-MAR/TGR2017-SIM", "id": "d64e705e8f6facc855dd3c67957223626c085634", "size": "88110", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "03-STM32L053-IOTClient/Drivers/STM32L0xx_HAL_Driver/Inc/stm32l0xx_hal_rcc.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "10686" }, { "name": "C", "bytes": "3043757" }, { "name": "C++", "bytes": "252372" }, { "name": "Python", "bytes": "28597" } ], "symlink_target": "" }
#ifndef SDLZHELPER_H #define SDLZHELPER_H /* * Types */ #define SDLZH_REQUIRE_CLIENT 0x01 #define SDLZH_REQUIRE_QUERY 0x02 #define SDLZH_REQUIRE_RECORD 0x04 #define SDLZH_REQUIRE_ZONE 0x08 typedef struct query_segment query_segment_t; typedef ISC_LIST(query_segment_t) query_list_t; typedef struct dbinstance dbinstance_t; typedef ISC_LIST(dbinstance_t) db_list_t; typedef struct driverinstance driverinstance_t; /*% * a query segment is all the text between our special tokens * special tokens are %zone%, %record%, %client% */ struct query_segment { void *sql; unsigned int strlen; isc_boolean_t direct; ISC_LINK(query_segment_t) link; }; /*% * a database instance contains everything we need for running * a query against the database. Using it each separate thread * can dynamically construct a query and execute it against the * database. The "instance_lock" and locking code in the driver's * make sure no two threads try to use the same DBI at a time. */ struct dbinstance { void *dbconn; query_list_t *allnodes_q; query_list_t *allowxfr_q; query_list_t *authority_q; query_list_t *findzone_q; query_list_t *lookup_q; query_list_t *countzone_q; char *query_buf; char *zone; char *record; char *client; isc_mem_t *mctx; isc_mutex_t instance_lock; ISC_LINK(dbinstance_t) link; }; /* * Method declarations */ /* see the code in sdlz_helper.c for more information on these methods */ char * sdlzh_build_querystring(isc_mem_t *mctx, query_list_t *querylist); isc_result_t sdlzh_build_sqldbinstance(isc_mem_t *mctx, const char *allnodes_str, const char *allowxfr_str, const char *authority_str, const char *findzone_str, const char *lookup_str, const char *countzone_str, dbinstance_t **dbi); void sdlzh_destroy_sqldbinstance(dbinstance_t *dbi); char * sdlzh_get_parameter_value(isc_mem_t *mctx, const char *input, const char* key); /* Compatability with existing DLZ drivers */ #define build_querystring sdlzh_build_querystring #define build_sqldbinstance sdlzh_build_sqldbinstance #define destroy_sqldbinstance sdlzh_destroy_sqldbinstance #define getParameterValue(x,y) sdlzh_get_parameter_value(ns_g_mctx, (x), (y)) #endif /* SDLZHELPER_H */
{ "content_hash": "b505f2c59f7d8054f29da2dd3b0695f7", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 26.61904761904762, "alnum_prop": 0.7303220035778175, "repo_name": "juneman/server-perf", "id": "764a05af7cf030b5f4495b18cc3990189847dee1", "size": "3911", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "contrib/dlz/drivers/include/dlz/sdlz_helper.h", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "11329" }, { "name": "C", "bytes": "14119666" }, { "name": "C++", "bytes": "814763" }, { "name": "CSS", "bytes": "3545" }, { "name": "Objective-C", "bytes": "8601" }, { "name": "Perl", "bytes": "228206" }, { "name": "Python", "bytes": "76120" }, { "name": "Shell", "bytes": "2377889" }, { "name": "Tcl", "bytes": "31803" }, { "name": "XSLT", "bytes": "77676" } ], "symlink_target": "" }
require 'rails_helper' RSpec.describe FundingLineItemType, :type => :model do let(:test_type) { create(:funding_line_item_type) } it '.to_s' do expect(test_type.to_s).to eq(test_type.code) end end
{ "content_hash": "b5695d145bddd4dd9cefcdcb0e3c46e7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 54, "avg_line_length": 21, "alnum_prop": 0.680952380952381, "repo_name": "camsys/transam_funding", "id": "f809b075bcdd3b3c83ab2754c8464b6c14689bf4", "size": "210", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "spec/models/funding_line_item_type_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "683" }, { "name": "HTML", "bytes": "7559" }, { "name": "Haml", "bytes": "229165" }, { "name": "JavaScript", "bytes": "3781" }, { "name": "Python", "bytes": "28330" }, { "name": "Ruby", "bytes": "378627" }, { "name": "SCSS", "bytes": "533" }, { "name": "Shell", "bytes": "1386" } ], "symlink_target": "" }
package io.dropwizard.testing.common; import com.fasterxml.jackson.databind.ObjectMapper; import io.dropwizard.testing.junit5.ResourceExtension; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.test.spi.TestContainerFactory; import javax.validation.Validator; import java.util.Map; import java.util.Set; import java.util.function.Consumer; /** * A configuration of a Jersey testing environment. * Encapsulates data required to configure a {@link ResourceExtension}. * Primarily accessed via {@link DropwizardTestResourceConfig}. */ class ResourceTestJerseyConfiguration { final Set<Object> singletons; final Set<Class<?>> providers; final Map<String, Object> properties; final ObjectMapper mapper; final Validator validator; final Consumer<ClientConfig> clientConfigurator; final TestContainerFactory testContainerFactory; final boolean registerDefaultExceptionMappers; ResourceTestJerseyConfiguration(Set<Object> singletons, Set<Class<?>> providers, Map<String, Object> properties, ObjectMapper mapper, Validator validator, Consumer<ClientConfig> clientConfigurator, TestContainerFactory testContainerFactory, boolean registerDefaultExceptionMappers) { this.singletons = singletons; this.providers = providers; this.properties = properties; this.mapper = mapper; this.validator = validator; this.clientConfigurator = clientConfigurator; this.testContainerFactory = testContainerFactory; this.registerDefaultExceptionMappers = registerDefaultExceptionMappers; } String getId() { return String.valueOf(hashCode()); } }
{ "content_hash": "05e99c7487a9e8f69458355522c841ab", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 121, "avg_line_length": 38.84444444444444, "alnum_prop": 0.738558352402746, "repo_name": "aaanders/dropwizard", "id": "ba2e47f01de83bf11a6c28afb0e3f3af28b4f7fb", "size": "1748", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dropwizard-testing/src/main/java/io/dropwizard/testing/common/ResourceTestJerseyConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "1002" }, { "name": "HTML", "bytes": "680" }, { "name": "Java", "bytes": "2402378" }, { "name": "Shell", "bytes": "6851" } ], "symlink_target": "" }
CONSUL_HTTP_ADDR=${CONSUL_HTTP_ADDR:-"localhost:8500"} KEY=$1 VALUE=$2 echo "Setting key $KEY to value $VALUE" curl -X PUT --data $VALUE http://$CONSUL_HTTP_ADDR/v1/kv/$KEY
{ "content_hash": "e203b8c4a28ce99944f9bc472978d590", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 61, "avg_line_length": 24.857142857142858, "alnum_prop": 0.7011494252873564, "repo_name": "andyalm/consul-rx", "id": "6c5a74bb2bf65c2d613a8a49d279df10b698713c", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Configuration.TestHarness/set-kv.sh", "mode": "33261", "license": "mit", "language": [ { "name": "C#", "bytes": "160375" }, { "name": "HTML", "bytes": "422" }, { "name": "Shell", "bytes": "1277" } ], "symlink_target": "" }
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig) class Ui_NovoPedido(object): def setupUi(self, NovoPedido): NovoPedido.setObjectName(_fromUtf8("NovoPedido")) NovoPedido.resize(743, 345) NovoPedido.move(550, 250) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("../Icons/mdpi.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) NovoPedido.setWindowIcon(icon) self.notaFiscalLabel = QtGui.QLabel(NovoPedido) self.notaFiscalLabel.setGeometry(QtCore.QRect(10, 20, 81, 17)) self.notaFiscalLabel.setObjectName(_fromUtf8("notaFiscalLabel")) self.label_2 = QtGui.QLabel(NovoPedido) self.label_2.setGeometry(QtCore.QRect(440, 20, 111, 17)) self.label_2.setObjectName(_fromUtf8("label_2")) self.label_4 = QtGui.QLabel(NovoPedido) self.label_4.setGeometry(QtCore.QRect(10, 270, 81, 17)) self.label_4.setObjectName(_fromUtf8("label_4")) self.label_5 = QtGui.QLabel(NovoPedido) self.label_5.setGeometry(QtCore.QRect(250, 310, 41, 17)) self.label_5.setObjectName(_fromUtf8("label_5")) self.label_6 = QtGui.QLabel(NovoPedido) self.label_6.setGeometry(QtCore.QRect(220, 270, 66, 17)) self.label_6.setObjectName(_fromUtf8("label_6")) self.cbTransportadora = QtGui.QComboBox(NovoPedido) self.cbTransportadora.setGeometry(QtCore.QRect(550, 10, 171, 31)) self.cbTransportadora.setObjectName(_fromUtf8("cbTransportadora")) self.tbFrete = QtGui.QPlainTextEdit(NovoPedido) self.tbFrete.setGeometry(QtCore.QRect(100, 260, 91, 31)) self.tbFrete.setPlainText(_fromUtf8("")) self.tbFrete.setObjectName(_fromUtf8("tbFrete")) self.tbDesconto = QtGui.QPlainTextEdit(NovoPedido) self.tbDesconto.setGeometry(QtCore.QRect(300, 260, 91, 31)) self.tbDesconto.setObjectName(_fromUtf8("tbDesconto")) self.lbTotal = QtGui.QLabel(NovoPedido) self.lbTotal.setGeometry(QtCore.QRect(300, 310, 91, 17)) self.lbTotal.setText(_fromUtf8("")) self.lbTotal.setObjectName(_fromUtf8("lbTotal")) self.tbNota = QtGui.QPlainTextEdit(NovoPedido) self.tbNota.setGeometry(QtCore.QRect(100, 10, 291, 31)) self.tbNota.setObjectName(_fromUtf8("tbNota")) self.btnSalvar = QtGui.QPushButton(NovoPedido) self.btnSalvar.setGeometry(QtCore.QRect(620, 300, 101, 27)) self.btnSalvar.setObjectName(_fromUtf8("btnSalvar")) self.btnCancelar = QtGui.QPushButton(NovoPedido) self.btnCancelar.setGeometry(QtCore.QRect(490, 300, 101, 27)) self.btnCancelar.setObjectName(_fromUtf8("btnCancelar")) self.tblItem = QtGui.QTableWidget(NovoPedido) self.tblItem.setGeometry(QtCore.QRect(10, 50, 381, 192)) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tblItem.sizePolicy().hasHeightForWidth()) self.tblItem.setSizePolicy(sizePolicy) self.tblItem.setMaximumSize(QtCore.QSize(541, 192)) self.tblItem.setAutoFillBackground(False) self.tblItem.setFrameShape(QtGui.QFrame.StyledPanel) self.tblItem.setFrameShadow(QtGui.QFrame.Sunken) self.tblItem.setLineWidth(1) self.tblItem.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.tblItem.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tblItem.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tblItem.setShowGrid(True) self.tblItem.setGridStyle(QtCore.Qt.SolidLine) self.tblItem.setWordWrap(True) self.tblItem.setCornerButtonEnabled(True) self.tblItem.setObjectName(_fromUtf8("tblItem")) self.tblItem.setColumnCount(3) self.tblItem.setRowCount(0) item = QtGui.QTableWidgetItem() self.tblItem.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tblItem.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tblItem.setHorizontalHeaderItem(2, item) self.tblItem.horizontalHeader().setVisible(True) self.tblItem.horizontalHeader().setCascadingSectionResizes(False) self.tblItem.horizontalHeader().setDefaultSectionSize(126) self.tblItem.horizontalHeader().setSortIndicatorShown(False) self.tblItem.horizontalHeader().setStretchLastSection(False) self.tblItem.verticalHeader().setVisible(False) self.tblItem.verticalHeader().setHighlightSections(True) self.frame = QtGui.QFrame(NovoPedido) self.frame.setGeometry(QtCore.QRect(400, 70, 321, 171)) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.frame.setObjectName(_fromUtf8("frame")) self.label_8 = QtGui.QLabel(self.frame) self.label_8.setGeometry(QtCore.QRect(190, 90, 41, 17)) self.label_8.setObjectName(_fromUtf8("label_8")) self.tbQtd = QtGui.QPlainTextEdit(self.frame) self.tbQtd.setGeometry(QtCore.QRect(120, 80, 51, 31)) self.tbQtd.setObjectName(_fromUtf8("tbQtd")) self.cbItem = QtGui.QComboBox(self.frame) self.cbItem.setGeometry(QtCore.QRect(100, 20, 121, 27)) self.cbItem.setObjectName(_fromUtf8("cbItem")) self.btnAdd = QtGui.QPushButton(self.frame) self.btnAdd.setGeometry(QtCore.QRect(250, 130, 41, 27)) self.btnAdd.setObjectName(_fromUtf8("btnAdd")) self.label_7 = QtGui.QLabel(self.frame) self.label_7.setGeometry(QtCore.QRect(20, 90, 91, 17)) self.label_7.setObjectName(_fromUtf8("label_7")) self.label_3 = QtGui.QLabel(self.frame) self.label_3.setGeometry(QtCore.QRect(20, 30, 81, 17)) self.label_3.setObjectName(_fromUtf8("label_3")) self.lbValor = QtGui.QLabel(self.frame) self.lbValor.setGeometry(QtCore.QRect(250, 90, 61, 17)) self.lbValor.setText(_fromUtf8("")) self.lbValor.setObjectName(_fromUtf8("lbValor")) self.btnRemove = QtGui.QPushButton(NovoPedido) self.btnRemove.setGeometry(QtCore.QRect(330, 230, 61, 27)) self.btnRemove.setObjectName(_fromUtf8("btnRemove")) self.btnCalcular = QtGui.QPushButton(NovoPedido) self.btnCalcular.setGeometry(QtCore.QRect(20, 300, 71, 27)) self.btnCalcular.setObjectName(_fromUtf8("btnCalcular")) self.retranslateUi(NovoPedido) QtCore.QMetaObject.connectSlotsByName(NovoPedido) def retranslateUi(self, NovoPedido): NovoPedido.setWindowTitle(_translate("NovoPedido", "Novo Pedido", None)) self.notaFiscalLabel.setText(_translate("NovoPedido", "Nota Fiscal:", None)) self.label_2.setText(_translate("NovoPedido", "Transportadora:", None)) self.label_4.setText(_translate("NovoPedido", "Valor Frete:", None)) self.label_5.setText(_translate("NovoPedido", "Total:", None)) self.label_6.setText(_translate("NovoPedido", "Desconto:", None)) self.btnSalvar.setText(_translate("NovoPedido", "Salvar", None)) self.btnCancelar.setText(_translate("NovoPedido", "Cancelar", None)) self.tblItem.setSortingEnabled(False) item = self.tblItem.horizontalHeaderItem(0) item.setText(_translate("NovoPedido", "Produto", None)) item = self.tblItem.horizontalHeaderItem(1) item.setText(_translate("NovoPedido", "Quantidade", None)) item = self.tblItem.horizontalHeaderItem(2) item.setText(_translate("NovoPedido", "Valor", None)) self.label_8.setText(_translate("NovoPedido", "Valor:", None)) self.btnAdd.setText(_translate("NovoPedido", "Add", None)) self.label_7.setText(_translate("NovoPedido", "Quantidade:", None)) self.label_3.setText(_translate("NovoPedido", "Novo Item:", None)) self.btnRemove.setText(_translate("NovoPedido", "Remove", None)) self.btnCalcular.setText(_translate("NovoPedido", "Calcular", None))
{ "content_hash": "d672e4eb460d8d2b579fdd8d63643e4f", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 106, "avg_line_length": 54.075949367088604, "alnum_prop": 0.6887874531835206, "repo_name": "rennancockles/gigapy", "id": "f3161d5dbaf31a3626f6b1bd406bdbf313deeefa", "size": "8569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "View/NovoPedidoView.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "112092" } ], "symlink_target": "" }
package tv.llel.supportclasses; import tv.llel.lollipop.widgets.R; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.LayerDrawable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.RelativeLayout; public class CheckBox extends CustomView{ int backgroundColor = Color.parseColor("#4CAF50"); Check checkView; boolean press = false; boolean check = false; OnCheckListener onCheckListener; public CheckBox(Context context, AttributeSet attrs) { super(context, attrs); setAttributes(attrs); } // Set atributtes of XML to View protected void setAttributes(AttributeSet attrs){ setBackgroundResource(R.drawable.background_checkbox); // Set size of view setMinimumHeight(Utils.dpToPx(48, getResources())); setMinimumWidth(Utils.dpToPx(48, getResources())); //Set background Color // Color by resource int bacgroundColor = attrs.getAttributeResourceValue(ANDROIDXML,"background",-1); if(bacgroundColor != -1){ setBackgroundColor(getResources().getColor(bacgroundColor)); }else{ // Color by hexadecimal String background = attrs.getAttributeValue(ANDROIDXML,"background"); if(background != null) setBackgroundColor(Color.parseColor(background)); } boolean check = attrs.getAttributeBooleanValue(MATERIALDESIGNXML,"check", false); if(check){ post(new Runnable() { @Override public void run() { setChecked(true); setPressed(false); changeBackgroundColor(getResources().getColor(android.R.color.transparent)); } }); } checkView = new Check(getContext()); RelativeLayout.LayoutParams params = new LayoutParams(Utils.dpToPx(20, getResources()),Utils.dpToPx(20, getResources())); params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE); checkView.setLayoutParams(params); addView(checkView); } @Override public boolean onTouchEvent(MotionEvent event) { isLastTouch = true; if (event.getAction() == MotionEvent.ACTION_DOWN) { changeBackgroundColor((check)?makePressColor():Color.parseColor("#446D6D6D")); } else if (event.getAction() == MotionEvent.ACTION_UP) { changeBackgroundColor(getResources().getColor(android.R.color.transparent)); press = false; if((event.getX()<= getWidth() && event.getX() >= 0) && (event.getY()<= getHeight() && event.getY() >= 0)){ isLastTouch = false; check = !check; if(onCheckListener != null) onCheckListener.onCheck(check); if(check){ step = 0; } if(check) checkView.changeBackground(); } } return true; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if(press){ Paint paint = new Paint(); paint.setAntiAlias(true); paint.setColor((check)?makePressColor():Color.parseColor("#446D6D6D")); canvas.drawCircle(getWidth()/2, getHeight()/2, getWidth()/2, paint); } invalidate(); } private void changeBackgroundColor(int color){ LayerDrawable layer = (LayerDrawable) getBackground(); GradientDrawable shape = (GradientDrawable) layer.findDrawableByLayerId(R.id.shape_bacground); shape.setColor(color); } /** * Make a dark color to press effect * @return */ protected int makePressColor(){ int r = (this.backgroundColor >> 16) & 0xFF; int g = (this.backgroundColor >> 8) & 0xFF; int b = (this.backgroundColor >> 0) & 0xFF; r = (r-30 < 0) ? 0 : r-30; g = (g-30 < 0) ? 0 : g-30; b = (b-30 < 0) ? 0 : b-30; return Color.argb(70,r, g, b); } @Override public void setBackgroundColor(int color) { backgroundColor = color; } public void setChecked(boolean check){ this.check = check; if(check){ step = 0; } if(check) checkView.changeBackground(); } public boolean isCheck(){ return check; } // Indicate step in check animation int step = 0; // View that contains checkbox class Check extends View{ Bitmap sprite; public Check(Context context) { super(context); setBackgroundResource(R.drawable.background_checkbox_uncheck); sprite = BitmapFactory.decodeResource(context.getResources(), R.drawable.sprite_check); } public void changeBackground(){ if(check){ setBackgroundResource(R.drawable.background_checkbox_check); LayerDrawable layer = (LayerDrawable) getBackground(); GradientDrawable shape = (GradientDrawable) layer.findDrawableByLayerId(R.id.shape_bacground); shape.setColor(backgroundColor); }else{ setBackgroundResource(R.drawable.background_checkbox_uncheck); } } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if(check){ if(step < 11) step++; }else{ if(step>=0) step--; if(step == -1) changeBackground(); } Rect src = new Rect(40*step, 0, (40*step)+40, 40); Rect dst = new Rect(0,0,this.getWidth()-2, this.getHeight()); canvas.drawBitmap(sprite, src, dst, null); invalidate(); } } public void setOncheckListener(OnCheckListener onCheckListener){ this.onCheckListener = onCheckListener; } public interface OnCheckListener{ public void onCheck(boolean check); } }
{ "content_hash": "520ddd34f154e0f44e4f572c57af3b54", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 124, "avg_line_length": 25.63302752293578, "alnum_prop": 0.6800286327845383, "repo_name": "llellabs/lollipopfx-kitkatjelly", "id": "38d5303895916ab2b44854684b98ecef93c18ae5", "size": "5588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lfx-widgets/src/tv/llel/supportclasses/CheckBox.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "86378" } ], "symlink_target": "" }
module UtaacDecisionHelpers def create_utaac_decision(fields, **kwargs) create_document(:utaac_decision, fields, **kwargs) end def go_to_show_page_for_utaac_decision(*args) go_to_show_page_for_document(:utaac_decision, *args) end def check_utaac_decision_exists_with(*args) check_document_exists_with(:utaac_decision, *args) end def go_to_utaac_decision_index visit_path_if_elsewhere(utaac_decisions_path) end def go_to_edit_page_for_utaac_decision(*args) go_to_edit_page_for_document(:utaac_decision, *args) end def edit_utaac_decision(title, *args) go_to_edit_page_for_utaac_decision(title) edit_document(title, *args) end def check_for_new_utaac_decision_title(*args) check_for_new_document_title(:utaac_decision, *args) end def withdraw_utaac_decision(*args) withdraw_document(:utaac_decision, *args) end def create_multiple_utaac_decisions(titles) titles.each do |title| create_document(:utaac_decision, utaac_decision_fields(title: title)) end end def utaac_decisions_are_visible(titles) titles.each { |t| utaac_decision_is_visible(t) } end def utaac_decision_is_visible(title) expect(page).to have_content(title) end def utaac_decisions_are_not_visible(titles) titles.each do |title| expect(page).not_to have_content(title) end end def utaac_decision_fields(overrides = {}) { title: "Lorem ipsum", summary: "Nullam quis risus eget urna mollis ornare vel eu leo.", body: "## Link to attachement:", "Category" => "Benefits for children", "Sub-category" => "Benefits for children - child benefit", "Judges" => "Angus, R", "Decision date" => "2015-02-02", "Hidden indexable content" => "## Header" + ("\n\nPraesent commodo cursus magna, vel scelerisque nisl consectetur et." * 10) }.merge(overrides) end def utaac_decision_rummager_fields(overrides = {}) fields = utaac_decision_fields(overrides) fields.delete(:body) fields.delete("Hidden indexable content") category = fields.delete("Category") sub_category = fields.delete("Sub-category") judges = fields.delete("Judges") fields[:tribunal_decision_category] = category.parameterize fields[:tribunal_decision_category_name] = category fields[:tribunal_decision_sub_category] = sub_category.parameterize fields[:tribunal_decision_sub_category_name] = sub_category fields[:tribunal_decision_judges] = [judges.parameterize] fields[:tribunal_decision_judges_name] = [judges] fields[:tribunal_decision_decision_date] = fields.delete("Decision date") fields end end RSpec.configuration.include UtaacDecisionHelpers, type: :feature
{ "content_hash": "09fee76ac7a5dd978623e1f52b7afed2", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 130, "avg_line_length": 31.790697674418606, "alnum_prop": 0.6978785662033651, "repo_name": "Catgov/10_specialist-publisher", "id": "7df55e8519cb4128b965a019086e3ea40b16f83b", "size": "2734", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "features/support/utaac_decision_helpers.rb", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "9495" }, { "name": "Cucumber", "bytes": "88501" }, { "name": "HTML", "bytes": "60336" }, { "name": "JavaScript", "bytes": "6248" }, { "name": "Ruby", "bytes": "610538" }, { "name": "Shell", "bytes": "3750" } ], "symlink_target": "" }
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <!-- Package description. --> Contains entry-point <b>Ignite & HPC APIs.</b> </body> </html>
{ "content_hash": "c8ff5f14ec09336541381b80ecae510d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 102, "avg_line_length": 42, "alnum_prop": 0.7390873015873016, "repo_name": "gridgain/apache-ignite", "id": "7aeece841df1d1320ab8ef0e8c5faac638a87637", "size": "1008", "binary": false, "copies": "1", "ref": "refs/heads/sprint-2", "path": "modules/core/src/main/java/org/apache/ignite/package.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "4522" }, { "name": "C++", "bytes": "28098" }, { "name": "CSS", "bytes": "17209" }, { "name": "HTML", "bytes": "260837" }, { "name": "Java", "bytes": "17999177" }, { "name": "JavaScript", "bytes": "1085" }, { "name": "PHP", "bytes": "18446" }, { "name": "Scala", "bytes": "732170" }, { "name": "Scilab", "bytes": "3923545" }, { "name": "Shell", "bytes": "407266" } ], "symlink_target": "" }
// Copyright 2014 The Cockroach Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the License. // // Author: Spencer Kimball (spencer.kimball@gmail.com) package storage import ( "bytes" "errors" "math" "github.com/cockroachdb/cockroach/keys" "github.com/cockroachdb/cockroach/roachpb" "github.com/cockroachdb/cockroach/storage/engine" "github.com/cockroachdb/cockroach/util" "github.com/cockroachdb/cockroach/util/encoding" "github.com/gogo/protobuf/proto" ) var errEmptyTxnID = errors.New("empty Transaction ID used in sequence cache") // The SequenceCache provides idempotence for request retries. Each // transactional request to a range specifies an Transaction ID and sequence number // which uniquely identifies a client command. After commands have // been replicated via Raft, they are executed against the state // machine and the results are stored in the SequenceCache. // // The SequenceCache stores responses in the underlying engine, using // keys derived from Range ID, txn ID and sequence number. // // A SequenceCache is not thread safe. Access to it is serialized // through Raft. type SequenceCache struct { rangeID roachpb.RangeID min, max roachpb.Key scratchEntry roachpb.SequenceCacheEntry scratchBuf [256]byte } // NewSequenceCache returns a new sequence cache. Every range replica // maintains a sequence cache, not just the leader. func NewSequenceCache(rangeID roachpb.RangeID) *SequenceCache { return &SequenceCache{ rangeID: rangeID, // The epoch and sequence numbers are encoded in decreasing order. min: keys.SequenceCacheKey(rangeID, txnIDMin, math.MaxUint32, math.MaxUint32), max: keys.SequenceCacheKey(rangeID, txnIDMax, 0, 0), } } var txnIDMin = bytes.Repeat([]byte{'\x00'}, roachpb.TransactionIDLen) var txnIDMax = bytes.Repeat([]byte{'\xff'}, roachpb.TransactionIDLen) // ClearData removes all persisted items stored in the cache. func (sc *SequenceCache) ClearData(e engine.Engine) error { _, err := engine.ClearRange(e, engine.MakeMVCCMetadataKey(sc.min), engine.MakeMVCCMetadataKey(sc.max)) return err } // Get looks up the latest sequence number recorded for this transaction ID. // The latest entry is that with the highest epoch (and then, highest // sequence). On a miss, zero is returned for both. If an entry is found and a // SequenceCacheEntry is provided, it is populated from the found value. func (sc *SequenceCache) Get(e engine.Engine, id []byte, dest *roachpb.SequenceCacheEntry) (uint32, uint32, error) { if len(id) == 0 { return 0, 0, errEmptyTxnID } // Pull response from disk and read into reply if available. Sequence // number sorts in decreasing order, so this gives us the largest entry or // an entry which isn't ours. To avoid encoding an end key for the scan, // we just scan and check via a simple prefix check whether we read a // key for "our" cache id. prefix := keys.SequenceCacheKeyPrefix(sc.rangeID, id) kvs, _, err := engine.MVCCScan(e, prefix, sc.max, 1, /* num */ roachpb.ZeroTimestamp, true /* consistent */, nil /* txn */) if err != nil || len(kvs) == 0 || !bytes.HasPrefix(kvs[0].Key, prefix) { return 0, 0, err } _, epoch, seq, err := decodeSequenceCacheKey(kvs[0].Key, sc.scratchBuf[:0]) if err != nil { return 0, 0, err } if dest != nil { dest.Reset() // Caller wants to have the unmarshaled value. if err := kvs[0].Value.GetProto(dest); err != nil { return 0, 0, err } } return epoch, seq, nil } // GetAllTransactionID returns all the key-value pairs for the given transaction ID from // the engine. func (sc *SequenceCache) GetAllTransactionID(e engine.Engine, id []byte) ([]roachpb.KeyValue, error) { prefix := keys.SequenceCacheKeyPrefix(sc.rangeID, id) kvs, _, err := engine.MVCCScan(e, prefix, prefix.PrefixEnd(), 0, /* max */ roachpb.ZeroTimestamp, true /* consistent */, nil /* txn */) return kvs, err } // Iterate walks through the sequence cache, invoking the given callback for // each unmarshaled entry with the key, the transaction ID and the decoded // entry. func (sc *SequenceCache) Iterate(e engine.Engine, f func([]byte, []byte, roachpb.SequenceCacheEntry)) { _, _ = engine.MVCCIterate(e, sc.min, sc.max, roachpb.ZeroTimestamp, true /* consistent */, nil /* txn */, false, /* !reverse */ func(kv roachpb.KeyValue) (bool, error) { var entry roachpb.SequenceCacheEntry id, _, _, err := decodeSequenceCacheKey(kv.Key, nil) if err != nil { panic(err) // TODO(tschottdorf): ReplicaCorruptionError } if err := kv.Value.GetProto(&entry); err != nil { panic(err) // TODO(tschottdorf): ReplicaCorruptionError } f(kv.Key, id, entry) return false, nil }) } func copySeqCache(e engine.Engine, srcID, dstID roachpb.RangeID, keyMin, keyMax engine.MVCCKey) error { var scratch [64]byte return e.Iterate(keyMin, keyMax, func(kv engine.MVCCKeyValue) (bool, error) { // Decode the key into a cmd, skipping on error. Otherwise, // write it to the corresponding key in the new cache. id, epoch, seq, err := decodeSequenceCacheMVCCKey(kv.Key, scratch[:0]) if err != nil { return false, util.Errorf("could not decode a sequence cache key %s: %s", kv.Key, err) } key := keys.SequenceCacheKey(dstID, id, epoch, seq) encKey := engine.MakeMVCCMetadataKey(key) // Decode the value, update the checksum and re-encode. meta := &engine.MVCCMetadata{} if err := proto.Unmarshal(kv.Value, meta); err != nil { return false, util.Errorf("could not decode sequence cache value %s [% x]: %s", kv.Key, kv.Value, err) } value := meta.Value() value.ClearChecksum() value.InitChecksum(key) meta.RawBytes = value.RawBytes _, _, err = engine.PutProto(e, encKey, meta) return false, err }) } // CopyInto copies all the results from this sequence cache into the destRangeID // sequence cache. Failures decoding individual cache entries return an error. func (sc *SequenceCache) CopyInto(e engine.Engine, destRangeID roachpb.RangeID) error { return copySeqCache(e, sc.rangeID, destRangeID, engine.MakeMVCCMetadataKey(sc.min), engine.MakeMVCCMetadataKey(sc.max)) } // CopyFrom copies all the persisted results from the originRangeID // sequence cache into this one. Note that the cache will not be // locked while copying is in progress. Failures decoding individual // entries return an error. The copy is done directly using the engine // instead of interpreting values through MVCC for efficiency. func (sc *SequenceCache) CopyFrom(e engine.Engine, originRangeID roachpb.RangeID) error { originMin := engine.MakeMVCCMetadataKey( keys.SequenceCacheKey(originRangeID, txnIDMin, math.MaxUint32, math.MaxUint32)) originMax := engine.MakeMVCCMetadataKey( keys.SequenceCacheKey(originRangeID, txnIDMax, 0, 0)) return copySeqCache(e, originRangeID, sc.rangeID, originMin, originMax) } // Put writes a sequence number for the specified transaction ID. func (sc *SequenceCache) Put(e engine.Engine, id []byte, epoch, seq uint32, txnKey roachpb.Key, txnTS roachpb.Timestamp, pErr *roachpb.Error) error { if seq <= 0 || len(id) == 0 { return errEmptyTxnID } if !sc.shouldCacheError(pErr) { return nil } // Write the response value to the engine. key := keys.SequenceCacheKey(sc.rangeID, id, epoch, seq) sc.scratchEntry = roachpb.SequenceCacheEntry{Key: txnKey, Timestamp: txnTS} return engine.MVCCPutProto(e, nil /* ms */, key, roachpb.ZeroTimestamp, nil /* txn */, &sc.scratchEntry) } // Responses with write-too-old, write-intent and not leader errors // are retried on the server, and so are not recorded in the sequence // cache in the hopes of retrying to a successful outcome. func (sc *SequenceCache) shouldCacheError(pErr *roachpb.Error) bool { switch pErr.GoError().(type) { case *roachpb.WriteTooOldError, *roachpb.WriteIntentError, *roachpb.NotLeaderError, *roachpb.RangeKeyMismatchError: return false } return true } func decodeSequenceCacheKey(key roachpb.Key, dest []byte) ([]byte, uint32, uint32, error) { // TODO(tschottdorf): redundant check. if !bytes.HasPrefix(key, keys.LocalRangeIDPrefix) { return nil, 0, 0, util.Errorf("key %s does not have %s prefix", key, keys.LocalRangeIDPrefix) } // Cut the prefix and the Range ID. b := key[len(keys.LocalRangeIDPrefix):] b, _, err := encoding.DecodeUvarintAscending(b) if err != nil { return nil, 0, 0, err } if !bytes.HasPrefix(b, keys.LocalSequenceCacheSuffix) { return nil, 0, 0, util.Errorf("key %s does not contain the sequence cache suffix %s", key, keys.LocalSequenceCacheSuffix) } // Cut the sequence cache suffix. b = b[len(keys.LocalSequenceCacheSuffix):] // Decode the id. b, id, err := encoding.DecodeBytesAscending(b, dest) if err != nil { return nil, 0, 0, err } // Decode the epoch. b, epoch, err := encoding.DecodeUint32Descending(b) if err != nil { return nil, 0, 0, err } // Decode the sequence number. b, seq, err := encoding.DecodeUint32Descending(b) if err != nil { return nil, 0, 0, err } if len(b) > 0 { return nil, 0, 0, util.Errorf("key %q has leftover bytes after decode: %s; indicates corrupt key", key, b) } return id, epoch, seq, nil } func decodeSequenceCacheMVCCKey(encKey engine.MVCCKey, dest []byte) ([]byte, uint32, uint32, error) { if encKey.IsValue() { return nil, 0, 0, util.Errorf("key %s is not a raw MVCC value", encKey) } return decodeSequenceCacheKey(encKey.Key, dest) }
{ "content_hash": "a04057a6e75b2821b267d7c1c68eec3b", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 149, "avg_line_length": 39.1897233201581, "alnum_prop": 0.7231467473524962, "repo_name": "marcuswestin/cockroach", "id": "152f3462b995e5f6d28df897953cb4a2a04927be", "size": "9915", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "storage/sequence_cache.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "1029" }, { "name": "C", "bytes": "5811" }, { "name": "C++", "bytes": "53887" }, { "name": "CSS", "bytes": "18910" }, { "name": "Go", "bytes": "4029390" }, { "name": "HCL", "bytes": "18689" }, { "name": "HTML", "bytes": "4837" }, { "name": "JavaScript", "bytes": "5490" }, { "name": "Makefile", "bytes": "18345" }, { "name": "Protocol Buffer", "bytes": "117602" }, { "name": "Ruby", "bytes": "1408" }, { "name": "Shell", "bytes": "33248" }, { "name": "Smarty", "bytes": "1504" }, { "name": "TypeScript", "bytes": "158984" }, { "name": "Yacc", "bytes": "88923" } ], "symlink_target": "" }
#include "includes.h" #include <dbus/dbus.h> #include "common.h" #include "eap_peer/eap_methods.h" #include "common/ieee802_11_defs.h" #include "eapol_supp/eapol_supp_sm.h" #include "rsn_supp/wpa.h" #include "../config.h" #include "../wpa_supplicant_i.h" #include "../driver_i.h" #include "../notify.h" #include "../wpas_glue.h" #include "../bss.h" #include "../scan.h" #include "dbus_old.h" #include "dbus_old_handlers.h" #include "dbus_dict_helpers.h" extern int wpa_debug_level; extern int wpa_debug_show_keys; extern int wpa_debug_timestamp; /** * wpas_dbus_new_invalid_opts_error - Return a new invalid options error message * @message: Pointer to incoming dbus message this error refers to * Returns: a dbus error message * * Convenience function to create and return an invalid options error */ DBusMessage * wpas_dbus_new_invalid_opts_error(DBusMessage *message, const char *arg) { DBusMessage *reply; reply = dbus_message_new_error(message, WPAS_ERROR_INVALID_OPTS, "Did not receive correct message " "arguments."); if (arg != NULL) dbus_message_append_args(reply, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID); return reply; } /** * wpas_dbus_new_success_reply - Return a new success reply message * @message: Pointer to incoming dbus message this reply refers to * Returns: a dbus message containing a single UINT32 that indicates * success (ie, a value of 1) * * Convenience function to create and return a success reply message */ DBusMessage * wpas_dbus_new_success_reply(DBusMessage *message) { DBusMessage *reply; unsigned int success = 1; reply = dbus_message_new_method_return(message); dbus_message_append_args(reply, DBUS_TYPE_UINT32, &success, DBUS_TYPE_INVALID); return reply; } /** * wpas_dbus_global_add_interface - Request registration of a network interface * @message: Pointer to incoming dbus message * @global: %wpa_supplicant global data structure * Returns: The object path of the new interface object, * or a dbus error message with more information * * Handler function for "addInterface" method call. Handles requests * by dbus clients to register a network interface that wpa_supplicant * will manage. */ DBusMessage * wpas_dbus_global_add_interface(DBusMessage *message, struct wpa_global *global) { char *ifname = NULL; char *driver = NULL; char *driver_param = NULL; char *confname = NULL; char *bridge_ifname = NULL; DBusMessage *reply = NULL; DBusMessageIter iter; dbus_message_iter_init(message, &iter); /* First argument: interface name (DBUS_TYPE_STRING) * Required; must be non-zero length */ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) goto error; dbus_message_iter_get_basic(&iter, &ifname); if (!os_strlen(ifname)) goto error; /* Second argument: dict of options */ if (dbus_message_iter_next(&iter)) { DBusMessageIter iter_dict; struct wpa_dbus_dict_entry entry; if (!wpa_dbus_dict_open_read(&iter, &iter_dict)) goto error; while (wpa_dbus_dict_has_dict_entry(&iter_dict)) { if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) goto error; if (!strcmp(entry.key, "driver") && (entry.type == DBUS_TYPE_STRING)) { driver = os_strdup(entry.str_value); wpa_dbus_dict_entry_clear(&entry); if (driver == NULL) goto error; } else if (!strcmp(entry.key, "driver-params") && (entry.type == DBUS_TYPE_STRING)) { driver_param = os_strdup(entry.str_value); wpa_dbus_dict_entry_clear(&entry); if (driver_param == NULL) goto error; } else if (!strcmp(entry.key, "config-file") && (entry.type == DBUS_TYPE_STRING)) { confname = os_strdup(entry.str_value); wpa_dbus_dict_entry_clear(&entry); if (confname == NULL) goto error; } else if (!strcmp(entry.key, "bridge-ifname") && (entry.type == DBUS_TYPE_STRING)) { bridge_ifname = os_strdup(entry.str_value); wpa_dbus_dict_entry_clear(&entry); if (bridge_ifname == NULL) goto error; } else { wpa_dbus_dict_entry_clear(&entry); goto error; } } } /* * Try to get the wpa_supplicant record for this iface, return * an error if we already control it. */ if (wpa_supplicant_get_iface(global, ifname) != NULL) { reply = dbus_message_new_error(message, WPAS_ERROR_EXISTS_ERROR, "wpa_supplicant already " "controls this interface."); } else { struct wpa_supplicant *wpa_s; struct wpa_interface iface; os_memset(&iface, 0, sizeof(iface)); iface.ifname = ifname; iface.driver = driver; iface.driver_param = driver_param; iface.confname = confname; iface.bridge_ifname = bridge_ifname; /* Otherwise, have wpa_supplicant attach to it. */ if ((wpa_s = wpa_supplicant_add_iface(global, &iface))) { const char *path = wpa_s->dbus_path; reply = dbus_message_new_method_return(message); dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); } else { reply = dbus_message_new_error(message, WPAS_ERROR_ADD_ERROR, "wpa_supplicant " "couldn't grab this " "interface."); } } out: os_free(driver); os_free(driver_param); os_free(confname); os_free(bridge_ifname); return reply; error: reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } /** * wpas_dbus_global_remove_interface - Request deregistration of an interface * @message: Pointer to incoming dbus message * @global: wpa_supplicant global data structure * Returns: a dbus message containing a UINT32 indicating success (1) or * failure (0), or returns a dbus error message with more information * * Handler function for "removeInterface" method call. Handles requests * by dbus clients to deregister a network interface that wpa_supplicant * currently manages. */ DBusMessage * wpas_dbus_global_remove_interface(DBusMessage *message, struct wpa_global *global) { struct wpa_supplicant *wpa_s; char *path; DBusMessage *reply = NULL; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } wpa_s = wpa_supplicant_get_iface_by_dbus_path(global, path); if (wpa_s == NULL) { reply = wpas_dbus_new_invalid_iface_error(message); goto out; } if (!wpa_supplicant_remove_iface(global, wpa_s, 0)) { reply = wpas_dbus_new_success_reply(message); } else { reply = dbus_message_new_error(message, WPAS_ERROR_REMOVE_ERROR, "wpa_supplicant couldn't " "remove this interface."); } out: return reply; } /** * wpas_dbus_global_get_interface - Get the object path for an interface name * @message: Pointer to incoming dbus message * @global: %wpa_supplicant global data structure * Returns: The object path of the interface object, * or a dbus error message with more information * * Handler function for "getInterface" method call. Handles requests * by dbus clients for the object path of an specific network interface. */ DBusMessage * wpas_dbus_global_get_interface(DBusMessage *message, struct wpa_global *global) { DBusMessage *reply = NULL; const char *ifname; const char *path; struct wpa_supplicant *wpa_s; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &ifname, DBUS_TYPE_INVALID)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } wpa_s = wpa_supplicant_get_iface(global, ifname); if (wpa_s == NULL) { reply = wpas_dbus_new_invalid_iface_error(message); goto out; } path = wpa_s->dbus_path; reply = dbus_message_new_method_return(message); dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); out: return reply; } /** * wpas_dbus_global_set_debugparams- Set the debug params * @message: Pointer to incoming dbus message * @global: %wpa_supplicant global data structure * Returns: a dbus message containing a UINT32 indicating success (1) or * failure (0), or returns a dbus error message with more information * * Handler function for "setDebugParams" method call. Handles requests * by dbus clients for the object path of an specific network interface. */ DBusMessage * wpas_dbus_global_set_debugparams(DBusMessage *message, struct wpa_global *global) { DBusMessage *reply = NULL; int debug_level; dbus_bool_t debug_timestamp; dbus_bool_t debug_show_keys; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_INT32, &debug_level, DBUS_TYPE_BOOLEAN, &debug_timestamp, DBUS_TYPE_BOOLEAN, &debug_show_keys, DBUS_TYPE_INVALID)) { return wpas_dbus_new_invalid_opts_error(message, NULL); } if (wpa_supplicant_set_debug_params(global, debug_level, debug_timestamp ? 1 : 0, debug_show_keys ? 1 : 0)) { return wpas_dbus_new_invalid_opts_error(message, NULL); } reply = wpas_dbus_new_success_reply(message); return reply; } /** * wpas_dbus_iface_scan - Request a wireless scan on an interface * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: a dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "scan" method call of a network device. Requests * that wpa_supplicant perform a wireless scan as soon as possible * on a particular wireless interface. */ DBusMessage * wpas_dbus_iface_scan(DBusMessage *message, struct wpa_supplicant *wpa_s) { wpa_s->scan_req = 2; wpa_supplicant_req_scan(wpa_s, 0, 0); return wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_scan_results - Get the results of a recent scan request * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: a dbus message containing a dbus array of objects paths, or returns * a dbus error message if not scan results could be found * * Handler function for "scanResults" method call of a network device. Returns * a dbus message containing the object paths of wireless networks found. */ DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; DBusMessageIter iter; DBusMessageIter sub_iter; struct wpa_bss *bss; /* Create and initialize the return message */ reply = dbus_message_new_method_return(message); dbus_message_iter_init_append(reply, &iter); dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &sub_iter); /* Loop through scan results and append each result's object path */ dl_list_for_each(bss, &wpa_s->bss_id, struct wpa_bss, list_id) { char path_buf[WPAS_DBUS_OBJECT_PATH_MAX]; char *path = path_buf; /* Construct the object path for this network. Note that ':' * is not a valid character in dbus object paths. */ os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX, "%s/" WPAS_DBUS_BSSIDS_PART "/" WPAS_DBUS_BSSID_FORMAT, wpa_s->dbus_path, MAC2STR(bss->bssid)); dbus_message_iter_append_basic(&sub_iter, DBUS_TYPE_OBJECT_PATH, &path); } dbus_message_iter_close_container(&iter, &sub_iter); return reply; } /** * wpas_dbus_bssid_properties - Return the properties of a scanned network * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * @res: wpa_supplicant scan result for which to get properties * Returns: a dbus message containing the properties for the requested network * * Handler function for "properties" method call of a scanned network. * Returns a dbus message containing the the properties. */ DBusMessage * wpas_dbus_bssid_properties(DBusMessage *message, struct wpa_supplicant *wpa_s, struct wpa_bss *bss) { DBusMessage *reply; DBusMessageIter iter, iter_dict; const u8 *ie; /* Dump the properties into a dbus message */ reply = dbus_message_new_method_return(message); dbus_message_iter_init_append(reply, &iter); if (!wpa_dbus_dict_open_write(&iter, &iter_dict)) goto error; if (!wpa_dbus_dict_append_byte_array(&iter_dict, "bssid", (const char *) bss->bssid, ETH_ALEN)) goto error; ie = wpa_bss_get_ie(bss, WLAN_EID_SSID); if (ie) { if (!wpa_dbus_dict_append_byte_array(&iter_dict, "ssid", (const char *) (ie + 2), ie[1])) goto error; } ie = wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE); if (ie) { if (!wpa_dbus_dict_append_byte_array(&iter_dict, "wpaie", (const char *) ie, ie[1] + 2)) goto error; } ie = wpa_bss_get_ie(bss, WLAN_EID_RSN); if (ie) { if (!wpa_dbus_dict_append_byte_array(&iter_dict, "rsnie", (const char *) ie, ie[1] + 2)) goto error; } ie = wpa_bss_get_vendor_ie(bss, WPS_IE_VENDOR_TYPE); if (ie) { if (!wpa_dbus_dict_append_byte_array(&iter_dict, "wpsie", (const char *) ie, ie[1] + 2)) goto error; } if (bss->freq) { if (!wpa_dbus_dict_append_int32(&iter_dict, "frequency", bss->freq)) goto error; } if (!wpa_dbus_dict_append_uint16(&iter_dict, "capabilities", bss->caps)) goto error; if (!(bss->flags & WPA_BSS_QUAL_INVALID) && !wpa_dbus_dict_append_int32(&iter_dict, "quality", bss->qual)) goto error; if (!(bss->flags & WPA_BSS_NOISE_INVALID) && !wpa_dbus_dict_append_int32(&iter_dict, "noise", bss->noise)) goto error; if (!(bss->flags & WPA_BSS_LEVEL_INVALID) && !wpa_dbus_dict_append_int32(&iter_dict, "level", bss->level)) goto error; if (!wpa_dbus_dict_append_int32(&iter_dict, "maxrate", wpa_bss_get_max_rate(bss) * 500000)) goto error; if (!wpa_dbus_dict_close_write(&iter, &iter_dict)) goto error; return reply; error: if (reply) dbus_message_unref(reply); return dbus_message_new_error(message, WPAS_ERROR_INTERNAL_ERROR, "an internal error occurred returning " "BSSID properties."); } /** * wpas_dbus_iface_capabilities - Return interface capabilities * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a dict of strings * * Handler function for "capabilities" method call of an interface. */ DBusMessage * wpas_dbus_iface_capabilities(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; struct wpa_driver_capa capa; int res; DBusMessageIter iter, iter_dict; char **eap_methods; size_t num_items; dbus_bool_t strict = FALSE; DBusMessageIter iter_dict_entry, iter_dict_val, iter_array; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_BOOLEAN, &strict, DBUS_TYPE_INVALID)) strict = FALSE; reply = dbus_message_new_method_return(message); dbus_message_iter_init_append(reply, &iter); if (!wpa_dbus_dict_open_write(&iter, &iter_dict)) goto error; /* EAP methods */ eap_methods = eap_get_names_as_string_array(&num_items); if (eap_methods) { dbus_bool_t success = FALSE; size_t i = 0; success = wpa_dbus_dict_append_string_array( &iter_dict, "eap", (const char **) eap_methods, num_items); /* free returned method array */ while (eap_methods[i]) os_free(eap_methods[i++]); os_free(eap_methods); if (!success) goto error; } res = wpa_drv_get_capa(wpa_s, &capa); /***** pairwise cipher */ if (res < 0) { if (!strict) { const char *args[] = {"CCMP", "TKIP", "NONE"}; if (!wpa_dbus_dict_append_string_array( &iter_dict, "pairwise", args, sizeof(args) / sizeof(char*))) goto error; } } else { if (!wpa_dbus_dict_begin_string_array(&iter_dict, "pairwise", &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; if (capa.enc & WPA_DRIVER_CAPA_ENC_CCMP) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "CCMP")) goto error; } if (capa.enc & WPA_DRIVER_CAPA_ENC_TKIP) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "TKIP")) goto error; } if (capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "NONE")) goto error; } if (!wpa_dbus_dict_end_string_array(&iter_dict, &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; } /***** group cipher */ if (res < 0) { if (!strict) { const char *args[] = { "CCMP", "TKIP", "WEP104", "WEP40" }; if (!wpa_dbus_dict_append_string_array( &iter_dict, "group", args, sizeof(args) / sizeof(char*))) goto error; } } else { if (!wpa_dbus_dict_begin_string_array(&iter_dict, "group", &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; if (capa.enc & WPA_DRIVER_CAPA_ENC_CCMP) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "CCMP")) goto error; } if (capa.enc & WPA_DRIVER_CAPA_ENC_TKIP) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "TKIP")) goto error; } if (capa.enc & WPA_DRIVER_CAPA_ENC_WEP104) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WEP104")) goto error; } if (capa.enc & WPA_DRIVER_CAPA_ENC_WEP40) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WEP40")) goto error; } if (!wpa_dbus_dict_end_string_array(&iter_dict, &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; } /***** key management */ if (res < 0) { if (!strict) { const char *args[] = { "WPA-PSK", "WPA-EAP", "IEEE8021X", "WPA-NONE", "NONE" }; if (!wpa_dbus_dict_append_string_array( &iter_dict, "key_mgmt", args, sizeof(args) / sizeof(char*))) goto error; } } else { if (!wpa_dbus_dict_begin_string_array(&iter_dict, "key_mgmt", &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; if (!wpa_dbus_dict_string_array_add_element(&iter_array, "NONE")) goto error; if (!wpa_dbus_dict_string_array_add_element(&iter_array, "IEEE8021X")) goto error; if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA | WPA_DRIVER_CAPA_KEY_MGMT_WPA2)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WPA-EAP")) goto error; } if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK | WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WPA-PSK")) goto error; } if (capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WPA-NONE")) goto error; } if (!wpa_dbus_dict_end_string_array(&iter_dict, &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; } /***** WPA protocol */ if (res < 0) { if (!strict) { const char *args[] = { "RSN", "WPA" }; if (!wpa_dbus_dict_append_string_array( &iter_dict, "proto", args, sizeof(args) / sizeof(char*))) goto error; } } else { if (!wpa_dbus_dict_begin_string_array(&iter_dict, "proto", &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA2 | WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "RSN")) goto error; } if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA | WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "WPA")) goto error; } if (!wpa_dbus_dict_end_string_array(&iter_dict, &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; } /***** auth alg */ if (res < 0) { if (!strict) { const char *args[] = { "OPEN", "SHARED", "LEAP" }; if (!wpa_dbus_dict_append_string_array( &iter_dict, "auth_alg", args, sizeof(args) / sizeof(char*))) goto error; } } else { if (!wpa_dbus_dict_begin_string_array(&iter_dict, "auth_alg", &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; if (capa.auth & (WPA_DRIVER_AUTH_OPEN)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "OPEN")) goto error; } if (capa.auth & (WPA_DRIVER_AUTH_SHARED)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "SHARED")) goto error; } if (capa.auth & (WPA_DRIVER_AUTH_LEAP)) { if (!wpa_dbus_dict_string_array_add_element( &iter_array, "LEAP")) goto error; } if (!wpa_dbus_dict_end_string_array(&iter_dict, &iter_dict_entry, &iter_dict_val, &iter_array)) goto error; } if (!wpa_dbus_dict_close_write(&iter, &iter_dict)) goto error; return reply; error: if (reply) dbus_message_unref(reply); return dbus_message_new_error(message, WPAS_ERROR_INTERNAL_ERROR, "an internal error occurred returning " "interface capabilities."); } /** * wpas_dbus_iface_add_network - Add a new configured network * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing the object path of the new network * * Handler function for "addNetwork" method call of a network interface. */ DBusMessage * wpas_dbus_iface_add_network(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; struct wpa_ssid *ssid; char path_buf[WPAS_DBUS_OBJECT_PATH_MAX], *path = path_buf; ssid = wpa_config_add_network(wpa_s->conf); if (ssid == NULL) { reply = dbus_message_new_error(message, WPAS_ERROR_ADD_NETWORK_ERROR, "wpa_supplicant could not add " "a network on this interface."); goto out; } wpas_notify_network_added(wpa_s, ssid); ssid->disabled = 1; wpa_config_set_network_defaults(ssid); /* Construct the object path for this network. */ os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX, "%s/" WPAS_DBUS_NETWORKS_PART "/%d", wpa_s->dbus_path, ssid->id); reply = dbus_message_new_method_return(message); dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); out: return reply; } /** * wpas_dbus_iface_remove_network - Remove a configured network * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "removeNetwork" method call of a network interface. */ DBusMessage * wpas_dbus_iface_remove_network(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; const char *op; char *iface = NULL, *net_id = NULL; int id; struct wpa_ssid *ssid; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &op, DBUS_TYPE_INVALID)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } /* Extract the network ID */ iface = wpas_dbus_decompose_object_path(op, &net_id, NULL); if (iface == NULL) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } /* Ensure the network is actually a child of this interface */ if (os_strcmp(iface, wpa_s->dbus_path) != 0) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } id = strtoul(net_id, NULL, 10); ssid = wpa_config_get_network(wpa_s->conf, id); if (ssid == NULL) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } wpas_notify_network_removed(wpa_s, ssid); if (wpa_config_remove_network(wpa_s->conf, id) < 0) { reply = dbus_message_new_error(message, WPAS_ERROR_REMOVE_NETWORK_ERROR, "error removing the specified " "on this interface."); goto out; } if (ssid == wpa_s->current_ssid) wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); reply = wpas_dbus_new_success_reply(message); out: os_free(iface); os_free(net_id); return reply; } static const char *dont_quote[] = { "key_mgmt", "proto", "pairwise", "auth_alg", "group", "eap", "opensc_engine_path", "pkcs11_engine_path", "pkcs11_module_path", "bssid", NULL }; static dbus_bool_t should_quote_opt(const char *key) { int i = 0; while (dont_quote[i] != NULL) { if (strcmp(key, dont_quote[i]) == 0) return FALSE; i++; } return TRUE; } /** * wpas_dbus_iface_set_network - Set options for a configured network * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * @ssid: wpa_ssid structure for a configured network * Returns: a dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "set" method call of a configured network. */ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message, struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { DBusMessage *reply = NULL; struct wpa_dbus_dict_entry entry = { .type = DBUS_TYPE_STRING }; DBusMessageIter iter, iter_dict; dbus_message_iter_init(message, &iter); if (!wpa_dbus_dict_open_read(&iter, &iter_dict)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } while (wpa_dbus_dict_has_dict_entry(&iter_dict)) { char *value = NULL; size_t size = 50; int ret; if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } /* Type conversions, since wpa_supplicant wants strings */ if (entry.type == DBUS_TYPE_ARRAY && entry.array_type == DBUS_TYPE_BYTE) { if (entry.array_len <= 0) goto error; size = entry.array_len * 2 + 1; value = os_zalloc(size); if (value == NULL) goto error; ret = wpa_snprintf_hex(value, size, (u8 *) entry.bytearray_value, entry.array_len); if (ret <= 0) goto error; } else if (entry.type == DBUS_TYPE_STRING) { if (should_quote_opt(entry.key)) { size = os_strlen(entry.str_value); /* Zero-length option check */ if (size <= 0) goto error; size += 3; /* For quotes and terminator */ value = os_zalloc(size); if (value == NULL) goto error; ret = os_snprintf(value, size, "\"%s\"", entry.str_value); if (ret < 0 || (size_t) ret != (size - 1)) goto error; } else { value = os_strdup(entry.str_value); if (value == NULL) goto error; } } else if (entry.type == DBUS_TYPE_UINT32) { value = os_zalloc(size); if (value == NULL) goto error; ret = os_snprintf(value, size, "%u", entry.uint32_value); if (ret <= 0) goto error; } else if (entry.type == DBUS_TYPE_INT32) { value = os_zalloc(size); if (value == NULL) goto error; ret = os_snprintf(value, size, "%d", entry.int32_value); if (ret <= 0) goto error; } else goto error; if (wpa_config_set(ssid, entry.key, value, 0) < 0) goto error; if ((os_strcmp(entry.key, "psk") == 0 && value[0] == '"' && ssid->ssid_len) || (os_strcmp(entry.key, "ssid") == 0 && ssid->passphrase)) wpa_config_update_psk(ssid); else if (os_strcmp(entry.key, "priority") == 0) wpa_config_update_prio_list(wpa_s->conf); os_free(value); wpa_dbus_dict_entry_clear(&entry); continue; error: os_free(value); reply = wpas_dbus_new_invalid_opts_error(message, entry.key); wpa_dbus_dict_entry_clear(&entry); break; } if (!reply) reply = wpas_dbus_new_success_reply(message); out: return reply; } /** * wpas_dbus_iface_enable_network - Mark a configured network as enabled * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * @ssid: wpa_ssid structure for a configured network * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "enable" method call of a configured network. */ DBusMessage * wpas_dbus_iface_enable_network(DBusMessage *message, struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { wpa_supplicant_enable_network(wpa_s, ssid); return wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_disable_network - Mark a configured network as disabled * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * @ssid: wpa_ssid structure for a configured network * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "disable" method call of a configured network. */ DBusMessage * wpas_dbus_iface_disable_network(DBusMessage *message, struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { wpa_supplicant_disable_network(wpa_s, ssid); return wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_select_network - Attempt association with a configured network * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "selectNetwork" method call of network interface. */ DBusMessage * wpas_dbus_iface_select_network(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; const char *op; struct wpa_ssid *ssid; char *iface_obj_path = NULL; char *network = NULL; if (os_strlen(dbus_message_get_signature(message)) == 0) { /* Any network */ ssid = NULL; } else { int nid; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &op, DBUS_TYPE_INVALID)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } /* Extract the network number */ iface_obj_path = wpas_dbus_decompose_object_path(op, &network, NULL); if (iface_obj_path == NULL) { reply = wpas_dbus_new_invalid_iface_error(message); goto out; } /* Ensure the object path really points to this interface */ if (os_strcmp(iface_obj_path, wpa_s->dbus_path) != 0) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } nid = strtoul(network, NULL, 10); if (errno == EINVAL) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } ssid = wpa_config_get_network(wpa_s->conf, nid); if (ssid == NULL) { reply = wpas_dbus_new_invalid_network_error(message); goto out; } } /* Finally, associate with the network */ wpa_supplicant_select_network(wpa_s, ssid); reply = wpas_dbus_new_success_reply(message); out: os_free(iface_obj_path); os_free(network); return reply; } /** * wpas_dbus_iface_disconnect - Terminate the current connection * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "disconnect" method call of network interface. */ DBusMessage * wpas_dbus_iface_disconnect(DBusMessage *message, struct wpa_supplicant *wpa_s) { wpa_s->disconnected = 1; wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); return wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_set_ap_scan - Control roaming mode * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "setAPScan" method call. */ DBusMessage * wpas_dbus_iface_set_ap_scan(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; dbus_uint32_t ap_scan = 1; if (!dbus_message_get_args(message, NULL, DBUS_TYPE_UINT32, &ap_scan, DBUS_TYPE_INVALID)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } if (wpa_supplicant_set_ap_scan(wpa_s, ap_scan)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); goto out; } reply = wpas_dbus_new_success_reply(message); out: return reply; } /** * wpas_dbus_iface_set_smartcard_modules - Set smartcard related module paths * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Handler function for "setSmartcardModules" method call. */ DBusMessage * wpas_dbus_iface_set_smartcard_modules( DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessageIter iter, iter_dict; char *opensc_engine_path = NULL; char *pkcs11_engine_path = NULL; char *pkcs11_module_path = NULL; struct wpa_dbus_dict_entry entry; if (!dbus_message_iter_init(message, &iter)) goto error; if (!wpa_dbus_dict_open_read(&iter, &iter_dict)) goto error; while (wpa_dbus_dict_has_dict_entry(&iter_dict)) { if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) goto error; if (!strcmp(entry.key, "opensc_engine_path") && (entry.type == DBUS_TYPE_STRING)) { opensc_engine_path = os_strdup(entry.str_value); if (opensc_engine_path == NULL) goto error; } else if (!strcmp(entry.key, "pkcs11_engine_path") && (entry.type == DBUS_TYPE_STRING)) { pkcs11_engine_path = os_strdup(entry.str_value); if (pkcs11_engine_path == NULL) goto error; } else if (!strcmp(entry.key, "pkcs11_module_path") && (entry.type == DBUS_TYPE_STRING)) { pkcs11_module_path = os_strdup(entry.str_value); if (pkcs11_module_path == NULL) goto error; } else { wpa_dbus_dict_entry_clear(&entry); goto error; } wpa_dbus_dict_entry_clear(&entry); } os_free(wpa_s->conf->opensc_engine_path); wpa_s->conf->opensc_engine_path = opensc_engine_path; os_free(wpa_s->conf->pkcs11_engine_path); wpa_s->conf->pkcs11_engine_path = pkcs11_engine_path; os_free(wpa_s->conf->pkcs11_module_path); wpa_s->conf->pkcs11_module_path = pkcs11_module_path; wpa_sm_set_eapol(wpa_s->wpa, NULL); eapol_sm_deinit(wpa_s->eapol); wpa_s->eapol = NULL; wpa_supplicant_init_eapol(wpa_s); wpa_sm_set_eapol(wpa_s->wpa, wpa_s->eapol); return wpas_dbus_new_success_reply(message); error: os_free(opensc_engine_path); os_free(pkcs11_engine_path); os_free(pkcs11_module_path); return wpas_dbus_new_invalid_opts_error(message, NULL); } /** * wpas_dbus_iface_get_state - Get interface state * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing a STRING representing the current * interface state * * Handler function for "state" method call. */ DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; const char *str_state; reply = dbus_message_new_method_return(message); if (reply != NULL) { str_state = wpa_supplicant_state_txt(wpa_s->wpa_state); dbus_message_append_args(reply, DBUS_TYPE_STRING, &str_state, DBUS_TYPE_INVALID); } return reply; } /** * wpas_dbus_iface_get_scanning - Get interface scanning state * @message: Pointer to incoming dbus message * @wpa_s: wpa_supplicant structure for a network interface * Returns: A dbus message containing whether the interface is scanning * * Handler function for "scanning" method call. */ DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE; reply = dbus_message_new_method_return(message); if (reply != NULL) { dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &scanning, DBUS_TYPE_INVALID); } else { wpa_printf(MSG_ERROR, "dbus: Not enough memory to return " "scanning state"); } return reply; } /** * wpas_dbus_iface_set_blobs - Store named binary blobs (ie, for certificates) * @message: Pointer to incoming dbus message * @wpa_s: %wpa_supplicant data structure * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Asks wpa_supplicant to internally store a one or more binary blobs. */ DBusMessage * wpas_dbus_iface_set_blobs(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessage *reply = NULL; struct wpa_dbus_dict_entry entry = { .type = DBUS_TYPE_STRING }; DBusMessageIter iter, iter_dict; dbus_message_iter_init(message, &iter); if (!wpa_dbus_dict_open_read(&iter, &iter_dict)) return wpas_dbus_new_invalid_opts_error(message, NULL); while (wpa_dbus_dict_has_dict_entry(&iter_dict)) { struct wpa_config_blob *blob; if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) { reply = wpas_dbus_new_invalid_opts_error(message, NULL); break; } if (entry.type != DBUS_TYPE_ARRAY || entry.array_type != DBUS_TYPE_BYTE) { reply = wpas_dbus_new_invalid_opts_error( message, "Byte array expected."); break; } if ((entry.array_len <= 0) || (entry.array_len > 65536) || !strlen(entry.key)) { reply = wpas_dbus_new_invalid_opts_error( message, "Invalid array size."); break; } blob = os_zalloc(sizeof(*blob)); if (blob == NULL) { reply = dbus_message_new_error( message, WPAS_ERROR_ADD_ERROR, "Not enough memory to add blob."); break; } blob->data = os_zalloc(entry.array_len); if (blob->data == NULL) { reply = dbus_message_new_error( message, WPAS_ERROR_ADD_ERROR, "Not enough memory to add blob data."); os_free(blob); break; } blob->name = os_strdup(entry.key); blob->len = entry.array_len; os_memcpy(blob->data, (u8 *) entry.bytearray_value, entry.array_len); if (blob->name == NULL || blob->data == NULL) { wpa_config_free_blob(blob); reply = dbus_message_new_error( message, WPAS_ERROR_ADD_ERROR, "Error adding blob."); break; } /* Success */ if (!wpa_config_remove_blob(wpa_s->conf, blob->name)) wpas_notify_blob_removed(wpa_s, blob->name); wpa_config_set_blob(wpa_s->conf, blob); wpas_notify_blob_added(wpa_s, blob->name); wpa_dbus_dict_entry_clear(&entry); } wpa_dbus_dict_entry_clear(&entry); return reply ? reply : wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_remove_blob - Remove named binary blobs * @message: Pointer to incoming dbus message * @wpa_s: %wpa_supplicant data structure * Returns: A dbus message containing a UINT32 indicating success (1) or * failure (0) * * Asks wpa_supplicant to remove one or more previously stored binary blobs. */ DBusMessage * wpas_dbus_iface_remove_blobs(DBusMessage *message, struct wpa_supplicant *wpa_s) { DBusMessageIter iter, array; char *err_msg = NULL; dbus_message_iter_init(message, &iter); if ((dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_ARRAY) || (dbus_message_iter_get_element_type (&iter) != DBUS_TYPE_STRING)) return wpas_dbus_new_invalid_opts_error(message, NULL); dbus_message_iter_recurse(&iter, &array); while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) { const char *name; dbus_message_iter_get_basic(&array, &name); if (!os_strlen(name)) err_msg = "Invalid blob name."; if (wpa_config_remove_blob(wpa_s->conf, name) != 0) err_msg = "Error removing blob."; else wpas_notify_blob_removed(wpa_s, name); dbus_message_iter_next(&array); } if (err_msg) return dbus_message_new_error(message, WPAS_ERROR_REMOVE_ERROR, err_msg); return wpas_dbus_new_success_reply(message); } /** * wpas_dbus_iface_flush - Clear BSS of old or all inactive entries * @message: Pointer to incoming dbus message * @wpa_s: %wpa_supplicant data structure * Returns: a dbus message containing a UINT32 indicating success (1) or * failure (0), or returns a dbus error message with more information * * Handler function for "flush" method call. Handles requests for an * interface with an optional "age" parameter that specifies the minimum * age of a BSS to be flushed. */ DBusMessage * wpas_dbus_iface_flush(DBusMessage *message, struct wpa_supplicant *wpa_s) { int flush_age = 0; if (os_strlen(dbus_message_get_signature(message)) != 0 && !dbus_message_get_args(message, NULL, DBUS_TYPE_INT32, &flush_age, DBUS_TYPE_INVALID)) { return wpas_dbus_new_invalid_opts_error(message, NULL); } if (flush_age == 0) wpa_bss_flush(wpa_s); else wpa_bss_flush_by_age(wpa_s, flush_age); return wpas_dbus_new_success_reply(message); }
{ "content_hash": "08247fa58d831616b82e0eaccb66ea35", "timestamp": "", "source": "github", "line_count": 1456, "max_line_length": 81, "avg_line_length": 28.21978021978022, "alnum_prop": 0.6518934968847352, "repo_name": "sergecodd/FireFox-OS", "id": "39fe241519f4eb8e56405f0fc52218a158122c92", "size": "41541", "binary": false, "copies": "25", "ref": "refs/heads/master", "path": "B2G/external/wpa_supplicant_8/wpa_supplicant/dbus/dbus_old_handlers.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "443" }, { "name": "ApacheConf", "bytes": "85" }, { "name": "Assembly", "bytes": "5123438" }, { "name": "Awk", "bytes": "46481" }, { "name": "Batchfile", "bytes": "56250" }, { "name": "C", "bytes": "101720951" }, { "name": "C#", "bytes": "38531" }, { "name": "C++", "bytes": "148896543" }, { "name": "CMake", "bytes": "23541" }, { "name": "CSS", "bytes": "2758664" }, { "name": "DIGITAL Command Language", "bytes": "56757" }, { "name": "Emacs Lisp", "bytes": "12694" }, { "name": "Erlang", "bytes": "889" }, { "name": "FLUX", "bytes": "34449" }, { "name": "GLSL", "bytes": "26344" }, { "name": "Gnuplot", "bytes": "710" }, { "name": "Groff", "bytes": "447012" }, { "name": "HTML", "bytes": "43343468" }, { "name": "IDL", "bytes": "1455122" }, { "name": "Java", "bytes": "43261012" }, { "name": "JavaScript", "bytes": "46646658" }, { "name": "Lex", "bytes": "38358" }, { "name": "Logos", "bytes": "21054" }, { "name": "Makefile", "bytes": "2733844" }, { "name": "Matlab", "bytes": "67316" }, { "name": "Max", "bytes": "3698" }, { "name": "NSIS", "bytes": "421625" }, { "name": "Objective-C", "bytes": "877657" }, { "name": "Objective-C++", "bytes": "737713" }, { "name": "PHP", "bytes": "17415" }, { "name": "Pascal", "bytes": "6780" }, { "name": "Perl", "bytes": "1153180" }, { "name": "Perl6", "bytes": "1255" }, { "name": "PostScript", "bytes": "1139" }, { "name": "PowerShell", "bytes": "8252" }, { "name": "Protocol Buffer", "bytes": "26553" }, { "name": "Python", "bytes": "8453201" }, { "name": "Ragel in Ruby Host", "bytes": "3481" }, { "name": "Ruby", "bytes": "5116" }, { "name": "Scilab", "bytes": "7" }, { "name": "Shell", "bytes": "3383832" }, { "name": "SourcePawn", "bytes": "23661" }, { "name": "TeX", "bytes": "879606" }, { "name": "WebIDL", "bytes": "1902" }, { "name": "XSLT", "bytes": "13134" }, { "name": "Yacc", "bytes": "112744" } ], "symlink_target": "" }
import { getIchingBook , Trigrams, generateKua, getHexagram, getHexagramNumberByKuas, getHexagramNumberByName } from "src/constants/IchingLookup"; import "src/assets/json/book"; // Fu hexagram (return - the turning point) const kuasMock = [{value: 8, name: 'young-yang', yin: 0}, {value: 6, name: 'old-yin', yin: 1}, {value: 7, name: 'young-yin', yin: 1}, {value: 7, name: 'young-yin', yin: 1}, {value: 6, name: 'old-yin', yin: 1}, {value: 7, name: 'young-yin', yin: 1}] describe("IChing Lookup", () => { it("should have window.Book loaded", () => { expect(window.Book).toBeDefined(); expect(window.Book.length).toBe(64); }); it("getIchingBook() should return window.Book", () => { expect(getIchingBook()).toBe(window.Book); }); it("Trigrams should defined", () => { expect(Trigrams).toBeDefined(); expect(Trigrams.length).toBe(8); }); it("getHexagramNumberByKuas([1,0,1,0,1,0])", () => { const hex_num = getHexagramNumberByKuas( kuasMock.map( (k) => k.yin) ); expect(hex_num).toBe(24); }); it("getHexagramNumberByKuas([...{kuas}])", () => { const hex_num = getHexagramNumberByKuas( kuasMock ) expect(hex_num).toBe(24); }); it("getHexagramNumberByName() should be resilient", () => { const hexagram = getHexagramNumberByName('Chien'); expect(hexagram).toBe(1) let hex2 = getHexagramNumberByName('XXX'); expect(hex2).toBe(-1); }); it("getHexagram(name)", () => { const hexagram = getHexagram('Chien'); expect(hexagram.name).toBe('Chien') }); it("getHexagram(number)", () => { const hexagram = getHexagram(1); expect(hexagram.name).toBe('Chien'); }); it('getHexagram([...kuas])', () => { const hexagram = getHexagram(kuasMock); expect(hexagram.number).toBe(24); expect(hexagram.name).toBe('Fu'); }); it("generateKua() should return a valid Kua", () => { let kua = generateKua(); expect(kua.value).toBeGreaterThan(5); expect(kua.value).toBeLessThan(10); expect(kua.name).not.toBeUndefined(); expect(kua.yin).not.toBeUndefined(); }); });
{ "content_hash": "b3a10fdb4a7bbf58b825326910d87294", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 79, "avg_line_length": 35.68181818181818, "alnum_prop": 0.5571125265392781, "repo_name": "barrabinfc/react-iching", "id": "8bd547fe4be0c67d0a28556cbfdfe9543df9bd8c", "size": "2355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/constants/IchingLookup.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "442477" }, { "name": "HTML", "bytes": "38996" }, { "name": "Java", "bytes": "257278" }, { "name": "JavaScript", "bytes": "60716" }, { "name": "Makefile", "bytes": "1296" }, { "name": "Objective-C", "bytes": "138266" }, { "name": "Python", "bytes": "343649" }, { "name": "Swift", "bytes": "217951" } ], "symlink_target": "" }
<?php namespace ChrisWhite\B2\Tests; use ChrisWhite\B2\Http\Client as HttpClient; trait TestHelper { protected function buildGuzzleFromResponses(array $responses, $history = null) { $mock = new \GuzzleHttp\Handler\MockHandler($responses); $handler = new \GuzzleHttp\HandlerStack($mock); if ($history) { $handler->push($history); } return new HttpClient(['handler' => $handler]); } protected function buildResponseFromStub($statusCode, array $headers = [], $responseFile) { $response = file_get_contents(dirname(__FILE__).'/responses/'.$responseFile); return new \GuzzleHttp\Psr7\Response($statusCode, $headers, $response); } }
{ "content_hash": "4463064b5baa79b375b978b8d4423477", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 93, "avg_line_length": 26.88888888888889, "alnum_prop": 0.6473829201101928, "repo_name": "cwhite92/b2-sdk-php", "id": "ec787a82a5339be92e6d8acc33d74b37a6640e69", "size": "726", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/TestHelper.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "40078" } ], "symlink_target": "" }
package js_ellina.init; import javax.script.Invocable; public class JsCallbackInvoker { public JsInvoker windowListener_onMove = new JsInvoker("WindowListener_onMove"); public JsInvoker windowListener_onSize = new JsInvoker("WindowListener_onSize"); public JsInvoker windowListener_onClosed = new JsInvoker("WindowListener_onClosed"); public JsInvoker windowListener_onMinimized = new JsInvoker("WindowListener_onMinimized"); public JsInvoker windowListener_onFocus = new JsInvoker("WindowListener_onFocus"); public JsInvoker mouseListener_onMove = new JsInvoker("MouseListener_onMove"); public JsInvoker mouseListener_onLeftDown = new JsInvoker("MouseListener_onLeftDown"); public JsInvoker mouseListener_onLeftUp = new JsInvoker("MouseListener_onLeftUp"); public JsInvoker mouseListener_onMiddleDown = new JsInvoker("MouseListener_onMiddleDown"); public JsInvoker mouseListener_onMiddleUp = new JsInvoker("MouseListener_onMiddleUp"); public JsInvoker mouseListener_onRightDown = new JsInvoker("MouseListener_onRightDown"); public JsInvoker mouseListener_onRightUp = new JsInvoker("MouseListener_onRightUp"); public JsInvoker mouseListener_onScrollDown = new JsInvoker("MouseListener_onScrollDown"); public JsInvoker mouseListener_onScrollUp = new JsInvoker("MouseListener_onScrollUp"); public JsInvoker keyListener_onKeyDown = new JsInvoker("KeyListener_onKeyDown"); public JsInvoker keyListener_onKeyUp = new JsInvoker("KeyListener_onKeyUp"); public JsInvoker sysListener_onTick = new JsInvoker("SysListener_onTick"); public JsInvoker sysListener_onAfterInit = new JsInvoker("SysListener_onAfterInit"); public void setInvocable( Invocable invocable ) { windowListener_onMove.setInvocable( invocable ); windowListener_onSize.setInvocable( invocable ); windowListener_onClosed.setInvocable( invocable ); windowListener_onMinimized.setInvocable( invocable ); windowListener_onFocus.setInvocable( invocable ); mouseListener_onMove.setInvocable( invocable ); mouseListener_onLeftDown.setInvocable( invocable ); mouseListener_onLeftUp.setInvocable( invocable ); mouseListener_onMiddleDown.setInvocable( invocable ); mouseListener_onMiddleUp.setInvocable( invocable ); mouseListener_onRightDown.setInvocable( invocable ); mouseListener_onRightUp.setInvocable( invocable ); mouseListener_onScrollDown.setInvocable( invocable ); mouseListener_onScrollUp.setInvocable( invocable ); keyListener_onKeyDown.setInvocable( invocable ); keyListener_onKeyUp.setInvocable( invocable ); sysListener_onTick.setInvocable( invocable ); sysListener_onAfterInit.setInvocable( invocable ); } }
{ "content_hash": "18a02c9bcabe806bf6e39c881ea31df7", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 94, "avg_line_length": 56, "alnum_prop": 0.751750700280112, "repo_name": "amortaza/js_ellina", "id": "64f86aaa5e8b0b7cff9a1941812f48fba0936ac1", "size": "2856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/js_ellina/init/JsCallbackInvoker.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "13465" }, { "name": "JavaScript", "bytes": "2547" }, { "name": "Shell", "bytes": "8" } ], "symlink_target": "" }
Likes === Graphicate your Facebook Friends likes, languages and birthdays. Instructions == Get the access token from https://developers.facebook.com/tools/explorer You'll need access to friends\_birthay, friends\_likes. Run download-data.js sending as argv the access token. Run process\_birthday.py process\_languages.py process\_like.py and each output would generate the "flare.json" for the graphics.
{ "content_hash": "0f1d51a322a8ee0929704194b0f84d4f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 72, "avg_line_length": 27.333333333333332, "alnum_prop": 0.7853658536585366, "repo_name": "seppo0010/facebook-likes", "id": "a38aa73becc906a740e75c4fffc26fb4d5178693", "size": "410", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "562" }, { "name": "Python", "bytes": "3320" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; namespace IDT.VersionedXmlSerialization { /// <summary> /// Object that creates a concrete types that implement the properties of a provided interface. /// </summary> public class ProxyInterfaceTypeBuilder { private const string DynamicProxyNamespace = "IDT.VersionedXmlSerialization.DynamicProxy"; private const MethodAttributes GetterSetterMethodAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.Virtual; private const TypeAttributes ProxyClassTypeAttributes = TypeAttributes.Serializable | TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed; /// <summary> /// Creates a proxy class for an interface of the specified type. /// </summary> /// <param name="interfaceType">The type of the interface.</param> /// <returns>The new <see cref="Type"/> object for the proxy class.</returns> /// <exception cref="System.ArgumentNullException"><paramref name="interfaceType"/> is <c>null</c>.</exception> /// <exception cref="System.ArgumentException"><paramref name="interfaceType"/> is not an interface.</exception> public Type GetProxyType(Type interfaceType) { if (interfaceType == null) { throw new ArgumentNullException("interfaceType"); } if (_createdTypeLookup.ContainsKey(interfaceType.FullName)) { return _createdTypeLookup[interfaceType.FullName]; } Type newType = CreateProxyType(interfaceType); _createdTypeLookup.Add(interfaceType.FullName, newType); return newType; } private static Type CreateProxyType(Type interfaceType) { if (!interfaceType.IsInterface) { throw new ArgumentException("Type is not an interface: " + interfaceType.Name, "interfaceType"); } string proxyTypeName = DynamicProxyNamespace + "." + interfaceType.Name; ModuleBuilder moduleBuilder = GetModuleBuilder(); TypeBuilder typeBuilder = moduleBuilder.DefineType(proxyTypeName, ProxyClassTypeAttributes, typeof(object), new[] { interfaceType }); typeBuilder.DefineDefaultConstructor(MethodAttributes.Public); foreach (var propertyInfo in GetAllProperties(interfaceType)) { FieldBuilder fieldBuilder = typeBuilder.DefineField("field_" + propertyInfo.Name, propertyInfo.PropertyType, FieldAttributes.Private); PropertyBuilder propertyBuilder = typeBuilder.DefineProperty(propertyInfo.Name, propertyInfo.Attributes, propertyInfo.PropertyType, null); MethodBuilder getMethod = DefineGetMethod(typeBuilder, fieldBuilder, propertyInfo); propertyBuilder.SetGetMethod(getMethod); MethodBuilder setMethod = DefineSetMethod(typeBuilder, fieldBuilder, propertyInfo); propertyBuilder.SetSetMethod(setMethod); } return typeBuilder.CreateType(); } private static MethodBuilder DefineGetMethod(TypeBuilder typeBuilder, FieldInfo fieldInfo, PropertyInfo propertyInfo) { // Define the 'get_' method. MethodBuilder getMethod = typeBuilder.DefineMethod( "get_" + propertyInfo.Name, GetterSetterMethodAttributes, propertyInfo.PropertyType, null); // Generate IL code for 'get_' method. ILGenerator methodIl = getMethod.GetILGenerator(); methodIl.Emit(OpCodes.Ldarg_0); methodIl.Emit(OpCodes.Ldfld, fieldInfo); methodIl.Emit(OpCodes.Ret); return getMethod; } private static MethodBuilder DefineSetMethod(TypeBuilder typeBuilder, FieldInfo fieldInfo, PropertyInfo propertyInfo) { Type[] methodArgs = {propertyInfo.PropertyType}; // Define the 'set_' method. MethodBuilder setMethod = typeBuilder.DefineMethod( "set_" + propertyInfo.Name, GetterSetterMethodAttributes, typeof (void), methodArgs); // Generate IL code for 'set_' method. ILGenerator methodIl = setMethod.GetILGenerator(); methodIl.Emit(OpCodes.Ldarg_0); methodIl.Emit(OpCodes.Ldarg_1); methodIl.Emit(OpCodes.Stfld, fieldInfo); methodIl.Emit(OpCodes.Ret); return setMethod; } private static IEnumerable<PropertyInfo> GetAllProperties(Type type) { var publicProperties = new List<PropertyInfo>(); publicProperties.AddRange(type.GetProperties()); foreach (var implementedInterfaceType in type.GetInterfaces()) { publicProperties.AddRange(GetAllProperties(implementedInterfaceType)); } return publicProperties; } private static ModuleBuilder GetModuleBuilder() { AppDomain currentDomain = AppDomain.CurrentDomain; var assemblyName = new AssemblyName(DynamicProxyNamespace); AssemblyBuilder assemblyBuilder = currentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); return assemblyBuilder.DefineDynamicModule(DynamicProxyNamespace); } private readonly Dictionary<string, Type> _createdTypeLookup = new Dictionary<string, Type>(); } }
{ "content_hash": "723bdc6fb239432a31b569ad1befba77", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 181, "avg_line_length": 43.370370370370374, "alnum_prop": 0.6334756618274978, "repo_name": "BrianZell/RabbitExtensions", "id": "9148e201ce61c0ae4fe6199e1eb8f75cbe7628b7", "size": "5857", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Src/IDT.VersionedXmlSerialization/ProxyInterfaceTypeBuilder.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "126885" } ], "symlink_target": "" }
GalaxyEngine is PHP Framework which make you develop easier than any others. This is RC version. So it would be dangreous if you develop your web site with this framework!!<br> Special Thanks to [SSUT](https://github.com/SSUT) [Demo Site](http://luavis.kr/GalaxyEngine) ##Change Log ######Version 0.75 RC - 모든 모듈 삭제. - Template 문법이 많이 바뀌고 없어짐. - middleware 구현으로 조금 더 커스터마이징이 쉬워짐. - User.class.php는 개발자가 알아서 수정하는 방향으로 바뀜. ######Version 0.7 RC - Base module support - Install support - SSO support support - Board module support - Article module support - File module support - Manage session support ######Version 0.6.9 beta - Base module support - Group permission support in module.xml - User class created - SSO support temporarily - Board module beta - Module.class.php not need (Only setting Model / View / Controller) - Article module beta - File module beta ######Version 0.6 beta - Short URL Support - Default login module added - Default board module added - Script tag can add in template file - Meta tag can add in template file - Action attribute is changed (e.x. form tag) - Make ORM to support utf-8 at default - Module.xml can support permission attribute - ViewController change name to Contoller - Fix some bug ######Version 0.5.2 beta - Module's action can define with mvc file - Button element is more easier to invoke - Fix some bug(e.x. import element's relative path) ######Version 0.5.1 beta - Make regular expression and git log clearly ######Version 0.5 beta - Context.class.php cleaning - Start page created - Foundation CSS Framework inserted - jQuery inserted - XHR filter - Inner module loader ######Version 0.1 alpha - First Commit - ModuleHandler created - Module created - Less Compiler created - Model-View-Controller created - Context created - TemplateHandler created
{ "content_hash": "732348897f21b8a37989596e1de092b8", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 99, "avg_line_length": 23.346153846153847, "alnum_prop": 0.7413509060955519, "repo_name": "Luavis/GalaxyEngine", "id": "0335b4afc1059c8cd379b6675973af0c1aaadf05", "size": "1987", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "29072" }, { "name": "JavaScript", "bytes": "510" }, { "name": "PHP", "bytes": "389391" } ], "symlink_target": "" }
#include <QtGui/QApplication> #include "keysequencelabel.h" //start int main(int argc, char *argv[]) { QApplication a(argc, argv); KeySequenceLabel mw; mw.show(); return a.exec(); /* Enter the event loop */ } //end
{ "content_hash": "d40b3cdc3f11aaf2b80a7fdd438a7399", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 47, "avg_line_length": 21, "alnum_prop": 0.6536796536796536, "repo_name": "PatrickTrentin88/intro_cpp_qt", "id": "f391e0162c8d02cac6a7ac8fcbe3ca1331be5932", "size": "231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/eventloop/main.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "17617" }, { "name": "QMake", "bytes": "2545" } ], "symlink_target": "" }
the first divsurf's test repository
{ "content_hash": "79b5da87e0eee92768ba5cb28c72e28a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8333333333333334, "repo_name": "divsurf/divsurf_test1", "id": "82582dfb17a04597fce1ebf49e1a2b9691cef1ff", "size": "52", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import {_hyphenate} from './util'; import {BehaviorPropertyObserver} from './behavior-property-observer'; import {bindingMode} from 'aurelia-binding'; import {Container} from 'aurelia-dependency-injection'; function getObserver(behavior, instance, name) { let lookup = instance.__observers__; if (lookup === undefined) { if (!behavior.isInitialized) { behavior.initialize(Container.instance || new Container(), instance.constructor); } lookup = behavior.observerLocator.getOrCreateObserversLookup(instance); behavior._ensurePropertiesDefined(instance, lookup); } return lookup[name]; } /** * Represents a bindable property on a behavior. */ export class BindableProperty { /** * Creates an instance of BindableProperty. * @param nameOrConfig The name of the property or a cofiguration object. */ constructor(nameOrConfig: string | Object) { if (typeof nameOrConfig === 'string') { this.name = nameOrConfig; } else { Object.assign(this, nameOrConfig); } this.attribute = this.attribute || _hyphenate(this.name); if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { this.defaultBindingMode = bindingMode.oneWay; } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; } /** * Registers this bindable property with particular Class and Behavior instance. * @param target The class to register this behavior with. * @param behavior The behavior instance to register this property with. * @param descriptor The property descriptor for this property. */ registerWith(target: Function, behavior: HtmlBehaviorResource, descriptor?: Object): void { behavior.properties.push(this); behavior.attributes[this.attribute] = this; this.owner = behavior; if (descriptor) { this.descriptor = descriptor; return this._configureDescriptor(behavior, descriptor); } return undefined; } _configureDescriptor(behavior: HtmlBehaviorResource, descriptor: Object): Object { let name = this.name; descriptor.configurable = true; descriptor.enumerable = true; if ('initializer' in descriptor) { this.defaultValue = descriptor.initializer; delete descriptor.initializer; delete descriptor.writable; } if ('value' in descriptor) { this.defaultValue = descriptor.value; delete descriptor.value; delete descriptor.writable; } descriptor.get = function() { return getObserver(behavior, this, name).getValue(); }; descriptor.set = function(value) { getObserver(behavior, this, name).setValue(value); }; descriptor.get.getObserver = function(obj) { return getObserver(behavior, obj, name); }; return descriptor; } /** * Defines this property on the specified class and behavior. * @param target The class to define the property on. * @param behavior The behavior to define the property on. */ defineOn(target: Function, behavior: HtmlBehaviorResource): void { let name = this.name; let handlerName; if (this.changeHandler === null) { handlerName = name + 'Changed'; if (handlerName in target.prototype) { this.changeHandler = handlerName; } } if (this.descriptor === null) { Object.defineProperty(target.prototype, name, this._configureDescriptor(behavior, {})); } } /** * Creates an observer for this property. * @param viewModel The view model instance on which to create the observer. * @return The property observer. */ createObserver(viewModel: Object): BehaviorPropertyObserver { let selfSubscriber = null; let defaultValue = this.defaultValue; let changeHandlerName = this.changeHandler; let name = this.name; let initialValue; if (this.hasOptions) { return undefined; } if (changeHandlerName in viewModel) { if ('propertyChanged' in viewModel) { selfSubscriber = (newValue, oldValue) => { viewModel[changeHandlerName](newValue, oldValue); viewModel.propertyChanged(name, newValue, oldValue); }; } else { selfSubscriber = (newValue, oldValue) => viewModel[changeHandlerName](newValue, oldValue); } } else if ('propertyChanged' in viewModel) { selfSubscriber = (newValue, oldValue) => viewModel.propertyChanged(name, newValue, oldValue); } else if (changeHandlerName !== null) { throw new Error(`Change handler ${changeHandlerName} was specified but not declared on the class.`); } if (defaultValue !== undefined) { initialValue = typeof defaultValue === 'function' ? defaultValue.call(viewModel) : defaultValue; } return new BehaviorPropertyObserver(this.owner.taskQueue, viewModel, this.name, selfSubscriber, initialValue); } _initialize(viewModel, observerLookup, attributes, behaviorHandlesBind, boundProperties): void { let selfSubscriber; let observer; let attribute; let defaultValue = this.defaultValue; if (this.isDynamic) { for (let key in attributes) { this._createDynamicProperty(viewModel, observerLookup, behaviorHandlesBind, key, attributes[key], boundProperties); } } else if (!this.hasOptions) { observer = observerLookup[this.name]; if (attributes !== null) { selfSubscriber = observer.selfSubscriber; attribute = attributes[this.attribute]; if (behaviorHandlesBind) { observer.selfSubscriber = null; } if (typeof attribute === 'string') { viewModel[this.name] = attribute; observer.call(); } else if (attribute) { boundProperties.push({observer: observer, binding: attribute.createBinding(viewModel)}); } else if (defaultValue !== undefined) { observer.call(); } observer.selfSubscriber = selfSubscriber; } observer.publishing = true; } } _createDynamicProperty(viewModel, observerLookup, behaviorHandlesBind, name, attribute, boundProperties) { let changeHandlerName = name + 'Changed'; let selfSubscriber = null; let observer; let info; if (changeHandlerName in viewModel) { if ('propertyChanged' in viewModel) { selfSubscriber = (newValue, oldValue) => { viewModel[changeHandlerName](newValue, oldValue); viewModel.propertyChanged(name, newValue, oldValue); }; } else { selfSubscriber = (newValue, oldValue) => viewModel[changeHandlerName](newValue, oldValue); } } else if ('propertyChanged' in viewModel) { selfSubscriber = (newValue, oldValue) => viewModel.propertyChanged(name, newValue, oldValue); } observer = observerLookup[name] = new BehaviorPropertyObserver( this.owner.taskQueue, viewModel, name, selfSubscriber ); Object.defineProperty(viewModel, name, { configurable: true, enumerable: true, get: observer.getValue.bind(observer), set: observer.setValue.bind(observer) }); if (behaviorHandlesBind) { observer.selfSubscriber = null; } if (typeof attribute === 'string') { viewModel[name] = attribute; observer.call(); } else if (attribute) { info = {observer: observer, binding: attribute.createBinding(viewModel)}; boundProperties.push(info); } observer.publishing = true; observer.selfSubscriber = selfSubscriber; } }
{ "content_hash": "0204fd052ea2b82a70431b4d065d7afa", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 123, "avg_line_length": 31.323651452282157, "alnum_prop": 0.6697575837859319, "repo_name": "davismj/templating", "id": "4b1c30caa3cbf8b5a02e7baeeb37e04b758d8d4a", "size": "7549", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/bindable-property.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "232155" } ], "symlink_target": "" }
{-# htermination elemFM :: Int -> FiniteMap Int b -> Bool #-} import FiniteMap
{ "content_hash": "e6aa536faff6614ee937108c60d09b8e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 61, "avg_line_length": 39.5, "alnum_prop": 0.6708860759493671, "repo_name": "ComputationWithBoundedResources/ara-inference", "id": "e7b1ff5abcc5631a396ac2e015af4746e40bf51a", "size": "79", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/tpdb_trs/Haskell/full_haskell/FiniteMap_elemFM_5.hs", "mode": "33188", "license": "mit", "language": [ { "name": "Haskell", "bytes": "352897" }, { "name": "Shell", "bytes": "4012" } ], "symlink_target": "" }
// // PSDrawerController.h // PSKit // // Created by Peter Shih on 11/22/11. // Copyright (c) 2011 Peter Shih. All rights reserved. // #import <UIKit/UIKit.h> #import "PSViewController.h" typedef enum { PSDrawerStateClosed = 1, PSDrawerStateOpenLeft = 2, PSDrawerStateOpenRight = 3, PSDrawerStateHiddenLeft = 4, PSDrawerStateHiddenRight = 5 } PSDrawerState; typedef enum{ PSDrawerPositionLeft = 1, PSDrawerPositionRight = 2 } PSDrawerPosition; @interface PSDrawerController : PSViewController { PSDrawerState _state; UIViewController *_rootViewController; UIViewController *_leftViewController; UIViewController *_rightViewController; } @property (nonatomic, retain) UIViewController *rootViewController; @property (nonatomic, retain, readonly) UIViewController *leftViewController; @property (nonatomic, retain, readonly) UIViewController *rightViewController; /** Initializes and returns a newly created drawer controller @param rootViewController The view controller that resides on the top of the stack @param leftViewController The view controller that represents the left drawer (optional) @param rightViewController The view controller that represents the right drawer (optiona) @return The initialized drawer controller object or nil if there was a problem initializing the object. */ - (id)initWithRootViewController:(UIViewController *)rootViewController leftViewController:(UIViewController *)leftViewController rightViewController:(UIViewController *)rightViewController; #pragma mark - Slide Drawer /** This method slides the top controller partially off the screen either to the left side or the right side. Generally you should use one of the slide/hide convenience methods instead of this method, but this method allows more customization. @param position Choose either PSDrawerPostionLeft or PSDrawerPositionRight */ - (void)slideWithPosition:(PSDrawerPosition)position hidden:(BOOL)hidden animated:(BOOL)animated; /** Slides to show the left drawer, partially hiding the root controller */ - (void)slideFromLeft; /** Slides to show the right drawer, partially hiding the root controller */ - (void)slideFromRight; /** Slides to show the left drawer, completely hiding the root controller */ - (void)hideFromLeft; /** Slides to show the right drawer, completely hiding the root controller */ - (void)hideFromRight; @end
{ "content_hash": "597dd756b521caad157e4eaf408e55b4", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 190, "avg_line_length": 30.075, "alnum_prop": 0.7826267664172901, "repo_name": "ptshih/PSDrawerController", "id": "029e47466557d4e96c1509145c461b36a73a4a43", "size": "3905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PSDrawerController.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Objective-C", "bytes": "11768" } ], "symlink_target": "" }
var packageName = 'velocityjs:velocityjs'; // https://atmospherejs.com/velocityjs/velocityjs var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing. var version = "1.2.1"; Package.describe({ "name": packageName, "summary": 'Velocity.js (official) - accelerated JavaScript animation.', "version": version, "git": 'https://github.com/julianshapiro/velocity.git' }); Package.onUse(function (api) { api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']); api.use("jquery", where); api.addFiles([ 'velocity.js', 'velocity.ui.js' ], where ); }); Package.onTest(function (api) { api.use(packageName, where); api.use('tinytest', where); api.addFiles('meteor/test.js', where); });
{ "content_hash": "950c8147239a98ee64495b50e77a161a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 92, "avg_line_length": 28.26923076923077, "alnum_prop": 0.6666666666666666, "repo_name": "MeteorPackaging/velocity", "id": "108706dd6dc8ca12cf95d37fe2ddb23c9650fc6b", "size": "774", "binary": false, "copies": "1", "ref": "refs/heads/meteor-integration", "path": "package.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "249369" } ], "symlink_target": "" }
Analytics Zoo provides a pre-defined KNRM model that can be used for text matching (e.g. question answering). More text matching models will be supported in the future. **Highlights** 1. Easy-to-use Keras-Style defined model which provides compile and fit methods for training. Alternatively, it could be fed into NNFrames or BigDL Optimizer. 2. The model can be used for both ranking and classification tasks. --- ## **Build a KNRM Model** Kernel-pooling Neural Ranking Model with RBF kernel. See [here](https://arxiv.org/abs/1706.06613) for more details. You can call the following API in Scala and Python respectively to create a `KNRM` with *pre-trained GloVe word embeddings*. **Scala** ```scala val knrm = KNRM(text1Length, text2Length, embeddingFile, wordIndex = null, trainEmbed = true, kernelNum = 21, sigma = 0.1, exactSigma = 0.001, targetMode = "ranking") ``` * `text1Length`: Sequence length of text1 (query). * `text2Length`: Sequence length of text2 (doc). * `embeddingFile`: The path to the word embedding file. Currently only *glove.6B.50d.txt, glove.6B.100d.txt, glove.6B.200d.txt, glove.6B.300d.txt, glove.42B.300d.txt, glove.840B.300d.txt* are supported. You can download from [here](https://nlp.stanford.edu/projects/glove/). * `wordIndex`: Map of word (String) and its corresponding index (integer). The index is supposed to __start from 1__ with 0 reserved for unknown words. During the prediction, if you have words that are not in the wordIndex for the training, you can map them to index 0. Default is null. In this case, all the words in the embeddingFile will be taken into account and you can call `WordEmbedding.getWordIndex(embeddingFile)` to retrieve the map. * `trainEmbed`: Boolean. Whether to train the embedding layer or not. Default is true. * `kernelNum`: Integer > 1. The number of kernels to use. Default is 21. * `sigma`: Double. Defines the kernel width, or the range of its softTF count. Default is 0.1. * `exactSigma`: Double. The sigma used for the kernel that harvests exact matches in the case where RBF mu=1.0. Default is 0.001. * `targetMode`: String. The target mode of the model. Either 'ranking' or 'classification'. For ranking, the output will be the relevance score between text1 and text2 and you are recommended to use 'rank_hinge' as loss for pairwise training. For classification, the last layer will be sigmoid and the output will be the probability between 0 and 1 indicating whether text1 is related to text2 and you are recommended to use 'binary_crossentropy' as loss for binary classification. Default mode is 'ranking'. **Python** ```python knrm = KNRM(text1_length, text2_length, embedding_file, word_index=None, train_embed=True, kernel_num=21, sigma=0.1, exact_sigma=0.001, target_mode="ranking") ``` * `text1_length`: Sequence length of text1 (query). * `text2_length`: Sequence length of text2 (doc). * `embedding_file`: The path to the word embedding file. Currently only *glove.6B.50d.txt, glove.6B.100d.txt, glove.6B.200d.txt, glove.6B.300d.txt, glove.42B.300d.txt, glove.840B.300d.txt* are supported. You can download from [here](https://nlp.stanford.edu/projects/glove/). * `word_index`: Dictionary of word (string) and its corresponding index (int). The index is supposed to __start from 1__ with 0 reserved for unknown words. During the prediction, if you have words that are not in the wordIndex for the training, you can map them to index 0. Default is None. In this case, all the words in the embedding_file will be taken into account and you can call `WordEmbedding.get_word_index(embedding_file)` to retrieve the dictionary. * `train_embed`: Boolean. Whether to train the embedding layer or not. Default is True. * `kernel_num`: Int > 1. The number of kernels to use. Default is 21. * `sigma`: Float. Defines the kernel width, or the range of its softTF count. Default is 0.1. * `exact_sigma`: Float. The sigma used for the kernel that harvests exact matches in the case where RBF mu=1.0. Default is 0.001. * `target_mode`: String. The target mode of the model. Either 'ranking' or 'classification'. For ranking, the output will be the relevance score between text1 and text2 and you are recommended to use 'rank_hinge' as loss for pairwise training. For classification, the last layer will be sigmoid and the output will be the probability between 0 and 1 indicating whether text1 is related to text2 and you are recommended to use 'binary_crossentropy' as loss for binary classification. Default mode is 'ranking'. --- ## **Pairwise training** For ranking, the model can be trained pairwisely with the following steps: 1. Read train relations. See [here](../APIGuide/FeatureEngineering/relation/#read-relations) for more details. 2. Read text1 and text2 corpus as TextSet. See [here](../APIGuide/FeatureEngineering/text/#read-texts-from-csv-file) for more details. 3. Preprocess text1 and text2 corpus. See [here](../APIGuide/FeatureEngineering/text/#textset-transformations) for more details. 4. Generate all relation pairs from train relations. Each pair is made up of a positive relation and a negative one of the same id1. During the training process, we intend to optimize the margin loss within each pair. We provide the following API to generate a `TextSet` for pairwise training: **Scala** ```scala val trainSet = TextSet.fromRelationPairs(relations, corpus1, corpus2) ``` * `relations`: RDD or array of Relation. * `corpus1`: TextSet that contains all id1 in relations. * `corpus2`: TextSet that contains all id2 in relations. * For corpus1 and corpus2 respectively, each text must have been transformed to indices of the same length by calling [tokenize](../APIGuide/FeatureEngineering/text/#tokenization), [word2idx](../APIGuide/FeatureEngineering/text/#word-to-index) and [shapeSequence](../APIGuide/FeatureEngineering/text/#sequence-shaping) in order. * If relations is an RDD, then corpus1 and corpus2 must both be DistributedTextSet. If relations is an array, then corpus1 and corpus2 must both be LocalTextSet. **Python** ```python train_set = TextSet.from_relation_pairs(relations, corpus1, corpus2) ``` * `relations`: RDD or list of Relation. * `corpus1`: TextSet that contains all id1 in relations. * `corpus2`: TextSet that contains all id2 in relations. * For corpus1 and corpus2 respectively, each text must have been transformed to indices of the same length by calling [tokenize](../APIGuide/FeatureEngineering/text/#tokenization), [word2idx](../APIGuide/FeatureEngineering/text/#word-to-index) and [shape_sequence](../APIGuide/FeatureEngineering/text/#sequence-shaping) in order. * If relations is an RDD, then corpus1 and corpus2 must both be DistributedTextSet. If relations is a list, then corpus1 and corpus2 must both be LocalTextSet. Call compile and fit to train the model: **Scala** ```scala val model = Sequential().add(TimeDistributed(knrm, inputShape = Shape(2, text1Length + text2Length))) model.compile(optimizer = new SGD(learningRate), loss = RankHinge()) model.fit(trainSet, batchSize, nbEpoch) ``` **Python** ```python model = Sequential().add(TimeDistributed(knrm, input_shape=(2, text1Length + text2Length))) model.compile(optimizer=SGD(learning_rate), loss='rank_hinge') model.fit(train_set, batch_size, nb_epoch) ``` --- ## **Listwise evaluation** Given text1 and a list of text2 candidates, we provide metrics [NDCG](https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)#Discounted_cumulative_gain) and [MAP](https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)#Mean_average_precision) to listwisely evaluate a ranking model with the following steps: 1. Read validation relations. See [here](../APIGuide/FeatureEngineering/relation/#read-relations) for more details. 2. Read text1 and text2 corpus as TextSet. See [here](../APIGuide/FeatureEngineering/text/#read-texts-from-csv-file) for more details. 3. Preprocess text1 and text2 corpus same as the training phase. See [here](../APIGuide/FeatureEngineering/text/#textset-transformations) for more details. 3. Generate all relation lists from validation relations. Each list is made up of one id1 and all id2 combined with id1. We provide the following API to generate a `TextSet` for listwise evaluation: **Scala** ```scala val validateSet = TextSet.fromRelationLists(relations, corpus1, corpus2) ``` * `relations`: RDD or array of Relation. * `corpus1`: TextSet that contains all id1 in relations. * `corpus2`: TextSet that contains all id2 in relations. * For corpus1 and corpus2 respectively, each text must have been transformed to indices of the same length as during the training process by calling [tokenize](../APIGuide/FeatureEngineering/text/#tokenization), [word2idx](../APIGuide/FeatureEngineering/text/#word-to-index) and [shapeSequence](../APIGuide/FeatureEngineering/text/#sequence-shaping) in order. * If relations is an RDD, then corpus1 and corpus2 must both be DistributedTextSet. If relations is an array, then corpus1 and corpus2 must both be LocalTextSet. **Python** ```python validate_set = TextSet.from_relation_lists(relations, corpus1, corpus2) ``` * `relations`: RDD or list of Relation. * `corpus1`: TextSet that contains all id1 in relations. * `corpus2`: TextSet that contains all id2 in relations. * For corpus1 and corpus2 respectively, each text must have been transformed to indices of the same length as during the training process by calling [tokenize](../APIGuide/FeatureEngineering/text/#tokenization), [word2idx](../APIGuide/FeatureEngineering/text/#word-to-index) and [shape_sequence](../APIGuide/FeatureEngineering/text/#sequence-shaping) in order. * If relations is an RDD, then corpus1 and corpus2 must both be DistributedTextSet. If relations is a list, then corpus1 and corpus2 must both be LocalTextSet. Call evaluateNDCG or evaluateMAP to evaluate the model: **Scala** ```scala knrm.evaluateNDCG(validateSet, k, threshold = 0.0) knrm.evaluateMAP(validateSet, threshold = 0.0) ``` **Python** ```python knrm.evaluate_ndcg(validate_set, k, threshold=0.0) knrm.evaluate_map(validate_set, threshold=0.0) ``` * `k`: Positive integer. Rank position in NDCG. * `threshold`: If label > threshold, then it will be considered as a positive record. Default is 0.0. --- ## **Examples** We provide an example to train and evaluate a KNRM model on WikiQA dataset for ranking. See [here](https://github.com/intel-analytics/analytics-zoo/tree/master/zoo/src/main/scala/com/intel/analytics/zoo/examples/qaranker) for the Scala example. See [here](https://github.com/intel-analytics/analytics-zoo/tree/master/pyzoo/zoo/examples/qaranker) for the Python example.
{ "content_hash": "b372985406b906e902315bc28934ec3d", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 459, "avg_line_length": 63.83233532934132, "alnum_prop": 0.7662288930581613, "repo_name": "yangw1234/BigDL", "id": "58b6b2fd2fda5a67c48d940d9e5ebc0b018fd5e9", "size": "10660", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "docs/docs/ProgrammingGuide/text-matching.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "5342" }, { "name": "Dockerfile", "bytes": "138760" }, { "name": "Java", "bytes": "1321348" }, { "name": "Jupyter Notebook", "bytes": "54063856" }, { "name": "Lua", "bytes": "1904" }, { "name": "Makefile", "bytes": "19253" }, { "name": "PowerShell", "bytes": "1137" }, { "name": "PureBasic", "bytes": "593" }, { "name": "Python", "bytes": "8762180" }, { "name": "RobotFramework", "bytes": "16117" }, { "name": "Scala", "bytes": "13216038" }, { "name": "Shell", "bytes": "844916" } ], "symlink_target": "" }
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example - example-example45-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.1/angular.min.js"></script> <script src="script.js"></script> </head> <body ng-app="myServiceModule"> <div id="simple" ng-controller="MyController"> <p>Let's try this simple notify service, injected into the controller...</p> <input ng-init="message='test'" ng-model="message" > <button ng-click="callNotify(message);">NOTIFY</button> <p>(you have to click 3 times to see an alert)</p> </div> </body> </html>
{ "content_hash": "da7b5753fa3de1ba6f276e767575a0a2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 93, "avg_line_length": 28.09090909090909, "alnum_prop": 0.6731391585760518, "repo_name": "PaoloUmali/netgear-noter", "id": "c92b7cbdb26cf4fac5f33cf216dab25271d95c0c", "size": "618", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "js/angular-1.4.0-rc.2/docs/examples/example-example45/index-production.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "48054" }, { "name": "HTML", "bytes": "2797221" }, { "name": "JavaScript", "bytes": "519872" }, { "name": "Smarty", "bytes": "26869" } ], "symlink_target": "" }
import { EdgeCalculator } from "../../../src/graph/edge/EdgeCalculator"; import { EdgeCalculatorDirections } from "../../../src/graph/edge/EdgeCalculatorDirections"; import { EdgeCalculatorSettings } from "../../../src/graph/edge/EdgeCalculatorSettings"; import { NavigationDirection } from "../../../src/graph/edge/NavigationDirection"; import { NavigationEdge } from "../../../src/graph/edge/interfaces/NavigationEdge"; import { PotentialEdge } from "../../../src/graph/edge/interfaces/PotentialEdge"; import { Image } from "../../../src/graph/Image"; import { EdgeCalculatorHelper } from "../../helper/EdgeCalculatorHelper"; describe("EdgeCalculator.computeSimilarEdges", () => { let edgeCalculator: EdgeCalculator; let settings: EdgeCalculatorSettings; let directions: EdgeCalculatorDirections; let helper: EdgeCalculatorHelper; let image: Image; let potentialEdge: PotentialEdge; beforeEach(() => { settings = new EdgeCalculatorSettings(); directions = new EdgeCalculatorDirections(); edgeCalculator = new EdgeCalculator(settings, directions); helper = new EdgeCalculatorHelper(); }); let createImage: (capturedAt: number) => Image = (capturedAt: number): Image => { return helper.createCompleteImage("key", { alt: 0, lat: 0, lng: 0 }, "skey", [0, 0, 0], "2", "perspective", capturedAt); }; beforeEach(() => { potentialEdge = helper.createPotentialEdge(); }); beforeEach(() => { image = helper.createDefaultImage(); }); it("should throw when image is not full", () => { image = helper.createCoreImage("", { alt: 0, lat: 0, lng: 0 }, ""); expect(() => { edgeCalculator.computeSimilarEdges(image, []); }).toThrowError(Error); }); it("should have a similar edge", () => { potentialEdge.capturedAt = 24234; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(1); let similarEdge: NavigationEdge = similarEdges[0]; expect(similarEdge.target).toBe(potentialEdge.id); expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); }); it("should not have a similar edge if sequence is missing on potential edge", () => { potentialEdge.capturedAt = 24234; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = null; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should not have a similar edge if image is spherical and potential image is not spherical", () => { potentialEdge.sameMergeCC = true; potentialEdge.sameSequence = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should not have a similar edge if same sequence", () => { potentialEdge.sameMergeCC = true; potentialEdge.sameSequence = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should have a similar edge even if not same merge cc", () => { potentialEdge.sameMergeCC = false; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(1); }); it("should have a similar edge if same merge cc", () => { potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(1); }); it("should not have a similar edge if distance is above threshold", () => { settings.similarMaxDistance = 5; potentialEdge.distance = 8; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should not have a similar edge if rotation is above threshold", () => { settings.similarMaxDirectionChange = 0.5; potentialEdge.directionChange = 1; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should have a similar edge even if rotation is above threshold when potential is spherical", () => { settings.similarMaxDirectionChange = 0.5; potentialEdge.directionChange = 1; potentialEdge.spherical = true; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(1); let similarEdge: NavigationEdge = similarEdges[0]; expect(similarEdge.target).toBe(potentialEdge.id); expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); }); it("should not have a similar edge for the same user within min time diff", () => { image = createImage(1000); settings.similarMinTimeDifference = 100; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; potentialEdge.sameUser = true; potentialEdge.capturedAt = 1050; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(0); }); it("should have a similar edge for the same user if above min time diff", () => { image = createImage(1000); settings.similarMinTimeDifference = 100; potentialEdge.sameMergeCC = true; potentialEdge.sequenceId = "other"; potentialEdge.sameUser = true; potentialEdge.capturedAt = 1200; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge]); expect(similarEdges.length).toBe(1); let similarEdge: NavigationEdge = similarEdges[0]; expect(similarEdge.target).toBe(potentialEdge.id); expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); }); it("should have a multiple similar edges from different sequences", () => { let potentialEdge1: PotentialEdge = helper.createPotentialEdge(); let potentialEdge2: PotentialEdge = helper.createPotentialEdge(); potentialEdge1.id = "k1"; potentialEdge1.sameMergeCC = true; potentialEdge1.sequenceId = "s1"; potentialEdge2.id = "k2"; potentialEdge2.sameMergeCC = true; potentialEdge2.sequenceId = "s2"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge1, potentialEdge2]); expect(similarEdges.length).toBe(2); for (let similarEdge of similarEdges) { expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); } for (let key of [potentialEdge1.id, potentialEdge2.id]) { let count: number = 0; for (let similarEdge of similarEdges) { if (similarEdge.target === key) { count++; } } expect(count).toBe(1); } }); it("should have only one similar edge for a sequence based on distance", () => { let potentialEdge1: PotentialEdge = helper.createPotentialEdge(); let potentialEdge2: PotentialEdge = helper.createPotentialEdge(); potentialEdge1.id = "k1"; potentialEdge1.distance = 2; potentialEdge1.sameMergeCC = true; potentialEdge1.sequenceId = "s1"; potentialEdge2.id = "k2"; potentialEdge2.distance = 1; potentialEdge2.sameMergeCC = true; potentialEdge2.sequenceId = "s1"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge1, potentialEdge2]); expect(similarEdges.length).toBe(1); let similarEdge: NavigationEdge = similarEdges[0]; expect(similarEdge.target).toBe(potentialEdge2.id); expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); }); it("should have only one similar edge for a sequence based on rotation", () => { let potentialEdge1: PotentialEdge = helper.createPotentialEdge(); let potentialEdge2: PotentialEdge = helper.createPotentialEdge(); potentialEdge1.id = "k1"; potentialEdge1.rotation = 2; potentialEdge1.sameMergeCC = true; potentialEdge1.sequenceId = "s1"; potentialEdge2.id = "k2"; potentialEdge2.rotation = 1; potentialEdge2.sameMergeCC = true; potentialEdge2.sequenceId = "s1"; let similarEdges: NavigationEdge[] = edgeCalculator.computeSimilarEdges(image, [potentialEdge1, potentialEdge2]); expect(similarEdges.length).toBe(1); let similarEdge: NavigationEdge = similarEdges[0]; expect(similarEdge.target).toBe(potentialEdge2.id); expect(similarEdge.data.direction).toBe(NavigationDirection.Similar); }); });
{ "content_hash": "27d2bc52a75a46132babbac6b5ef8039", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 132, "avg_line_length": 35.97794117647059, "alnum_prop": 0.6575720416922134, "repo_name": "mapillary/mapillary-js", "id": "43850d9e31c916f9e12257813383072fbf25532d", "size": "9786", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "test/graph/edge/EdgeCalculator.Similar.test.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "37330" }, { "name": "Dockerfile", "bytes": "618" }, { "name": "JavaScript", "bytes": "5948" }, { "name": "TypeScript", "bytes": "2737922" } ], "symlink_target": "" }
/* Funciones auxiliares de visualización*/ function create_yt(rec, url) { var _url = url.split('/').pop() _url = _url.split('watch?v=').pop() $(rec).append('<div class="embed-responsive embed-responsive-16by9"> <iframe src = "//www.youtube.com/embed/' + _url + '" frameborder = "0" fs="1" allowfullscreen> < /iframe></div > '); } function create_go(rec, url) { url = url.replace('edit', 'preview'); $(rec).append('<div class="embed-responsive embed-responsive-16by9"> <iframe src="' + url + '" ></iframe></div>'); } function create_pdf(rec, url) { var _url = 'http://innovacion.educa.aragon.es/w/api.php?action=query&prop=imageinfo&format=json&iiprop=url&iiurlwidth=200&titles=Archivo:'; jQuery.ajax({ dataType: "json", url: _url + url, async: false, success: function(data){ var item = data.query.pages; var itemid = Object.keys(item)[0]; var thumb = item[itemid].imageinfo[0].thumburl; var urlpdf = item[itemid].imageinfo[0].url; jQuery(rec).append('<a href="' + urlpdf + '" target="_blank" class="thumbnail"> <img alt="proyecto" class="img-responsive" src="' + thumb + '"></img></a>'); } }); } function create_kizoa(rec, url) { var _url = url.split('/').pop() $(rec).append('<div class="embed-responsive embed-responsive-16by9"> <iframe src="http://www.kizoa.com/embed-' + _url + '" frameborder = "0" fs="1" allowfullscreen> < /iframe></div > '); } function create_sway(rec, url) { var _url = url.split('/').pop(); $(rec).append('<div class="embed-responsive embed-responsive-16by9"> <iframe src="https://sway.com/s/' + _url + '/embed" frameborder = "0" fs="1" allowfullscreen> < /iframe></div > '); } function create_vimeo(rec, url) { var _url = url.split('/').pop() $(rec).append('<div class="embed-responsive embed-responsive-16by9"> <iframe src="https://player.vimeo.com/video/' + _url + '" ></iframe></div>'); } function create_swf(rec, url) { $(rec).append('<div class="embed-responsive embed-responsive-16by9"><object data="' + url + '" type="application/x-shockwave-flash" > <param value="' + url + '" name="movie" /></object></div>'); } /* Muestra recurso según su tipo*/ function muestraRecurso(rec) { var itemID = rec.getAttribute("itemid"); var url = rec.getAttribute("url"); var pos = rec.getElementsByClassName('iflense'); if (url.indexOf('docs.google') != -1) { create_go(pos, url); } else if (url.endsWith('.pdf')) { create_pdf(pos, url); } else if (url.indexOf('youtu') != -1) { create_yt(pos, url); } else if (url.indexOf('kizoa') != -1) { create_kizoa(pos, url); } else if (url.indexOf('sway') != -1) { create_sway(pos, url); } else if (url.indexOf('vimeo') != -1) { create_vimeo(pos, url); } else if (url.indexOf('swf') != -1) { create_swf(pos, url); } else if (url.indexOf('.jpg') != -1 || url.indexOf('.png') != -1 ) { create_pdf(pos, url); } } /* Muestra proyectos del centro como lista, no como separados por comas */ function showProjects(centro) { var itemID = centro.getAttribute("itemid"); var datos = centro.getElementsByClassName('exhibit-item'); if (datos.length > 1) { jQuery(datos).wrap('<li></li>'); ds = centro.getElementsByClassName('datosproyectos') jQuery(ds).contents().filter(function() { return (this.nodeType == 3); }).remove(); } } /* Recursos totales. Hace llamada a tabla Cargo */ jQuery(document).bind("dataload.exhibit", function() { jQuery('div.exhibit-views-header div').first().addClass('clearfix').append('<span class="pull-right"> <span class="glyphicon glyphicon-hand-right"></span> <strong>Recursos totales: </strong><span id="totalRec"></span></span>'); var url = '//innovacion.educa.aragon.es/w/index.php?title=Especial:CargoExport&tables=RecursosDBN&fields=count(_pageName)=recursos&format=json' jQuery.getJSON( url, function( json ) {jQuery('#totalRec').html(json[0].recursos);}); }); /* Novedades */ jQuery(document).ready( jQuery.ajax({ type: "GET", url: "http://innovacion.educa.aragon.es/w/api.php", data: { action:'parse', format:'json', prop:'text', page:'Página_principal/Novedades'}, dataType: 'json', success: function( jsondata ){ jQuery( '#novedades' ).html( jsondata.parse.text["*"] ); } }) ); /* Destacados - Carrusel */ jQuery(document).ready( jQuery.ajax({ type: "GET", url: "http://innovacion.educa.aragon.es/w/api.php", data: { action:'parse', format:'json', prop:'text', page:'Página_principal/Destacados'}, dataType: 'json', success: function( jsondata ){ jQuery( '#carrusel_destacados' ).html( jsondata.parse.text["*"] ); } }) ); /* Añade iconos a líneas estratégicas. Elimina cuadrado de selección */ function lineaFormatter(elmt) { var link = jQuery(elmt).find('.exhibit-flowingFacet-value-link') //.prepend('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAABm0lEQVQ4T63UzUvUURTG8c9vEYGiMwlFuDA3OpWzK6gWgvUHFOQiCFQIoqaZCoLATZvWLdL0V1CQ2NCyokWLIAuCXqBlxdgiatMLiCXagAQVd6ZhbMycps7y3nu+53nuPfdEfh9pbNNlh8hmfEfBK0/xDC9r06JlnA4n7bbPTi26FaUVfSulNpnW7LF5t1035/LS3F9BHW4Z1ibj8wpKy8tjks6Z8db+yrkqKEDyEnrN/xFS2byv1SGz3pRhZVCwM6x/VSW1FS5Y54zJYDOA0oaMmrBQl5LaQ4NaXHMsgIZclHPU+4ZAsXZZI5EusUt67DHXEOiepKznkW5THlq0wdeGQB+s0WdtJGXKA4s2/jsoFv8PawyKnZDxriFr49rlnA+vttWAcZN1NmJttQGt8o6UG3KTnNMOyPr0V6pGtDlrwqwr1S/S6aarkvrqVHZXQsaM1/qrX6Qio9MNp6x3fBVlQcmojxXIclBYSThsr4OlMZJS1ONLqc4LzQqaPLHgjnyws/IYqe5swXYpuygNthAF0x79HGyF2rv8Ab1raGApJNh5AAAAAElFTkSuQmCC" style="vertical-align: middle;"></img> '); var dest = jQuery(elmt).find(".exhibit-flowingFacet-value-checkbox img"); switch (link[0].textContent) { case "TAC (Tecnologías del Aprendizaje y del Conocimiento)": dest.replaceWith('<img src="http://innovacion.educa.aragon.es/w/images/thumb/3/3c/TAC.svg/18px-TAC.svg.png" alt="TAC">').show(); break; case "Gestión de las emociones": dest.replaceWith('<img src="http://innovacion.educa.aragon.es/w/images/thumb/6/6b/Gestion_de_emociones.svg/18px-Gestion_de_emociones.svg.png">'); break; case "Metodologías activas": dest.replaceWith('<img src="http://innovacion.educa.aragon.es/w/images/thumb/7/73/Metodologias_activas.svg/18px-Metodologias_activas.svg.png">'); break; case "Compromiso social": dest.replaceWith('<img src="http://innovacion.educa.aragon.es/w/images/thumb/6/6f/Compromiso_social.svg/18px-Compromiso_social.svg.png">'); break; case "Comunicación oral": dest.replaceWith('<img src="http://innovacion.educa.aragon.es/w/images/thumb/8/8e/Monstruo_comunicacion_oral.svg/18px-Monstruo_comunicacion_oral.svg.png">'); break; } } /* Muestra 1/0 como institucional / no institucional. Añade title*/ function institucionalFormatter (elmt){ switch (jQuery(elmt).find('.exhibit-flowingFacet-value-link').text()){ case "1": jQuery(elmt).find('.exhibit-flowingFacet-value-link').html('Institucional'); break; case "0": jQuery(elmt).find('.exhibit-flowingFacet-value-link').html('No institucional'); break; } switch (elmt[0].getAttribute('title')){ case "0": elmt[0].setAttribute('title', 'No institucional'); break; case "1": elmt[0].setAttribute('title', 'Institucional'); } } function provinciaFormatter (elmt){ switch (jQuery(elmt).find('.exhibit-flowingFacet-value-link').text()){ case "H": jQuery(elmt).find('.exhibit-flowingFacet-value-link').html('Huesca'); break; case "T": jQuery(elmt).find('.exhibit-flowingFacet-value-link').html('Teruel'); break; case "Z": jQuery(elmt).find('.exhibit-flowingFacet-value-link').html('Zaragoza'); break; } switch (elmt[0].getAttribute('title')){ case "H": elmt[0].setAttribute('title', 'Huesca'); break; case "T": elmt[0].setAttribute('title', 'Teruel'); break; case "Z": elmt[0].setAttribute('title', 'Zaragoza'); } }
{ "content_hash": "7b2698e21617aecbf3082bd4d5b04aac", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 781, "avg_line_length": 44.73684210526316, "alnum_prop": 0.6289411764705882, "repo_name": "lmorillas/mapa-innovacion-aragon", "id": "15bec8c0c29d88c629652398bb6b2402de3a99ab", "size": "8513", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "viewresource.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "9012" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using StackExchange.Redis; using System.Threading; using System.Diagnostics; namespace Features.Test { class TestNumbers { private static ConnectionMultiplexer Redis = null; static volatile bool g_Terminate = false; static volatile int g_ConfigNr = 0; static volatile int g_WorkInput = 0; public static void WorkerThread() { int cfgNr = g_ConfigNr; var workerID = String.Format("{0}:{1}:{2}", Environment.MachineName, Process.GetCurrentProcess().Id, Thread.CurrentThread.ManagedThreadId); var rnd = new Random(); var db = Redis.GetDatabase(); while (!g_Terminate) { int workerNo = -1; string key = ""; while (true) { ++workerNo; key = String.Format("WorkerNo:{0}", workerNo); db.StringSet(key, workerID, TimeSpan.FromSeconds(rnd.Next(10)+3), When.NotExists, CommandFlags.DemandMaster); if (db.StringGet(key, CommandFlags.DemandMaster).CompareTo(workerID) == 0) break; } db.HashSet("WorkerList", workerNo, workerID); Redis.GetSubscriber().Publish("ClusterCtrl", "reconfigure"); Console.WriteLine("{0} allocated number {1}", workerID, workerNo); while (!g_Terminate) { Thread.Sleep(50); var value = g_WorkInput; if ((value != 0) && ((value % 10) == workerNo)) { g_WorkInput = 0; Console.Write("{0} with number {1} handles {2} ", workerID, workerNo, value); value += rnd.Next(51) + 17; value /= 3; Redis.GetSubscriber().Publish("Work.Next", value); Console.WriteLine("-> {0}", value); } if (db.StringGet(key, CommandFlags.DemandMaster).CompareTo(workerID) != 0) { Console.WriteLine("{0} assigned number {1} timed out, renewing lease ...", workerID, workerNo); break; } } } } private static void HandleClusterCtrl(RedisValue msg) { var data = msg.ToString().Split( new char[] {'|'}); //Console.WriteLine("Received ClusterCtrl({0})", data[0]); switch (data[0]) { case "reconfigure": ++g_ConfigNr; break; default: Debug.Assert(false); break; } } private static void HandleWorkpack(RedisValue msg) { g_WorkInput = (int)msg; } internal static void Execute(ConnectionMultiplexer redis) { Redis = redis; const int TEST = 10; var threads = new List<Thread>(); Console.Write("Creating worker threads ... "); for (var i = 0; i < TEST; ++i) { var thread = new Thread(new ThreadStart(WorkerThread)); threads.Add(thread); } Console.WriteLine(" OK"); Console.Write("Starting worker threads "); foreach (var thread in threads) { thread.Start(); Console.Write("."); } Console.WriteLine(" OK."); Console.WriteLine("Subscribing to a bunch of channels ..."); var sub = Redis.GetSubscriber(); sub.Subscribe("ClusterCtrl", (channel, msg) => { HandleClusterCtrl(msg); }); sub.Subscribe("Work.*", (channel, msg) => { HandleWorkpack(msg); }); Console.WriteLine("Initiating some work ..."); Redis.GetSubscriber().Publish("Work.First", 42); Thread.Sleep(3 * 60 * 1000); g_Terminate = true; Console.WriteLine("Waiting for threads to terminate ..."); while (threads.Count > 0) if (threads[0].Join(4096)) threads.RemoveAt(0); Console.WriteLine("Waiting for threads to terminate ... OK."); } } }
{ "content_hash": "e99b22d941fe4802561a797b982348e2", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 129, "avg_line_length": 33.06993006993007, "alnum_prop": 0.46690632268978643, "repo_name": "Jens-G/Redis-Samples", "id": "5386172f782b341c897740d7b830092a82c2a1f1", "size": "4731", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Features/Test/TestNumbers.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "275" }, { "name": "C#", "bytes": "95975" }, { "name": "Thrift", "bytes": "649" } ], "symlink_target": "" }
// Copyright (C) 2017 Andrea Spurio. All rights reserved. // // Licensed under the MIT License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at // // http://opensource.org/licenses/MIT // // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. #ifndef JSONTYPE_RESOLVER_HPP_ #define JSONTYPE_RESOLVER_HPP_ #define RAPIDJSON_HAS_STDSTRING 1 #include <type_traits> #include <unordered_map> #include <memory> #include <stdexcept> #include <utility> #include <string> #include <rapidjson/document.h> #include "Key.hpp" namespace jsontype { namespace detail { template <typename Document, typename F> class Key_node { typedef F Func; typedef std::basic_string<typename Document::Ch> Key_type; public: Key_node() = default; Key_node(const F& func) : activable_(true), func_(func) {} void activate(const F& func); template <typename T, typename... Ts, typename std::enable_if_t<sizeof...(Ts) >= 1>* = nullptr> void add(const F&); template <typename T, typename... Ts, typename std::enable_if_t<sizeof...(Ts) == 0>* = nullptr> void add(const F&); template <typename T, typename... Ts, typename... Fargs, typename std::enable_if_t<sizeof...(Ts) >= 1>* = nullptr> auto invoke(Fargs&&...) const; template <typename T, typename... Ts, typename... Fargs, typename std::enable_if_t<sizeof...(Ts) == 0>* = nullptr> auto invoke(Fargs&&...) const; template <typename... Fargs, typename... Ts, typename std::enable_if_t<sizeof...(Ts) == 0>* = nullptr> auto invoke(Fargs&&...) const; template <typename... Fargs, typename U = std::result_of_t<F(Fargs...)>, typename std::enable_if_t<std::is_same<U, void>::value>* = nullptr> auto scan(const Document&, Fargs&&... fargs) const; template <typename... Fargs, typename U = std::result_of_t<F(Fargs...)>, typename std::enable_if_t<!std::is_same<U, void>::value>* = nullptr> auto scan(const Document&, Fargs&&... fargs) const; private: template <typename Json_ref, typename... Fargs, typename U = std::result_of_t<F(Fargs...)>, typename std::enable_if_t<std::is_same<U, void>::value>* = nullptr> std::result_of_t<F(Fargs...)> do_scan(const Json_ref&, bool& found, Fargs&&... fargs) const; template <typename Json_ref, typename... Fargs, typename U = std::result_of_t<F(Fargs...)>, typename std::enable_if_t<!std::is_same<U, void>::value>* = nullptr> std::result_of_t<F(Fargs...)> do_scan(const Json_ref&, bool& found, Fargs&&... fargs) const; bool activable_ = false; F func_; std::unordered_map<Key_type, std::unique_ptr<Key_node>> children_; }; } template <typename Document, typename F> class Generic_resolver { typedef F Func; typedef std::basic_string<typename Document::Ch> String_type; public: /** * Add a mapping <key, function> */ template <typename Key> void add(Key&&, const Func& f = Func()) { add(typename Key::Args(), f); } /** * Invokes the function linked to the given key * * @throws Out_of_range if the key is not found */ template <typename Key, typename... Fargs> auto invoke(Key&&, Fargs&&... ar) const { return invoke(typename Key::Args(), std::forward<Fargs>(ar)...); } /** * Scans a json and tries to invoke the best fitting function * * @throws Out_of_range if no matching key is not found */ template <typename... Fargs> auto scan(const Document& doc, Fargs&&...) const; /** * Scans a raw string and tries to invoke the best fitting function * * @throws Runtime_error if the string is not a valid json, out_of_range if no matching key is not found */ template <typename... Fargs> auto scan(const String_type&, Fargs&&... fargs) const; private: template <typename... Args> void add(detail::Pack<Args...>&&, const Func&); template <typename... Args, typename... Fargs> auto invoke(detail::Pack<Args...>&&, Fargs&&...) const; detail::Key_node<Document, F> root_; }; template <typename F> using Resolver = Generic_resolver<rapidjson::Document, F>; // // Definitions // template <typename Document, typename F> template <typename... Args> void Generic_resolver<Document, F>::add(detail::Pack<Args...>&&, const Func& f) { root_.template add<Args...>(f); } template <typename Document, typename F> template <typename... Args, typename... Fargs> auto Generic_resolver<Document, F>::invoke(detail::Pack<Args...>&&, Fargs&&... fargs) const { return root_.template invoke<Fargs..., Args...>(std::forward<Fargs>(fargs)...); } template <typename Document, typename F> template <typename... Fargs> auto Generic_resolver<Document, F>::scan(const Document& doc, Fargs&&... fargs) const { return root_.template scan(doc, std::forward<Fargs>(fargs)...); } template <typename Document, typename F> template <typename... Fargs> auto Generic_resolver<Document, F>::scan(const String_type& str, Fargs&&... fargs) const { Document doc; doc.Parse(str); if (!doc.IsObject()) { throw std::runtime_error("Cannot parse string as json: " + str); } return scan(doc, std::forward<Fargs>(fargs)...); } namespace detail { template <typename Document, typename F> void Key_node<Document, F>::activate(const F& func) { func_ = func; activable_ = true; } template <typename Document, typename F> template <typename T, typename... Ts, typename std::enable_if_t<sizeof...(Ts) >= 1>*> void Key_node<Document, F>::add(const F& f) { auto pair = children_.emplace(std::piecewise_construct, std::forward_as_tuple(T::name()), std::forward_as_tuple(std::make_unique<Key_node<Document, F>>())); pair.first->second->template add<Ts...>(f); } template <typename Document, typename F> template <typename T, typename... Ts, typename std::enable_if_t<sizeof...(Ts) == 0>*> void Key_node<Document, F>::add(const F& f) { auto pair = children_.emplace(std::piecewise_construct, std::forward_as_tuple(T::name()), std::forward_as_tuple(std::make_unique<Key_node<Document, F>>())); pair.first->second->activate(f); } template <typename Document, typename F> template <typename T, typename... Ts, typename... Fargs, typename std::enable_if_t<sizeof...(Ts) >= 1>*> auto Key_node<Document, F>::invoke(Fargs&&... fargs) const { const auto it = children_.find(T::name()); if (it == children_.cend()) { throw std::out_of_range("Key not found!"); } return it->second->template invoke<Ts...>(std::forward<Fargs>(fargs)...); } template <typename Document, typename F> template <typename T, typename... Ts, typename... Fargs, typename std::enable_if_t<sizeof...(Ts) == 0>*> auto Key_node<Document, F>::invoke(Fargs&&... fargs) const { const auto it = children_.find(T::name()); if (it == children_.cend() || !it->second->activable_) { throw std::out_of_range("Key not found!"); } return it->second->func_(std::forward<Fargs>(fargs)...); } template <typename Document, typename F> template <typename... Fargs, typename U, typename std::enable_if_t<std::is_same<U, void>::value>*> auto Key_node<Document, F>::scan(const Document& doc, Fargs&&... fargs) const { bool found = false; do_scan(doc, found, std::forward<Fargs>(fargs)...); if (!found) { throw std::out_of_range("No matching key found!"); } } template <typename Document, typename F> template <typename... Fargs, typename U, typename std::enable_if_t<!std::is_same<U, void>::value>*> auto Key_node<Document, F>::scan(const Document& doc, Fargs&&... fargs) const { bool found = false; const auto ret = do_scan(doc, found, std::forward<Fargs>(fargs)...); if (!found) { throw std::out_of_range("No matching key found!"); } return ret; } template <typename Document, typename F> template <typename Json_ref, typename... Fargs, typename U, typename std::enable_if_t<std::is_same<U, void>::value>*> auto Key_node<Document, F>::do_scan(const Json_ref& ref, bool& found, Fargs&&... fargs) const -> std::result_of_t<F(Fargs...)> { for (auto& member : ref.GetObject()) { const auto it = children_.find(member.name.GetString()); if (it == children_.cend()) { continue; } bool found_child = false; if (member.value.IsObject()) { it->second->do_scan(member.value, found_child, std::forward<Fargs>(fargs)...); if (found_child) { found = true; return; } } if (it->second->activable_) { found = true; return it->second->func_(std::forward<Fargs>(fargs)...); } } } template <typename Document, typename F> template <typename Json_ref, typename... Fargs, typename U, typename std::enable_if_t<!std::is_same<U, void>::value>*> auto Key_node<Document, F>::do_scan(const Json_ref& ref, bool& found, Fargs&&... fargs) const -> std::result_of_t<F(Fargs...)> { for (auto& member : ref.GetObject()) { const auto it = children_.find(member.name.GetString()); if (it == children_.cend()) { continue; } bool found_child = false; if (member.value.IsObject()) { const auto ret = it->second->do_scan(member.value, found_child, std::forward<Fargs>(fargs)...); if (found_child) { found = true; return ret; } } if (it->second->activable_) { found = true; return it->second->func_(std::forward<Fargs>(fargs)...); } } return std::result_of_t<F(Fargs...)>{}; } } } #endif
{ "content_hash": "c3bbae29150a382b312210c6ab89832e", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 110, "avg_line_length": 30.653250773993808, "alnum_prop": 0.6353903646096354, "repo_name": "Trisfald/jsontype", "id": "004d0f50c80be68da086c08b12852ffbc06791c2", "size": "9901", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/jsontype/Resolver.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "57504" } ], "symlink_target": "" }
package com.google.api.ads.dfp.jaxws.v201405; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * * Represents the actions that can be performed on the {@link ReconciliationOrderReport} objects. * * * <p>Java class for ReconciliationOrderReportAction complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ReconciliationOrderReportAction"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ReconciliationOrderReportAction.Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ReconciliationOrderReportAction", propOrder = { "reconciliationOrderReportActionType" }) @XmlSeeAlso({ SubmitReconciliationOrderReports.class, RevertReconciliationOrderReports.class }) public abstract class ReconciliationOrderReportAction { @XmlElement(name = "ReconciliationOrderReportAction.Type") protected String reconciliationOrderReportActionType; /** * Gets the value of the reconciliationOrderReportActionType property. * * @return * possible object is * {@link String } * */ public String getReconciliationOrderReportActionType() { return reconciliationOrderReportActionType; } /** * Sets the value of the reconciliationOrderReportActionType property. * * @param value * allowed object is * {@link String } * */ public void setReconciliationOrderReportActionType(String value) { this.reconciliationOrderReportActionType = value; } }
{ "content_hash": "7ab9dd91476054985b6e8efd0bd61dc3", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 130, "avg_line_length": 29.35211267605634, "alnum_prop": 0.696257197696737, "repo_name": "stoksey69/googleads-java-lib", "id": "7ffd6c18f1e40f38767d7df9550dbbab3729b318", "size": "2084", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201405/ReconciliationOrderReportAction.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "93553686" } ], "symlink_target": "" }
FROM balenalib/jn30b-nano-fedora:34-run ENV GO_VERSION 1.15.8 # gcc for cgo RUN dnf install -y \ gcc-c++ \ gcc \ git \ && dnf clean all RUN mkdir -p /usr/local/go \ && curl -SLO "https://storage.googleapis.com/golang/go$GO_VERSION.linux-arm64.tar.gz" \ && echo "0e31ea4bf53496b0f0809730520dee98c0ae5c530f3701a19df0ba0a327bf3d2 go$GO_VERSION.linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-arm64.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-arm64.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 34 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.15.8 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "49d7d7d3cbb00312404ad9013d1e2578", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 669, "avg_line_length": 53.94736842105263, "alnum_prop": 0.7160975609756097, "repo_name": "nghiant2710/base-images", "id": "09e71fd5a011fdb83e7fec2f3492a36ff37178df", "size": "2071", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/golang/jn30b-nano/fedora/34/1.15.8/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "144558581" }, { "name": "JavaScript", "bytes": "16316" }, { "name": "Shell", "bytes": "368690" } ], "symlink_target": "" }
 #include <aws/secretsmanager/model/ReplicateSecretToRegionsResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::SecretsManager::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ReplicateSecretToRegionsResult::ReplicateSecretToRegionsResult() { } ReplicateSecretToRegionsResult::ReplicateSecretToRegionsResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } ReplicateSecretToRegionsResult& ReplicateSecretToRegionsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("ARN")) { m_aRN = jsonValue.GetString("ARN"); } if(jsonValue.ValueExists("ReplicationStatus")) { Aws::Utils::Array<JsonView> replicationStatusJsonList = jsonValue.GetArray("ReplicationStatus"); for(unsigned replicationStatusIndex = 0; replicationStatusIndex < replicationStatusJsonList.GetLength(); ++replicationStatusIndex) { m_replicationStatus.push_back(replicationStatusJsonList[replicationStatusIndex].AsObject()); } } return *this; }
{ "content_hash": "fc680501d6f2d1309ff3c6e1f367bc6f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 134, "avg_line_length": 28.304347826086957, "alnum_prop": 0.7795698924731183, "repo_name": "aws/aws-sdk-cpp", "id": "5f6a57bfafdfedeb6cf65e773421130e6a400e4c", "size": "1421", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "aws-cpp-sdk-secretsmanager/source/model/ReplicateSecretToRegionsResult.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "309797" }, { "name": "C++", "bytes": "476866144" }, { "name": "CMake", "bytes": "1245180" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "8056" }, { "name": "Java", "bytes": "413602" }, { "name": "Python", "bytes": "79245" }, { "name": "Shell", "bytes": "9246" } ], "symlink_target": "" }
namespace google { namespace protobuf { namespace { const ::google::protobuf::Descriptor* Any_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Any_reflection_ = NULL; } // namespace void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() { protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "google/protobuf/any.proto"); GOOGLE_CHECK(file != NULL); Any_descriptor_ = file->message_type(0); static const int Any_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), }; Any_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( Any_descriptor_, Any::default_instance_, Any_offsets_, -1, -1, -1, sizeof(Any), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _is_default_instance_)); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto); } void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Any_descriptor_, &Any::default_instance()); } } // namespace void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() { delete Any::default_instance_; delete Any_reflection_; } void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\031google/protobuf/any.proto\022\017google.prot" "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002" " \001(\014BK\n\023com.google.protobufB\010AnyProtoP\001\240" "\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownType" "sb\006proto3", 169); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/any.proto", &protobuf_RegisterTypes); Any::default_instance_ = new Any(); Any::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto { StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() { protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); } } static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_; namespace { static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; static void MergeFromFail(int line) { GOOGLE_CHECK(false) << __FILE__ << ":" << line; } } // namespace // =================================================================== void Any::PackFrom(const ::google::protobuf::Message& message) { _any_metadata_.PackFrom(message); } bool Any::UnpackTo(::google::protobuf::Message* message) const { return _any_metadata_.UnpackTo(message); } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Any::kTypeUrlFieldNumber; const int Any::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Any::Any() : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Any) } void Any::InitAsDefaultInstance() { _is_default_instance_ = true; } Any::Any(const Any& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.Any) } void Any::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } Any::~Any() { // @@protoc_insertion_point(destructor:google.protobuf.Any) SharedDtor(); } void Any::SharedDtor() { type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { } } void Any::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Any::descriptor() { protobuf_AssignDescriptorsOnce(); return Any_descriptor_; } const Any& Any::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); return *default_instance_; } Any* Any::default_instance_ = NULL; Any* Any::New(::google::protobuf::Arena* arena) const { Any* n = new Any; if (arena != NULL) { arena->Own(n); } return n; } void Any::Clear() { type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } bool Any::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Any) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string type_url = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Any.type_url")); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_value; break; } // optional bytes value = 2; case 2: { if (tag == 18) { parse_value: DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_value())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.Any) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.Any) return false; #undef DO_ } void Any::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Any) // optional string type_url = 1; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Any.type_url"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->type_url(), output); } // optional bytes value = 2; if (this->value().size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2, this->value(), output); } // @@protoc_insertion_point(serialize_end:google.protobuf.Any) } ::google::protobuf::uint8* Any::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) // optional string type_url = 1; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Any.type_url"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->type_url(), target); } // optional bytes value = 2; if (this->value().size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2, this->value(), target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any) return target; } int Any::ByteSize() const { int total_size = 0; // optional string type_url = 1; if (this->type_url().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->type_url()); } // optional bytes value = 2; if (this->value().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( this->value()); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Any::MergeFrom(const ::google::protobuf::Message& from) { if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); const Any* source = ::google::protobuf::internal::DynamicCastToGenerated<const Any>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void Any::MergeFrom(const Any& from) { if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); if (from.type_url().size() > 0) { type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_); } if (from.value().size() > 0) { value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_); } } void Any::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void Any::CopyFrom(const Any& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool Any::IsInitialized() const { return true; } void Any::Swap(Any* other) { if (other == this) return; InternalSwap(other); } void Any::InternalSwap(Any* other) { type_url_.Swap(&other->type_url_); value_.Swap(&other->value_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Any::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Any_descriptor_; metadata.reflection = Any_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // Any // optional string type_url = 1; void Any::clear_type_url() { type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Any::type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Any::set_type_url(const ::std::string& value) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) } void Any::set_type_url(const char* value) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) } void Any::set_type_url(const char* value, size_t size) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url) } ::std::string* Any::mutable_type_url() { // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Any::release_type_url() { return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Any::set_allocated_type_url(::std::string* type_url) { if (type_url != NULL) { } else { } type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) } // optional bytes value = 2; void Any::clear_value() { value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Any::value() const { // @@protoc_insertion_point(field_get:google.protobuf.Any.value) return value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Any::set_value(const ::std::string& value) { value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Any.value) } void Any::set_value(const char* value) { value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) } void Any::set_value(const void* value, size_t size) { value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value) } ::std::string* Any::mutable_value() { // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Any::release_value() { return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Any::set_allocated_value(::std::string* value) { if (value != NULL) { } else { } value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace protobuf } // namespace google // @@protoc_insertion_point(global_scope)
{ "content_hash": "4d6bdcf86df06fa1d4e80665b48f5523", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 110, "avg_line_length": 32.644396551724135, "alnum_prop": 0.678088070244933, "repo_name": "miyosuda/intro-to-dl-android", "id": "321fd315f32a1671c5ba6b02b1f6b80cc44b8c28", "size": "15756", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ImageClassification/jni-build/jni/include/google/protobuf/any.pb.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "286277" }, { "name": "C++", "bytes": "25872569" }, { "name": "CSS", "bytes": "214" }, { "name": "HTML", "bytes": "1249714" }, { "name": "Java", "bytes": "168408" }, { "name": "JavaScript", "bytes": "12988" }, { "name": "Jupyter Notebook", "bytes": "1483370" }, { "name": "Makefile", "bytes": "3180" }, { "name": "Objective-C", "bytes": "2576" }, { "name": "Protocol Buffer", "bytes": "1199784" }, { "name": "Python", "bytes": "5899210" }, { "name": "Ruby", "bytes": "5784" }, { "name": "Shell", "bytes": "45750" }, { "name": "TypeScript", "bytes": "527234" } ], "symlink_target": "" }
angular.module("leaflet-directive").directive('bounds', function ($log, leafletHelpers, leafletBoundsHelpers) { return { restrict: "A", scope: false, replace: false, require: 'leaflet', link: function(scope, element, attrs, controller) { var isDefined = leafletHelpers.isDefined, createLeafletBounds = leafletBoundsHelpers.createLeafletBounds, updateBoundsInScope = leafletBoundsHelpers.updateBoundsInScope, leafletScope = controller.getLeafletScope(); controller.getMap().then(function(map) { var initializing = true; map.whenReady(function() { leafletScope.$watch('bounds', function(newBounds) { if (!isDefined(newBounds)) { $log.error('[AngularJS - Leaflet] Invalid bounds'); return; } initializing = false; var leafletBounds = createLeafletBounds(newBounds); if (leafletBounds && !map.getBounds().equals(leafletBounds)) { map.fitBounds(leafletBounds); } }, true); map.on('moveend dragend zoomend', function() { if (!initializing) { updateBoundsInScope(leafletScope, map); } }); }); }); } }; });
{ "content_hash": "ba59532a21e2881c4cb7f7ec63a798ee", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 111, "avg_line_length": 38.46341463414634, "alnum_prop": 0.4806594800253646, "repo_name": "eugene-d/angular-leaflet-directive", "id": "d4687dcdfe75f86b0f118a0890302c0aa000ae4f", "size": "1577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/directives/bounds.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "d771ec65429e7793d567528aa6ef3b22", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "b597b907af3b368eed1aacaae5ba18b4b0d69156", "size": "201", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Trisetella/Trisetella triglochin/ Syn. Triaristellina trichaete/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
JRE=$JAVA_HOME/jre JAVA=$JRE/bin/java QUARTZ=../.. . ${QUARTZ}/examples/bin/buildcp.sh # # Set the path to your JDCB Driver jar file here JDBC_CP=/home/user/lib/postgres.jar QUARTZ_CP=$QUARTZ_CP:$JDBC_CP # Uncomment the following line if you would like to set log4j # logging properties # #LOGGING_PROPS="-Dlog4j.configuration=log4j.properties" # Set the name and location of the quartz.properties file QUARTZ_PROPS="-Dorg.quartz.properties=instance2.properties" $JAVA -classpath $QUARTZ_CP $QUARTZ_PROPS $LOGGING_PROPS org.quartz.examples.example13.ClusterExample dontScheduleJobs
{ "content_hash": "1f657e93d178225ceb6ef211b92598ed", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 118, "avg_line_length": 24.666666666666668, "alnum_prop": 0.768581081081081, "repo_name": "optivo-org/quartz-1.8.3-optivo", "id": "09b9c79559ce483e7f0adf488a0ed6b7e841136b", "size": "685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/example13/instance2.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "2713" }, { "name": "Java", "bytes": "1950002" } ], "symlink_target": "" }
<?php /** @var $installer Mage_Customer_Model_Entity_Setup */ $installer = $this; $installer->getConnection()->addColumn($installer->getTable('customer/entity'), 'disable_auto_group_change', array( 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, 'unsigned' => true, 'nullable' => false, 'default' => '0', 'comment' => 'Disable automatic group change based on VAT ID' ));
{ "content_hash": "9b97e97f08c4646d03b7e815a82a9b5d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 115, "avg_line_length": 30.153846153846153, "alnum_prop": 0.6530612244897959, "repo_name": "tagalpha/library", "id": "04f2b5beb13928af0a95d74ee892f03e11814b7d", "size": "1347", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "20063" }, { "name": "ApacheConf", "bytes": "8117" }, { "name": "Batchfile", "bytes": "1036" }, { "name": "CSS", "bytes": "1805855" }, { "name": "HTML", "bytes": "5531269" }, { "name": "JavaScript", "bytes": "1295882" }, { "name": "PHP", "bytes": "45317581" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "288" }, { "name": "Shell", "bytes": "19717" }, { "name": "XSLT", "bytes": "2066" } ], "symlink_target": "" }
class userled { public: void blinkGreen(int count, int gap); }; extern userled UserLed; #endif
{ "content_hash": "c31854929d320ca448335433b916d322", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 40, "avg_line_length": 10.3, "alnum_prop": 0.6893203883495146, "repo_name": "joshmarinacci/xadow-lib", "id": "19febdcb9309b9446a885e29ebf8276a1cb05ba7", "size": "148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "userled.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "5505" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <feed><tipo>Rua</tipo><logradouro>Uberlândia</logradouro><bairro>São Tomé</bairro><cidade>Viamão</cidade><uf>RS</uf><cep>94460120</cep></feed>
{ "content_hash": "4b00242dedf93d73476093c1e9a9b19e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 142, "avg_line_length": 99.5, "alnum_prop": 0.7185929648241206, "repo_name": "chesarex/webservice-cep", "id": "71b0b4fa232ce5986682a19992d8daa4fe724cf6", "size": "203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/ceps/94/460/120/cep.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package poll func (fd *FD) EOFError(n int, err error) error { return fd.eofError(n, err) }
{ "content_hash": "aed4f9c9b405c5b1eadb6389e36c99c5", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 48, "avg_line_length": 18.6, "alnum_prop": 0.6881720430107527, "repo_name": "CAFxX/go", "id": "3415ab383981797c471ff01492a9a44ee3aaee75", "size": "432", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/internal/poll/export_posix_test.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "2544097" }, { "name": "Awk", "bytes": "450" }, { "name": "Batchfile", "bytes": "8202" }, { "name": "C", "bytes": "107970" }, { "name": "C++", "bytes": "917" }, { "name": "Dockerfile", "bytes": "506" }, { "name": "Fortran", "bytes": "394" }, { "name": "Go", "bytes": "44135746" }, { "name": "HTML", "bytes": "2621340" }, { "name": "JavaScript", "bytes": "20486" }, { "name": "Makefile", "bytes": "748" }, { "name": "Perl", "bytes": "31365" }, { "name": "Python", "bytes": "15702" }, { "name": "Shell", "bytes": "54296" } ], "symlink_target": "" }
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "") Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan . "$PSScriptRoot\constants.ps1" Describe "$CommandName Unit Tests" -Tag 'UnitTests' { Context "Validate parameters" { [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object {$_ -notin ('whatif', 'confirm')} [object[]]$knownParameters = 'SqlInstance','SqlCredential','Pattern','EnableException' $knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters It "Should only contain our specific parameters" { (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object {$_}) -DifferenceObject $params).Count ) | Should Be 0 } } } <# Integration test should appear below and are custom to the command you are writing. Read https://github.com/sqlcollaborative/dbatools/blob/development/contributing.md#tests for more guidence. #>
{ "content_hash": "d359cdb9cbf7bf132fd1ec3df9e2541a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 134, "avg_line_length": 51.63157894736842, "alnum_prop": 0.7054026503567788, "repo_name": "dsolodow/dbatools", "id": "e222eb6df98f4c67dc64fc16c3ea3d390e11a319", "size": "981", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Find-DbaUserObject.Tests.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "472360" }, { "name": "PLpgSQL", "bytes": "774638" }, { "name": "PowerShell", "bytes": "13034919" }, { "name": "Rich Text Format", "bytes": "61846" } ], "symlink_target": "" }
var util = require('util'); var Transform = require('stream').Transform; function JSONReader(options) { if (!(this instanceof JSONReader)) { return new JSONReader(options); } this._reset(); Transform.call(this, options); } util.inherits(JSONReader, Transform); JSONReader.prototype._transform = function(chunk, encoding, callback) { var chunkString = chunk.toString('utf8'); this.jsonBuffer += chunkString; while( this.position < this.jsonBuffer.length) { var i = this.position; if (this.jsonBuffer[i] === '{') { this.openCurlies.push(i) } else if (this.jsonBuffer[i] === '}') { var start = this.openCurlies.pop(i) var end = i; if (this.openCurlies.length === 0) { var json = this.jsonBuffer.slice(start, end+1); this.push(json, 'utf8'); this.emit('json', json); callback(); this._reset(); return; } } this.position++; } callback(); } JSONReader.prototype._reset = function() { this.jsonBuffer = '' this.position = 0; this.openCurlies = []; } module.exports = JSONReader;
{ "content_hash": "592df13f0fee9b0adb587500785da708", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 71, "avg_line_length": 26.76086956521739, "alnum_prop": 0.554021121039805, "repo_name": "lakowske/json-streamer", "id": "0ee195cfdff4850138c36d70644169d9358a7d36", "size": "1231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "JavaScript", "bytes": "2194" } ], "symlink_target": "" }
/* Library includes. */ #include <stdio.h> #include <cross_studio_io.h> /* FreeRTOS includes. */ #include "FreeRTOS.h" #include "task.h" void vPrintString( const char *pcString ) { /* Print the string, suspending the scheduler as method of mutual exclusion. */ vTaskSuspendAll(); { debug_printf( pcString ); } xTaskResumeAll(); } /*-----------------------------------------------------------*/ void vPrintStringAndNumber( const char *pcString, unsigned long ulValue ) { /* Print the string, suspending the scheduler as method of mutual exclusion. */ vTaskSuspendAll(); { debug_printf( "%s %u\n", pcString, ulValue ); } xTaskResumeAll(); } /*-----------------------------------------------------------*/
{ "content_hash": "2a3739469e50dbf949890b0bba4ff148", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 73, "avg_line_length": 22.323529411764707, "alnum_prop": 0.546772068511199, "repo_name": "acverbeck/the-embedded-world", "id": "21d90cd18d0ccf3936f471d6270314dd6923445c", "size": "2272", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/FreeRTOS v7.3.0 STM32F407 Discovery/Common/basic_io.c", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "434410" }, { "name": "C", "bytes": "7649533" }, { "name": "C++", "bytes": "3044058" }, { "name": "HTML", "bytes": "75523" }, { "name": "Objective-C", "bytes": "13115" }, { "name": "Shell", "bytes": "9891" } ], "symlink_target": "" }
#include <toe/cmdlopt.h> #include <stdlib.h> #include <stdio.h> #if defined(_WIN32) || defined(_WIN64) # include "Windows/getopt.h" #else # include <getopt.h> #endif static const char* s_AppName = "<no app name set>"; static const char* s_AppVersion = "<no app version set>"; static const char* s_Header; static const char* s_Footer; static int s_OptionIndent = 2; static int s_ArgIndent = 8; static int s_DescriptionIndent = 10; static const cmdlopt_opt* s_Options; static void PrintLinesWithIndend(int indent, FILE* file, const char* text) { while (*text) { fprintf(file, "%c", *text); if (*text == '\n') { fprintf(file, "%*s", indent, ""); } ++text; } fprintf(file, "\n"); } extern int cmdlopt_set_help_indents(int optindent, int argindent, int descindent) { if (optindent < 0 || argindent < 0 || descindent < 0) { return CMDLOPT_E_INVALID_PARAM; } s_OptionIndent = optindent; s_ArgIndent = argindent; s_DescriptionIndent = descindent; return CMDLOPT_E_NONE; } extern int cmdlopt_set_app_name(const char* name) { if (!name) { return CMDLOPT_E_INVALID_PARAM; } s_AppName = name; return CMDLOPT_E_NONE; } extern int cmdlopt_set_app_version(const char* version) { if (!version) { return CMDLOPT_E_INVALID_PARAM; } s_AppVersion = version; return CMDLOPT_E_NONE; } extern int cmdlopt_set_options(const cmdlopt_opt* options) { s_Options = options; return CMDLOPT_E_NONE; } extern int cmdlopt_print_help() { return cmdlopt_fprint_help(stdout); } extern int cmdlopt_fprint_help(FILE* file) { const cmdlopt_opt* opt = NULL; if (!file) { return CMDLOPT_E_INVALID_PARAM; } if (s_Footer) { fprintf(file, "%s\n", s_Footer); } if (s_Header) { fprintf(file, "%s\n", s_Header); } else { fprintf(file, "Usage: %s%s\n\n", s_AppName, s_Options ? " [OPTIONS]" : ""); } if (!s_Options) { return CMDLOPT_E_NONE; } for (opt = s_Options; opt->name; ++opt) { if (opt->getopt_char) { fprintf(file, " -%c, ", opt->getopt_char); } else { fprintf(file, " "); } fprintf(file, "--%s: %s\n", opt->name, opt->description ? opt->description : ""); if (opt->args) { const cmdlopt_arg* arg = opt->args; for (; arg->name || arg->description || arg->example; ++arg) { const int Indent = 4; if (arg->name) { if (arg->description) { fprintf(file, "%*s%s: ", Indent, "", arg->name); PrintLinesWithIndend(Indent, file, arg->description); } else { fprintf(file, "%*s%s\n", Indent, "", arg->name); } } else { // no name if (arg->description) { PrintLinesWithIndend(Indent, file, arg->description); } } if (arg->example) { fprintf(file, "%*sExample: %s\n", Indent + 6, "", arg->example); } } fprintf(file, "\n"); } } fprintf(file, "\n"); if (s_Footer) { fprintf(file, "%s\n", s_Footer); } return CMDLOPT_E_NONE; } extern int cmdlopt_parse_cmdl(int argc, char** argv, void* ctx) { char* getoptString = NULL; struct option* longOptions = NULL; size_t optionCount = 0, getoptStringOffset = 0, i = 0; int error = CMDLOPT_E_NONE; const cmdlopt_opt* opt = NULL; if (argc <= 0 || argv == NULL) { error = CMDLOPT_E_INVALID_PARAM; goto Exit; } if (!s_Options) { goto Exit; } for (opt = s_Options; opt->name; ++opt, ++optionCount); getoptString = (char*)malloc(optionCount * 2 + 1); longOptions = (struct option*)malloc(sizeof(*longOptions) * (optionCount + 1)); for (i = 0; i < optionCount + 1; ++i) { longOptions[i].name = s_Options[i].name; longOptions[i].has_arg = s_Options[i].args ? required_argument : no_argument; longOptions[i].flag = NULL; longOptions[i].val = s_Options[i].getopt_long_value; if (s_Options[i].getopt_char) { getoptString[getoptStringOffset++] = s_Options[i].getopt_char; if (s_Options[i].args) { getoptString[getoptStringOffset++] = ':'; } } } getoptString[getoptStringOffset] = 0; /* Reset getopt */ optarg = NULL; optind = 1; opterr = 0; /* print error message */ optopt = 0; for (;;) { const int c = getopt_long(argc, argv, getoptString, longOptions, NULL); if (c == -1) { break; } switch (c) { case CMDLOPT_HELP_GETOPT_LONG_VALUE: case 'h': cmdlopt_print_help(); error = CMDLOPT_E_HELP_REQUESTED; goto Exit; case CMDLOPT_VERSION_GETOPT_LONG_VALUE: fprintf(stdout, "%s version %s\n\n", s_AppName, s_AppVersion); error = CMDLOPT_E_VERSION_REQUESTED; goto Exit; default: { int found = 0; for (opt = s_Options; opt->name; ++opt) { if (opt->getopt_char == c || opt->getopt_long_value == c) { found = 1; if (opt->arg_parser) { error = opt->arg_parser(ctx, optarg); if (error != CMDLOPT_E_NONE) { goto Exit; } } break; } } if (!found) { cmdlopt_print_help(); error = CMDLOPT_E_UNKNOWN_OPTION; goto Exit; } } break; } } Exit: free(getoptString); free(longOptions); return error; } extern int cmdlopt_set_help_header(const char* header) { s_Header = header; return CMDLOPT_E_NONE; } /* Sets a custom footer to show after the options are printed. */ extern int cmdlopt_set_help_footer(const char* footer) { s_Footer = footer; return CMDLOPT_E_NONE; }
{ "content_hash": "fa6a57f823f5bfeebbde975e34716af8", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 89, "avg_line_length": 22.427046263345197, "alnum_prop": 0.5150745794985718, "repo_name": "jgressmann/Weatherbug", "id": "753fdc812aa87028b981c23d741559eb4e65d623", "size": "7454", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/rpi/3rd-party/toe/src/cmdlopt.c", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "112448" }, { "name": "C++", "bytes": "158760" }, { "name": "CMake", "bytes": "12138" } ], "symlink_target": "" }
package net.pekkit.actionbarbroadcast.commands; import java.io.File; import java.io.IOException; import net.pekkit.actionbarbroadcast.ActionBarBroadcast; import net.pekkit.actionbarbroadcast.BroadcastManager; import net.pekkit.actionbarbroadcast.locale.MessageSender; import net.pekkit.actionbarbroadcast.util.ActionUtils; import net.pekkit.actionbarbroadcast.util.Constants; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; /** * * @author Squawkers13 */ public class BaseCommandExecutor implements CommandExecutor { private final ActionBarBroadcast plugin; private final BroadcastManager bm; public BaseCommandExecutor(ActionBarBroadcast par1, BroadcastManager par2) { plugin = par1; bm = par2; } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (command.getName().equalsIgnoreCase("ab")) { baseCommand(command, sender, args); } else if (command.getName().equalsIgnoreCase("broadcast")) { broadcastCommand(command, sender, args); } return true; } public void baseCommand(Command command, CommandSender sender, String[] args) { if (args.length < 1) { MessageSender.sendMsg(sender, "&5ActionBarBroadcast &d" + plugin.getDescription().getVersion() + ", &5created by &dSquawkers13"); MessageSender.sendMsg(sender, "&5Type &d/ab ? &5for help."); } else if (args[0].equalsIgnoreCase("?")) { helpCommand(sender); } else if (args[0].equalsIgnoreCase("broadcast") || args[0].equalsIgnoreCase("b")) { broadcastCommand(command, sender, args); } else if (args[0].equalsIgnoreCase("reload") || args[0].equalsIgnoreCase("r")) { reloadCommand(sender); } else { //Invalid arguments MessageSender.sendMsg(sender, "&5I'm not sure what you mean: &d" + args[0]); MessageSender.sendMsg(sender, "&5Type &d/ab ?&b for help."); } } /** * * @param sender */ public void helpCommand(CommandSender sender) { MessageSender.sendMsg(sender, "&9---------- &5ActionBarBroadcast: &dHelp &9----------"); if (sender.hasPermission("actionbarbroadcast.broadcast")) { MessageSender.sendMsg(sender, "&5/ab &db,broadcast &9[message] &5- Broadcast a message to all online players."); } if (sender.hasPermission("actionbarbroadcast.reload")) { MessageSender.sendMsg(sender, "&5/ab &dr,reload &5- Reload the plugin's configuration."); } } /** * * @param command * @param sender * @param args */ public void broadcastCommand(Command command, CommandSender sender, String[] args) { if (!sender.hasPermission("actionbarbroadcast.broadcast")) { MessageSender.sendMsg(sender, "&cYou don't have permission to do that!"); return; } int i = 0; if (command.getName().equalsIgnoreCase("ab")) { if (args.length < 2) { MessageSender.sendMsg(sender, "&5Broadcasts a message to all online players."); MessageSender.sendMsg(sender, "&d/ab &dbroadcast &9[message]"); return; } } else if (command.getName().equalsIgnoreCase("broadcast")) { if (args.length < 1) { MessageSender.sendMsg(sender, "&5Broadcasts a message to all online players."); MessageSender.sendMsg(sender, "&5/broadcast &9[message]"); return; } i = 1; } StringBuilder sb = new StringBuilder(); for (String msg : args) { if (i != 0) { sb.append(msg).append(" "); } i++; } for (Player player : Bukkit.getOnlinePlayers()) { ActionUtils.sendTitle(player, sb.toString(), null); } MessageSender.sendMsg(sender, "&5Message broadcasted sucessfully."); } /** * * @param sender */ public void reloadCommand(CommandSender sender) { if (!sender.hasPermission("actionbarbroadcast.reload")) { MessageSender.sendMsg(sender, "&cYou don't have permission to do that!"); return; } bm.stop(); plugin.reloadConfig(); if (plugin.getConfig() == null) { plugin.saveResource("config.yml", true); } if (plugin.getConfig().getDouble("settings.config-version", -1.0D) != Constants.CONFIG_VERSION) { String old = plugin.getConfig().getString("settings.config-version", "OLD"); MessageSender.sendMsg(sender, "&cIncompatible config detected! Renaming it to config-" + old + ".yml"); MessageSender.sendMsg(sender, "&cA new config has been created, please transfer your settings."); MessageSender.sendMsg(sender, "&cWhen you have finished, type &6/ab reload&c to load your settings."); try { plugin.getConfig().save(new File(plugin.getDataFolder(), "config-" + old + ".yml")); } catch (IOException ex) { MessageSender.logStackTrace("Error while renaming config!", ex); } plugin.saveResource("config.yml", true); } else { MessageSender.sendMsg(sender, "&5Config successfully reloaded."); } bm.startBroadcasting(); } }
{ "content_hash": "27635450264581bb16621b09c98b16b5", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 141, "avg_line_length": 37.35761589403973, "alnum_prop": 0.6082254919340543, "repo_name": "Squawkers13/ActionBarBroadcast", "id": "c6d388cc25ee238cf849229ddefde3ddd53f1bc3", "size": "6809", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/pekkit/actionbarbroadcast/commands/BaseCommandExecutor.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "28817" } ], "symlink_target": "" }
var _ = require('lodash'); var files = ['_index', 'watch', 'auth_callback']; exports.routes = _.map(files, function(f) { return require('./' + f); });
{ "content_hash": "545b5efb2afc7b27cfa1ceb59dc81b0c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 49, "avg_line_length": 26, "alnum_prop": 0.5769230769230769, "repo_name": "garaemon/jsk-github-watcher", "id": "32fc8caafe7b802afa1199f4cd60a12b6aa3c7f2", "size": "156", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/index.js", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
status: publish tags: - plain - USA - wardrobe published: true title: Joe the Plumber's Manolo Blahniks type: post meta: aktt_tweeted: "1" _edit_last: "2" aktt_notify_twitter: "yes" layout: post --- Vice presidential nominee Sarah Palin never grows tired of telling the public that she's just an average person, that she's part of the average American middle class, and other stories from a happy little box of hockey mom fairy tales. That's why her party allegedly <a href="http://www.nytimes.com/2008/10/23/us/politics/23palin.html?partner=permalink&exprod=permalink">spent 150,000 dollars on her wardrobe</a>: <blockquote>Sarah Palin’s wardrobe joined the ranks of symbolic political excess on Wednesday, alongside John McCain’s multiple houses and John Edwards’s $400 haircut, as Republicans expressed fear that weeks of tailoring Ms. Palin as an average “hockey mom” would fray amid revelations that the Republican Party outfitted her with expensive clothing from high-end stores.</blockquote> <blockquote>“I don’t think Joe the Plumber wears Manolo Blahniks,” Ms. Behar [co-host on ABC's "The View"] said.</blockquote> Don't get me wrong: I agree that a politician with such a high public exposure can't walk around in sweatpants and t-shirts. But don't pretend you are just an average person, worse even, try to make people believe you have the same financial situation as the average American middle class family. Unless, of course, the average American goes shopping on Fifth Avenue, in which case, never mind.
{ "content_hash": "c6143c0627ce332419e0d54012a42dcc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 394, "avg_line_length": 67, "alnum_prop": 0.7754704737183648, "repo_name": "fwenzel/fredericiana", "id": "ca40dfb7ba8efcfe1782b5729a63e0f9c26bc854", "size": "1562", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/_posts/2008-10-23-joe-the-plumbers-manolo-blahniks.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "114123" }, { "name": "HTML", "bytes": "22292" }, { "name": "JavaScript", "bytes": "30332" }, { "name": "Ruby", "bytes": "8505" } ], "symlink_target": "" }
package net.spy.memcached.ketama; import net.spy.memcached.MemcachedNode; /** * Defines the set of all configuration dependencies * required for the KetamaNodeLocator algorithm to run */ public interface KetamaNodeLocatorConfiguration { /** * Returns a uniquely identifying key, suitable for hashing by the * KetamaNodeLocator algorithm * @param node The MemcachedNode to use to form the unique identifier * @param repetition The repetition number for the particular node in question (0 is the first repetition) * @return String The key that represents the specific repetition of the node */ public String getKeyForNode(MemcachedNode node, int repetition); /** * Returns the number of discrete hashes * that should be defined for each node in the continuum * * @return int a value greater than 0 */ int getNodeRepetitions(); }
{ "content_hash": "44810d1542e60c902ddbfa78dc85ea35", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 110, "avg_line_length": 31.275862068965516, "alnum_prop": 0.7221609702315325, "repo_name": "ciaranj/java-memcached-client", "id": "1affcc4ad678d3a489bfc6280ad72211514a4f76", "size": "907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/spy/memcached/ketama/KetamaNodeLocatorConfiguration.java", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package joshie.mariculture.core.util.tile; import joshie.mariculture.core.helpers.TileHelper; import joshie.mariculture.core.util.interfaces.Faceable; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public abstract class TileMC extends TileEntity { @Override public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(getPos(), 1, getUpdateTag()); } @Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { NBTTagCompound nbt = packet.getNbtCompound(); readFromNBT(nbt); if (nbt.hasKey("Render")) { worldObj.markBlockRangeForRenderUpdate(getPos(), getPos()); } } @Override public NBTTagCompound getUpdateTag() { return writeToNBT(new NBTTagCompound()); } @Override public void markDirty() { if (!worldObj.isRemote) { TileHelper.sendRenderUpdate(this); } } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); if (this instanceof Faceable) ((Faceable)this).readFacing(compound); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { if (this instanceof Faceable) ((Faceable)this).writeFacing(compound); return super.writeToNBT(compound); } }
{ "content_hash": "e2a9b120e42aada49da79f047863a03c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 82, "avg_line_length": 31.333333333333332, "alnum_prop": 0.7034574468085106, "repo_name": "joshiejack/Mariculture", "id": "d443cd6582d06ed6750bef5b8b8eb9b6d9ddb83c", "size": "1504", "binary": false, "copies": "1", "ref": "refs/heads/1.10.2", "path": "src/main/java/joshie/mariculture/core/util/tile/TileMC.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "311586" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("09. Make a Word")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("09. Make a Word")] [assembly: AssemblyCopyright("Copyright © 2017")] [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("0feede3f-a90c-48c4-bcde-79edbf2e5828")] // 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": "39186bda364d62fc070ab28e471517be", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 38.833333333333336, "alnum_prop": 0.7432045779685265, "repo_name": "metodiobetsanov/Tech-Module-CSharp", "id": "b2917493f301c5b8bd7eb5bd10dcb7c83e936703", "size": "1401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tech Module/Programming Fundamentals/CSharp/Data Types and Variables - More Exercises/09. Make a Word/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "511022" } ], "symlink_target": "" }
@pushd .. @call BuildDeps.cmd "Visual Studio 10 2010 Win64" Release @popd
{ "content_hash": "1b2356e2d8492440e13b55bef11bfb87", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 57, "avg_line_length": 24.666666666666668, "alnum_prop": 0.7432432432432432, "repo_name": "realXtend/tundra-urho3d", "id": "d747722139dc66e86fe2cf8b3d79116d9f4554d5", "size": "74", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/Windows/VS2010/BuildDeps-x64-Release.cmd", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5798" }, { "name": "C", "bytes": "3334051" }, { "name": "C#", "bytes": "122989" }, { "name": "C++", "bytes": "4791572" }, { "name": "CMake", "bytes": "140734" }, { "name": "GLSL", "bytes": "40491" }, { "name": "HLSL", "bytes": "45692" }, { "name": "Java", "bytes": "41652" }, { "name": "JavaScript", "bytes": "41532" }, { "name": "Objective-C", "bytes": "2800" } ], "symlink_target": "" }
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // System.Text.UnicodeEncoding/UnicodeDecoder struct UnicodeDecoder_t3369145031; // System.Byte[] struct ByteU5BU5D_t58506160; // System.Char[] struct CharU5BU5D_t3416858730; #include "codegen/il2cpp-codegen.h" // System.Void System.Text.UnicodeEncoding/UnicodeDecoder::.ctor(System.Boolean) extern "C" void UnicodeDecoder__ctor_m1607892801 (UnicodeDecoder_t3369145031 * __this, bool ___bigEndian, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Text.UnicodeEncoding/UnicodeDecoder::GetChars(System.Byte[],System.Int32,System.Int32,System.Char[],System.Int32) extern "C" int32_t UnicodeDecoder_GetChars_m4249510390 (UnicodeDecoder_t3369145031 * __this, ByteU5BU5D_t58506160* ___bytes, int32_t ___byteIndex, int32_t ___byteCount, CharU5BU5D_t3416858730* ___chars, int32_t ___charIndex, const MethodInfo* method) IL2CPP_METHOD_ATTR;
{ "content_hash": "bc302d40f89ce2f4f7305b2dd33f1def", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 271, "avg_line_length": 38.2962962962963, "alnum_prop": 0.769825918762089, "repo_name": "moixxsyc/Unity3dLearningDemos", "id": "32f49a87f7b415e6ba1affd868e31d6e2f9a777c", "size": "1036", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "01Dongzuo/Temp/il2cppOutput/il2cppOutput/mscorlib_System_Text_UnicodeEncoding_UnicodeDecode3369145031MethodDeclarations.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "118649" }, { "name": "C", "bytes": "5575726" }, { "name": "C#", "bytes": "1643157" }, { "name": "C++", "bytes": "39741079" }, { "name": "GLSL", "bytes": "48675" }, { "name": "JavaScript", "bytes": "2544" }, { "name": "Objective-C", "bytes": "54221" }, { "name": "Objective-C++", "bytes": "246841" }, { "name": "Shell", "bytes": "1420" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="th_TH" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Incoin</source> <translation>เกี่ยวกับ บิตคอย์น</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Incoin&lt;/b&gt; version</source> <translation>&lt;b&gt;บิตคอย์น&lt;b&gt;รุ่น</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Incoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>สมุดรายชื่อ</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>ดับเบิลคลิก เพื่อแก้ไขที่อยู่ หรือชื่อ</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>สร้างที่อยู่ใหม่</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>คัดลอกที่อยู่ที่ถูกเลือกไปยัง คลิปบอร์ดของระบบ</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Incoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Incoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Incoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>ลบ</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Incoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>ส่งออกรายชื่อทั้งหมด</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>ส่งออกผิดพลาด</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>ชื่อ</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ไม่มีชื่อ)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>ใส่รหัสผ่าน</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>รหัสผา่นใหม่</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>กรุณากรอกรหัสผ่านใหม่อีกครั้งหนึ่ง</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>กระเป๋าสตางค์ที่เข้ารหัส</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>เปิดกระเป๋าสตางค์</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>ถอดรหัสกระเป๋าสตางค์</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>เปลี่ยนรหัสผ่าน</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>กรอกรหัสผ่านเก่าและรหัสผ่านใหม่สำหรับกระเป๋าสตางค์</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>ยืนยันการเข้ารหัสกระเป๋าสตางค์</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR INCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>กระเป๋าสตางค์ถูกเข้ารหัสเรียบร้อยแล้ว</translation> </message> <message> <location line="-56"/> <source>Incoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your incoins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>การเข้ารหัสกระเป๋าสตางค์ผิดพลาด</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>รหัสผ่านที่คุณกรอกไม่ตรงกัน</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Show information about Incoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a Incoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for Incoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>Incoin</source> <translation type="unfinished"/> </message> <message> <location line="-530"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About Incoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Incoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Incoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Incoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Incoin network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Incoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Incoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Incoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Incoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Incoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Incoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the Incoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the Incoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Incoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show Incoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Incoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Incoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-124"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start incoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Incoin-Qt help message to get a list with possible Incoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>Incoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Incoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the Incoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Incoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Incoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Incoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Incoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Incoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter Incoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Incoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation>วันนี้</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation>ชื่อ</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>ที่อยู่</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>ส่งออกผิดพลาด</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Incoin version</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Send command to -server or incoind</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Specify configuration file (default: incoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Specify pid file (default: incoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=incoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Incoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Incoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Incoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>SSL options: (see the Incoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+165"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Incoin</source> <translation type="unfinished"/> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Incoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Incoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
{ "content_hash": "e4287685a32f02bbc8e270b0e7060746", "timestamp": "", "source": "github", "line_count": 2917, "max_line_length": 395, "avg_line_length": 33.10318820706205, "alnum_prop": 0.5849091775232493, "repo_name": "Incoin/incoin", "id": "d972546833a4c22a920f7b20de64f97b9aa57a4b", "size": "97728", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_th_TH.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "103297" }, { "name": "C++", "bytes": "2522848" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "14696" }, { "name": "Objective-C", "bytes": "5864" }, { "name": "Python", "bytes": "69714" }, { "name": "Shell", "bytes": "9702" }, { "name": "TypeScript", "bytes": "5236293" } ], "symlink_target": "" }
using System; using System.Reflection; using System.Collections.Generic; using System.Xml; using log4net; using OMV = OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.PhysicsModules.SharedBase; using OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet; namespace OpenSim.Region.PhysicsModule.BulletS { [Serializable] public class BSPrim : BSPhysObject { protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly string LogHeader = "[BULLETS PRIM]"; // _size is what the user passed. Scale is what we pass to the physics engine with the mesh. private OMV.Vector3 _size; // the multiplier for each mesh dimension as passed by the user private bool _grabbed; private bool _isSelected; private bool _isVolumeDetect; private float _mass; // the mass of this object private OMV.Vector3 _acceleration; private int _physicsActorType; private bool _isPhysical; private bool _flying; private bool _setAlwaysRun; private bool _throttleUpdates; private bool _floatOnWater; private bool _kinematic; private float _buoyancy; private int CrossingFailures { get; set; } // Keep a handle to the vehicle actor so it is easy to set parameters on same. public const string VehicleActorName = "BasicVehicle"; // Parameters for the hover actor public const string HoverActorName = "BSPrim.HoverActor"; // Parameters for the axis lock actor public const String LockedAxisActorName = "BSPrim.LockedAxis"; // Parameters for the move to target actor public const string MoveToTargetActorName = "BSPrim.MoveToTargetActor"; // Parameters for the setForce and setTorque actors public const string SetForceActorName = "BSPrim.SetForceActor"; public const string SetTorqueActorName = "BSPrim.SetTorqueActor"; public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical) : base(parent_scene, localID, primName, "BSPrim") { // m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID); _physicsActorType = (int)ActorTypes.Prim; RawPosition = pos; _size = size; Scale = size; // prims are the size the user wants them to be (different for BSCharactes). RawOrientation = rotation; _buoyancy = 0f; RawVelocity = OMV.Vector3.Zero; RawRotationalVelocity = OMV.Vector3.Zero; BaseShape = pbs; _isPhysical = pisPhysical; _isVolumeDetect = false; _mass = CalculateMass(); DetailLog("{0},BSPrim.constructor,pbs={1}", LocalID, BSScene.PrimitiveBaseShapeToString(pbs)); // DetailLog("{0},BSPrim.constructor,call", LocalID); // do the actual object creation at taint time PhysScene.TaintedObject(LocalID, "BSPrim.create", delegate() { // Make sure the object is being created with some sanity. ExtremeSanityCheck(true /* inTaintTime */); CreateGeomAndObject(true); CurrentCollisionFlags = PhysScene.PE.GetCollisionFlags(PhysBody); IsInitialized = true; }); } // called when this prim is being destroyed and we should free all the resources public override void Destroy() { // m_log.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID); IsInitialized = false; base.Destroy(); // Undo any vehicle properties this.VehicleType = (int)Vehicle.TYPE_NONE; PhysScene.TaintedObject(LocalID, "BSPrim.Destroy", delegate() { DetailLog("{0},BSPrim.Destroy,taint,", LocalID); // If there are physical body and shape, release my use of same. PhysScene.Shapes.DereferenceBody(PhysBody, null); PhysBody.Clear(); PhysShape.Dereference(PhysScene); PhysShape = new BSShapeNull(); }); } // No one uses this property. public override bool Stopped { get { return false; } } public override bool IsIncomplete { get { return ShapeRebuildScheduled; } } // 'true' if this object's shape is in need of a rebuild and a rebuild has been queued. // The prim is still available but its underlying shape will change soon. // This is protected by a 'lock(this)'. public bool ShapeRebuildScheduled { get; protected set; } public override OMV.Vector3 Size { get { return _size; } set { // We presume the scale and size are the same. If scale must be changed for // the physical shape, that is done when the geometry is built. _size = value; Scale = _size; ForceBodyShapeRebuild(false); } } public override PrimitiveBaseShape Shape { set { BaseShape = value; DetailLog("{0},BSPrim.changeShape,pbs={1}", LocalID, BSScene.PrimitiveBaseShapeToString(BaseShape)); PrimAssetState = PrimAssetCondition.Unknown; ForceBodyShapeRebuild(false); } } // Cause the body and shape of the prim to be rebuilt if necessary. // If there are no changes required, this is quick and does not make changes to the prim. // If rebuilding is necessary (like changing from static to physical), that will happen. // The 'ShapeRebuildScheduled' tells any checker that the body/shape may change shortly. // The return parameter is not used by anyone. public override bool ForceBodyShapeRebuild(bool inTaintTime) { if (inTaintTime) { // If called in taint time, do the operation immediately _mass = CalculateMass(); // changing the shape changes the mass CreateGeomAndObject(true); } else { lock (this) { // If a rebuild is not already in the queue if (!ShapeRebuildScheduled) { // Remember that a rebuild is queued -- this is used to flag an incomplete object ShapeRebuildScheduled = true; PhysScene.TaintedObject(LocalID, "BSPrim.ForceBodyShapeRebuild", delegate() { _mass = CalculateMass(); // changing the shape changes the mass CreateGeomAndObject(true); ShapeRebuildScheduled = false; }); } } } return true; } public override bool Grabbed { set { _grabbed = value; } } public override bool Selected { set { if (value != _isSelected) { _isSelected = value; PhysScene.TaintedObject(LocalID, "BSPrim.setSelected", delegate() { DetailLog("{0},BSPrim.selected,taint,selected={1}", LocalID, _isSelected); SetObjectDynamic(false); }); } } } public override bool IsSelected { get { return _isSelected; } } public override void CrossingFailure() { CrossingFailures++; if (CrossingFailures > BSParam.CrossingFailuresBeforeOutOfBounds) { base.RaiseOutOfBounds(RawPosition); } else if (CrossingFailures == BSParam.CrossingFailuresBeforeOutOfBounds) { m_log.WarnFormat("{0} Too many crossing failures for {1}", LogHeader, Name); } return; } // link me to the specified parent public override void link(PhysicsActor obj) { } // delink me from my linkset public override void delink() { } // Set motion values to zero. // Do it to the properties so the values get set in the physics engine. // Push the setting of the values to the viewer. // Called at taint time! public override void ZeroMotion(bool inTaintTime) { RawVelocity = OMV.Vector3.Zero; _acceleration = OMV.Vector3.Zero; RawRotationalVelocity = OMV.Vector3.Zero; // Zero some other properties in the physics engine PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() { if (PhysBody.HasPhysicalBody) PhysScene.PE.ClearAllForces(PhysBody); }); } public override void ZeroAngularMotion(bool inTaintTime) { RawRotationalVelocity = OMV.Vector3.Zero; // Zero some other properties in the physics engine PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ZeroMotion", delegate() { // DetailLog("{0},BSPrim.ZeroAngularMotion,call,rotVel={1}", LocalID, _rotationalVelocity); if (PhysBody.HasPhysicalBody) { PhysScene.PE.SetInterpolationAngularVelocity(PhysBody, RawRotationalVelocity); PhysScene.PE.SetAngularVelocity(PhysBody, RawRotationalVelocity); } }); } public override void LockAngularMotion(byte axislocks) { DetailLog("{0},BSPrim.LockAngularMotion,call,axis={1}", LocalID, axislocks); ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR, 0f, 0f); if ((axislocks & 0x02) != 0) { ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X, 0f, 0f); } if ((axislocks & 0x04) != 0) { ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y, 0f, 0f); } if ((axislocks & 0x08) != 0) { ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z, 0f, 0f); } InitializeAxisActor(); return; } public override OMV.Vector3 Position { get { // don't do the GetObjectPosition for root elements because this function is called a zillion times. // RawPosition = ForcePosition; return RawPosition; } set { // If the position must be forced into the physics engine, use ForcePosition. // All positions are given in world positions. if (RawPosition == value) { DetailLog("{0},BSPrim.setPosition,call,positionNotChanging,pos={1},orient={2}", LocalID, RawPosition, RawOrientation); return; } RawPosition = value; PositionSanityCheck(false); PhysScene.TaintedObject(LocalID, "BSPrim.setPosition", delegate() { DetailLog("{0},BSPrim.SetPosition,taint,pos={1},orient={2}", LocalID, RawPosition, RawOrientation); ForcePosition = RawPosition; }); } } // NOTE: overloaded by BSPrimDisplaced to handle offset for center-of-gravity. public override OMV.Vector3 ForcePosition { get { RawPosition = PhysScene.PE.GetPosition(PhysBody); return RawPosition; } set { RawPosition = value; if (PhysBody.HasPhysicalBody) { PhysScene.PE.SetTranslation(PhysBody, RawPosition, RawOrientation); ActivateIfPhysical(false); } } } // Check that the current position is sane and, if not, modify the position to make it so. // Check for being below terrain and being out of bounds. // Returns 'true' of the position was made sane by some action. private bool PositionSanityCheck(bool inTaintTime) { bool ret = false; // We don't care where non-physical items are placed if (!IsPhysicallyActive) return ret; if (!PhysScene.TerrainManager.IsWithinKnownTerrain(RawPosition)) { // The physical object is out of the known/simulated area. // Upper levels of code will handle the transition to other areas so, for // the time, we just ignore the position. return ret; } float terrainHeight = PhysScene.TerrainManager.GetTerrainHeightAtXYZ(RawPosition); OMV.Vector3 upForce = OMV.Vector3.Zero; float approxSize = Math.Max(Size.X, Math.Max(Size.Y, Size.Z)); if ((RawPosition.Z + approxSize / 2f) < terrainHeight) { DetailLog("{0},BSPrim.PositionAdjustUnderGround,call,pos={1},terrain={2}", LocalID, RawPosition, terrainHeight); float targetHeight = terrainHeight + (Size.Z / 2f); // If the object is below ground it just has to be moved up because pushing will // not get it through the terrain RawPosition = new OMV.Vector3(RawPosition.X, RawPosition.Y, targetHeight); if (inTaintTime) { ForcePosition = RawPosition; } // If we are throwing the object around, zero its other forces ZeroMotion(inTaintTime); ret = true; } if ((CurrentCollisionFlags & CollisionFlags.BS_FLOATS_ON_WATER) != 0) { float waterHeight = PhysScene.TerrainManager.GetWaterLevelAtXYZ(RawPosition); // TODO: a floating motor so object will bob in the water if (Math.Abs(RawPosition.Z - waterHeight) > 0.1f) { // Upforce proportional to the distance away from the water. Correct the error in 1 sec. upForce.Z = (waterHeight - RawPosition.Z) * 1f; // Apply upforce and overcome gravity. OMV.Vector3 correctionForce = upForce - PhysScene.DefaultGravity; DetailLog("{0},BSPrim.PositionSanityCheck,applyForce,pos={1},upForce={2},correctionForce={3}", LocalID, RawPosition, upForce, correctionForce); AddForce(inTaintTime, correctionForce); ret = true; } } return ret; } // Occasionally things will fly off and really get lost. // Find the wanderers and bring them back. // Return 'true' if some parameter need some sanity. private bool ExtremeSanityCheck(bool inTaintTime) { bool ret = false; int wayOverThere = -1000; int wayOutThere = 10000; // There have been instances of objects getting thrown way out of bounds and crashing // the border crossing code. if ( RawPosition.X < wayOverThere || RawPosition.X > wayOutThere || RawPosition.Y < wayOverThere || RawPosition.X > wayOutThere || RawPosition.Z < wayOverThere || RawPosition.X > wayOutThere) { RawPosition = new OMV.Vector3(10, 10, 50); ZeroMotion(inTaintTime); ret = true; } if (RawVelocity.LengthSquared() > BSParam.MaxLinearVelocitySquared) { RawVelocity = Util.ClampV(RawVelocity, BSParam.MaxLinearVelocity); ret = true; } if (RawRotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared) { RawRotationalVelocity = Util.ClampV(RawRotationalVelocity, BSParam.MaxAngularVelocity); ret = true; } return ret; } // Return the effective mass of the object. // The definition of this call is to return the mass of the prim. // If the simulator cares about the mass of the linkset, it will sum it itself. public override float Mass { get { return _mass; } } // TotalMass returns the mass of the large object the prim may be in (overridden by linkset code) public virtual float TotalMass { get { return _mass; } } // used when we only want this prim's mass and not the linkset thing public override float RawMass { get { return _mass; } } // Set the physical mass to the passed mass. // Note that this does not change _mass! public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) { if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape) { if (IsStatic) { PhysScene.PE.SetGravity(PhysBody, PhysScene.DefaultGravity); Inertia = OMV.Vector3.Zero; PhysScene.PE.SetMassProps(PhysBody, 0f, Inertia); PhysScene.PE.UpdateInertiaTensor(PhysBody); } else { if (inWorld) { // Changing interesting properties doesn't change proxy and collision cache // information. The Bullet solution is to re-add the object to the world // after parameters are changed. PhysScene.PE.RemoveObjectFromWorld(PhysScene.World, PhysBody); } // The computation of mass props requires gravity to be set on the object. Gravity = ComputeGravity(Buoyancy); PhysScene.PE.SetGravity(PhysBody, Gravity); // OMV.Vector3 currentScale = PhysScene.PE.GetLocalScaling(PhysShape.physShapeInfo); // DEBUG DEBUG // DetailLog("{0},BSPrim.UpdateMassProperties,currentScale{1},shape={2}", LocalID, currentScale, PhysShape.physShapeInfo); // DEBUG DEBUG Inertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); PhysScene.PE.SetMassProps(PhysBody, physMass, Inertia); PhysScene.PE.UpdateInertiaTensor(PhysBody); DetailLog("{0},BSPrim.UpdateMassProperties,mass={1},localInertia={2},grav={3},inWorld={4}", LocalID, physMass, Inertia, Gravity, inWorld); if (inWorld) { AddObjectToPhysicalWorld(); } } } } // Return what gravity should be set to this very moment public OMV.Vector3 ComputeGravity(float buoyancy) { OMV.Vector3 ret = PhysScene.DefaultGravity; if (!IsStatic) { ret *= (1f - buoyancy); ret *= GravModifier; } return ret; } // Is this used? public override OMV.Vector3 CenterOfMass { get { return RawPosition; } } // Is this used? public override OMV.Vector3 GeometricCenter { get { return RawPosition; } } public override OMV.Vector3 Force { get { return RawForce; } set { RawForce = value; EnableActor(RawForce != OMV.Vector3.Zero, SetForceActorName, delegate() { return new BSActorSetForce(PhysScene, this, SetForceActorName); }); // Call update so actor Refresh() is called to start things off PhysScene.TaintedObject(LocalID, "BSPrim.setForce", delegate() { UpdatePhysicalParameters(); }); } } // Find and return a handle to the current vehicle actor. // Return 'null' if there is no vehicle actor. public BSDynamics GetVehicleActor(bool createIfNone) { BSDynamics ret = null; BSActor actor; if (PhysicalActors.TryGetActor(VehicleActorName, out actor)) { ret = actor as BSDynamics; } else { if (createIfNone) { ret = new BSDynamics(PhysScene, this, VehicleActorName); PhysicalActors.Add(ret.ActorName, ret); } } return ret; } public override int VehicleType { get { int ret = (int)Vehicle.TYPE_NONE; BSDynamics vehicleActor = GetVehicleActor(false /* createIfNone */); if (vehicleActor != null) ret = (int)vehicleActor.Type; return ret; } set { Vehicle type = (Vehicle)value; PhysScene.TaintedObject(LocalID, "setVehicleType", delegate() { // Some vehicle scripts change vehicle type on the fly as an easy way to // change all the parameters. Like a plane changing to CAR when on the // ground. In this case, don't want to zero motion. // ZeroMotion(true /* inTaintTime */); if (type == Vehicle.TYPE_NONE) { // Vehicle type is 'none' so get rid of any actor that may have been allocated. BSDynamics vehicleActor = GetVehicleActor(false /* createIfNone */); if (vehicleActor != null) { PhysicalActors.RemoveAndRelease(vehicleActor.ActorName); } } else { // Vehicle type is not 'none' so create an actor and set it running. BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null) { vehicleActor.ProcessTypeChange(type); ActivateIfPhysical(false); } } }); } } public override void VehicleFloatParam(int param, float value) { PhysScene.TaintedObject(LocalID, "BSPrim.VehicleFloatParam", delegate() { BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null) { vehicleActor.ProcessFloatVehicleParam((Vehicle)param, value); ActivateIfPhysical(false); } }); } public override void VehicleVectorParam(int param, OMV.Vector3 value) { PhysScene.TaintedObject(LocalID, "BSPrim.VehicleVectorParam", delegate() { BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null) { vehicleActor.ProcessVectorVehicleParam((Vehicle)param, value); ActivateIfPhysical(false); } }); } public override void VehicleRotationParam(int param, OMV.Quaternion rotation) { PhysScene.TaintedObject(LocalID, "BSPrim.VehicleRotationParam", delegate() { BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null) { vehicleActor.ProcessRotationVehicleParam((Vehicle)param, rotation); ActivateIfPhysical(false); } }); } public override void VehicleFlags(int param, bool remove) { PhysScene.TaintedObject(LocalID, "BSPrim.VehicleFlags", delegate() { BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null) { vehicleActor.ProcessVehicleFlags(param, remove); } }); } public override void SetVehicle(object pvdata) { PhysScene.TaintedObject(LocalID, "BSPrim.SetVehicle", delegate () { BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); if (vehicleActor != null && (pvdata is VehicleData) ) { VehicleData vdata = (VehicleData)pvdata; // vehicleActor.ProcessSetVehicle((VehicleData)vdata); vehicleActor.ProcessTypeChange(vdata.m_type); vehicleActor.ProcessVehicleFlags(-1, false); vehicleActor.ProcessVehicleFlags((int)vdata.m_flags, false); // Linear properties vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_MOTOR_DIRECTION, vdata.m_linearMotorDirection); vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_FRICTION_TIMESCALE, vdata.m_linearFrictionTimescale); vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE, vdata.m_linearMotorDecayTimescale); vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_MOTOR_TIMESCALE, vdata.m_linearMotorTimescale); vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_MOTOR_OFFSET, vdata.m_linearMotorOffset); //Angular properties vehicleActor.ProcessVectorVehicleParam(Vehicle.ANGULAR_MOTOR_DIRECTION, vdata.m_angularMotorDirection); vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_MOTOR_TIMESCALE, vdata.m_angularMotorTimescale); vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE, vdata.m_angularMotorDecayTimescale); vehicleActor.ProcessVectorVehicleParam(Vehicle.ANGULAR_FRICTION_TIMESCALE, vdata.m_angularFrictionTimescale); //Deflection properties vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_DEFLECTION_EFFICIENCY, vdata.m_angularDeflectionEfficiency); vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_DEFLECTION_TIMESCALE, vdata.m_angularDeflectionTimescale); vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_DEFLECTION_EFFICIENCY, vdata.m_linearDeflectionEfficiency); vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_DEFLECTION_TIMESCALE, vdata.m_linearDeflectionTimescale); //Banking properties vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_EFFICIENCY, vdata.m_bankingEfficiency); vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_MIX, vdata.m_bankingMix); vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_TIMESCALE, vdata.m_bankingTimescale); //Hover and Buoyancy properties vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_HEIGHT, vdata.m_VhoverHeight); vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_EFFICIENCY, vdata.m_VhoverEfficiency); vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_TIMESCALE, vdata.m_VhoverTimescale); vehicleActor.ProcessFloatVehicleParam(Vehicle.BUOYANCY, vdata.m_VehicleBuoyancy); //Attractor properties vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, vdata.m_verticalAttractionEfficiency); vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, vdata.m_verticalAttractionTimescale); vehicleActor.ProcessRotationVehicleParam(Vehicle.REFERENCE_FRAME, vdata.m_referenceFrame); } }); } // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more public override void SetVolumeDetect(int param) { bool newValue = (param != 0); if (_isVolumeDetect != newValue) { _isVolumeDetect = newValue; PhysScene.TaintedObject(LocalID, "BSPrim.SetVolumeDetect", delegate() { // DetailLog("{0},setVolumeDetect,taint,volDetect={1}", LocalID, _isVolumeDetect); SetObjectDynamic(true); }); } return; } public override bool IsVolumeDetect { get { return _isVolumeDetect; } } public override void SetMaterial(int material) { base.SetMaterial(material); PhysScene.TaintedObject(LocalID, "BSPrim.SetMaterial", delegate() { UpdatePhysicalParameters(); }); } public override float Friction { get { return base.Friction; } set { if (base.Friction != value) { base.Friction = value; PhysScene.TaintedObject(LocalID, "BSPrim.setFriction", delegate() { UpdatePhysicalParameters(); }); } } } public override float Restitution { get { return base.Restitution; } set { if (base.Restitution != value) { base.Restitution = value; PhysScene.TaintedObject(LocalID, "BSPrim.setRestitution", delegate() { UpdatePhysicalParameters(); }); } } } // The simulator/viewer keep density as 100kg/m3. // Remember to use BSParam.DensityScaleFactor to create the physical density. public override float Density { get { return base.Density; } set { if (base.Density != value) { base.Density = value; PhysScene.TaintedObject(LocalID, "BSPrim.setDensity", delegate() { UpdatePhysicalParameters(); }); } } } public override float GravModifier { get { return base.GravModifier; } set { if (base.GravModifier != value) { base.GravModifier = value; PhysScene.TaintedObject(LocalID, "BSPrim.setGravityModifier", delegate() { UpdatePhysicalParameters(); }); } } } public override OMV.Vector3 ForceVelocity { get { return RawVelocity; } set { RawVelocity = Util.ClampV(value, BSParam.MaxLinearVelocity); if (PhysBody.HasPhysicalBody) { DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, RawVelocity); PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity); ActivateIfPhysical(false); } } } public override OMV.Vector3 Torque { get { return RawTorque; } set { RawTorque = value; EnableActor(RawTorque != OMV.Vector3.Zero, SetTorqueActorName, delegate() { return new BSActorSetTorque(PhysScene, this, SetTorqueActorName); }); DetailLog("{0},BSPrim.SetTorque,call,torque={1}", LocalID, RawTorque); // Call update so actor Refresh() is called to start things off PhysScene.TaintedObject(LocalID, "BSPrim.setTorque", delegate() { UpdatePhysicalParameters(); }); } } public override OMV.Vector3 Acceleration { get { return _acceleration; } set { _acceleration = value; } } public override OMV.Quaternion Orientation { get { return RawOrientation; } set { if (RawOrientation == value) return; RawOrientation = value; PhysScene.TaintedObject(LocalID, "BSPrim.setOrientation", delegate() { ForceOrientation = RawOrientation; }); } } // Go directly to Bullet to get/set the value. public override OMV.Quaternion ForceOrientation { get { RawOrientation = PhysScene.PE.GetOrientation(PhysBody); return RawOrientation; } set { RawOrientation = value; if (PhysBody.HasPhysicalBody) PhysScene.PE.SetTranslation(PhysBody, RawPosition, RawOrientation); } } public override int PhysicsActorType { get { return _physicsActorType; } set { _physicsActorType = value; } } public override bool IsPhysical { get { return _isPhysical; } set { if (_isPhysical != value) { _isPhysical = value; PhysScene.TaintedObject(LocalID, "BSPrim.setIsPhysical", delegate() { DetailLog("{0},setIsPhysical,taint,isPhys={1}", LocalID, _isPhysical); SetObjectDynamic(true); // whether phys-to-static or static-to-phys, the object is not moving. ZeroMotion(true); }); } } } // An object is static (does not move) if selected or not physical public override bool IsStatic { get { return _isSelected || !IsPhysical; } } // An object is solid if it's not phantom and if it's not doing VolumeDetect public override bool IsSolid { get { return !IsPhantom && !_isVolumeDetect; } } // The object is moving and is actively being dynamic in the physical world public override bool IsPhysicallyActive { get { return !_isSelected && IsPhysical; } } // Make gravity work if the object is physical and not selected // Called at taint-time!! private void SetObjectDynamic(bool forceRebuild) { // Recreate the physical object if necessary CreateGeomAndObject(forceRebuild); } // Convert the simulator's physical properties into settings on BulletSim objects. // There are four flags we're interested in: // IsStatic: Object does not move, otherwise the object has mass and moves // isSolid: other objects bounce off of this object // isVolumeDetect: other objects pass through but can generate collisions // collisionEvents: whether this object returns collision events // NOTE: overloaded by BSPrimLinkable to also update linkset physical parameters. public virtual void UpdatePhysicalParameters() { if (!PhysBody.HasPhysicalBody) { // This would only happen if updates are called for during initialization when the body is not set up yet. // DetailLog("{0},BSPrim.UpdatePhysicalParameters,taint,calledWithNoPhysBody", LocalID); return; } // Mangling all the physical properties requires the object not be in the physical world. // This is a NOOP if the object is not in the world (BulletSim and Bullet ignore objects not found). PhysScene.PE.RemoveObjectFromWorld(PhysScene.World, PhysBody); // Set up the object physicalness (does gravity and collisions move this object) MakeDynamic(IsStatic); // Update vehicle specific parameters (after MakeDynamic() so can change physical parameters) PhysicalActors.Refresh(); // Arrange for collision events if the simulator wants them EnableCollisions(SubscribedEvents()); // Make solid or not (do things bounce off or pass through this object). MakeSolid(IsSolid); AddObjectToPhysicalWorld(); // Rebuild its shape PhysScene.PE.UpdateSingleAabb(PhysScene.World, PhysBody); DetailLog("{0},BSPrim.UpdatePhysicalParameters,taintExit,static={1},solid={2},mass={3},collide={4},cf={5:X},cType={6},body={7},shape={8}", LocalID, IsStatic, IsSolid, Mass, SubscribedEvents(), CurrentCollisionFlags, PhysBody.collisionType, PhysBody, PhysShape); } // "Making dynamic" means changing to and from static. // When static, gravity does not effect the object and it is fixed in space. // When dynamic, the object can fall and be pushed by others. // This is independent of its 'solidness' which controls what passes through // this object and what interacts with it. protected virtual void MakeDynamic(bool makeStatic) { if (makeStatic) { // Become a Bullet 'static' object type CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.CF_STATIC_OBJECT); // Stop all movement ZeroMotion(true); // Set various physical properties so other object interact properly PhysScene.PE.SetFriction(PhysBody, Friction); PhysScene.PE.SetRestitution(PhysBody, Restitution); PhysScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); // Mass is zero which disables a bunch of physics stuff in Bullet UpdatePhysicalMassProperties(0f, false); // Set collision detection parameters if (BSParam.CcdMotionThreshold > 0f) { PhysScene.PE.SetCcdMotionThreshold(PhysBody, BSParam.CcdMotionThreshold); PhysScene.PE.SetCcdSweptSphereRadius(PhysBody, BSParam.CcdSweptSphereRadius); } // The activation state is 'disabled' so Bullet will not try to act on it. // PhysicsScene.PE.ForceActivationState(PhysBody, ActivationState.DISABLE_SIMULATION); // Start it out sleeping and physical actions could wake it up. PhysScene.PE.ForceActivationState(PhysBody, ActivationState.ISLAND_SLEEPING); // This collides like a static object PhysBody.collisionType = CollisionType.Static; } else { // Not a Bullet static object CurrentCollisionFlags = PhysScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.CF_STATIC_OBJECT); // Set various physical properties so other object interact properly PhysScene.PE.SetFriction(PhysBody, Friction); PhysScene.PE.SetRestitution(PhysBody, Restitution); // DetailLog("{0},BSPrim.MakeDynamic,frict={1},rest={2}", LocalID, Friction, Restitution); // per http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=3382 // Since this can be called multiple times, only zero forces when becoming physical // PhysicsScene.PE.ClearAllForces(BSBody); // For good measure, make sure the transform is set through to the motion state ForcePosition = RawPosition; ForceVelocity = RawVelocity; ForceRotationalVelocity = RawRotationalVelocity; // A dynamic object has mass UpdatePhysicalMassProperties(RawMass, false); // Set collision detection parameters if (BSParam.CcdMotionThreshold > 0f) { PhysScene.PE.SetCcdMotionThreshold(PhysBody, BSParam.CcdMotionThreshold); PhysScene.PE.SetCcdSweptSphereRadius(PhysBody, BSParam.CcdSweptSphereRadius); } // Various values for simulation limits PhysScene.PE.SetDamping(PhysBody, BSParam.LinearDamping, BSParam.AngularDamping); PhysScene.PE.SetDeactivationTime(PhysBody, BSParam.DeactivationTime); PhysScene.PE.SetSleepingThresholds(PhysBody, BSParam.LinearSleepingThreshold, BSParam.AngularSleepingThreshold); PhysScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); // This collides like an object. PhysBody.collisionType = CollisionType.Dynamic; // Force activation of the object so Bullet will act on it. // Must do the ForceActivationState2() to overcome the DISABLE_SIMULATION from static objects. PhysScene.PE.ForceActivationState(PhysBody, ActivationState.ACTIVE_TAG); } } // "Making solid" means that other object will not pass through this object. // To make transparent, we create a Bullet ghost object. // Note: This expects to be called from the UpdatePhysicalParameters() routine as // the functions after this one set up the state of a possibly newly created collision body. private void MakeSolid(bool makeSolid) { CollisionObjectTypes bodyType = (CollisionObjectTypes)PhysScene.PE.GetBodyType(PhysBody); if (makeSolid) { // Verify the previous code created the correct shape for this type of thing. if ((bodyType & CollisionObjectTypes.CO_RIGID_BODY) == 0) { m_log.ErrorFormat("{0} MakeSolid: physical body of wrong type for solidity. id={1}, type={2}", LogHeader, LocalID, bodyType); } CurrentCollisionFlags = PhysScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.CF_NO_CONTACT_RESPONSE); } else { if ((bodyType & CollisionObjectTypes.CO_GHOST_OBJECT) == 0) { m_log.ErrorFormat("{0} MakeSolid: physical body of wrong type for non-solidness. id={1}, type={2}", LogHeader, LocalID, bodyType); } CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.CF_NO_CONTACT_RESPONSE); // Change collision info from a static object to a ghosty collision object PhysBody.collisionType = CollisionType.VolumeDetect; } } // Turn on or off the flag controlling whether collision events are returned to the simulator. private void EnableCollisions(bool wantsCollisionEvents) { if (wantsCollisionEvents) { CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); } else { CurrentCollisionFlags = PhysScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); } } // Add me to the physical world. // Object MUST NOT already be in the world. // This routine exists because some assorted properties get mangled by adding to the world. internal void AddObjectToPhysicalWorld() { if (PhysBody.HasPhysicalBody) { PhysScene.PE.AddObjectToWorld(PhysScene.World, PhysBody); } else { m_log.ErrorFormat("{0} Attempt to add physical object without body. id={1}", LogHeader, LocalID); DetailLog("{0},BSPrim.AddObjectToPhysicalWorld,addObjectWithoutBody,cType={1}", LocalID, PhysBody.collisionType); } } // prims don't fly public override bool Flying { get { return _flying; } set { _flying = value; } } public override bool SetAlwaysRun { get { return _setAlwaysRun; } set { _setAlwaysRun = value; } } public override bool ThrottleUpdates { get { return _throttleUpdates; } set { _throttleUpdates = value; } } public bool IsPhantom { get { // SceneObjectPart removes phantom objects from the physics scene // so, although we could implement touching and such, we never // are invoked as a phantom object return false; } } public override bool FloatOnWater { set { _floatOnWater = value; PhysScene.TaintedObject(LocalID, "BSPrim.setFloatOnWater", delegate() { if (_floatOnWater) CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); else CurrentCollisionFlags = PhysScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); }); } } public override bool Kinematic { get { return _kinematic; } set { _kinematic = value; // m_log.DebugFormat("{0}: Kinematic={1}", LogHeader, _kinematic); } } public override float Buoyancy { get { return _buoyancy; } set { _buoyancy = value; PhysScene.TaintedObject(LocalID, "BSPrim.setBuoyancy", delegate() { ForceBuoyancy = _buoyancy; }); } } public override float ForceBuoyancy { get { return _buoyancy; } set { _buoyancy = value; // DetailLog("{0},BSPrim.setForceBuoyancy,taint,buoy={1}", LocalID, _buoyancy); // Force the recalculation of the various inertia,etc variables in the object UpdatePhysicalMassProperties(RawMass, true); DetailLog("{0},BSPrim.ForceBuoyancy,buoy={1},mass={2},grav={3}", LocalID, _buoyancy, RawMass, Gravity); ActivateIfPhysical(false); } } public override bool PIDActive { get { return MoveToTargetActive; } set { MoveToTargetActive = value; EnableActor(MoveToTargetActive, MoveToTargetActorName, delegate() { return new BSActorMoveToTarget(PhysScene, this, MoveToTargetActorName); }); // Call update so actor Refresh() is called to start things off PhysScene.TaintedObject(LocalID, "BSPrim.PIDActive", delegate() { UpdatePhysicalParameters(); }); } } public override OMV.Vector3 PIDTarget { set { base.PIDTarget = value; BSActor actor; if (PhysicalActors.TryGetActor(MoveToTargetActorName, out actor)) { // if the actor exists, tell it to refresh its values. actor.Refresh(); } } } // Used for llSetHoverHeight and maybe vehicle height // Hover Height will override MoveTo target's Z public override bool PIDHoverActive { get { return base.HoverActive; } set { base.HoverActive = value; EnableActor(HoverActive, HoverActorName, delegate() { return new BSActorHover(PhysScene, this, HoverActorName); }); // Call update so actor Refresh() is called to start things off PhysScene.TaintedObject(LocalID, "BSPrim.PIDHoverActive", delegate() { UpdatePhysicalParameters(); }); } } public override void AddForce(OMV.Vector3 force, bool pushforce) { // Per documentation, max force is limited. OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); // Push forces seem to be scaled differently (follow pattern in ubODE) if (!pushforce) { // Since this force is being applied in only one step, make this a force per second. addForce /= PhysScene.LastTimeStep; } AddForce(false /* inTaintTime */, addForce); } // Applying a force just adds this to the total force on the object. // This added force will only last the next simulation tick. public override void AddForce(bool inTaintTime, OMV.Vector3 force) { // for an object, doesn't matter if force is a pushforce or not if (IsPhysicallyActive) { if (force.IsFinite()) { // DetailLog("{0},BSPrim.addForce,call,force={1}", LocalID, addForce); OMV.Vector3 addForce = force; PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.AddForce", delegate() { // Bullet adds this central force to the total force for this tick. // Deep down in Bullet: // linearVelocity += totalForce / mass * timeStep; DetailLog("{0},BSPrim.addForce,taint,force={1}", LocalID, addForce); if (PhysBody.HasPhysicalBody) { PhysScene.PE.ApplyCentralForce(PhysBody, addForce); ActivateIfPhysical(false); } }); } else { m_log.WarnFormat("{0}: AddForce: Got a NaN force applied to a prim. LocalID={1}", LogHeader, LocalID); return; } } } public void AddForceImpulse(OMV.Vector3 impulse, bool pushforce, bool inTaintTime) { // for an object, doesn't matter if force is a pushforce or not if (!IsPhysicallyActive) { if (impulse.IsFinite()) { OMV.Vector3 addImpulse = Util.ClampV(impulse, BSParam.MaxAddForceMagnitude); // DetailLog("{0},BSPrim.addForceImpulse,call,impulse={1}", LocalID, impulse); PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.AddImpulse", delegate() { // Bullet adds this impulse immediately to the velocity DetailLog("{0},BSPrim.addForceImpulse,taint,impulseforce={1}", LocalID, addImpulse); if (PhysBody.HasPhysicalBody) { PhysScene.PE.ApplyCentralImpulse(PhysBody, addImpulse); ActivateIfPhysical(false); } }); } else { m_log.WarnFormat("{0}: AddForceImpulse: Got a NaN impulse applied to a prim. LocalID={1}", LogHeader, LocalID); return; } } } // BSPhysObject.AddAngularForce() public override void AddAngularForce(bool inTaintTime, OMV.Vector3 force) { if (force.IsFinite()) { OMV.Vector3 angForce = force; PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.AddAngularForce", delegate() { if (PhysBody.HasPhysicalBody) { DetailLog("{0},BSPrim.AddAngularForce,taint,angForce={1}", LocalID, angForce); PhysScene.PE.ApplyTorque(PhysBody, angForce); ActivateIfPhysical(false); } }); } else { m_log.WarnFormat("{0}: Got a NaN force applied to a prim. LocalID={1}", LogHeader, LocalID); return; } } // A torque impulse. // ApplyTorqueImpulse adds torque directly to the angularVelocity. // AddAngularForce accumulates the force and applied it to the angular velocity all at once. // Computed as: angularVelocity += impulse * inertia; public void ApplyTorqueImpulse(OMV.Vector3 impulse, bool inTaintTime) { OMV.Vector3 applyImpulse = impulse; PhysScene.TaintedObject(inTaintTime, LocalID, "BSPrim.ApplyTorqueImpulse", delegate() { if (PhysBody.HasPhysicalBody) { PhysScene.PE.ApplyTorqueImpulse(PhysBody, applyImpulse); ActivateIfPhysical(false); } }); } #region Mass Calculation private float CalculateMass() { float volume = _size.X * _size.Y * _size.Z; // default float tmp; float returnMass = 0; float hollowAmount = (float)BaseShape.ProfileHollow * 2.0e-5f; float hollowVolume = hollowAmount * hollowAmount; switch (BaseShape.ProfileShape) { case ProfileShape.Square: // default box if (BaseShape.PathCurve == (byte)Extrusion.Straight) { if (hollowAmount > 0.0) { switch (BaseShape.HollowShape) { case HollowShape.Square: case HollowShape.Same: break; case HollowShape.Circle: hollowVolume *= 0.78539816339f; break; case HollowShape.Triangle: hollowVolume *= (0.5f * .5f); break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } else if (BaseShape.PathCurve == (byte)Extrusion.Curve1) { //a tube volume *= 0.78539816339e-2f * (float)(200 - BaseShape.PathScaleX); tmp= 1.0f -2.0e-2f * (float)(200 - BaseShape.PathScaleY); volume -= volume*tmp*tmp; if (hollowAmount > 0.0) { hollowVolume *= hollowAmount; switch (BaseShape.HollowShape) { case HollowShape.Square: case HollowShape.Same: break; case HollowShape.Circle: hollowVolume *= 0.78539816339f;; break; case HollowShape.Triangle: hollowVolume *= 0.5f * 0.5f; break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } break; case ProfileShape.Circle: if (BaseShape.PathCurve == (byte)Extrusion.Straight) { volume *= 0.78539816339f; // elipse base if (hollowAmount > 0.0) { switch (BaseShape.HollowShape) { case HollowShape.Same: case HollowShape.Circle: break; case HollowShape.Square: hollowVolume *= 0.5f * 2.5984480504799f; break; case HollowShape.Triangle: hollowVolume *= .5f * 1.27323954473516f; break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } else if (BaseShape.PathCurve == (byte)Extrusion.Curve1) { volume *= 0.61685027506808491367715568749226e-2f * (float)(200 - BaseShape.PathScaleX); tmp = 1.0f - .02f * (float)(200 - BaseShape.PathScaleY); volume *= (1.0f - tmp * tmp); if (hollowAmount > 0.0) { // calculate the hollow volume by it's shape compared to the prim shape hollowVolume *= hollowAmount; switch (BaseShape.HollowShape) { case HollowShape.Same: case HollowShape.Circle: break; case HollowShape.Square: hollowVolume *= 0.5f * 2.5984480504799f; break; case HollowShape.Triangle: hollowVolume *= .5f * 1.27323954473516f; break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } break; case ProfileShape.HalfCircle: if (BaseShape.PathCurve == (byte)Extrusion.Curve1) { volume *= 0.52359877559829887307710723054658f; } break; case ProfileShape.EquilateralTriangle: if (BaseShape.PathCurve == (byte)Extrusion.Straight) { volume *= 0.32475953f; if (hollowAmount > 0.0) { // calculate the hollow volume by it's shape compared to the prim shape switch (BaseShape.HollowShape) { case HollowShape.Same: case HollowShape.Triangle: hollowVolume *= .25f; break; case HollowShape.Square: hollowVolume *= 0.499849f * 3.07920140172638f; break; case HollowShape.Circle: // Hollow shape is a perfect cyllinder in respect to the cube's scale // Cyllinder hollow volume calculation hollowVolume *= 0.1963495f * 3.07920140172638f; break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } else if (BaseShape.PathCurve == (byte)Extrusion.Curve1) { volume *= 0.32475953f; volume *= 0.01f * (float)(200 - BaseShape.PathScaleX); tmp = 1.0f - .02f * (float)(200 - BaseShape.PathScaleY); volume *= (1.0f - tmp * tmp); if (hollowAmount > 0.0) { hollowVolume *= hollowAmount; switch (BaseShape.HollowShape) { case HollowShape.Same: case HollowShape.Triangle: hollowVolume *= .25f; break; case HollowShape.Square: hollowVolume *= 0.499849f * 3.07920140172638f; break; case HollowShape.Circle: hollowVolume *= 0.1963495f * 3.07920140172638f; break; default: hollowVolume = 0; break; } volume *= (1.0f - hollowVolume); } } break; default: break; } float taperX1; float taperY1; float taperX; float taperY; float pathBegin; float pathEnd; float profileBegin; float profileEnd; if (BaseShape.PathCurve == (byte)Extrusion.Straight || BaseShape.PathCurve == (byte)Extrusion.Flexible) { taperX1 = BaseShape.PathScaleX * 0.01f; if (taperX1 > 1.0f) taperX1 = 2.0f - taperX1; taperX = 1.0f - taperX1; taperY1 = BaseShape.PathScaleY * 0.01f; if (taperY1 > 1.0f) taperY1 = 2.0f - taperY1; taperY = 1.0f - taperY1; } else { taperX = BaseShape.PathTaperX * 0.01f; if (taperX < 0.0f) taperX = -taperX; taperX1 = 1.0f - taperX; taperY = BaseShape.PathTaperY * 0.01f; if (taperY < 0.0f) taperY = -taperY; taperY1 = 1.0f - taperY; } volume *= (taperX1 * taperY1 + 0.5f * (taperX1 * taperY + taperX * taperY1) + 0.3333333333f * taperX * taperY); pathBegin = (float)BaseShape.PathBegin * 2.0e-5f; pathEnd = 1.0f - (float)BaseShape.PathEnd * 2.0e-5f; volume *= (pathEnd - pathBegin); // this is crude aproximation profileBegin = (float)BaseShape.ProfileBegin * 2.0e-5f; profileEnd = 1.0f - (float)BaseShape.ProfileEnd * 2.0e-5f; volume *= (profileEnd - profileBegin); returnMass = Density * BSParam.DensityScaleFactor * volume; returnMass = Util.Clamp(returnMass, BSParam.MinimumObjectMass, BSParam.MaximumObjectMass); // DetailLog("{0},BSPrim.CalculateMass,den={1},vol={2},mass={3}", LocalID, Density, volume, returnMass); DetailLog("{0},BSPrim.CalculateMass,den={1},vol={2},mass={3},pathB={4},pathE={5},profB={6},profE={7},siz={8}", LocalID, Density, volume, returnMass, pathBegin, pathEnd, profileBegin, profileEnd, _size); return returnMass; }// end CalculateMass #endregion Mass Calculation // Rebuild the geometry and object. // This is called when the shape changes so we need to recreate the mesh/hull. // Called at taint-time!!! public void CreateGeomAndObject(bool forceRebuild) { // Create the correct physical representation for this type of object. // Updates base.PhysBody and base.PhysShape with the new information. // Ignore 'forceRebuild'. 'GetBodyAndShape' makes the right choices and changes of necessary. PhysScene.Shapes.GetBodyAndShape(false /*forceRebuild */, PhysScene.World, this, delegate(BulletBody pBody, BulletShape pShape) { // Called if the current prim body is about to be destroyed. // Remove all the physical dependencies on the old body. // (Maybe someday make the changing of BSShape an event to be subscribed to by BSLinkset, ...) // Note: this virtual function is overloaded by BSPrimLinkable to remove linkset constraints. RemoveDependencies(); }); // Make sure the properties are set on the new object UpdatePhysicalParameters(); return; } // Called at taint-time protected virtual void RemoveDependencies() { PhysicalActors.RemoveDependencies(); } #region Extension public override object Extension(string pFunct, params object[] pParams) { DetailLog("{0} BSPrim.Extension,op={1}", LocalID, pFunct); object ret = null; switch (pFunct) { case ExtendedPhysics.PhysFunctAxisLockLimits: ret = SetAxisLockLimitsExtension(pParams); break; default: ret = base.Extension(pFunct, pParams); break; } return ret; } private void InitializeAxisActor() { EnableActor(LockedAngularAxis != LockedAxisFree || LockedLinearAxis != LockedAxisFree, LockedAxisActorName, delegate() { return new BSActorLockAxis(PhysScene, this, LockedAxisActorName); }); // Update parameters so the new actor's Refresh() action is called at the right time. PhysScene.TaintedObject(LocalID, "BSPrim.LockAxis", delegate() { UpdatePhysicalParameters(); }); } // Passed an array of an array of parameters, set the axis locking. // This expects an int (PHYS_AXIS_*) followed by none or two limit floats // followed by another int and floats, etc. private object SetAxisLockLimitsExtension(object[] pParams) { DetailLog("{0} SetAxisLockLimitsExtension. parmlen={1}", LocalID, pParams.GetLength(0)); object ret = null; try { if (pParams.GetLength(0) > 1) { int index = 2; while (index < pParams.GetLength(0)) { var funct = pParams[index]; DetailLog("{0} SetAxisLockLimitsExtension. op={1}, index={2}", LocalID, funct, index); if (funct is Int32 || funct is Int64) { switch ((int)funct) { // Those that take no parameters case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_X: case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Y: case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Z: case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR: case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X: case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y: case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z: case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR: case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_X: case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Y: case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Z: case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR: case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_X: case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Y: case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Z: case ExtendedPhysics.PHYS_AXIS_UNLOCK: ApplyAxisLimits((int)funct, 0f, 0f); index += 1; break; // Those that take two parameters (the limits) case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_X: case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Y: case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Z: case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_X: case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Y: case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Z: ApplyAxisLimits((int)funct, (float)pParams[index + 1], (float)pParams[index + 2]); index += 3; break; default: m_log.WarnFormat("{0} SetSxisLockLimitsExtension. Unknown op={1}", LogHeader, funct); index += 1; break; } } } InitializeAxisActor(); ret = (object)index; } } catch (Exception e) { m_log.WarnFormat("{0} SetSxisLockLimitsExtension exception in object {1}: {2}", LogHeader, this.Name, e); ret = null; } return ret; // not implemented yet } // Set the locking parameters. // If an axis is locked, the limits for the axis are set to zero, // If the axis is being constrained, the high and low value are passed and set. // When done here, LockedXXXAxis flags are set and LockedXXXAxixLow/High are set to the range. protected void ApplyAxisLimits(int funct, float low, float high) { DetailLog("{0} ApplyAxisLimits. op={1}, low={2}, high={3}", LocalID, funct, low, high); float linearMax = 23000f; float angularMax = (float)Math.PI; switch (funct) { case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: this.LockedLinearAxis = new OMV.Vector3(LockedAxis, LockedAxis, LockedAxis); this.LockedLinearAxisLow = OMV.Vector3.Zero; this.LockedLinearAxisHigh = OMV.Vector3.Zero; break; case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_X: this.LockedLinearAxis.X = LockedAxis; this.LockedLinearAxisLow.X = 0f; this.LockedLinearAxisHigh.X = 0f; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_X: this.LockedLinearAxis.X = LockedAxis; this.LockedLinearAxisLow.X = Util.Clip(low, -linearMax, linearMax); this.LockedLinearAxisHigh.X = Util.Clip(high, -linearMax, linearMax); break; case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Y: this.LockedLinearAxis.Y = LockedAxis; this.LockedLinearAxisLow.Y = 0f; this.LockedLinearAxisHigh.Y = 0f; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Y: this.LockedLinearAxis.Y = LockedAxis; this.LockedLinearAxisLow.Y = Util.Clip(low, -linearMax, linearMax); this.LockedLinearAxisHigh.Y = Util.Clip(high, -linearMax, linearMax); break; case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Z: this.LockedLinearAxis.Z = LockedAxis; this.LockedLinearAxisLow.Z = 0f; this.LockedLinearAxisHigh.Z = 0f; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Z: this.LockedLinearAxis.Z = LockedAxis; this.LockedLinearAxisLow.Z = Util.Clip(low, -linearMax, linearMax); this.LockedLinearAxisHigh.Z = Util.Clip(high, -linearMax, linearMax); break; case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR: this.LockedAngularAxis = new OMV.Vector3(LockedAxis, LockedAxis, LockedAxis); this.LockedAngularAxisLow = OMV.Vector3.Zero; this.LockedAngularAxisHigh = OMV.Vector3.Zero; break; case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X: this.LockedAngularAxis.X = LockedAxis; this.LockedAngularAxisLow.X = 0; this.LockedAngularAxisHigh.X = 0; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_X: this.LockedAngularAxis.X = LockedAxis; this.LockedAngularAxisLow.X = Util.Clip(low, -angularMax, angularMax); this.LockedAngularAxisHigh.X = Util.Clip(high, -angularMax, angularMax); break; case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y: this.LockedAngularAxis.Y = LockedAxis; this.LockedAngularAxisLow.Y = 0; this.LockedAngularAxisHigh.Y = 0; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Y: this.LockedAngularAxis.Y = LockedAxis; this.LockedAngularAxisLow.Y = Util.Clip(low, -angularMax, angularMax); this.LockedAngularAxisHigh.Y = Util.Clip(high, -angularMax, angularMax); break; case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z: this.LockedAngularAxis.Z = LockedAxis; this.LockedAngularAxisLow.Z = 0; this.LockedAngularAxisHigh.Z = 0; break; case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Z: this.LockedAngularAxis.Z = LockedAxis; this.LockedAngularAxisLow.Z = Util.Clip(low, -angularMax, angularMax); this.LockedAngularAxisHigh.Z = Util.Clip(high, -angularMax, angularMax); break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR: this.LockedLinearAxis = LockedAxisFree; this.LockedLinearAxisLow = new OMV.Vector3(-linearMax, -linearMax, -linearMax); this.LockedLinearAxisHigh = new OMV.Vector3(linearMax, linearMax, linearMax); break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_X: this.LockedLinearAxis.X = FreeAxis; this.LockedLinearAxisLow.X = -linearMax; this.LockedLinearAxisHigh.X = linearMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Y: this.LockedLinearAxis.Y = FreeAxis; this.LockedLinearAxisLow.Y = -linearMax; this.LockedLinearAxisHigh.Y = linearMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Z: this.LockedLinearAxis.Z = FreeAxis; this.LockedLinearAxisLow.Z = -linearMax; this.LockedLinearAxisHigh.Z = linearMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR: this.LockedAngularAxis = LockedAxisFree; this.LockedAngularAxisLow = new OMV.Vector3(-angularMax, -angularMax, -angularMax); this.LockedAngularAxisHigh = new OMV.Vector3(angularMax, angularMax, angularMax); break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_X: this.LockedAngularAxis.X = FreeAxis; this.LockedAngularAxisLow.X = -angularMax; this.LockedAngularAxisHigh.X = angularMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Y: this.LockedAngularAxis.Y = FreeAxis; this.LockedAngularAxisLow.Y = -angularMax; this.LockedAngularAxisHigh.Y = angularMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Z: this.LockedAngularAxis.Z = FreeAxis; this.LockedAngularAxisLow.Z = -angularMax; this.LockedAngularAxisHigh.Z = angularMax; break; case ExtendedPhysics.PHYS_AXIS_UNLOCK: ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR, 0f, 0f); ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR, 0f, 0f); break; default: break; } return; } #endregion // Extension // The physics engine says that properties have updated. Update same and inform // the world that things have changed. // NOTE: BSPrim.UpdateProperties is overloaded by BSPrimLinkable which modifies updates from root and children prims. // NOTE: BSPrim.UpdateProperties is overloaded by BSPrimDisplaced which handles mapping physical position to simulator position. public override void UpdateProperties(EntityProperties entprop) { // Let anyone (like the actors) modify the updated properties before they are pushed into the object and the simulator. TriggerPreUpdatePropertyAction(ref entprop); // DetailLog("{0},BSPrim.UpdateProperties,entry,entprop={1}", LocalID, entprop); // DEBUG DEBUG // Assign directly to the local variables so the normal set actions do not happen RawPosition = entprop.Position; RawOrientation = entprop.Rotation; // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be // very sensitive to velocity changes. if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(RawVelocity, BSParam.UpdateVelocityChangeThreshold)) RawVelocity = entprop.Velocity; _acceleration = entprop.Acceleration; RawRotationalVelocity = entprop.RotationalVelocity; // DetailLog("{0},BSPrim.UpdateProperties,afterAssign,entprop={1}", LocalID, entprop); // DEBUG DEBUG // The sanity check can change the velocity and/or position. if (PositionSanityCheck(true /* inTaintTime */ )) { entprop.Position = RawPosition; entprop.Velocity = RawVelocity; entprop.RotationalVelocity = RawRotationalVelocity; entprop.Acceleration = _acceleration; } OMV.Vector3 direction = OMV.Vector3.UnitX * RawOrientation; // DEBUG DEBUG DEBUG DetailLog("{0},BSPrim.UpdateProperties,call,entProp={1},dir={2}", LocalID, entprop, direction); // remember the current and last set values LastEntityProperties = CurrentEntityProperties; CurrentEntityProperties = entprop; PhysScene.PostUpdate(this); } } }
{ "content_hash": "660e7b063651214c96e7181bf12a70c6", "timestamp": "", "source": "github", "line_count": 1885, "max_line_length": 159, "avg_line_length": 40.322546419098146, "alnum_prop": 0.5661509314808968, "repo_name": "EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC", "id": "f085d7055072859b51840fe9b5ca55b6e3a27ce3", "size": "77626", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "3307" }, { "name": "C#", "bytes": "21720339" }, { "name": "CSS", "bytes": "1683" }, { "name": "HTML", "bytes": "9919" }, { "name": "JavaScript", "bytes": "556" }, { "name": "LSL", "bytes": "36962" }, { "name": "Makefile", "bytes": "1232" }, { "name": "NSIS", "bytes": "6208" }, { "name": "PLpgSQL", "bytes": "599" }, { "name": "Perl", "bytes": "3578" }, { "name": "Python", "bytes": "5053" }, { "name": "Ruby", "bytes": "1111" }, { "name": "Shell", "bytes": "2979" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Jan 18 00:59:45 GMT 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.apache.taverna.server.master.common.Permission (Apache Taverna Server 3.1.0-incubating API)</title> <meta name="date" content="2018-01-18"> <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="Uses of Class org.apache.taverna.server.master.common.Permission (Apache Taverna Server 3.1.0-incubating API)"; } } 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><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/taverna/server/master/common/class-use/Permission.html" target="_top">Frames</a></li> <li><a href="Permission.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="header"> <h2 title="Uses of Class org.apache.taverna.server.master.common.Permission" class="title">Uses of Class<br>org.apache.taverna.server.master.common.Permission</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></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="altColor"> <td class="colFirst"><a href="#org.apache.taverna.server.master">org.apache.taverna.server.master</a></td> <td class="colLast"> <div class="block">The core of the implementation of Taverna Server, including the implementations of the SOAP and REST interfaces.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.apache.taverna.server.master.common">org.apache.taverna.server.master.common</a></td> <td class="colLast"> <div class="block">This package contains the common XML elements used throughout Taverna Server's various interfaces.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.taverna.server.master.rest">org.apache.taverna.server.master.rest</a></td> <td class="colLast"> <div class="block">This package contains the RESTful interface to Taverna Server.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.apache.taverna.server.master.rest.handler">org.apache.taverna.server.master.rest.handler</a></td> <td class="colLast"> <div class="block">This package contains type handlers for the RESTful interface to Taverna Server.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.taverna.server.master.soap">org.apache.taverna.server.master.soap</a></td> <td class="colLast"> <div class="block">This package contains the SOAP interface to Taverna Server.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.taverna.server.master"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a> in <a href="../../../../../../../org/apache/taverna/server/master/package-summary.html">org.apache.taverna.server.master</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/package-summary.html">org.apache.taverna.server.master</a> that return <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSupport.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/TavernaServerSupport.html#getPermission-org.apache.taverna.server.master.interfaces.TavernaSecurityContext-java.lang.String-">getPermission</a></span>(<a href="../../../../../../../org/apache/taverna/server/master/interfaces/TavernaSecurityContext.html" title="interface in org.apache.taverna.server.master.interfaces">TavernaSecurityContext</a>&nbsp;context, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userName)</code> <div class="block">Get the permission description for the given user.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/package-summary.html">org.apache.taverna.server.master</a> that return types with arguments of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSupport.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/TavernaServerSupport.html#getPermissionMap-org.apache.taverna.server.master.interfaces.TavernaSecurityContext-">getPermissionMap</a></span>(<a href="../../../../../../../org/apache/taverna/server/master/interfaces/TavernaSecurityContext.html" title="interface in org.apache.taverna.server.master.interfaces">TavernaSecurityContext</a>&nbsp;context)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/package-summary.html">org.apache.taverna.server.master</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSupport.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/TavernaServerSupport.html#setPermission-org.apache.taverna.server.master.interfaces.TavernaSecurityContext-java.lang.String-org.apache.taverna.server.master.common.Permission-">setPermission</a></span>(<a href="../../../../../../../org/apache/taverna/server/master/interfaces/TavernaSecurityContext.html" title="interface in org.apache.taverna.server.master.interfaces">TavernaSecurityContext</a>&nbsp;context, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userName, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;permission)</code> <div class="block">Set the permissions for the given user.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">TavernaServer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/TavernaServer.html#setRunPermission-java.lang.String-java.lang.String-org.apache.taverna.server.master.common.Permission-">setRunPermission</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;runName, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userName, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;permission)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.taverna.server.master.common"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a> in <a href="../../../../../../../org/apache/taverna/server/master/common/package-summary.html">org.apache.taverna.server.master.common</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/common/package-summary.html">org.apache.taverna.server.master.common</a> that return <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">Permission.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html#valueOf-java.lang.String-">valueOf</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>[]</code></td> <td class="colLast"><span class="typeNameLabel">Permission.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html#values--">values</a></span>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.taverna.server.master.rest"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a> in <a href="../../../../../../../org/apache/taverna/server/master/rest/package-summary.html">org.apache.taverna.server.master.rest</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../org/apache/taverna/server/master/rest/package-summary.html">org.apache.taverna.server.master.rest</a> declared as <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSecurityREST.PermissionsDescription.LinkedPermissionDescription.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.PermissionsDescription.LinkedPermissionDescription.html#permission">permission</a></span></code> <div class="block">What are they granted?</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSecurityREST.PermissionDescription.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.PermissionDescription.html#permission">permission</a></span></code> <div class="block">What permission to grant them?</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/rest/package-summary.html">org.apache.taverna.server.master.rest</a> that return <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSecurityREST.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.html#describePermission-java.lang.String-">describePermission</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</code> <div class="block">Describe the particular permission granted to a user.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSecurityREST.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.html#setPermission-java.lang.String-org.apache.taverna.server.master.common.Permission-">setPermission</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;perm)</code> <div class="block">Update the permission granted to a user.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/rest/package-summary.html">org.apache.taverna.server.master.rest</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSecurityREST.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.html#setPermission-java.lang.String-org.apache.taverna.server.master.common.Permission-">setPermission</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;perm)</code> <div class="block">Update the permission granted to a user.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructor parameters in <a href="../../../../../../../org/apache/taverna/server/master/rest/package-summary.html">org.apache.taverna.server.master.rest</a> with type arguments of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/TavernaServerSecurityREST.PermissionsDescription.html#PermissionsDescription-javax.ws.rs.core.UriBuilder-java.util.Map-">PermissionsDescription</a></span>(javax.ws.rs.core.UriBuilder&nbsp;ub, <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&gt;&nbsp;permissionMap)</code> <div class="block">Initialise the description of a collection of permissions.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.taverna.server.master.rest.handler"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a> in <a href="../../../../../../../org/apache/taverna/server/master/rest/handler/package-summary.html">org.apache.taverna.server.master.rest.handler</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/rest/handler/package-summary.html">org.apache.taverna.server.master.rest.handler</a> that return <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">PermissionHandler.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/handler/PermissionHandler.html#readFrom-java.lang.Class-java.lang.reflect.Type-java.lang.annotation.Annotation:A-javax.ws.rs.core.MediaType-javax.ws.rs.core.MultivaluedMap-java.io.InputStream-">readFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&gt;&nbsp;type, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a>&nbsp;genericType, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>[]&nbsp;annotations, javax.ws.rs.core.MediaType&nbsp;mediaType, javax.ws.rs.core.MultivaluedMap&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;httpHeaders, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;entityStream)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/rest/handler/package-summary.html">org.apache.taverna.server.master.rest.handler</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><span class="typeNameLabel">PermissionHandler.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/handler/PermissionHandler.html#getSize-org.apache.taverna.server.master.common.Permission-java.lang.Class-java.lang.reflect.Type-java.lang.annotation.Annotation:A-javax.ws.rs.core.MediaType-">getSize</a></span>(<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;t, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a>&nbsp;genericType, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>[]&nbsp;annotations, javax.ws.rs.core.MediaType&nbsp;mediaType)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">PermissionHandler.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/handler/PermissionHandler.html#writeTo-org.apache.taverna.server.master.common.Permission-java.lang.Class-java.lang.reflect.Type-java.lang.annotation.Annotation:A-javax.ws.rs.core.MediaType-javax.ws.rs.core.MultivaluedMap-java.io.OutputStream-">writeTo</a></span>(<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;t, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a>&nbsp;genericType, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>[]&nbsp;annotations, javax.ws.rs.core.MediaType&nbsp;mediaType, javax.ws.rs.core.MultivaluedMap&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&nbsp;httpHeaders, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;entityStream)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Method parameters in <a href="../../../../../../../org/apache/taverna/server/master/rest/handler/package-summary.html">org.apache.taverna.server.master.rest.handler</a> with type arguments of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">PermissionHandler.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/rest/handler/PermissionHandler.html#readFrom-java.lang.Class-java.lang.reflect.Type-java.lang.annotation.Annotation:A-javax.ws.rs.core.MediaType-javax.ws.rs.core.MultivaluedMap-java.io.InputStream-">readFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;<a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&gt;&nbsp;type, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Type.html?is-external=true" title="class or interface in java.lang.reflect">Type</a>&nbsp;genericType, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>[]&nbsp;annotations, javax.ws.rs.core.MediaType&nbsp;mediaType, javax.ws.rs.core.MultivaluedMap&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;httpHeaders, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;entityStream)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.apache.taverna.server.master.soap"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a> in <a href="../../../../../../../org/apache/taverna/server/master/soap/package-summary.html">org.apache.taverna.server.master.soap</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../org/apache/taverna/server/master/soap/package-summary.html">org.apache.taverna.server.master.soap</a> declared as <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></code></td> <td class="colLast"><span class="typeNameLabel">PermissionList.SinglePermissionMapping.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/soap/PermissionList.SinglePermissionMapping.html#permission">permission</a></span></code> <div class="block">The permission level that the user is granted.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/master/soap/package-summary.html">org.apache.taverna.server.master.soap</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">TavernaServerSOAP.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/soap/TavernaServerSOAP.html#setRunPermission-java.lang.String-java.lang.String-org.apache.taverna.server.master.common.Permission-">setRunPermission</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;runName, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userName, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;permission)</code> <div class="block">Set the permission for a user to access and update a particular workflow run.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../../../org/apache/taverna/server/master/soap/package-summary.html">org.apache.taverna.server.master.soap</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/master/soap/PermissionList.SinglePermissionMapping.html#SinglePermissionMapping-java.lang.String-org.apache.taverna.server.master.common.Permission-">SinglePermissionMapping</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;user, <a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Permission</a>&nbsp;permission)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </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><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/apache/taverna/server/master/common/Permission.html" title="enum in org.apache.taverna.server.master.common">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/apache/taverna/server/master/common/class-use/Permission.html" target="_top">Frames</a></li> <li><a href="Permission.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 ======= --> <p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "7ecb6335f84202a45309342715361cc6", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 704, "avg_line_length": 82.6, "alnum_prop": 0.6988532049064736, "repo_name": "apache/incubator-taverna-site", "id": "3a586f9684b493cca90cde73fe7d4951afc6b5d5", "size": "37583", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "content/javadoc/taverna-server/org/apache/taverna/server/master/common/class-use/Permission.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10003" }, { "name": "Clojure", "bytes": "49413" }, { "name": "Dockerfile", "bytes": "1398" }, { "name": "HTML", "bytes": "72209" }, { "name": "Perl", "bytes": "2822" }, { "name": "Python", "bytes": "31455" }, { "name": "Shell", "bytes": "374" } ], "symlink_target": "" }
def remove_line_ending(line): """ Strip line from the RHS end. :param str line: line to be stripped :return: stripped line :rtype: str """ return line.rstrip() def filter_out_empty(line): """ Filter used to determinate if line is not empty. :param str line: line to be tested :return: length of the line; for non-empty lines this returns value greater than zero, which evaluates to boolean ``True`` :rtype: int """ return len(line) def process_lines(lines): """ Filter and alter a list of lines (for example from a file). This function is used for initial processing of input files. :param list lines: lines to be stripped and filtered out :return: the same line without line-ending white characters. Additionally empty lines get dropped. :rtype: list """ lines = map(remove_line_ending, lines) # get rid of line endings lines = filter(filter_out_empty, lines) # get rid of empty lines return lines def read_warehouse_map(name): """ Read the file line by line and represent it as an array or list of lists. :param string name: path to the warehouse map file :return: immutable map :rtype: tuple """ with open(name, 'r') as f: lines = process_lines(f.readlines()) lines = map(list, lines) # split each line into list (ie. mutable string) # change '0' to '9' into integers 0-9 for k1, v1 in enumerate(lines): for k2, v2 in enumerate(v1): try: v2_ = int(v2) except ValueError: v2_ = v2 lines[k1][k2] = v2_ lines[k1] = tuple(lines[k1]) return tuple(lines) def read_robots_positions(name): """ Read a file declaring number of robots and their starting positions. All robots can start from the same position. :param string name: path to the file with robot initial positions :return: list of pairs (y, x) :rtype: list """ with open(name, 'r') as f: lines = process_lines(f.readlines()) # robots_number = len(lines) starting_positions = [] for line in lines: y_pos, x_pos = map(int, line.split(",")) starting_positions.append((y_pos, x_pos)) return starting_positions def read_order(name): """ Read a file with products sequence. This sequence is important: our robots have to bring products to the drop zone in this exact sequence. :param string name: path to the file requested order :return: requested order sequence :rtype: tuple """ with open(name, 'r') as f: lines = process_lines(f.readlines()) return tuple(lines)
{ "content_hash": "5863a10c173bf4651a1296e4815d06f8", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 28.28125, "alnum_prop": 0.6257826887661142, "repo_name": "WojciechFocus/MMVD", "id": "25b6e6aa7663b68481c9a17f0ae83c4bf7fac9f7", "size": "2733", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mmvdApp/utils/io.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "6763" }, { "name": "Python", "bytes": "102307" }, { "name": "Shell", "bytes": "6706" } ], "symlink_target": "" }
package com.rtg.util.array; import java.util.Random; import com.rtg.util.diagnostic.Diagnostic; import junit.framework.TestCase; /** * Base class for testing all of the index implementations that are capable of * holding more than the maximum integer worth of data that they actually work. */ public abstract class AbstractCommonIndexRegression extends TestCase { private static final long NUM_ELEMENTS = 2L * Integer.MAX_VALUE + 9000L; protected abstract long getRange(); protected abstract CommonIndex createIndex(long elements); protected long getNumElements() { return NUM_ELEMENTS; } /** * Test the common index implementation */ public void testIndex() { Diagnostic.setLogStream(); doTest(getRange(), getNumElements()); } private void doTest(long range, long elements) { final RandomLongGenerator value = new RandomLongGenerator(range); final CommonIndex index = createIndex(elements); assertEquals(elements, index.length()); for (long l = 0; l < elements; ++l) { index.set(l, value.nextValue()); } value.reset(); for (long l = 0; l < elements; ++l) { assertEquals(value.nextValue(), index.get(l)); } } /** * Utility class to create a repeatable stream of * positive random longs. */ public static final class RandomLongGenerator { private final long mRange; private final long mSeed; private Random mRand; /** * Constructor for generator with seed from current time. * @param range the range of longs to generate from 0 inclusive to range exclusive. */ public RandomLongGenerator(long range) { this(range, System.nanoTime()); System.err.println("Seed: " + mSeed); } /** * Constructor for generator with seed provided. * @param range the range of longs to generate from 0 inclusive to range exclusive. * @param seed the seed for the random number generator. */ public RandomLongGenerator(long range, long seed) { assert 0 < range && range <= Long.MAX_VALUE; mRange = range; mSeed = seed; reset(); } /** * Method to get the next long in the sequence. * @return the next long in the sequence. */ public long nextValue() { return (long) (mRand.nextDouble() * mRange); } /** * Method to reset the generator to produce the same sequence again * from the beginning. */ public void reset() { mRand = new Random(mSeed); } } }
{ "content_hash": "29568c271c0a12e816f1883fcba19fff", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 87, "avg_line_length": 25.693877551020407, "alnum_prop": 0.659650516282764, "repo_name": "RealTimeGenomics/rtg-tools", "id": "2d86cc5eb7b909bff724af1610f138b8626be38c", "size": "3919", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/com/rtg/util/array/AbstractCommonIndexRegression.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "6360" }, { "name": "CSS", "bytes": "26925" }, { "name": "HTML", "bytes": "500647" }, { "name": "Java", "bytes": "8289543" }, { "name": "JavaScript", "bytes": "194293" }, { "name": "Shell", "bytes": "40973" }, { "name": "XSLT", "bytes": "39426" } ], "symlink_target": "" }
import { remote } from 'electron' import { readFile, writeFile } from 'fs' import * as q from 'q' export function getHistoryModel( options, basePath = remote.app.getPath('userData') ) { let buffer: any[] = [] let promise = q() const fileName = basePath + '/' + options.file const history = { push(item) { promise = promise.then(() => { buffer.splice(0, 0, item) if (buffer.length > options.max) { buffer = buffer.slice(0, options.min) } return q.nfcall( writeFile, fileName, buffer.map(obj => JSON.stringify(obj)).join(',') ) }) return promise }, list: () => buffer, } return q.nfcall(readFile, fileName).then( content => { buffer = JSON.parse('[' + content + ']') return history }, () => history ) }
{ "content_hash": "42aa0255aa179553863954ceb6349cea", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 68, "avg_line_length": 27.944444444444443, "alnum_prop": 0.46222664015904574, "repo_name": "OlafurTorfi/gandalf", "id": "2fdb7cc1885ea17f48abda746935731c45ea00c6", "size": "1006", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/modules/history.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19326" }, { "name": "HTML", "bytes": "526" }, { "name": "JavaScript", "bytes": "4492" }, { "name": "TypeScript", "bytes": "154545" } ], "symlink_target": "" }
#pragma once #include "storage/country.hpp" #include "storage/country_decl.hpp" #include "platform/platform.hpp" #include "geometry/region2d.hpp" #include "coding/file_container.hpp" #include "base/cache.hpp" #include <map> #include <mutex> #include <string> #include <type_traits> #include <unordered_map> #include <vector> namespace storage { // This class allows users to get information about country by point or by name. class CountryInfoGetterBase { public: // Identifier of a region (index in m_countries array). using TRegionId = size_t; using TRegionIdSet = std::vector<TRegionId>; explicit CountryInfoGetterBase(bool isSingleMwm) : m_isSingleMwm(isSingleMwm) {} virtual ~CountryInfoGetterBase() = default; // Returns country file name without an extension for a country |pt| // belongs to. If there is no such country, returns an empty // string. TCountryId GetRegionCountryId(m2::PointD const & pt) const; // Returns true when |pt| belongs to at least one of the specified // |regions|. bool IsBelongToRegions(m2::PointD const & pt, TRegionIdSet const & regions) const; // Returns true if there're at least one region with id equal to |countryId|. bool IsBelongToRegions(TCountryId const & countryId, TRegionIdSet const & regions) const; void RegionIdsToCountryIds(TRegionIdSet const & regions, TCountriesVec & countries) const; protected: // Returns identifier of the first country containing |pt|. TRegionId FindFirstCountry(m2::PointD const & pt) const; // Returns true when |pt| belongs to a country identified by |id|. virtual bool IsBelongToRegionImpl(size_t id, m2::PointD const & pt) const = 0; // List of all known countries. std::vector<CountryDef> m_countries; // m_isSingleMwm == true if the system is currently working with single (small) mwms // and false otherwise. // @TODO(bykoianko) Init m_isSingleMwm correctly. bool m_isSingleMwm; }; // *NOTE* This class is thread-safe. class CountryInfoGetter : public CountryInfoGetterBase { public: explicit CountryInfoGetter(bool isSingleMwm) : CountryInfoGetterBase(isSingleMwm) {} // Returns vector of countries file names without an extension for // countries belong to |rect|. |rough| provides fast rough result // or a slower but more precise one. std::vector<TCountryId> GetRegionsCountryIdByRect(m2::RectD const & rect, bool rough) const; // Returns a list of country ids by a |pt| in mercator. // |closestCoutryIds| is filled with country ids of mwm which covers |pt| or close to it. // |closestCoutryIds| is not filled with country world.mwm country id and with custom mwm. // If |pt| is covered by a sea or a ocean closestCoutryIds may be left empty. void GetRegionsCountryId(m2::PointD const & pt, TCountriesVec & closestCoutryIds); // Returns info for a region |pt| belongs to. void GetRegionInfo(m2::PointD const & pt, CountryInfo & info) const; // Returns info for a country by id. void GetRegionInfo(TCountryId const & countryId, CountryInfo & info) const; // Return limit rects of USA: // 0 - continental part // 1 - Alaska // 2 - Hawaii void CalcUSALimitRect(m2::RectD rects[3]) const; // Calculates limit rect for all countries whose name starts with // |prefix|. m2::RectD CalcLimitRect(string const & prefix) const; // Returns limit rect for |countryId| (non-expandable node). // Returns bounding box in mercator coordinates if |countryId| is a country id of non-expandable node // and zero rect otherwise. m2::RectD GetLimitRectForLeaf(TCountryId const & leafCountryId) const; // Returns identifiers for all regions matching to correspondent |affiliation|. virtual void GetMatchedRegions(string const & affiliation, TRegionIdSet & regions) const; // Clears regions cache. inline void ClearCaches() const { ClearCachesImpl(); } void InitAffiliationsInfo(TMappingAffiliations const * affiliations); protected: CountryInfoGetter() : CountryInfoGetterBase(true /* isSingleMwm */ ) {}; // Invokes |toDo| on each country whose name starts with |prefix|. template <typename ToDo> void ForEachCountry(string const & prefix, ToDo && toDo) const; // Clears regions cache. virtual void ClearCachesImpl() const = 0; // Returns true when |rect| intersects a country identified by |id|. virtual bool IsIntersectedByRegionImpl(size_t id, m2::RectD const & rect) const = 0; // Returns true when the distance from |pt| to country identified by |id| less then |distance|. virtual bool IsCloseEnough(size_t id, m2::PointD const & pt, double distance) = 0; // @TODO(bykoianko): consider to get rid of m_countryIndex. // The possibility should be considered. // Maps all leaf country id (file names) to their indices in m_countries. std::unordered_map<TCountryId, TRegionId> m_countryIndex; TMappingAffiliations const * m_affiliations = nullptr; // Maps country file name without an extension to a country info. std::map<std::string, CountryInfo> m_id2info; }; // This class reads info about countries from polygons file and // countries file and caches it. class CountryInfoReader : public CountryInfoGetter { public: /// \returns CountryInfoGetter based on countries.txt and packed_polygons.bin. static unique_ptr<CountryInfoGetter> CreateCountryInfoReader(Platform const & platform); /// \returns CountryInfoGetter based on countries_obsolete.txt and packed_polygons_obsolete.bin. /// \brief The polygons in CountryInfoGetter() returned by the method was used at the time when /// routing and map data were in different files. /// \note This method should be used before migration to single-component and for tests. static unique_ptr<CountryInfoGetter> CreateCountryInfoReaderObsolete(Platform const & platform); protected: CountryInfoReader(ModelReaderPtr polyR, ModelReaderPtr countryR); // CountryInfoGetter overrides: void ClearCachesImpl() const override; bool IsBelongToRegionImpl(size_t id, m2::PointD const & pt) const override; bool IsIntersectedByRegionImpl(size_t id, m2::RectD const & rect) const override; bool IsCloseEnough(size_t id, m2::PointD const & pt, double distance) override; template <typename TFn> std::result_of_t<TFn(vector<m2::RegionD>)> WithRegion(size_t id, TFn && fn) const; FilesContainerR m_reader; mutable base::Cache<uint32_t, std::vector<m2::RegionD>> m_cache; mutable std::mutex m_cacheMutex; }; // This class allows users to get info about very simply rectangular // countries, whose info can be described by CountryDef instances. // It's needed for testing purposes only. class CountryInfoGetterForTesting : public CountryInfoGetter { public: CountryInfoGetterForTesting() = default; CountryInfoGetterForTesting(std::vector<CountryDef> const & countries); void AddCountry(CountryDef const & country); // CountryInfoGetter overrides: void GetMatchedRegions(string const & affiliation, TRegionIdSet & regions) const override; protected: // CountryInfoGetter overrides: void ClearCachesImpl() const override; bool IsBelongToRegionImpl(size_t id, m2::PointD const & pt) const override; bool IsIntersectedByRegionImpl(size_t id, m2::RectD const & rect) const override; bool IsCloseEnough(size_t id, m2::PointD const & pt, double distance) override; }; } // namespace storage
{ "content_hash": "75fe2a9d13914d9bd7f0a0fbdfbda87c", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 103, "avg_line_length": 39.5945945945946, "alnum_prop": 0.7486689419795222, "repo_name": "bykoianko/omim", "id": "db807faed38a5391b265ae1efce09db35352b7c9", "size": "7325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "storage/country_info_getter.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "3962" }, { "name": "Batchfile", "bytes": "5586" }, { "name": "C", "bytes": "13970378" }, { "name": "C++", "bytes": "147850479" }, { "name": "CMake", "bytes": "242731" }, { "name": "CSS", "bytes": "26798" }, { "name": "Common Lisp", "bytes": "17521" }, { "name": "DIGITAL Command Language", "bytes": "36710" }, { "name": "GLSL", "bytes": "57179" }, { "name": "Gherkin", "bytes": "305230" }, { "name": "Go", "bytes": "12771" }, { "name": "HTML", "bytes": "9503027" }, { "name": "Inno Setup", "bytes": "4337" }, { "name": "Java", "bytes": "2474269" }, { "name": "JavaScript", "bytes": "29076" }, { "name": "Lua", "bytes": "57672" }, { "name": "M4", "bytes": "53992" }, { "name": "Makefile", "bytes": "429637" }, { "name": "Metal", "bytes": "77540" }, { "name": "Module Management System", "bytes": "2080" }, { "name": "Objective-C", "bytes": "2017649" }, { "name": "Objective-C++", "bytes": "1337333" }, { "name": "PHP", "bytes": "2841" }, { "name": "Perl", "bytes": "57807" }, { "name": "PowerShell", "bytes": "1885" }, { "name": "Python", "bytes": "560198" }, { "name": "Roff", "bytes": "13545" }, { "name": "Ruby", "bytes": "66470" }, { "name": "Shell", "bytes": "1318758" }, { "name": "Swift", "bytes": "489000" }, { "name": "sed", "bytes": "236" } ], "symlink_target": "" }
from __future__ import absolute_import from sentry.mediators import Mediator, Param class Destroyer(Mediator): external_issue = Param("sentry.models.PlatformExternalIssue") def call(self): self._delete_external_issue() self._notify_sentry_app() return True def _delete_external_issue(self): self.external_issue.delete() def _notify_sentry_app(self): """ Placeholder until implemented. Planned but not prioritized yet. """
{ "content_hash": "d63f8af01df7362e3cd3dc8d1533b49b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 71, "avg_line_length": 25, "alnum_prop": 0.658, "repo_name": "beeftornado/sentry", "id": "6e34c6f7c1c2c10ca7ab6731b69e90e30065af13", "size": "500", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/sentry/mediators/external_issues/destroyer.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "157195" }, { "name": "HTML", "bytes": "197026" }, { "name": "JavaScript", "bytes": "380379" }, { "name": "Makefile", "bytes": "2832" }, { "name": "Python", "bytes": "6473603" } ], "symlink_target": "" }
<?php namespace tests; use Yii; /** * CarouselTest */ class CarouselTest extends \PHPUnit_Framework_TestCase { public function testWidget() { $view = Yii::$app->getView(); $content = $view->render('//carousel'); $actual = $view->render('//layouts/main', ['content' => $content]); $expected = file_get_contents(__DIR__ . '/data/test-carousel.bin'); $this->assertEquals($expected, $actual); } }
{ "content_hash": "326838e10b22682a29963a66da97f034", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 21.476190476190474, "alnum_prop": 0.5875831485587583, "repo_name": "2amigos/yii2-gallery-widget", "id": "6a245ca21b586398648aa228f7c7aeab53b3d5c8", "size": "638", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/CarouselTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "756" }, { "name": "PHP", "bytes": "14433" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1"> <file>file:/E:/xampp/htdocs/siska/bonfire/modules/matakuliah_prasyarat/controllers/jurusan.php</file> </open-files> </project-private>
{ "content_hash": "1b18732a94fa2602815a8c311153a03e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 109, "avg_line_length": 55.333333333333336, "alnum_prop": 0.713855421686747, "repo_name": "stttexmaco/sisfoakademik", "id": "f16ad3c0d5de0e8e502ec503205de2e3cb8bb03d", "size": "332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nbproject/private/private.xml", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "7951" }, { "name": "CSS", "bytes": "144733" }, { "name": "HTML", "bytes": "494137" }, { "name": "JavaScript", "bytes": "497768" }, { "name": "PHP", "bytes": "8024155" }, { "name": "Shell", "bytes": "401" } ], "symlink_target": "" }
var appServerProcess, childProcess = require('child_process'), PORT = 3123; exports.config = { 'directConnect' : true, 'allScriptsTimeout' : 3000, 'baseUrl' : 'http://localhost:' + PORT, 'specs' : ['./spec/integration/*.spec.js'], 'beforeLaunch' : function beforeLaunch() { appServerProcess = childProcess.spawn('./index.js', ['serve', '--port', PORT]); }, 'onCleanUp' : function onCleanUp() { appServerProcess.kill(); }, 'chromeDriver' : '../node_modules/.bin/chromedriver', 'capabilities' : { 'browserName': 'chrome', 'chromeOptions': { 'args': ['--headless', '--disable-gpu', '--window-size=800,600'] } } };
{ "content_hash": "855e4798ce481213de14df4cdc41a455", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 83, "avg_line_length": 24.379310344827587, "alnum_prop": 0.5770862800565771, "repo_name": "p1100i/generator-morf", "id": "f32b9bccf37da0286df058c9486647ef0892ab1a", "size": "707", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "generators/angular/templates/default/test/protractor.conf.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9783" }, { "name": "HTML", "bytes": "4775" }, { "name": "JavaScript", "bytes": "38279" }, { "name": "Shell", "bytes": "88" } ], "symlink_target": "" }
#ifndef MONGOC_CLIENT_PRIVATE_H #define MONGOC_CLIENT_PRIVATE_H #if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION) #error "Only <mongoc.h> can be included directly." #endif #include "bson.h" #include "mongoc-buffer-private.h" #include "mongoc-client.h" #include "mongoc-cluster-private.h" #include "mongoc-config.h" #include "mongoc-host-list.h" #include "mongoc-read-prefs.h" #include "mongoc-rpc-private.h" #include "mongoc-opcode.h" #ifdef MONGOC_ENABLE_SSL #include "mongoc-ssl.h" #endif #include "mongoc-stream.h" #include "mongoc-topology-private.h" #include "mongoc-write-concern.h" BSON_BEGIN_DECLS struct _mongoc_client_t { uint32_t request_id; mongoc_list_t *conns; mongoc_uri_t *uri; mongoc_cluster_t cluster; bool in_exhaust; mongoc_stream_initiator_t initiator; void *initiator_data; #ifdef MONGOC_ENABLE_SSL mongoc_ssl_opt_t ssl_opts; char *pem_subject; #endif mongoc_topology_t *topology; mongoc_read_prefs_t *read_prefs; mongoc_write_concern_t *write_concern; }; mongoc_client_t * _mongoc_client_new_from_uri (const mongoc_uri_t *uri, mongoc_topology_t *topology); mongoc_stream_t * mongoc_client_default_stream_initiator (const mongoc_uri_t *uri, const mongoc_host_list_t *host, void *user_data, bson_error_t *error); mongoc_stream_t * _mongoc_client_create_stream (mongoc_client_t *client, const mongoc_host_list_t *host, bson_error_t *error); uint32_t _mongoc_client_sendv (mongoc_client_t *client, mongoc_rpc_t *rpcs, size_t rpcs_len, uint32_t server_id, const mongoc_write_concern_t *write_concern, const mongoc_read_prefs_t *read_prefs, bson_error_t *error); bool _mongoc_client_recv (mongoc_client_t *client, mongoc_rpc_t *rpc, mongoc_buffer_t *buffer, uint32_t server_id, bson_error_t *error); bool _mongoc_client_recv_gle (mongoc_client_t *client, uint32_t hint, bson_t **gle_doc, bson_error_t *error); uint32_t _mongoc_client_preselect (mongoc_client_t *client, mongoc_opcode_t opcode, const mongoc_write_concern_t *write_concern, const mongoc_read_prefs_t *read_prefs, bson_error_t *error); void _mongoc_topology_background_thread_start (mongoc_topology_t *topology); void _mongoc_topology_background_thread_stop (mongoc_topology_t *topology); mongoc_server_description_t * _mongoc_client_get_server_description (mongoc_client_t *client, uint32_t server_id); bool _mongoc_client_command_simple_with_hint (mongoc_client_t *client, const char *db_name, const bson_t *command, const mongoc_read_prefs_t *read_prefs, bson_t *reply, uint32_t hint, bson_error_t *error); void _mongoc_client_kill_cursor (mongoc_client_t *client, uint32_t server_id, int64_t cursor_id); BSON_END_DECLS #endif /* MONGOC_CLIENT_PRIVATE_H */
{ "content_hash": "6d643b700a49497ba2350a18a1583090", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 79, "avg_line_length": 33.91129032258065, "alnum_prop": 0.4782401902497027, "repo_name": "matfur92/SwiftMongoDB", "id": "fe222f08a8beb85395a40c5c31369184e843f90e", "size": "4799", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "swiftMongoDB/dependencies/private/mongoc-client-private.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "385391" }, { "name": "C++", "bytes": "5923" }, { "name": "Objective-C", "bytes": "542" }, { "name": "Ruby", "bytes": "956" }, { "name": "Swift", "bytes": "42680" } ], "symlink_target": "" }
-- SQL to create the initial tables for the MediaWiki database. -- This is read and executed by the install script; you should -- not have to run it by itself unless doing a manual install. -- This is a shared schema file used for both MySQL and SQLite installs. -- -- General notes: -- -- If possible, create tables as InnoDB to benefit from the -- superior resiliency against crashes and ability to read -- during writes (and write during reads!) -- -- Only the 'searchindex' table requires MyISAM due to the -- requirement for fulltext index support, which is missing -- from InnoDB. -- -- -- The MySQL table backend for MediaWiki currently uses -- 14-character BINARY or VARBINARY fields to store timestamps. -- The format is YYYYMMDDHHMMSS, which is derived from the -- text format of MySQL's TIMESTAMP fields. -- -- Historically TIMESTAMP fields were used, but abandoned -- in early 2002 after a lot of trouble with the fields -- auto-updating. -- -- The Postgres backend uses TIMESTAMPTZ fields for timestamps, -- and we will migrate the MySQL definitions at some point as -- well. -- -- -- The /*_*/ comments in this and other files are -- replaced with the defined table prefix by the installer -- and updater scripts. If you are installing or running -- updates manually, you will need to manually insert the -- table prefix if any when running these scripts. -- -- -- The user table contains basic account information, -- authentication keys, etc. -- -- Some multi-wiki sites may share a single central user table -- between separate wikis using the $wgSharedDB setting. -- -- Note that when a external authentication plugin is used, -- user table entries still need to be created to store -- preferences and to key tracking information in the other -- tables. -- CREATE TABLE /*_*/user ( user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Usernames must be unique, must not be in the form of -- an IP address. _Shouldn't_ allow slashes or case -- conflicts. Spaces are allowed, and are _not_ converted -- to underscores like titles. See the User::newFromName() for -- the specific tests that usernames have to pass. user_name varchar(255) binary NOT NULL default '', -- Optional 'real name' to be displayed in credit listings user_real_name varchar(255) binary NOT NULL default '', -- Password hashes, see User::crypt() and User::comparePasswords() -- in User.php for the algorithm user_password tinyblob NOT NULL, -- When using 'mail me a new password', a random -- password is generated and the hash stored here. -- The previous password is left in place until -- someone actually logs in with the new password, -- at which point the hash is moved to user_password -- and the old password is invalidated. user_newpassword tinyblob NOT NULL, -- Timestamp of the last time when a new password was -- sent, for throttling and expiring purposes -- Emailed passwords will expire $wgNewPasswordExpiry -- (a week) after being set. If user_newpass_time is NULL -- (eg. created by mail) it doesn't expire. user_newpass_time binary(14), -- Note: email should be restricted, not public info. -- Same with passwords. user_email tinytext NOT NULL, -- If the browser sends an If-Modified-Since header, a 304 response is -- suppressed if the value in this field for the current user is later than -- the value in the IMS header. That is, this field is an invalidation timestamp -- for the browser cache of logged-in users. Among other things, it is used -- to prevent pages generated for a previously logged in user from being -- displayed after a session expiry followed by a fresh login. user_touched binary(14) NOT NULL default '', -- A pseudorandomly generated value that is stored in -- a cookie when the "remember password" feature is -- used (previously, a hash of the password was used, but -- this was vulnerable to cookie-stealing attacks) user_token binary(32) NOT NULL default '', -- Initially NULL; when a user's e-mail address has been -- validated by returning with a mailed token, this is -- set to the current timestamp. user_email_authenticated binary(14), -- Randomly generated token created when the e-mail address -- is set and a confirmation test mail sent. user_email_token binary(32), -- Expiration date for the user_email_token user_email_token_expires binary(14), -- Timestamp of account registration. -- Accounts predating this schema addition may contain NULL. user_registration binary(14), -- Count of edits and edit-like actions. -- -- *NOT* intended to be an accurate copy of COUNT(*) WHERE rev_user=user_id -- May contain NULL for old accounts if batch-update scripts haven't been -- run, as well as listing deleted edits and other myriad ways it could be -- out of sync. -- -- Meant primarily for heuristic checks to give an impression of whether -- the account has been used much. -- user_editcount int ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); CREATE INDEX /*i*/user_email ON /*_*/user (user_email(50)); -- -- User permissions have been broken out to a separate table; -- this allows sites with a shared user table to have different -- permissions assigned to a user in each project. -- -- This table replaces the old user_rights field which used a -- comma-separated blob. -- CREATE TABLE /*_*/user_groups ( -- Key to user_id ug_user int unsigned NOT NULL default 0, -- Group names are short symbolic string keys. -- The set of group names is open-ended, though in practice -- only some predefined ones are likely to be used. -- -- At runtime $wgGroupPermissions will associate group keys -- with particular permissions. A user will have the combined -- permissions of any group they're explicitly in, plus -- the implicit '*' and 'user' groups. ug_group varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); -- Stores the groups the user has once belonged to. -- The user may still belong to these groups (check user_groups). -- Users are not autopromoted to groups from which they were removed. CREATE TABLE /*_*/user_former_groups ( -- Key to user_id ufg_user int unsigned NOT NULL default 0, ufg_group varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ufg_user_group ON /*_*/user_former_groups (ufg_user,ufg_group); -- -- Stores notifications of user talk page changes, for the display -- of the "you have new messages" box -- CREATE TABLE /*_*/user_newtalk ( -- Key to user.user_id user_id int NOT NULL default 0, -- If the user is an anonymous user their IP address is stored here -- since the user_id of 0 is ambiguous user_ip varbinary(40) NOT NULL default '', -- The highest timestamp of revisions of the talk page viewed -- by this user user_last_timestamp varbinary(14) NULL default NULL ) /*$wgDBTableOptions*/; -- Indexes renamed for SQLite in 1.14 CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id); CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip); -- -- User preferences and perhaps other fun stuff. :) -- Replaces the old user.user_options blob, with a couple nice properties: -- -- 1) We only store non-default settings, so changes to the defauls -- are now reflected for everybody, not just new accounts. -- 2) We can more easily do bulk lookups, statistics, or modifications of -- saved options since it's a sane table structure. -- CREATE TABLE /*_*/user_properties ( -- Foreign key to user.user_id up_user int NOT NULL, -- Name of the option being saved. This is indexed for bulk lookup. up_property varbinary(255) NOT NULL, -- Property value as a string. up_value blob ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property); CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property); -- -- Core of the wiki: each page has an entry here which identifies -- it by title and contains some essential metadata. -- CREATE TABLE /*_*/page ( -- Unique identifier number. The page_id will be preserved across -- edits and rename operations, but not deletions and recreations. page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- A page name is broken into a namespace and a title. -- The namespace keys are UI-language-independent constants, -- defined in includes/Defines.php page_namespace int NOT NULL, -- The rest of the title, as text. -- Spaces are transformed into underscores in title storage. page_title varchar(255) binary NOT NULL, -- Comma-separated set of permission keys indicating who -- can move or edit the page. page_restrictions tinyblob NOT NULL, -- Number of times this page has been viewed. page_counter bigint unsigned NOT NULL default 0, -- 1 indicates the article is a redirect. page_is_redirect tinyint unsigned NOT NULL default 0, -- 1 indicates this is a new entry, with only one edit. -- Not all pages with one edit are new pages. page_is_new tinyint unsigned NOT NULL default 0, -- Random value between 0 and 1, used for Special:Randompage page_random real unsigned NOT NULL, -- This timestamp is updated whenever the page changes in -- a way requiring it to be re-rendered, invalidating caches. -- Aside from editing this includes permission changes, -- creation or deletion of linked pages, and alteration -- of contained templates. page_touched binary(14) NOT NULL default '', -- Handy key to revision.rev_id of the current revision. -- This may be 0 during page creation, but that shouldn't -- happen outside of a transaction... hopefully. page_latest int unsigned NOT NULL, -- Uncompressed length in bytes of the page's current source text. page_len int unsigned NOT NULL, -- content model, see CONTENT_MODEL_XXX constants page_content_model varbinary(32) DEFAULT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); CREATE INDEX /*i*/page_random ON /*_*/page (page_random); CREATE INDEX /*i*/page_len ON /*_*/page (page_len); CREATE INDEX /*i*/page_redirect_namespace_len ON /*_*/page (page_is_redirect, page_namespace, page_len); -- -- Every edit of a page creates also a revision row. -- This stores metadata about the revision, and a reference -- to the text storage backend. -- CREATE TABLE /*_*/revision ( -- Unique ID to identify each revision rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Key to page_id. This should _never_ be invalid. rev_page int unsigned NOT NULL, -- Key to text.old_id, where the actual bulk text is stored. -- It's possible for multiple revisions to use the same text, -- for instance revisions where only metadata is altered -- or a rollback to a previous version. rev_text_id int unsigned NOT NULL, -- Text comment summarizing the change. -- This text is shown in the history and other changes lists, -- rendered in a subset of wiki markup by Linker::formatComment() rev_comment tinyblob NOT NULL, -- Key to user.user_id of the user who made this edit. -- Stores 0 for anonymous edits and for some mass imports. rev_user int unsigned NOT NULL default 0, -- Text username or IP address of the editor. rev_user_text varchar(255) binary NOT NULL default '', -- Timestamp of when revision was created rev_timestamp binary(14) NOT NULL default '', -- Records whether the user marked the 'minor edit' checkbox. -- Many automated edits are marked as minor. rev_minor_edit tinyint unsigned NOT NULL default 0, -- Restrictions on who can access this revision rev_deleted tinyint unsigned NOT NULL default 0, -- Length of this revision in bytes rev_len int unsigned, -- Key to revision.rev_id -- This field is used to add support for a tree structure (The Adjacency List Model) rev_parent_id int unsigned default NULL, -- SHA-1 text content hash in base-36 rev_sha1 varbinary(32) NOT NULL default '', -- content model, see CONTENT_MODEL_XXX constants rev_content_model varbinary(32) DEFAULT NULL, -- content format, see CONTENT_FORMAT_XXX constants rev_content_format varbinary(64) DEFAULT NULL ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id); CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp); CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp); CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp); CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp); CREATE INDEX /*i*/page_user_timestamp ON /*_*/revision (rev_page,rev_user,rev_timestamp); -- -- Holds text of individual page revisions. -- -- Field names are a holdover from the 'old' revisions table in -- MediaWiki 1.4 and earlier: an upgrade will transform that -- table into the 'text' table to minimize unnecessary churning -- and downtime. If upgrading, the other fields will be left unused. -- CREATE TABLE /*_*/text ( -- Unique text storage key number. -- Note that the 'oldid' parameter used in URLs does *not* -- refer to this number anymore, but to rev_id. -- -- revision.rev_text_id is a key to this column old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Depending on the contents of the old_flags field, the text -- may be convenient plain text, or it may be funkily encoded. old_text mediumblob NOT NULL, -- Comma-separated list of flags: -- gzip: text is compressed with PHP's gzdeflate() function. -- utf8: text was stored as UTF-8. -- If $wgLegacyEncoding option is on, rows *without* this flag -- will be converted to UTF-8 transparently at load time. -- object: text field contained a serialized PHP object. -- The object either contains multiple versions compressed -- together to achieve a better compression ratio, or it refers -- to another row where the text can be found. old_flags tinyblob NOT NULL ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240; -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit -- -- Holding area for deleted articles, which may be viewed -- or restored by admins through the Special:Undelete interface. -- The fields generally correspond to the page, revision, and text -- fields, with several caveats. -- CREATE TABLE /*_*/archive ( ar_namespace int NOT NULL default 0, ar_title varchar(255) binary NOT NULL default '', -- Newly deleted pages will not store text in this table, -- but will reference the separately existing text rows. -- This field is retained for backwards compatibility, -- so old archived pages will remain accessible after -- upgrading from 1.4 to 1.5. -- Text may be gzipped or otherwise funky. ar_text mediumblob NOT NULL, -- Basic revision stuff... ar_comment tinyblob NOT NULL, ar_user int unsigned NOT NULL default 0, ar_user_text varchar(255) binary NOT NULL, ar_timestamp binary(14) NOT NULL default '', ar_minor_edit tinyint NOT NULL default 0, -- See ar_text note. ar_flags tinyblob NOT NULL, -- When revisions are deleted, their unique rev_id is stored -- here so it can be retained after undeletion. This is necessary -- to retain permalinks to given revisions after accidental delete -- cycles or messy operations like history merges. -- -- Old entries from 1.4 will be NULL here, and a new rev_id will -- be created on undeletion for those revisions. ar_rev_id int unsigned, -- For newly deleted revisions, this is the text.old_id key to the -- actual stored text. To avoid breaking the block-compression scheme -- and otherwise making storage changes harder, the actual text is -- *not* deleted from the text table, merely hidden by removal of the -- page and revision entries. -- -- Old entries deleted under 1.2-1.4 will have NULL here, and their -- ar_text and ar_flags fields will be used to create a new text -- row upon undeletion. ar_text_id int unsigned, -- rev_deleted for archives ar_deleted tinyint unsigned NOT NULL default 0, -- Length of this revision in bytes ar_len int unsigned, -- Reference to page_id. Useful for sysadmin fixing of large pages -- merged together in the archives, or for cleanly restoring a page -- at its original ID number if possible. -- -- Will be NULL for pages deleted prior to 1.11. ar_page_id int unsigned, -- Original previous revision ar_parent_id int unsigned default NULL, -- SHA-1 text content hash in base-36 ar_sha1 varbinary(32) NOT NULL default '', -- content model, see CONTENT_MODEL_XXX constants ar_content_model varbinary(32) DEFAULT NULL, -- content format, see CONTENT_FORMAT_XXX constants ar_content_format varbinary(64) DEFAULT NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp); CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp); CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id); -- -- Track page-to-page hyperlinks within the wiki. -- CREATE TABLE /*_*/pagelinks ( -- Key to the page_id of the page containing the link. pl_from int unsigned NOT NULL default 0, -- Key to page_namespace/page_title of the target page. -- The target page may or may not exist, and due to renames -- and deletions may refer to different page records as time -- goes by. pl_namespace int NOT NULL default 0, pl_title varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); -- -- Track template inclusions. -- CREATE TABLE /*_*/templatelinks ( -- Key to the page_id of the page containing the link. tl_from int unsigned NOT NULL default 0, -- Key to page_namespace/page_title of the target page. -- The target page may or may not exist, and due to renames -- and deletions may refer to different page records as time -- goes by. tl_namespace int NOT NULL default 0, tl_title varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); -- -- Track links to images *used inline* -- We don't distinguish live from broken links here, so -- they do not need to be changed on upload/removal. -- CREATE TABLE /*_*/imagelinks ( -- Key to page_id of the page containing the image / media link. il_from int unsigned NOT NULL default 0, -- Filename of target image. -- This is also the page_title of the file's description page; -- all such pages are in namespace 6 (NS_FILE). il_to varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); -- -- Track category inclusions *used inline* -- This tracks a single level of category membership -- CREATE TABLE /*_*/categorylinks ( -- Key to page_id of the page defined as a category member. cl_from int unsigned NOT NULL default 0, -- Name of the category. -- This is also the page_title of the category's description page; -- all such pages are in namespace 14 (NS_CATEGORY). cl_to varchar(255) binary NOT NULL default '', -- A binary string obtained by applying a sortkey generation algorithm -- (Collation::getSortKey()) to page_title, or cl_sortkey_prefix . "\n" -- . page_title if cl_sortkey_prefix is nonempty. cl_sortkey varbinary(230) NOT NULL default '', -- A prefix for the raw sortkey manually specified by the user, either via -- [[Category:Foo|prefix]] or {{defaultsort:prefix}}. If nonempty, it's -- concatenated with a line break followed by the page title before the sortkey -- conversion algorithm is run. We store this so that we can update -- collations without reparsing all pages. -- Note: If you change the length of this field, you also need to change -- code in LinksUpdate.php. See bug 25254. cl_sortkey_prefix varchar(255) binary NOT NULL default '', -- This isn't really used at present. Provided for an optional -- sorting method by approximate addition time. cl_timestamp timestamp NOT NULL, -- Stores $wgCategoryCollation at the time cl_sortkey was generated. This -- can be used to install new collation versions, tracking which rows are not -- yet updated. '' means no collation, this is a legacy row that needs to be -- updated by updateCollation.php. In the future, it might be possible to -- specify different collations per category. cl_collation varbinary(32) NOT NULL default '', -- Stores whether cl_from is a category, file, or other page, so we can -- paginate the three categories separately. This never has to be updated -- after the page is created, since none of these page types can be moved to -- any other. cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to); -- We always sort within a given category, and within a given type. FIXME: -- Formerly this index didn't cover cl_type (since that didn't exist), so old -- callers won't be using an index: fix this? CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from); -- Used by the API (and some extensions) CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp); -- FIXME: Not used, delete this CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation); -- -- Track all existing categories. Something is a category if 1) it has an en- -- try somewhere in categorylinks, or 2) it once did. Categories might not -- have corresponding pages, so they need to be tracked separately. -- CREATE TABLE /*_*/category ( -- Primary key cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Name of the category, in the same form as page_title (with underscores). -- If there is a category page corresponding to this category, by definition, -- it has this name (in the Category namespace). cat_title varchar(255) binary NOT NULL, -- The numbers of member pages (including categories and media), subcatego- -- ries, and Image: namespace members, respectively. These are signed to -- make underflow more obvious. We make the first number include the second -- two for better sorting: subtracting for display is easy, adding for order- -- ing is not. cat_pages int signed NOT NULL default 0, cat_subcats int signed NOT NULL default 0, cat_files int signed NOT NULL default 0 ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); -- For Special:Mostlinkedcategories CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); -- -- Track links to external URLs -- CREATE TABLE /*_*/externallinks ( -- page_id of the referring page el_from int unsigned NOT NULL default 0, -- The URL el_to blob NOT NULL, -- In the case of HTTP URLs, this is the URL with any username or password -- removed, and with the labels in the hostname reversed and converted to -- lower case. An extra dot is added to allow for matching of either -- example.com or *.example.com in a single scan. -- Example: -- http://user:password@sub.example.com/page.html -- becomes -- http://com.example.sub./page.html -- which allows for fast searching for all pages under example.com with the -- clause: -- WHERE el_index LIKE 'http://com.example.%' el_index blob NOT NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); -- -- Track interlanguage links -- CREATE TABLE /*_*/langlinks ( -- page_id of the referring page ll_from int unsigned NOT NULL default 0, -- Language code of the target ll_lang varbinary(20) NOT NULL default '', -- Title of the target, including namespace ll_title varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); -- -- Track inline interwiki links -- CREATE TABLE /*_*/iwlinks ( -- page_id of the referring page iwl_from int unsigned NOT NULL default 0, -- Interwiki prefix code of the target iwl_prefix varbinary(20) NOT NULL default '', -- Title of the target, including namespace iwl_title varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); CREATE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from); CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title); -- -- Contains a single row with some aggregate info -- on the state of the site. -- CREATE TABLE /*_*/site_stats ( -- The single row should contain 1 here. ss_row_id int unsigned NOT NULL, -- Total number of page views, if hit counters are enabled. ss_total_views bigint unsigned default 0, -- Total number of edits performed. ss_total_edits bigint unsigned default 0, -- An approximate count of pages matching the following criteria: -- * in namespace 0 -- * not a redirect -- * contains the text '[[' -- See Article::isCountable() in includes/Article.php ss_good_articles bigint unsigned default 0, -- Total pages, theoretically equal to SELECT COUNT(*) FROM page; except faster ss_total_pages bigint default '-1', -- Number of users, theoretically equal to SELECT COUNT(*) FROM user; ss_users bigint default '-1', -- Number of users that still edit ss_active_users bigint default '-1', -- Number of images, equivalent to SELECT COUNT(*) FROM image ss_images int default 0 ) /*$wgDBTableOptions*/; -- Pointless index to assuage developer superstitions CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id); -- -- Stores an ID for every time any article is visited; -- depending on $wgHitcounterUpdateFreq, it is -- periodically cleared and the page_counter column -- in the page table updated for all the articles -- that have been visited.) -- CREATE TABLE /*_*/hitcounter ( hc_id int unsigned NOT NULL ) ENGINE=HEAP MAX_ROWS=25000; -- -- The internet is full of jerks, alas. Sometimes it's handy -- to block a vandal or troll account. -- CREATE TABLE /*_*/ipblocks ( -- Primary key, introduced for privacy. ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Blocked IP address in dotted-quad form or user name. ipb_address tinyblob NOT NULL, -- Blocked user ID or 0 for IP blocks. ipb_user int unsigned NOT NULL default 0, -- User ID who made the block. ipb_by int unsigned NOT NULL default 0, -- User name of blocker ipb_by_text varchar(255) binary NOT NULL default '', -- Text comment made by blocker. ipb_reason tinyblob NOT NULL, -- Creation (or refresh) date in standard YMDHMS form. -- IP blocks expire automatically. ipb_timestamp binary(14) NOT NULL default '', -- Indicates that the IP address was banned because a banned -- user accessed a page through it. If this is 1, ipb_address -- will be hidden, and the block identified by block ID number. ipb_auto bool NOT NULL default 0, -- If set to 1, block applies only to logged-out users ipb_anon_only bool NOT NULL default 0, -- Block prevents account creation from matching IP addresses ipb_create_account bool NOT NULL default 1, -- Block triggers autoblocks ipb_enable_autoblock bool NOT NULL default '1', -- Time at which the block will expire. -- May be "infinity" ipb_expiry varbinary(14) NOT NULL default '', -- Start and end of an address range, in hexadecimal -- Size chosen to allow IPv6 -- FIXME: these fields were originally blank for single-IP blocks, -- but now they are populated. No migration was ever done. They -- should be fixed to be blank again for such blocks (bug 49504). ipb_range_start tinyblob NOT NULL, ipb_range_end tinyblob NOT NULL, -- Flag for entries hidden from users and Sysops ipb_deleted bool NOT NULL default 0, -- Block prevents user from accessing Special:Emailuser ipb_block_email bool NOT NULL default 0, -- Block allows user to edit their own talk page ipb_allow_usertalk bool NOT NULL default 0, -- ID of the block that caused this block to exist -- Autoblocks set this to the original block -- so that the original block being deleted also -- deletes the autoblocks ipb_parent_block_id int default NULL ) /*$wgDBTableOptions*/; -- Unique index to support "user already blocked" messages -- Any new options which prevent collisions should be included CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only); CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user); CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8)); CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp); CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry); CREATE INDEX /*i*/ipb_parent_block_id ON /*_*/ipblocks (ipb_parent_block_id); -- -- Uploaded images and other files. -- CREATE TABLE /*_*/image ( -- Filename. -- This is also the title of the associated description page, -- which will be in namespace 6 (NS_FILE). img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, -- File size in bytes. img_size int unsigned NOT NULL default 0, -- For images, size in pixels. img_width int NOT NULL default 0, img_height int NOT NULL default 0, -- Extracted Exif metadata stored as a serialized PHP array. img_metadata mediumblob NOT NULL, -- For images, bits per pixel if known. img_bits int NOT NULL default 0, -- Media type as defined by the MEDIATYPE_xxx constants img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, -- major part of a MIME media type as defined by IANA -- see http://www.iana.org/assignments/media-types/ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", -- minor part of a MIME media type as defined by IANA -- the minor parts are not required to adher to any standard -- but should be consistent throughout the database -- see http://www.iana.org/assignments/media-types/ img_minor_mime varbinary(100) NOT NULL default "unknown", -- Description field as entered by the uploader. -- This is displayed in image upload history and logs. img_description tinyblob NOT NULL, -- user_id and user_name of uploader. img_user int unsigned NOT NULL default 0, img_user_text varchar(255) binary NOT NULL, -- Time of the upload. img_timestamp varbinary(14) NOT NULL default '', -- SHA-1 content hash in base-36 img_sha1 varbinary(32) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp); -- Used by Special:ListFiles for sort-by-size CREATE INDEX /*i*/img_size ON /*_*/image (img_size); -- Used by Special:Newimages and Special:ListFiles CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp); -- Used in API and duplicate search CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1(10)); -- Used to get media of one type CREATE INDEX /*i*/img_media_mime ON /*_*/image (img_media_type,img_major_mime,img_minor_mime); -- -- Previous revisions of uploaded files. -- Awkwardly, image rows have to be moved into -- this table at re-upload time. -- CREATE TABLE /*_*/oldimage ( -- Base filename: key to image.img_name oi_name varchar(255) binary NOT NULL default '', -- Filename of the archived file. -- This is generally a timestamp and '!' prepended to the base name. oi_archive_name varchar(255) binary NOT NULL default '', -- Other fields as in image... oi_size int unsigned NOT NULL default 0, oi_width int NOT NULL default 0, oi_height int NOT NULL default 0, oi_bits int NOT NULL default 0, oi_description tinyblob NOT NULL, oi_user int unsigned NOT NULL default 0, oi_user_text varchar(255) binary NOT NULL, oi_timestamp binary(14) NOT NULL default '', oi_metadata mediumblob NOT NULL, oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", oi_minor_mime varbinary(100) NOT NULL default "unknown", oi_deleted tinyint unsigned NOT NULL default 0, oi_sha1 varbinary(32) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp); CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp); -- oi_archive_name truncated to 14 to avoid key length overflow CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14)); CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1(10)); -- -- Record of deleted file data -- CREATE TABLE /*_*/filearchive ( -- Unique row id fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Original base filename; key to image.img_name, page.page_title, etc fa_name varchar(255) binary NOT NULL default '', -- Filename of archived file, if an old revision fa_archive_name varchar(255) binary default '', -- Which storage bin (directory tree or object store) the file data -- is stored in. Should be 'deleted' for files that have been deleted; -- any other bin is not yet in use. fa_storage_group varbinary(16), -- SHA-1 of the file contents plus extension, used as a key for storage. -- eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg -- -- If NULL, the file was missing at deletion time or has been purged -- from the archival storage. fa_storage_key varbinary(64) default '', -- Deletion information, if this file is deleted. fa_deleted_user int, fa_deleted_timestamp binary(14) default '', fa_deleted_reason text, -- Duped fields from image fa_size int unsigned default 0, fa_width int default 0, fa_height int default 0, fa_metadata mediumblob, fa_bits int default 0, fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", fa_minor_mime varbinary(100) default "unknown", fa_description tinyblob, fa_user int unsigned default 0, fa_user_text varchar(255) binary, fa_timestamp binary(14) default '', -- Visibility of deleted revisions, bitfield fa_deleted tinyint unsigned NOT NULL default 0, -- sha1 hash of file content fa_sha1 varbinary(32) NOT NULL default '' ) /*$wgDBTableOptions*/; -- pick out by image name CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); -- pick out dupe files CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); -- sort by deletion time CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); -- sort by uploader CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp); -- find file by sha1, 10 bytes will be enough for hashes to be indexed CREATE INDEX /*i*/fa_sha1 ON /*_*/filearchive (fa_sha1(10)); -- -- Store information about newly uploaded files before they're -- moved into the actual filestore -- CREATE TABLE /*_*/uploadstash ( us_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- the user who uploaded the file. us_user int unsigned NOT NULL, -- file key. this is how applications actually search for the file. -- this might go away, or become the primary key. us_key varchar(255) NOT NULL, -- the original path us_orig_path varchar(255) NOT NULL, -- the temporary path at which the file is actually stored us_path varchar(255) NOT NULL, -- which type of upload the file came from (sometimes) us_source_type varchar(50), -- the date/time on which the file was added us_timestamp varbinary(14) NOT NULL, us_status varchar(50) NOT NULL, -- chunk counter starts at 0, current offset is stored in us_size us_chunk_inx int unsigned NULL, -- Serialized file properties from File::getPropsFromPath us_props blob, -- file size in bytes us_size int unsigned NOT NULL, -- this hash comes from File::sha1Base36(), and is 31 characters us_sha1 varchar(31) NOT NULL, us_mime varchar(255), -- Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, -- image-specific properties us_image_width int unsigned, us_image_height int unsigned, us_image_bits smallint unsigned ) /*$wgDBTableOptions*/; -- sometimes there's a delete for all of a user's stuff. CREATE INDEX /*i*/us_user ON /*_*/uploadstash (us_user); -- pick out files by key, enforce key uniqueness CREATE UNIQUE INDEX /*i*/us_key ON /*_*/uploadstash (us_key); -- the abandoned upload cleanup script needs this CREATE INDEX /*i*/us_timestamp ON /*_*/uploadstash (us_timestamp); -- -- Primarily a summary table for Special:Recentchanges, -- this table contains some additional info on edits from -- the last few days, see Article::editUpdates() -- CREATE TABLE /*_*/recentchanges ( rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, rc_timestamp varbinary(14) NOT NULL default '', -- This is no longer used rc_cur_time varbinary(14) NOT NULL default '', -- As in revision rc_user int unsigned NOT NULL default 0, rc_user_text varchar(255) binary NOT NULL, -- When pages are renamed, their RC entries do _not_ change. rc_namespace int NOT NULL default 0, rc_title varchar(255) binary NOT NULL default '', -- as in revision... rc_comment varchar(255) binary NOT NULL default '', rc_minor tinyint unsigned NOT NULL default 0, -- Edits by user accounts with the 'bot' rights key are -- marked with a 1 here, and will be hidden from the -- default view. rc_bot tinyint unsigned NOT NULL default 0, -- Set if this change corresponds to a page creation rc_new tinyint unsigned NOT NULL default 0, -- Key to page_id (was cur_id prior to 1.5). -- This will keep links working after moves while -- retaining the at-the-time name in the changes list. rc_cur_id int unsigned NOT NULL default 0, -- rev_id of the given revision rc_this_oldid int unsigned NOT NULL default 0, -- rev_id of the prior revision, for generating diff links. rc_last_oldid int unsigned NOT NULL default 0, -- The type of change entry (RC_EDIT,RC_NEW,RC_LOG,RC_EXTERNAL) rc_type tinyint unsigned NOT NULL default 0, -- If the Recent Changes Patrol option is enabled, -- users may mark edits as having been reviewed to -- remove a warning flag on the RC list. -- A value of 1 indicates the page has been reviewed. rc_patrolled tinyint unsigned NOT NULL default 0, -- Recorded IP address the edit was made from, if the -- $wgPutIPinRC option is enabled. rc_ip varbinary(40) NOT NULL default '', -- Text length in characters before -- and after the edit rc_old_len int, rc_new_len int, -- Visibility of recent changes items, bitfield rc_deleted tinyint unsigned NOT NULL default 0, -- Value corresonding to log_id, specific log entries rc_logid int unsigned NOT NULL default 0, -- Store log type info here, or null rc_log_type varbinary(255) NULL default NULL, -- Store log action or null rc_log_action varbinary(255) NULL default NULL, -- Log params rc_params blob NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); CREATE TABLE /*_*/watchlist ( -- Key to user.user_id wl_user int unsigned NOT NULL, -- Key to page_namespace/page_title -- Note that users may watch pages which do not exist yet, -- or existed in the past but have been deleted. wl_namespace int NOT NULL default 0, wl_title varchar(255) binary NOT NULL default '', -- Timestamp when user was last sent a notification e-mail; -- cleared when the user visits the page. wl_notificationtimestamp varbinary(14) ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); -- -- When using the default MySQL search backend, page titles -- and text are munged to strip markup, do Unicode case folding, -- and prepare the result for MySQL's fulltext index. -- -- This table must be MyISAM; InnoDB does not support the needed -- fulltext index. -- CREATE TABLE /*_*/searchindex ( -- Key to page_id si_page int unsigned NOT NULL, -- Munged version of title si_title varchar(255) NOT NULL default '', -- Munged version of body text si_text mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); -- -- Recognized interwiki link prefixes -- CREATE TABLE /*_*/interwiki ( -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") iw_prefix varchar(32) NOT NULL, -- The URL of the wiki, with "$1" as a placeholder for an article name. -- Any spaces in the name will be transformed to underscores before -- insertion. iw_url blob NOT NULL, -- The URL of the file api.php iw_api blob NOT NULL, -- The name of the database (for a connection to be established with wfGetLB( 'wikiid' )) iw_wikiid varchar(64) NOT NULL, -- A boolean value indicating whether the wiki is in this project -- (used, for example, to detect redirect loops) iw_local bool NOT NULL, -- Boolean value indicating whether interwiki transclusions are allowed. iw_trans tinyint NOT NULL default 0 ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix); -- -- Used for caching expensive grouped queries -- CREATE TABLE /*_*/querycache ( -- A key name, generally the base name of of the special page. qc_type varbinary(32) NOT NULL, -- Some sort of stored value. Sizes, counts... qc_value int unsigned NOT NULL default 0, -- Target namespace+title qc_namespace int NOT NULL default 0, qc_title varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); -- -- For a few generic cache operations if not using Memcached -- CREATE TABLE /*_*/objectcache ( keyname varbinary(255) NOT NULL default '' PRIMARY KEY, value mediumblob, exptime datetime ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); -- -- Cache of interwiki transclusion -- CREATE TABLE /*_*/transcache ( tc_url varbinary(255) NOT NULL, tc_contents text, tc_time binary(14) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url); CREATE TABLE /*_*/logging ( -- Log ID, for referring to this specific log entry, probably for deletion and such. log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Symbolic keys for the general log type and the action type -- within the log. The output format will be controlled by the -- action field, but only the type controls categorization. log_type varbinary(32) NOT NULL default '', log_action varbinary(32) NOT NULL default '', -- Timestamp. Duh. log_timestamp binary(14) NOT NULL default '19700101000000', -- The user who performed this action; key to user_id log_user int unsigned NOT NULL default 0, -- Name of the user who performed this action log_user_text varchar(255) binary NOT NULL default '', -- Key to the page affected. Where a user is the target, -- this will point to the user page. log_namespace int NOT NULL default 0, log_title varchar(255) binary NOT NULL default '', log_page int unsigned NULL, -- Freeform text. Interpreted as edit history comments. log_comment varchar(255) NOT NULL default '', -- miscellaneous parameters: -- LF separated list (old system) or serialized PHP array (new system) log_params blob NOT NULL, -- rev_deleted for logs log_deleted tinyint unsigned NOT NULL default 0 ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp); CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp); CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp); CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp); CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp); CREATE INDEX /*i*/type_action ON /*_*/logging (log_type, log_action, log_timestamp); CREATE TABLE /*_*/log_search ( -- The type of ID (rev ID, log ID, rev timestamp, username) ls_field varbinary(32) NOT NULL, -- The value of the ID ls_value varchar(255) NOT NULL, -- Key to log_id ls_log_id int unsigned NOT NULL default 0 ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id); CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); -- Jobs performed by parallel apache threads or a command-line daemon CREATE TABLE /*_*/job ( job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Command name -- Limited to 60 to prevent key length overflow job_cmd varbinary(60) NOT NULL default '', -- Namespace and title to act on -- Should be 0 and '' if the command does not operate on a title job_namespace int NOT NULL, job_title varchar(255) binary NOT NULL, -- Timestamp of when the job was inserted -- NULL for jobs added before addition of the timestamp job_timestamp varbinary(14) NULL default NULL, -- Any other parameters to the command -- Stored as a PHP serialized array, or an empty string if there are no parameters job_params blob NOT NULL, -- Random, non-unique, number used for job acquisition (for lock concurrency) job_random integer unsigned NOT NULL default 0, -- The number of times this job has been locked job_attempts integer unsigned NOT NULL default 0, -- Field that conveys process locks on rows via process UUIDs job_token varbinary(32) NOT NULL default '', -- Timestamp when the job was locked job_token_timestamp varbinary(14) NULL default NULL, -- Base 36 SHA1 of the job parameters relevant to detecting duplicates job_sha1 varbinary(32) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/job_sha1 ON /*_*/job (job_sha1); CREATE INDEX /*i*/job_cmd_token ON /*_*/job (job_cmd,job_token,job_random); CREATE INDEX /*i*/job_cmd_token_id ON /*_*/job (job_cmd,job_token,job_id); CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128)); CREATE INDEX /*i*/job_timestamp ON /*_*/job (job_timestamp); -- Details of updates to cached special pages CREATE TABLE /*_*/querycache_info ( -- Special page name -- Corresponds to a qc_type value qci_type varbinary(32) NOT NULL default '', -- Timestamp of last update qci_timestamp binary(14) NOT NULL default '19700101000000' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type); -- For each redirect, this table contains exactly one row defining its target CREATE TABLE /*_*/redirect ( -- Key to the page_id of the redirect page rd_from int unsigned NOT NULL default 0 PRIMARY KEY, -- Key to page_namespace/page_title of the target page. -- The target page may or may not exist, and due to renames -- and deletions may refer to different page records as time -- goes by. rd_namespace int NOT NULL default 0, rd_title varchar(255) binary NOT NULL default '', rd_interwiki varchar(32) default NULL, rd_fragment varchar(255) binary default NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); -- Used for caching expensive grouped queries that need two links (for example double-redirects) CREATE TABLE /*_*/querycachetwo ( -- A key name, generally the base name of of the special page. qcc_type varbinary(32) NOT NULL, -- Some sort of stored value. Sizes, counts... qcc_value int unsigned NOT NULL default 0, -- Target namespace+title qcc_namespace int NOT NULL default 0, qcc_title varchar(255) binary NOT NULL default '', -- Target namespace+title2 qcc_namespacetwo int NOT NULL default 0, qcc_titletwo varchar(255) binary NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); -- Used for storing page restrictions (i.e. protection levels) CREATE TABLE /*_*/page_restrictions ( -- Page to apply restrictions to (Foreign Key to page). pr_page int NOT NULL, -- The protection type (edit, move, etc) pr_type varbinary(60) NOT NULL, -- The protection level (Sysop, autoconfirmed, etc) pr_level varbinary(60) NOT NULL, -- Whether or not to cascade the protection down to pages transcluded. pr_cascade tinyint NOT NULL, -- Field for future support of per-user restriction. pr_user int NULL, -- Field for time-limited protection. pr_expiry varbinary(14) NULL, -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages) pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level); CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level); CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); -- Protected titles - nonexistent pages that have been protected CREATE TABLE /*_*/protected_titles ( pt_namespace int NOT NULL, pt_title varchar(255) binary NOT NULL, pt_user int unsigned NOT NULL, pt_reason tinyblob, pt_timestamp binary(14) NOT NULL, pt_expiry varbinary(14) NOT NULL default '', pt_create_perm varbinary(60) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title); CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp); -- Name/value pairs indexed by page_id CREATE TABLE /*_*/page_props ( pp_page int NOT NULL, pp_propname varbinary(60) NOT NULL, pp_value blob NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname); CREATE UNIQUE INDEX /*i*/pp_propname_page ON /*_*/page_props (pp_propname,pp_page); -- A table to log updates, one text key row per update. CREATE TABLE /*_*/updatelog ( ul_key varchar(255) NOT NULL PRIMARY KEY, ul_value blob ) /*$wgDBTableOptions*/; -- A table to track tags for revisions, logs and recent changes. CREATE TABLE /*_*/change_tag ( -- RCID for the change ct_rc_id int NULL, -- LOGID for the change ct_log_id int NULL, -- REVID for the change ct_rev_id int NULL, -- Tag applied ct_tag varchar(255) NOT NULL, -- Parameters for the tag, presently unused ct_params blob NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); -- Covering index, so we can pull all the info only out of the index. CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); -- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT -- that only works on MySQL 4.1+ CREATE TABLE /*_*/tag_summary ( -- RCID for the change ts_rc_id int NULL, -- LOGID for the change ts_log_id int NULL, -- REVID for the change ts_rev_id int NULL, -- Comma-separated list of tags ts_tags blob NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); CREATE TABLE /*_*/valid_tag ( vt_tag varchar(255) NOT NULL PRIMARY KEY ) /*$wgDBTableOptions*/; -- Table for storing localisation data CREATE TABLE /*_*/l10n_cache ( -- Language code lc_lang varbinary(32) NOT NULL, -- Cache key lc_key varchar(255) NOT NULL, -- Value lc_value mediumblob NOT NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key); -- Table for caching JSON message blobs for the resource loader CREATE TABLE /*_*/msg_resource ( -- Resource name mr_resource varbinary(255) NOT NULL, -- Language code mr_lang varbinary(32) NOT NULL, -- JSON blob mr_blob mediumblob NOT NULL, -- Timestamp of last update mr_timestamp binary(14) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang); -- Table for administering which message is contained in which resource CREATE TABLE /*_*/msg_resource_links ( mrl_resource varbinary(255) NOT NULL, -- Message key mrl_message varbinary(255) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource); -- Table caching which local files a module depends on that aren't -- registered directly, used for fast retrieval of file dependency. -- Currently only used for tracking images that CSS depends on CREATE TABLE /*_*/module_deps ( -- Module name md_module varbinary(255) NOT NULL, -- Skin name md_skin varbinary(32) NOT NULL, -- JSON blob with file dependencies md_deps mediumblob NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin); -- Holds all the sites known to the wiki. CREATE TABLE /*_*/sites ( -- Numeric id of the site site_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Global identifier for the site, ie 'enwiktionary' site_global_key varbinary(32) NOT NULL, -- Type of the site, ie 'mediawiki' site_type varbinary(32) NOT NULL, -- Group of the site, ie 'wikipedia' site_group varbinary(32) NOT NULL, -- Source of the site data, ie 'local', 'wikidata', 'my-magical-repo' site_source varbinary(32) NOT NULL, -- Language code of the sites primary language. site_language varbinary(32) NOT NULL, -- Protocol of the site, ie 'http://', 'irc://', '//' -- This field is an index for lookups and is build from type specific data in site_data. site_protocol varbinary(32) NOT NULL, -- Domain of the site in reverse order, ie 'org.mediawiki.www.' -- This field is an index for lookups and is build from type specific data in site_data. site_domain VARCHAR(255) NOT NULL, -- Type dependent site data. site_data BLOB NOT NULL, -- If site.tld/path/key:pageTitle should forward users to the page on -- the actual site, where "key" is the local identifier. site_forward bool NOT NULL, -- Type dependent site config. -- For instance if template transclusion should be allowed if it's a MediaWiki. site_config BLOB NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/sites_global_key ON /*_*/sites (site_global_key); CREATE INDEX /*i*/sites_type ON /*_*/sites (site_type); CREATE INDEX /*i*/sites_group ON /*_*/sites (site_group); CREATE INDEX /*i*/sites_source ON /*_*/sites (site_source); CREATE INDEX /*i*/sites_language ON /*_*/sites (site_language); CREATE INDEX /*i*/sites_protocol ON /*_*/sites (site_protocol); CREATE INDEX /*i*/sites_domain ON /*_*/sites (site_domain); CREATE INDEX /*i*/sites_forward ON /*_*/sites (site_forward); -- Links local site identifiers to their corresponding site. CREATE TABLE /*_*/site_identifiers ( -- Key on site.site_id si_site INT UNSIGNED NOT NULL, -- local key type, ie 'interwiki' or 'langlink' si_type varbinary(32) NOT NULL, -- local key value, ie 'en' or 'wiktionary' si_key varbinary(32) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/site_ids_type ON /*_*/site_identifiers (si_type, si_key); CREATE INDEX /*i*/site_ids_site ON /*_*/site_identifiers (si_site); CREATE INDEX /*i*/site_ids_key ON /*_*/site_identifiers (si_key); -- vim: sw=2 sts=2 et
{ "content_hash": "9c33b5217bbbeadf5c60e886dc8cf67b", "timestamp": "", "source": "github", "line_count": 1576, "max_line_length": 143, "avg_line_length": 37.10659898477157, "alnum_prop": 0.7063098495212038, "repo_name": "AngLi-Leon/peloton", "id": "d37ca47b663ea2db5e6a8e25d2be05b450ea5311", "size": "58480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mediawiki-dataset/schema-versions/0056.26-Sep-2013.2f02c77b4ef1d6a7d6a8e8862ead5592863d7988.tables.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "33324" }, { "name": "C++", "bytes": "5390546" }, { "name": "CMake", "bytes": "108537" }, { "name": "Java", "bytes": "44383" }, { "name": "PLpgSQL", "bytes": "5855" }, { "name": "Protocol Buffer", "bytes": "74081" }, { "name": "Python", "bytes": "61459" }, { "name": "Ruby", "bytes": "1310" }, { "name": "Shell", "bytes": "14523" } ], "symlink_target": "" }
/* ----------------------------------------------- /* Author : Vincent Garreau - vincentgarreau.com /* MIT license: http://opensource.org/licenses/MIT /* Demo / Generator : vincentgarreau.com/particles.js /* GitHub : github.com/VincentGarreau/particles.js /* How to use? : Check the GitHub README /* v2.0.0 /* ----------------------------------------------- */ var pJS = function(tag_id, params){ var canvas_el = document.querySelector('#'+tag_id+' > .particles-js-canvas-el'); /* particles.js variables with default values */ this.pJS = { canvas: { el: canvas_el, w: canvas_el.offsetWidth, h: canvas_el.offsetHeight }, particles: { number: { value: 400, density: { enable: true, value_area: 800 } }, color: { value: '#fff' }, shape: { type: 'circle', stroke: { width: 0, color: '#ff0000' }, polygon: { nb_sides: 5 }, image: { src: '', width: 100, height: 100 } }, opacity: { value: 1, random: false, anim: { enable: false, speed: 2, opacity_min: 0, sync: false } }, size: { value: 20, random: false, anim: { enable: false, speed: 20, size_min: 0, sync: false } }, line_linked: { enable: true, distance: 100, color: '#fff', opacity: 1, width: 1 }, move: { enable: true, speed: 2, direction: 'none', random: false, straight: false, out_mode: 'out', bounce: false, attract: { enable: false, rotateX: 3000, rotateY: 3000 } }, array: [] }, interactivity: { detect_on: 'canvas', events: { onhover: { enable: true, mode: 'grab' }, onclick: { enable: true, mode: 'push' }, resize: true }, modes: { grab:{ distance: 100, line_linked:{ opacity: 1 } }, bubble:{ distance: 200, size: 80, duration: 0.4 }, repulse:{ distance: 200, duration: 0.4 }, push:{ particles_nb: 4 }, remove:{ particles_nb: 2 } }, mouse:{} }, retina_detect: false, fn: { interact: {}, modes: {}, vendors:{} }, tmp: {} }; var pJS = this.pJS; /* params settings */ if(params){ Object.deepExtend(pJS, params); } pJS.tmp.obj = { size_value: pJS.particles.size.value, size_anim_speed: pJS.particles.size.anim.speed, move_speed: pJS.particles.move.speed, line_linked_distance: pJS.particles.line_linked.distance, line_linked_width: pJS.particles.line_linked.width, mode_grab_distance: pJS.interactivity.modes.grab.distance, mode_bubble_distance: pJS.interactivity.modes.bubble.distance, mode_bubble_size: pJS.interactivity.modes.bubble.size, mode_repulse_distance: pJS.interactivity.modes.repulse.distance }; pJS.fn.retinaInit = function(){ if(pJS.retina_detect && window.devicePixelRatio > 1){ pJS.canvas.pxratio = window.devicePixelRatio; pJS.tmp.retina = true; } else{ pJS.canvas.pxratio = 1; pJS.tmp.retina = false; } pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio; pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio; pJS.particles.size.value = pJS.tmp.obj.size_value * pJS.canvas.pxratio; pJS.particles.size.anim.speed = pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio; pJS.particles.move.speed = pJS.tmp.obj.move_speed * pJS.canvas.pxratio; pJS.particles.line_linked.distance = pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio; pJS.interactivity.modes.grab.distance = pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio; pJS.interactivity.modes.bubble.distance = pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio; pJS.particles.line_linked.width = pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio; pJS.interactivity.modes.bubble.size = pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio; pJS.interactivity.modes.repulse.distance = pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio; }; /* ---------- pJS functions - canvas ------------ */ pJS.fn.canvasInit = function(){ pJS.canvas.ctx = pJS.canvas.el.getContext('2d'); }; pJS.fn.canvasSize = function(){ pJS.canvas.el.width = pJS.canvas.w; pJS.canvas.el.height = pJS.canvas.h; if(pJS && pJS.interactivity.events.resize){ window.addEventListener('resize', function(){ pJS.canvas.w = pJS.canvas.el.offsetWidth; pJS.canvas.h = pJS.canvas.el.offsetHeight; /* resize canvas */ if(pJS.tmp.retina){ pJS.canvas.w *= pJS.canvas.pxratio; pJS.canvas.h *= pJS.canvas.pxratio; } pJS.canvas.el.width = pJS.canvas.w; pJS.canvas.el.height = pJS.canvas.h; /* repaint canvas on anim disabled */ if(!pJS.particles.move.enable){ pJS.fn.particlesEmpty(); pJS.fn.particlesCreate(); pJS.fn.particlesDraw(); pJS.fn.vendors.densityAutoParticles(); } /* density particles enabled */ pJS.fn.vendors.densityAutoParticles(); }); } }; pJS.fn.canvasPaint = function(){ pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h); }; pJS.fn.canvasClear = function(){ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h); }; /* --------- pJS functions - particles ----------- */ pJS.fn.particle = function(color, opacity, position){ /* size */ this.radius = (pJS.particles.size.random ? Math.random() : 1) * pJS.particles.size.value; if(pJS.particles.size.anim.enable){ this.size_status = false; this.vs = pJS.particles.size.anim.speed / 100; if(!pJS.particles.size.anim.sync){ this.vs = this.vs * Math.random(); } } /* position */ this.x = position ? position.x : Math.random() * pJS.canvas.w; this.y = position ? position.y : Math.random() * pJS.canvas.h; /* check position - into the canvas */ if(this.x > pJS.canvas.w - this.radius*2) this.x = this.x - this.radius; else if(this.x < this.radius*2) this.x = this.x + this.radius; if(this.y > pJS.canvas.h - this.radius*2) this.y = this.y - this.radius; else if(this.y < this.radius*2) this.y = this.y + this.radius; /* check position - avoid overlap */ if(pJS.particles.move.bounce){ pJS.fn.vendors.checkOverlap(this, position); } /* color */ this.color = {}; if(typeof(color.value) == 'object'){ if(color.value instanceof Array){ var color_selected = color.value[Math.floor(Math.random() * pJS.particles.color.value.length)]; this.color.rgb = hexToRgb(color_selected); }else{ if(color.value.r != undefined && color.value.g != undefined && color.value.b != undefined){ this.color.rgb = { r: color.value.r, g: color.value.g, b: color.value.b } } if(color.value.h != undefined && color.value.s != undefined && color.value.l != undefined){ this.color.hsl = { h: color.value.h, s: color.value.s, l: color.value.l } } } } else if(color.value == 'random'){ this.color.rgb = { r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0), g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0), b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0) } } else if(typeof(color.value) == 'string'){ this.color = color; this.color.rgb = hexToRgb(this.color.value); } /* opacity */ this.opacity = (pJS.particles.opacity.random ? Math.random() : 1) * pJS.particles.opacity.value; if(pJS.particles.opacity.anim.enable){ this.opacity_status = false; this.vo = pJS.particles.opacity.anim.speed / 100; if(!pJS.particles.opacity.anim.sync){ this.vo = this.vo * Math.random(); } } /* animation - velocity for speed */ var velbase = {} switch(pJS.particles.move.direction){ case 'top': velbase = { x:0, y:-1 }; break; case 'top-right': velbase = { x:0.5, y:-0.5 }; break; case 'right': velbase = { x:1, y:-0 }; break; case 'bottom-right': velbase = { x:0.5, y:0.5 }; break; case 'bottom': velbase = { x:0, y:1 }; break; case 'bottom-left': velbase = { x:-0.5, y:1 }; break; case 'left': velbase = { x:-1, y:0 }; break; case 'top-left': velbase = { x:-0.5, y:-0.5 }; break; default: velbase = { x:0, y:0 }; break; } if(pJS.particles.move.straight){ this.vx = velbase.x; this.vy = velbase.y; if(pJS.particles.move.random){ this.vx = this.vx * (Math.random()); this.vy = this.vy * (Math.random()); } }else{ this.vx = velbase.x + Math.random()-0.5; this.vy = velbase.y + Math.random()-0.5; } // var theta = 2.0 * Math.PI * Math.random(); // this.vx = Math.cos(theta); // this.vy = Math.sin(theta); this.vx_i = this.vx; this.vy_i = this.vy; /* if shape is image */ var shape_type = pJS.particles.shape.type; if(typeof(shape_type) == 'object'){ if(shape_type instanceof Array){ var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)]; this.shape = shape_selected; } }else{ this.shape = shape_type; } if(this.shape == 'image'){ var sh = pJS.particles.shape; this.img = { src: sh.image.src, ratio: sh.image.width / sh.image.height } if(!this.img.ratio) this.img.ratio = 1; if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg != undefined){ pJS.fn.vendors.createSvgImg(this); if(pJS.tmp.pushing){ this.img.loaded = false; } } } }; pJS.fn.particle.prototype.draw = function() { var p = this; if(p.radius_bubble != undefined){ var radius = p.radius_bubble; }else{ var radius = p.radius; } if(p.opacity_bubble != undefined){ var opacity = p.opacity_bubble; }else{ var opacity = p.opacity; } if(p.color.rgb){ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+opacity+')'; }else{ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+opacity+')'; } pJS.canvas.ctx.fillStyle = color_value; pJS.canvas.ctx.beginPath(); switch(p.shape){ case 'circle': pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false); break; case 'edge': pJS.canvas.ctx.rect(p.x-radius, p.y-radius, radius*2, radius*2); break; case 'triangle': pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x-radius, p.y+radius / 1.66, radius*2, 3, 2); break; case 'polygon': pJS.fn.vendors.drawShape( pJS.canvas.ctx, p.x - radius / (pJS.particles.shape.polygon.nb_sides/3.5), // startX p.y - radius / (2.66/3.5), // startY radius*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength pJS.particles.shape.polygon.nb_sides, // sideCountNumerator 1 // sideCountDenominator ); break; case 'star': pJS.fn.vendors.drawShape( pJS.canvas.ctx, p.x - radius*2 / (pJS.particles.shape.polygon.nb_sides/4), // startX p.y - radius / (2*2.66/3.5), // startY radius*2*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength pJS.particles.shape.polygon.nb_sides, // sideCountNumerator 2 // sideCountDenominator ); break; case 'image': function draw(){ pJS.canvas.ctx.drawImage( img_obj, p.x-radius, p.y-radius, radius*2, radius*2 / p.img.ratio ); } if(pJS.tmp.img_type == 'svg'){ var img_obj = p.img.obj; }else{ var img_obj = pJS.tmp.img_obj; } if(img_obj){ draw(); } break; } pJS.canvas.ctx.closePath(); if(pJS.particles.shape.stroke.width > 0){ pJS.canvas.ctx.strokeStyle = pJS.particles.shape.stroke.color; pJS.canvas.ctx.lineWidth = pJS.particles.shape.stroke.width; pJS.canvas.ctx.stroke(); } pJS.canvas.ctx.fill(); }; pJS.fn.particlesCreate = function(){ for(var i = 0; i < pJS.particles.number.value; i++) { pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value)); } }; pJS.fn.particlesUpdate = function(){ for(var i = 0; i < pJS.particles.array.length; i++){ /* the particle */ var p = pJS.particles.array[i]; // var d = ( dx = pJS.interactivity.mouse.click_pos_x - p.x ) * dx + ( dy = pJS.interactivity.mouse.click_pos_y - p.y ) * dy; // var f = -BANG_SIZE / d; // if ( d < BANG_SIZE ) { // var t = Math.atan2( dy, dx ); // p.vx = f * Math.cos(t); // p.vy = f * Math.sin(t); // } /* move the particle */ if(pJS.particles.move.enable){ var ms = pJS.particles.move.speed/2; p.x += p.vx * ms; p.y += p.vy * ms; } /* change opacity status */ if(pJS.particles.opacity.anim.enable) { if(p.opacity_status == true) { if(p.opacity >= pJS.particles.opacity.value) p.opacity_status = false; p.opacity += p.vo; }else { if(p.opacity <= pJS.particles.opacity.anim.opacity_min) p.opacity_status = true; p.opacity -= p.vo; } if(p.opacity < 0) p.opacity = 0; } /* change size */ if(pJS.particles.size.anim.enable){ if(p.size_status == true){ if(p.radius >= pJS.particles.size.value) p.size_status = false; p.radius += p.vs; }else{ if(p.radius <= pJS.particles.size.anim.size_min) p.size_status = true; p.radius -= p.vs; } if(p.radius < 0) p.radius = 0; } /* change particle position if it is out of canvas */ if(pJS.particles.move.out_mode == 'bounce'){ var new_pos = { x_left: p.radius, x_right: pJS.canvas.w, y_top: p.radius, y_bottom: pJS.canvas.h } }else{ var new_pos = { x_left: -p.radius, x_right: pJS.canvas.w + p.radius, y_top: -p.radius, y_bottom: pJS.canvas.h + p.radius } } if(p.x - p.radius > pJS.canvas.w){ p.x = new_pos.x_left; p.y = Math.random() * pJS.canvas.h; } else if(p.x + p.radius < 0){ p.x = new_pos.x_right; p.y = Math.random() * pJS.canvas.h; } if(p.y - p.radius > pJS.canvas.h){ p.y = new_pos.y_top; p.x = Math.random() * pJS.canvas.w; } else if(p.y + p.radius < 0){ p.y = new_pos.y_bottom; p.x = Math.random() * pJS.canvas.w; } /* out of canvas modes */ switch(pJS.particles.move.out_mode){ case 'bounce': if (p.x + p.radius > pJS.canvas.w) p.vx = -p.vx; else if (p.x - p.radius < 0) p.vx = -p.vx; if (p.y + p.radius > pJS.canvas.h) p.vy = -p.vy; else if (p.y - p.radius < 0) p.vy = -p.vy; break; } /* events */ if(isInArray('grab', pJS.interactivity.events.onhover.mode)){ pJS.fn.modes.grabParticle(p); } if(isInArray('bubble', pJS.interactivity.events.onhover.mode) || isInArray('bubble', pJS.interactivity.events.onclick.mode)){ pJS.fn.modes.bubbleParticle(p); } if(isInArray('repulse', pJS.interactivity.events.onhover.mode) || isInArray('repulse', pJS.interactivity.events.onclick.mode)){ pJS.fn.modes.repulseParticle(p); } /* interaction auto between particles */ if(pJS.particles.line_linked.enable || pJS.particles.move.attract.enable){ for(var j = i + 1; j < pJS.particles.array.length; j++){ var p2 = pJS.particles.array[j]; /* link particles */ if(pJS.particles.line_linked.enable){ pJS.fn.interact.linkParticles(p,p2); } /* attract particles */ if(pJS.particles.move.attract.enable){ pJS.fn.interact.attractParticles(p,p2); } /* bounce particles */ if(pJS.particles.move.bounce){ pJS.fn.interact.bounceParticles(p,p2); } } } } }; pJS.fn.particlesDraw = function(){ /* clear canvas */ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h); /* update each particles param */ pJS.fn.particlesUpdate(); /* draw each particle */ for(var i = 0; i < pJS.particles.array.length; i++){ var p = pJS.particles.array[i]; p.draw(); } }; pJS.fn.particlesEmpty = function(){ pJS.particles.array = []; }; pJS.fn.particlesRefresh = function(){ /* init all */ cancelRequestAnimFrame(pJS.fn.checkAnimFrame); cancelRequestAnimFrame(pJS.fn.drawAnimFrame); pJS.tmp.source_svg = undefined; pJS.tmp.img_obj = undefined; pJS.tmp.count_svg = 0; pJS.fn.particlesEmpty(); pJS.fn.canvasClear(); /* restart */ pJS.fn.vendors.start(); }; /* ---------- pJS functions - particles interaction ------------ */ pJS.fn.interact.linkParticles = function(p1, p2){ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); /* draw a line between p1 and p2 if the distance between them is under the config distance */ if(dist <= pJS.particles.line_linked.distance){ var opacity_line = pJS.particles.line_linked.opacity - (dist / (1/pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance; if(opacity_line > 0){ /* style */ var color_line = pJS.particles.line_linked.color_rgb_line; pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')'; pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width; //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */ /* path */ pJS.canvas.ctx.beginPath(); pJS.canvas.ctx.moveTo(p1.x, p1.y); pJS.canvas.ctx.lineTo(p2.x, p2.y); pJS.canvas.ctx.stroke(); pJS.canvas.ctx.closePath(); } } }; pJS.fn.interact.attractParticles = function(p1, p2){ /* condensed particles */ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); if(dist <= pJS.particles.line_linked.distance){ var ax = dx/(pJS.particles.move.attract.rotateX*1000), ay = dy/(pJS.particles.move.attract.rotateY*1000); p1.vx -= ax; p1.vy -= ay; p2.vx += ax; p2.vy += ay; } } pJS.fn.interact.bounceParticles = function(p1, p2){ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy), dist_p = p1.radius+p2.radius; if(dist <= dist_p){ p1.vx = -p1.vx; p1.vy = -p1.vy; p2.vx = -p2.vx; p2.vy = -p2.vy; } } /* ---------- pJS functions - modes events ------------ */ pJS.fn.modes.pushParticles = function(nb, pos){ pJS.tmp.pushing = true; for(var i = 0; i < nb; i++){ pJS.particles.array.push( new pJS.fn.particle( pJS.particles.color, pJS.particles.opacity.value, { 'x': pos ? pos.pos_x : Math.random() * pJS.canvas.w, 'y': pos ? pos.pos_y : Math.random() * pJS.canvas.h } ) ) if(i == nb-1){ if(!pJS.particles.move.enable){ pJS.fn.particlesDraw(); } pJS.tmp.pushing = false; } } }; pJS.fn.modes.removeParticles = function(nb){ pJS.particles.array.splice(0, nb); if(!pJS.particles.move.enable){ pJS.fn.particlesDraw(); } }; pJS.fn.modes.bubbleParticle = function(p){ /* on hover event */ if(pJS.interactivity.events.onhover.enable && isInArray('bubble', pJS.interactivity.events.onhover.mode)){ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse), ratio = 1 - dist_mouse / pJS.interactivity.modes.bubble.distance; function init(){ p.opacity_bubble = p.opacity; p.radius_bubble = p.radius; } /* mousemove - check ratio */ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){ if(ratio >= 0 && pJS.interactivity.status == 'mousemove'){ /* size */ if(pJS.interactivity.modes.bubble.size != pJS.particles.size.value){ if(pJS.interactivity.modes.bubble.size > pJS.particles.size.value){ var size = p.radius + (pJS.interactivity.modes.bubble.size*ratio); if(size >= 0){ p.radius_bubble = size; } }else{ var dif = p.radius - pJS.interactivity.modes.bubble.size, size = p.radius - (dif*ratio); if(size > 0){ p.radius_bubble = size; }else{ p.radius_bubble = 0; } } } /* opacity */ if(pJS.interactivity.modes.bubble.opacity != pJS.particles.opacity.value){ if(pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value){ var opacity = pJS.interactivity.modes.bubble.opacity*ratio; if(opacity > p.opacity && opacity <= pJS.interactivity.modes.bubble.opacity){ p.opacity_bubble = opacity; } }else{ var opacity = p.opacity - (pJS.particles.opacity.value-pJS.interactivity.modes.bubble.opacity)*ratio; if(opacity < p.opacity && opacity >= pJS.interactivity.modes.bubble.opacity){ p.opacity_bubble = opacity; } } } } }else{ init(); } /* mouseleave */ if(pJS.interactivity.status == 'mouseleave'){ init(); } } /* on click event */ else if(pJS.interactivity.events.onclick.enable && isInArray('bubble', pJS.interactivity.events.onclick.mode)){ if(pJS.tmp.bubble_clicking){ var dx_mouse = p.x - pJS.interactivity.mouse.click_pos_x, dy_mouse = p.y - pJS.interactivity.mouse.click_pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse), time_spent = (new Date().getTime() - pJS.interactivity.mouse.click_time)/1000; if(time_spent > pJS.interactivity.modes.bubble.duration){ pJS.tmp.bubble_duration_end = true; } if(time_spent > pJS.interactivity.modes.bubble.duration*2){ pJS.tmp.bubble_clicking = false; pJS.tmp.bubble_duration_end = false; } } function process(bubble_param, particles_param, p_obj_bubble, p_obj, id){ if(bubble_param != particles_param){ if(!pJS.tmp.bubble_duration_end){ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){ if(p_obj_bubble != undefined) var obj = p_obj_bubble; else var obj = p_obj; if(obj != bubble_param){ var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration); if(id == 'size') p.radius_bubble = value; if(id == 'opacity') p.opacity_bubble = value; } }else{ if(id == 'size') p.radius_bubble = undefined; if(id == 'opacity') p.opacity_bubble = undefined; } }else{ if(p_obj_bubble != undefined){ var value_tmp = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration), dif = bubble_param - value_tmp; value = bubble_param + dif; if(id == 'size') p.radius_bubble = value; if(id == 'opacity') p.opacity_bubble = value; } } } } if(pJS.tmp.bubble_clicking){ /* size */ process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size'); /* opacity */ process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity'); } } }; pJS.fn.modes.repulseParticle = function(p){ if(pJS.interactivity.events.onhover.enable && isInArray('repulse', pJS.interactivity.events.onhover.mode) && pJS.interactivity.status == 'mousemove') { var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse); var normVec = {x: dx_mouse/dist_mouse, y: dy_mouse/dist_mouse}, repulseRadius = pJS.interactivity.modes.repulse.distance, velocity = 100, repulseFactor = clamp((1/repulseRadius)*(-1*Math.pow(dist_mouse/repulseRadius,2)+1)*repulseRadius*velocity, 0, 50); var pos = { x: p.x + normVec.x * repulseFactor, y: p.y + normVec.y * repulseFactor } if(pJS.particles.move.out_mode == 'bounce'){ if(pos.x - p.radius > 0 && pos.x + p.radius < pJS.canvas.w) p.x = pos.x; if(pos.y - p.radius > 0 && pos.y + p.radius < pJS.canvas.h) p.y = pos.y; }else{ p.x = pos.x; p.y = pos.y; } } else if(pJS.interactivity.events.onclick.enable && isInArray('repulse', pJS.interactivity.events.onclick.mode)) { if(!pJS.tmp.repulse_finish){ pJS.tmp.repulse_count++; if(pJS.tmp.repulse_count == pJS.particles.array.length){ pJS.tmp.repulse_finish = true; } } if(pJS.tmp.repulse_clicking){ var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance/6, 3); var dx = pJS.interactivity.mouse.click_pos_x - p.x, dy = pJS.interactivity.mouse.click_pos_y - p.y, d = dx*dx + dy*dy; var force = -repulseRadius / d * 1; function process(){ var f = Math.atan2(dy,dx); p.vx = force * Math.cos(f); p.vy = force * Math.sin(f); if(pJS.particles.move.out_mode == 'bounce'){ var pos = { x: p.x + p.vx, y: p.y + p.vy } if (pos.x + p.radius > pJS.canvas.w) p.vx = -p.vx; else if (pos.x - p.radius < 0) p.vx = -p.vx; if (pos.y + p.radius > pJS.canvas.h) p.vy = -p.vy; else if (pos.y - p.radius < 0) p.vy = -p.vy; } } // default if(d <= repulseRadius){ process(); } // bang - slow motion mode // if(!pJS.tmp.repulse_finish){ // if(d <= repulseRadius){ // process(); // } // }else{ // process(); // } }else{ if(pJS.tmp.repulse_clicking == false){ p.vx = p.vx_i; p.vy = p.vy_i; } } } } pJS.fn.modes.grabParticle = function(p){ if(pJS.interactivity.events.onhover.enable && pJS.interactivity.status == 'mousemove'){ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse); /* draw a line between the cursor and the particle if the distance between them is under the config distance */ if(dist_mouse <= pJS.interactivity.modes.grab.distance){ var opacity_line = pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1/pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance; if(opacity_line > 0){ /* style */ var color_line = pJS.particles.line_linked.color_rgb_line; pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')'; pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width; //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */ /* path */ pJS.canvas.ctx.beginPath(); pJS.canvas.ctx.moveTo(p.x, p.y); pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y); pJS.canvas.ctx.stroke(); pJS.canvas.ctx.closePath(); } } } }; /* ---------- pJS functions - vendors ------------ */ pJS.fn.vendors.eventsListeners = function(){ /* events target element */ if(pJS.interactivity.detect_on == 'window'){ pJS.interactivity.el = window; }else{ pJS.interactivity.el = pJS.canvas.el; } /* detect mouse pos - on hover / click event */ if(pJS.interactivity.events.onhover.enable || pJS.interactivity.events.onclick.enable){ /* el on mousemove */ pJS.interactivity.el.addEventListener('mousemove', function(e){ if(pJS.interactivity.el == window){ var pos_x = e.clientX, pos_y = e.clientY; } else{ var pos_x = e.offsetX || e.clientX, pos_y = e.offsetY || e.clientY; } pJS.interactivity.mouse.pos_x = pos_x; pJS.interactivity.mouse.pos_y = pos_y; if(pJS.tmp.retina){ pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio; pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio; } pJS.interactivity.status = 'mousemove'; }); /* el on onmouseleave */ pJS.interactivity.el.addEventListener('mouseleave', function(e){ pJS.interactivity.mouse.pos_x = null; pJS.interactivity.mouse.pos_y = null; pJS.interactivity.status = 'mouseleave'; }); } /* on click event */ if(pJS.interactivity.events.onclick.enable){ pJS.interactivity.el.addEventListener('click', function(){ pJS.interactivity.mouse.click_pos_x = pJS.interactivity.mouse.pos_x; pJS.interactivity.mouse.click_pos_y = pJS.interactivity.mouse.pos_y; pJS.interactivity.mouse.click_time = new Date().getTime(); if(pJS.interactivity.events.onclick.enable){ switch(pJS.interactivity.events.onclick.mode){ case 'push': if(pJS.particles.move.enable){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse); }else{ if(pJS.interactivity.modes.push.particles_nb == 1){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse); } else if(pJS.interactivity.modes.push.particles_nb > 1){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb); } } break; case 'remove': pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb); break; case 'bubble': pJS.tmp.bubble_clicking = true; break; case 'repulse': pJS.tmp.repulse_clicking = true; pJS.tmp.repulse_count = 0; pJS.tmp.repulse_finish = false; setTimeout(function(){ pJS.tmp.repulse_clicking = false; }, pJS.interactivity.modes.repulse.duration*1000) break; } } }); } }; pJS.fn.vendors.densityAutoParticles = function(){ if(pJS.particles.number.density.enable){ /* calc area */ var area = pJS.canvas.el.width * pJS.canvas.el.height / 1000; if(pJS.tmp.retina){ area = area/(pJS.canvas.pxratio*2); } /* calc number of particles based on density area */ var nb_particles = area * pJS.particles.number.value / pJS.particles.number.density.value_area; /* add or remove X particles */ var missing_particles = pJS.particles.array.length - nb_particles; if(missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles)); else pJS.fn.modes.removeParticles(missing_particles); } }; pJS.fn.vendors.checkOverlap = function(p1, position){ for(var i = 0; i < pJS.particles.array.length; i++){ var p2 = pJS.particles.array[i]; var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); if(dist <= p1.radius + p2.radius){ p1.x = position ? position.x : Math.random() * pJS.canvas.w; p1.y = position ? position.y : Math.random() * pJS.canvas.h; pJS.fn.vendors.checkOverlap(p1); } } }; pJS.fn.vendors.createSvgImg = function(p){ /* set color to svg element */ var svgXml = pJS.tmp.source_svg, rgbHex = /#([0-9A-F]{3,6})/gi, coloredSvgXml = svgXml.replace(rgbHex, function (m, r, g, b) { if(p.color.rgb){ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')'; }else{ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')'; } return color_value; }); /* prepare to create img with colored svg */ var svg = new Blob([coloredSvgXml], {type: 'image/svg+xml;charset=utf-8'}), DOMURL = window.URL || window.webkitURL || window, url = DOMURL.createObjectURL(svg); /* create particle img obj */ var img = new Image(); img.addEventListener('load', function(){ p.img.obj = img; p.img.loaded = true; DOMURL.revokeObjectURL(url); pJS.tmp.count_svg++; }); img.src = url; }; pJS.fn.vendors.destroypJS = function(){ cancelAnimationFrame(pJS.fn.drawAnimFrame); canvas_el.remove(); pJSDom = null; }; pJS.fn.vendors.drawShape = function(c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator){ // By Programming Thomas - https://programmingthomas.wordpress.com/2013/04/03/n-sided-shapes/ var sideCount = sideCountNumerator * sideCountDenominator; var decimalSides = sideCountNumerator / sideCountDenominator; var interiorAngleDegrees = (180 * (decimalSides - 2)) / decimalSides; var interiorAngle = Math.PI - Math.PI * interiorAngleDegrees / 180; // convert to radians c.save(); c.beginPath(); c.translate(startX, startY); c.moveTo(0,0); for (var i = 0; i < sideCount; i++) { c.lineTo(sideLength,0); c.translate(sideLength,0); c.rotate(interiorAngle); } //c.stroke(); c.fill(); c.restore(); }; pJS.fn.vendors.exportImg = function(){ window.open(pJS.canvas.el.toDataURL('image/png'), '_blank'); }; pJS.fn.vendors.loadImg = function(type){ pJS.tmp.img_error = undefined; if(pJS.particles.shape.image.src != ''){ if(type == 'svg'){ var xhr = new XMLHttpRequest(); xhr.open('GET', pJS.particles.shape.image.src); xhr.onreadystatechange = function (data) { if(xhr.readyState == 4){ if(xhr.status == 200){ pJS.tmp.source_svg = data.currentTarget.response; pJS.fn.vendors.checkBeforeDraw(); }else{ console.log('Error pJS - Image not found'); pJS.tmp.img_error = true; } } } xhr.send(); }else{ var img = new Image(); img.addEventListener('load', function(){ pJS.tmp.img_obj = img; pJS.fn.vendors.checkBeforeDraw(); }); img.src = pJS.particles.shape.image.src; } }else{ console.log('Error pJS - No image.src'); pJS.tmp.img_error = true; } }; pJS.fn.vendors.draw = function(){ if(pJS.particles.shape.type == 'image'){ if(pJS.tmp.img_type == 'svg'){ if(pJS.tmp.count_svg >= pJS.particles.number.value){ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); }else{ //console.log('still loading...'); if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } }else{ if(pJS.tmp.img_obj != undefined){ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); }else{ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } } }else{ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } }; pJS.fn.vendors.checkBeforeDraw = function(){ // if shape is image if(pJS.particles.shape.type == 'image'){ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg == undefined){ pJS.tmp.checkAnimFrame = requestAnimFrame(check); }else{ //console.log('images loaded! cancel check'); cancelRequestAnimFrame(pJS.tmp.checkAnimFrame); if(!pJS.tmp.img_error){ pJS.fn.vendors.init(); pJS.fn.vendors.draw(); } } }else{ pJS.fn.vendors.init(); pJS.fn.vendors.draw(); } }; pJS.fn.vendors.init = function(){ /* init canvas + particles */ pJS.fn.retinaInit(); pJS.fn.canvasInit(); pJS.fn.canvasSize(); pJS.fn.canvasPaint(); pJS.fn.particlesCreate(); pJS.fn.vendors.densityAutoParticles(); /* particles.line_linked - convert hex colors to rgb */ pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color); }; pJS.fn.vendors.start = function(){ if(isInArray('image', pJS.particles.shape.type)){ pJS.tmp.img_type = pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3); pJS.fn.vendors.loadImg(pJS.tmp.img_type); }else{ pJS.fn.vendors.checkBeforeDraw(); } }; /* ---------- pJS - start ------------ */ pJS.fn.vendors.eventsListeners(); pJS.fn.vendors.start(); }; /* ---------- global functions - vendors ------------ */ Object.deepExtend = function(destination, source) { for (var property in source) { if (source[property] && source[property].constructor && source[property].constructor === Object) { destination[property] = destination[property] || {}; arguments.callee(destination[property], source[property]); } else { destination[property] = source[property]; } } return destination; }; window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){ window.setTimeout(callback, 1000 / 60); }; })(); window.cancelRequestAnimFrame = ( function() { return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout } )(); function hexToRgb(hex){ // By Tim Down - http://stackoverflow.com/a/5624139/3493650 // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace(shorthandRegex, function(m, r, g, b) { return r + r + g + g + b + b; }); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; }; function clamp(number, min, max) { return Math.min(Math.max(number, min), max); }; function isInArray(value, array) { return array.indexOf(value) > -1; } /* ---------- particles.js functions - start ------------ */ window.pJSDom = []; window.particlesJS = function(tag_id, params){ //console.log(params); /* no string id? so it's object params, and set the id with default id */ if(typeof(tag_id) != 'string'){ params = tag_id; tag_id = 'particles-js'; } /* no id? set the id to default id */ if(!tag_id){ tag_id = 'particles-js'; } /* pJS elements */ var pJS_tag = document.getElementById(tag_id), pJS_canvas_class = 'particles-js-canvas-el', exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class); /* remove canvas if exists into the pJS target tag */ if(exist_canvas.length){ while(exist_canvas.length > 0){ pJS_tag.removeChild(exist_canvas[0]); } } /* create canvas element */ var canvas_el = document.createElement('canvas'); canvas_el.className = pJS_canvas_class; /* set size canvas */ canvas_el.style.width = "100%"; //canvas_el.style.height = "100%"; /* append canvas */ var canvas = document.getElementById(tag_id).appendChild(canvas_el); /* launch particle.js */ if(canvas != null){ pJSDom.push(new pJS(tag_id, params)); } }; window.particlesJS.load = function(tag_id, path_config_json, callback){ /* load json config */ var xhr = new XMLHttpRequest(); xhr.open('GET', path_config_json); xhr.onreadystatechange = function (data) { if(xhr.readyState == 4){ if(xhr.status == 200){ var params = JSON.parse(data.currentTarget.response); window.particlesJS(tag_id, params); if(callback) callback(); }else{ console.log('Error pJS - XMLHttpRequest status: '+xhr.status); console.log('Error pJS - File config not found'); } } }; xhr.send(); };
{ "content_hash": "fc16ced2382ae7a61ce7d15fc005e685", "timestamp": "", "source": "github", "line_count": 1541, "max_line_length": 186, "avg_line_length": 27.911096690460738, "alnum_prop": 0.5542303131756993, "repo_name": "sumitsohani/sumitsohani.github.io", "id": "f7e3071f872b283534f7968a3454b593dcd88561", "size": "43011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "particles.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "150227" }, { "name": "HTML", "bytes": "4465" }, { "name": "JavaScript", "bytes": "49392" } ], "symlink_target": "" }
 using Evolution.Framework; using Microsoft.AspNetCore.Http; using Evolution.Domain.Entity.SystemManage; using System.Collections.Generic; using System.Linq; using Evolution.Data; using Evolution.Domain.IRepository.SystemManage; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; namespace Evolution.Application.SystemManage { public class ItemsDetailService : IItemsDetailService { private IItemsDetailRepository service = null; public ItemsDetailService(IItemsDetailRepository service) { this.service = service; } public Task<List<ItemsDetailEntity>> GetList(string itemId = "", string keyword = "") { var expression = ExtLinq.True<ItemsDetailEntity>(); if (!string.IsNullOrEmpty(itemId)) { expression = expression.And(t => t.ItemId == itemId); } if (!string.IsNullOrEmpty(keyword)) { expression = expression.And(t => t.ItemName.Contains(keyword)); expression = expression.Or(t => t.ItemCode.Contains(keyword)); } return service.IQueryable(expression).OrderBy(t => t.SortCode).ToListAsync(); } public Task<List<ItemsDetailEntity>> GetItemList(string enCode) { return service.GetItemList(enCode); } public Task<ItemsDetailEntity> GetForm(string keyValue) { return service.FindEntityAsync(keyValue); } public Task<int> Delete(string keyValue) { return service.DeleteAsync(t => t.Id == keyValue); } public Task<int> Save(ItemsDetailEntity itemsDetailEntity, string keyValue,HttpContext context) { if (!string.IsNullOrEmpty(keyValue)) { itemsDetailEntity.AttachModifyInfo(keyValue, context); return service.UpdateAsync(itemsDetailEntity); } else { itemsDetailEntity.AttachCreateInfo(context); return service.InsertAsync(itemsDetailEntity); } } } }
{ "content_hash": "917b6741023c457d8284eab934dabed4", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 103, "avg_line_length": 33.734375, "alnum_prop": 0.6146364057433997, "repo_name": "CAH-FlyChen/Evolution.Framework", "id": "dd768cf0a9638580aa1e3f263322bd3bdfd66ec1", "size": "2457", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Evolution.HttpServicesLocator/SystemManage/ItemsDetailService.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1825" }, { "name": "C#", "bytes": "19492947" }, { "name": "CSS", "bytes": "139167" }, { "name": "CoffeeScript", "bytes": "25422" }, { "name": "PowerShell", "bytes": "165928" }, { "name": "Ruby", "bytes": "3996" }, { "name": "Shell", "bytes": "6804" }, { "name": "Smalltalk", "bytes": "3" }, { "name": "TypeScript", "bytes": "27466" } ], "symlink_target": "" }
import { TABLE_ROW_HEIGHT } from '../utils/constants' export const addJoinArrowheads = (join: any, joinName: string) => { join .append('marker') .attr('id', 'arrows-' + joinName) .attr('refX', 18) .attr('refY', 18) .attr('markerWidth', 50) .attr('markerHeight', 50) .attr('markerUnits', 'userSpaceOnUse') .attr('orient', 'auto') .append('path') .attr('d', 'M 12 12 24 18 12 24 15 18') } export interface JoinPoint { x: number y: number viewName?: string } export function getManyPath( connectorSize: number, rightmost: number, joinField: any ): JoinPoint[][] { const connectorAlign = rightmost ? connectorSize : connectorSize * -1 const baseX = joinField.joinX const baseY = joinField.joinY + TABLE_ROW_HEIGHT / 2 const manyTopX = baseX + connectorAlign const manyTopY = baseY - 8 const manyBotX = baseX + connectorAlign const manyBotY = baseY + 8 const topFork = [] const bottomFork = [] topFork.push({ x: baseX, y: baseY }) topFork.push({ x: manyTopX, y: manyTopY }) bottomFork.push({ x: baseX, y: baseY }) bottomFork.push({ x: manyBotX, y: manyBotY }) return [topFork, bottomFork] } export function getOnePath( connectorSize: number, rightmost: number, joinField: any ) { const path = [] const connectorAlign = rightmost ? connectorSize : connectorSize * -1 const baseX = joinField.joinX const baseY = joinField.joinY + TABLE_ROW_HEIGHT / 2 const headX = baseX + connectorAlign const headY = baseY path.push({ x: baseX, y: baseY }) path.push({ x: headX, y: headY }) return [path] }
{ "content_hash": "114a1eda37abfd6a32846e9706fe1fe1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 71, "avg_line_length": 22.957142857142856, "alnum_prop": 0.657125077784692, "repo_name": "looker-open-source/app-lookml-diagram", "id": "b834683b78530f3320782d291f7350a86b3d1831", "size": "2715", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/d3-utils/join-helpers.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "17168" }, { "name": "LookML", "bytes": "33" }, { "name": "TypeScript", "bytes": "11648275" } ], "symlink_target": "" }
<?php if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page } require_once ($CFG->dirroot.'/course/moodleform_mod.php'); class mod_glossary_mod_form extends moodleform_mod { function definition() { global $CFG, $COURSE, $DB; $mform =& $this->_form; //------------------------------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('name'), array('size'=>'64')); if (!empty($CFG->formatstringstriptags)) { $mform->setType('name', PARAM_TEXT); } else { $mform->setType('name', PARAM_CLEANHTML); } $mform->addRule('name', null, 'required', null, 'client'); $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $this->add_intro_editor(true); if (has_capability('mod/glossary:manageentries', context_system::instance())) { $mform->addElement('checkbox', 'globalglossary', get_string('isglobal', 'glossary')); $mform->addHelpButton('globalglossary', 'isglobal', 'glossary'); }else{ $mform->addElement('hidden', 'globalglossary'); $mform->setType('globalglossary', PARAM_INT); } $options = array(1=>get_string('mainglossary', 'glossary'), 0=>get_string('secondaryglossary', 'glossary')); $mform->addElement('select', 'mainglossary', get_string('glossarytype', 'glossary'), $options); $mform->addHelpButton('mainglossary', 'glossarytype', 'glossary'); $mform->setDefault('mainglossary', 0); // ---------------------------------------------------------------------- $mform->addElement('header', 'entrieshdr', get_string('entries', 'glossary')); $mform->addElement('selectyesno', 'defaultapproval', get_string('defaultapproval', 'glossary')); $mform->setDefault('defaultapproval', $CFG->glossary_defaultapproval); $mform->addHelpButton('defaultapproval', 'defaultapproval', 'glossary'); $mform->addElement('selectyesno', 'editalways', get_string('editalways', 'glossary')); $mform->setDefault('editalways', 0); $mform->addHelpButton('editalways', 'editalways', 'glossary'); $mform->addElement('selectyesno', 'allowduplicatedentries', get_string('allowduplicatedentries', 'glossary')); $mform->setDefault('allowduplicatedentries', $CFG->glossary_dupentries); $mform->addHelpButton('allowduplicatedentries', 'allowduplicatedentries', 'glossary'); $mform->addElement('selectyesno', 'allowcomments', get_string('allowcomments', 'glossary')); $mform->setDefault('allowcomments', $CFG->glossary_allowcomments); $mform->addHelpButton('allowcomments', 'allowcomments', 'glossary'); $mform->addElement('selectyesno', 'usedynalink', get_string('usedynalink', 'glossary')); $mform->setDefault('usedynalink', $CFG->glossary_linkbydefault); $mform->addHelpButton('usedynalink', 'usedynalink', 'glossary'); // ---------------------------------------------------------------------- $mform->addElement('header', 'appearancehdr', get_string('appearance')); // Get and update available formats. $recformats = glossary_get_available_formats(); $formats = array(); foreach ($recformats as $format) { $formats[$format->name] = get_string('displayformat'.$format->name, 'glossary'); } asort($formats); $mform->addElement('select', 'displayformat', get_string('displayformat', 'glossary'), $formats); $mform->setDefault('displayformat', 'dictionary'); $mform->addHelpButton('displayformat', 'displayformat', 'glossary'); $displayformats['default'] = get_string('displayformatdefault', 'glossary'); $displayformats = array_merge($displayformats, $formats); $mform->addElement('select', 'approvaldisplayformat', get_string('approvaldisplayformat', 'glossary'), $displayformats); $mform->setDefault('approvaldisplayformat', 'default'); $mform->addHelpButton('approvaldisplayformat', 'approvaldisplayformat', 'glossary'); $mform->addElement('text', 'entbypage', get_string('entbypage', 'glossary')); $mform->setDefault('entbypage', $this->get_default_entbypage()); $mform->addRule('entbypage', null, 'numeric', null, 'client'); $mform->setType('entbypage', PARAM_INT); $mform->addElement('selectyesno', 'showalphabet', get_string('showalphabet', 'glossary')); $mform->setDefault('showalphabet', 1); $mform->addHelpButton('showalphabet', 'showalphabet', 'glossary'); $mform->addElement('selectyesno', 'showall', get_string('showall', 'glossary')); $mform->setDefault('showall', 1); $mform->addHelpButton('showall', 'showall', 'glossary'); $mform->addElement('selectyesno', 'showspecial', get_string('showspecial', 'glossary')); $mform->setDefault('showspecial', 1); $mform->addHelpButton('showspecial', 'showspecial', 'glossary'); $mform->addElement('selectyesno', 'allowprintview', get_string('allowprintview', 'glossary')); $mform->setDefault('allowprintview', 1); $mform->addHelpButton('allowprintview', 'allowprintview', 'glossary'); if ($CFG->enablerssfeeds && isset($CFG->glossary_enablerssfeeds) && $CFG->glossary_enablerssfeeds) { //------------------------------------------------------------------------------- $mform->addElement('header', 'rssheader', get_string('rss')); $choices = array(); $choices[0] = get_string('none'); $choices[1] = get_string('withauthor', 'glossary'); $choices[2] = get_string('withoutauthor', 'glossary'); $mform->addElement('select', 'rsstype', get_string('rsstype'), $choices); $mform->addHelpButton('rsstype', 'rsstype', 'glossary'); $choices = array(); $choices[0] = '0'; $choices[1] = '1'; $choices[2] = '2'; $choices[3] = '3'; $choices[4] = '4'; $choices[5] = '5'; $choices[10] = '10'; $choices[15] = '15'; $choices[20] = '20'; $choices[25] = '25'; $choices[30] = '30'; $choices[40] = '40'; $choices[50] = '50'; $mform->addElement('select', 'rssarticles', get_string('rssarticles'), $choices); $mform->addHelpButton('rssarticles', 'rssarticles', 'glossary'); $mform->disabledIf('rssarticles', 'rsstype', 'eq', 0); } //------------------------------------------------------------------------------- $this->standard_grading_coursemodule_elements(); $this->standard_coursemodule_elements(); //------------------------------------------------------------------------------- // buttons $this->add_action_buttons(); } function definition_after_data() { global $COURSE, $DB; parent::definition_after_data(); $mform =& $this->_form; $mainglossaryel =& $mform->getElement('mainglossary'); $mainglossary = $DB->get_record('glossary', array('mainglossary'=>1, 'course'=>$COURSE->id)); if ($mainglossary && ($mainglossary->id != $mform->getElementValue('instance'))){ //secondary glossary, a main one already exists in this course. $mainglossaryel->setValue(0); $mainglossaryel->freeze(); $mainglossaryel->setPersistantFreeze(true); } else { $mainglossaryel->unfreeze(); $mainglossaryel->setPersistantFreeze(false); } } function data_preprocessing(&$default_values){ parent::data_preprocessing($default_values); // Fallsback on the default setting if 'Entries shown per page' has been left blank. // This prevents the field from being required and expand its section which should not // be the case if there is a default value defined. if (empty($default_values['entbypage']) || $default_values['entbypage'] < 0) { $default_values['entbypage'] = $this->get_default_entbypage(); } // Set up the completion checkboxes which aren't part of standard data. // We also make the default value (if you turn on the checkbox) for those // numbers to be 1, this will not apply unless checkbox is ticked. $default_values['completionentriesenabled']= !empty($default_values['completionentries']) ? 1 : 0; if (empty($default_values['completionentries'])) { $default_values['completionentries']=1; } } function add_completion_rules() { $mform =& $this->_form; $group=array(); $group[] =& $mform->createElement('checkbox', 'completionentriesenabled', '', get_string('completionentries','glossary')); $group[] =& $mform->createElement('text', 'completionentries', '', array('size'=>3)); $mform->setType('completionentries', PARAM_INT); $mform->addGroup($group, 'completionentriesgroup', get_string('completionentriesgroup','glossary'), array(' '), false); $mform->disabledIf('completionentries','completionentriesenabled','notchecked'); return array('completionentriesgroup'); } function completion_rule_enabled($data) { return (!empty($data['completionentriesenabled']) && $data['completionentries']!=0); } function get_data() { $data = parent::get_data(); if (!$data) { return false; } if (!empty($data->completionunlocked)) { // Turn off completion settings if the checkboxes aren't ticked $autocompletion = !empty($data->completion) && $data->completion==COMPLETION_TRACKING_AUTOMATIC; if (empty($data->completionentriesenabled) || !$autocompletion) { $data->completionentries = 0; } } return $data; } /** * Returns the default value for 'Entries shown per page'. * * @return int default for number of entries per page. */ protected function get_default_entbypage() { global $CFG; return !empty($CFG->glossary_entbypage) ? $CFG->glossary_entbypage : 10; } }
{ "content_hash": "5c2e931561f092d9fb54deb077fe9b76", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 130, "avg_line_length": 46, "alnum_prop": 0.5795519270932219, "repo_name": "faisalsyfl/DINAMIK12", "id": "9576132c770df9466031564f4087b7f7fc5b6e69", "size": "10534", "binary": false, "copies": "151", "ref": "refs/heads/master", "path": "kompetisijaringan/mod/glossary/mod_form.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "1205" }, { "name": "ApacheConf", "bytes": "435" }, { "name": "CSS", "bytes": "2210571" }, { "name": "Gherkin", "bytes": "597017" }, { "name": "HTML", "bytes": "2324742" }, { "name": "Java", "bytes": "14870" }, { "name": "JavaScript", "bytes": "14853851" }, { "name": "PHP", "bytes": "58354432" }, { "name": "PLSQL", "bytes": "4867" }, { "name": "PLpgSQL", "bytes": "483151" }, { "name": "Perl", "bytes": "20769" }, { "name": "XSLT", "bytes": "33921" } ], "symlink_target": "" }
package org.minimalj.frontend.impl.json; import java.lang.reflect.Array; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.time.temporal.Temporal; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Stack; public class JsonWriter { private final StringBuilder s = new StringBuilder(512); private final Stack<Object> calls = new Stack<>(); private static final String spaces = " "; private static final int stepsize = 3; private static final int max = spaces.length() / stepsize; private int level = 0; public JsonWriter() { } public String write(Object values) { s.setLength(0); value(values); return s.toString(); } private void indent() { if (0 == level) return; if (level < max) { add(spaces.substring(0, level * stepsize)); } else { add(spaces); for (int i = level - max; i < level; ++i) { for (int j = 0; j < stepsize; ++j) { add(" "); } } } } private void nl() { add("\n"); indent(); } private void stepIn(char c) { add(c); ++level; nl(); } private void stepOut(char c) { --level; nl(); add(c); } private void emptyArray() { add("[]"); } @SuppressWarnings({ "unchecked", "rawtypes" }) private void value(Object object) { if (object == null || cyclic(object)) { add("null"); } else { calls.push(object); if (object instanceof String || object instanceof Character) string(object); else if (object instanceof Number) add(object); else if (object instanceof Boolean) bool((Boolean) object); else if (object instanceof Temporal) string(object.toString()); else if (object instanceof Map) map((Map) object); else if (object.getClass().isArray()) array(object); else if (object instanceof Iterator) array((Iterator) object); else if (object instanceof Collection) array(((Collection) object).iterator()); else { System.err.println(s.toString()); throw new IllegalArgumentException("cannot be serialized in json: " + object); } calls.pop(); } } private boolean cyclic(Object object) { for (Object called : calls) { if (object == called) return true; } return false; } private void map(Map<String, Object> map) { stepIn('{'); Iterator<Map.Entry<String, Object>> it = map.entrySet().iterator(); while (it.hasNext()) { Map.Entry<?, ?> e = it.next(); value(e.getKey()); add(": "); value(e.getValue()); if (it.hasNext()) { add(','); nl(); } } stepOut('}'); } private void array(Iterator<?> it) { if (it.hasNext()) { stepIn('['); while (it.hasNext()) { value(it.next()); if (it.hasNext()) { add(","); nl(); } } stepOut(']'); } else { emptyArray(); } } private void array(Object object) { int length = Array.getLength(object); if (length > 0) { stepIn('['); for (int i = 0; i < length; ++i) { value(Array.get(object, i)); if (i < length - 1) { add(','); nl(); } } stepOut(']'); } else { emptyArray(); } } private void bool(boolean b) { add(Boolean.valueOf(b).toString()); } private void string(Object obj) { add('"'); CharacterIterator it = new StringCharacterIterator(obj.toString()); for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { if (c == '"') add("\\\""); else if (c == '\\') add("\\\\"); else if (Character.isISOControl(c)) { if (c == '\b') add("\\b"); else if (c == '\f') add("\\f"); else if (c == '\n') add("\\n"); else if (c == '\r') add("\\r"); else if (c == '\t') add("\\t"); else unicode(c); } else { add(c); } } add('"'); } private void add(Object obj) { s.append(obj); } private void add(char c) { s.append(c); } private static final char[] hex = "0123456789ABCDEF".toCharArray(); private void unicode(char c) { add("\\u"); int n = c; for (int i = 0; i < 4; ++i) { int digit = (n & 0xf000) >> 12; add(hex[digit]); n <<= 4; } } }
{ "content_hash": "41d4675d1ba4a4b5243edcd228a21b48", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 101, "avg_line_length": 20.02403846153846, "alnum_prop": 0.5680672268907563, "repo_name": "BrunoEberhard/minimal-j", "id": "da1e93b2800ca9e4027323eca0d0030c64511ed6", "size": "4165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/minimalj/frontend/impl/json/JsonWriter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "133530" }, { "name": "HTML", "bytes": "74175" }, { "name": "Java", "bytes": "1801760" }, { "name": "JavaScript", "bytes": "25433" }, { "name": "Procfile", "bytes": "252" }, { "name": "SCSS", "bytes": "2706" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Web.Http; using System.Web.Http.Controllers; using System.Web.Http.Description; using SwaggerDemoApi.Areas.HelpPage.ModelDescriptions; using SwaggerDemoApi.Areas.HelpPage.Models; namespace SwaggerDemoApi.Areas.HelpPage { public static class HelpPageConfigurationExtensions { private const string ApiModelPrefix = "MS_HelpPageApiModel_"; /// <summary> /// Sets the documentation provider for help page. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="documentationProvider">The documentation provider.</param> public static void SetDocumentationProvider(this HttpConfiguration config, IDocumentationProvider documentationProvider) { config.Services.Replace(typeof(IDocumentationProvider), documentationProvider); } /// <summary> /// Sets the objects that will be used by the formatters to produce sample requests/responses. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sampleObjects">The sample objects.</param> public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects) { config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects; } /// <summary> /// Sets the sample request directly for the specified media type and action. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample request.</param> /// <param name="mediaType">The media type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, new[] { "*" }), sample); } /// <summary> /// Sets the sample request directly for the specified media type and action with parameters. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample request.</param> /// <param name="mediaType">The media type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, parameterNames), sample); } /// <summary> /// Sets the sample request directly for the specified media type of the action. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample response.</param> /// <param name="mediaType">The media type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, new[] { "*" }), sample); } /// <summary> /// Sets the sample response directly for the specified media type of the action with specific parameters. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample response.</param> /// <param name="mediaType">The media type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, parameterNames), sample); } /// <summary> /// Sets the sample directly for all actions with the specified media type. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample.</param> /// <param name="mediaType">The media type.</param> public static void SetSampleForMediaType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType), sample); } /// <summary> /// Sets the sample directly for all actions with the specified type and media type. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sample">The sample.</param> /// <param name="mediaType">The media type.</param> /// <param name="type">The parameter type or return type of an action.</param> public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type) { config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample); } /// <summary> /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action. /// The help page will use this information to produce more accurate request samples. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="type">The type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName) { config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, new[] { "*" }), type); } /// <summary> /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action. /// The help page will use this information to produce more accurate request samples. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="type">The type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames) { config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, parameterNames), type); } /// <summary> /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action. /// The help page will use this information to produce more accurate response samples. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="type">The type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName) { config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, new[] { "*" }), type); } /// <summary> /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action. /// The help page will use this information to produce more accurate response samples. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="type">The type.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames) { config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, parameterNames), type); } /// <summary> /// Gets the help page sample generator. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <returns>The help page sample generator.</returns> public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config) { return (HelpPageSampleGenerator)config.Properties.GetOrAdd( typeof(HelpPageSampleGenerator), k => new HelpPageSampleGenerator()); } /// <summary> /// Sets the help page sample generator. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="sampleGenerator">The help page sample generator.</param> public static void SetHelpPageSampleGenerator(this HttpConfiguration config, HelpPageSampleGenerator sampleGenerator) { config.Properties.AddOrUpdate( typeof(HelpPageSampleGenerator), k => sampleGenerator, (k, o) => sampleGenerator); } /// <summary> /// Gets the model description generator. /// </summary> /// <param name="config">The configuration.</param> /// <returns>The <see cref="ModelDescriptionGenerator"/></returns> public static ModelDescriptionGenerator GetModelDescriptionGenerator(this HttpConfiguration config) { return (ModelDescriptionGenerator)config.Properties.GetOrAdd( typeof(ModelDescriptionGenerator), k => InitializeModelDescriptionGenerator(config)); } /// <summary> /// Gets the model that represents an API displayed on the help page. The model is initialized on the first call and cached for subsequent calls. /// </summary> /// <param name="config">The <see cref="HttpConfiguration"/>.</param> /// <param name="apiDescriptionId">The <see cref="ApiDescription"/> ID.</param> /// <returns> /// An <see cref="HelpPageApiModel"/> /// </returns> public static HelpPageApiModel GetHelpPageApiModel(this HttpConfiguration config, string apiDescriptionId) { object model; string modelId = ApiModelPrefix + apiDescriptionId; if (!config.Properties.TryGetValue(modelId, out model)) { Collection<ApiDescription> apiDescriptions = config.Services.GetApiExplorer().ApiDescriptions; ApiDescription apiDescription = apiDescriptions.FirstOrDefault(api => String.Equals(api.GetFriendlyId(), apiDescriptionId, StringComparison.OrdinalIgnoreCase)); if (apiDescription != null) { model = GenerateApiModel(apiDescription, config); config.Properties.TryAdd(modelId, model); } } return (HelpPageApiModel)model; } private static HelpPageApiModel GenerateApiModel(ApiDescription apiDescription, HttpConfiguration config) { HelpPageApiModel apiModel = new HelpPageApiModel() { ApiDescription = apiDescription, }; ModelDescriptionGenerator modelGenerator = config.GetModelDescriptionGenerator(); HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator(); GenerateUriParameters(apiModel, modelGenerator); GenerateRequestModelDescription(apiModel, modelGenerator, sampleGenerator); GenerateResourceDescription(apiModel, modelGenerator); GenerateSamples(apiModel, sampleGenerator); return apiModel; } private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator) { ApiDescription apiDescription = apiModel.ApiDescription; foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions) { if (apiParameter.Source == ApiParameterSource.FromUri) { HttpParameterDescriptor parameterDescriptor = apiParameter.ParameterDescriptor; Type parameterType = null; ModelDescription typeDescription = null; ComplexTypeModelDescription complexTypeDescription = null; if (parameterDescriptor != null) { parameterType = parameterDescriptor.ParameterType; typeDescription = modelGenerator.GetOrCreateModelDescription(parameterType); complexTypeDescription = typeDescription as ComplexTypeModelDescription; } // Example: // [TypeConverter(typeof(PointConverter))] // public class Point // { // public Point(int x, int y) // { // X = x; // Y = y; // } // public int X { get; set; } // public int Y { get; set; } // } // Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection. // // public class Point // { // public int X { get; set; } // public int Y { get; set; } // } // Regular complex class Point will have properties X and Y added to UriParameters collection. if (complexTypeDescription != null && !IsBindableWithTypeConverter(parameterType)) { foreach (ParameterDescription uriParameter in complexTypeDescription.Properties) { apiModel.UriParameters.Add(uriParameter); } } else if (parameterDescriptor != null) { ParameterDescription uriParameter = AddParameterDescription(apiModel, apiParameter, typeDescription); if (!parameterDescriptor.IsOptional) { uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Required" }); } object defaultValue = parameterDescriptor.DefaultValue; if (defaultValue != null) { uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture) }); } } else { Debug.Assert(parameterDescriptor == null); // If parameterDescriptor is null, this is an undeclared route parameter which only occurs // when source is FromUri. Ignored in request model and among resource parameters but listed // as a simple string here. ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string)); AddParameterDescription(apiModel, apiParameter, modelDescription); } } } } private static bool IsBindableWithTypeConverter(Type parameterType) { if (parameterType == null) { return false; } return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string)); } private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel, ApiParameterDescription apiParameter, ModelDescription typeDescription) { ParameterDescription parameterDescription = new ParameterDescription { Name = apiParameter.Name, Documentation = apiParameter.Documentation, TypeDescription = typeDescription, }; apiModel.UriParameters.Add(parameterDescription); return parameterDescription; } private static void GenerateRequestModelDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator, HelpPageSampleGenerator sampleGenerator) { ApiDescription apiDescription = apiModel.ApiDescription; foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions) { if (apiParameter.Source == ApiParameterSource.FromBody) { Type parameterType = apiParameter.ParameterDescriptor.ParameterType; apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType); apiModel.RequestDocumentation = apiParameter.Documentation; } else if (apiParameter.ParameterDescriptor != null && apiParameter.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)) { Type parameterType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription); if (parameterType != null) { apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType); } } } } private static void GenerateResourceDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator) { ResponseDescription response = apiModel.ApiDescription.ResponseDescription; Type responseType = response.ResponseType ?? response.DeclaredType; if (responseType != null && responseType != typeof(void)) { apiModel.ResourceDescription = modelGenerator.GetOrCreateModelDescription(responseType); } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as ErrorMessages.")] private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator) { try { foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription)) { apiModel.SampleRequests.Add(item.Key, item.Value); LogInvalidSampleAsError(apiModel, item.Value); } foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription)) { apiModel.SampleResponses.Add(item.Key, item.Value); LogInvalidSampleAsError(apiModel, item.Value); } } catch (Exception e) { apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture, "An exception has occurred while generating the sample. Exception message: {0}", HelpPageSampleGenerator.UnwrapException(e).Message)); } } private static bool TryGetResourceParameter(ApiDescription apiDescription, HttpConfiguration config, out ApiParameterDescription parameterDescription, out Type resourceType) { parameterDescription = apiDescription.ParameterDescriptions.FirstOrDefault( p => p.Source == ApiParameterSource.FromBody || (p.ParameterDescriptor != null && p.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage))); if (parameterDescription == null) { resourceType = null; return false; } resourceType = parameterDescription.ParameterDescriptor.ParameterType; if (resourceType == typeof(HttpRequestMessage)) { HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator(); resourceType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription); } if (resourceType == null) { parameterDescription = null; return false; } return true; } private static ModelDescriptionGenerator InitializeModelDescriptionGenerator(HttpConfiguration config) { ModelDescriptionGenerator modelGenerator = new ModelDescriptionGenerator(config); Collection<ApiDescription> apis = config.Services.GetApiExplorer().ApiDescriptions; foreach (ApiDescription api in apis) { ApiParameterDescription parameterDescription; Type parameterType; if (TryGetResourceParameter(api, config, out parameterDescription, out parameterType)) { modelGenerator.GetOrCreateModelDescription(parameterType); } } return modelGenerator; } private static void LogInvalidSampleAsError(HelpPageApiModel apiModel, object sample) { InvalidSample invalidSample = sample as InvalidSample; if (invalidSample != null) { apiModel.ErrorMessages.Add(invalidSample.ErrorMessage); } } } }
{ "content_hash": "41827a8564ff282a3ae48953c5834108", "timestamp": "", "source": "github", "line_count": 467, "max_line_length": 196, "avg_line_length": 51.58029978586724, "alnum_prop": 0.6230073065426769, "repo_name": "billpratt/SwaggerDemoApi", "id": "d0551ffee4e0dadcc691e64ad8ca5c4ef14a4bef", "size": "24088", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SwaggerDemoApi/Areas/HelpPage/HelpPageConfigurationExtensions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "108" }, { "name": "C#", "bytes": "182646" }, { "name": "CSS", "bytes": "2626" }, { "name": "HTML", "bytes": "16133" }, { "name": "JavaScript", "bytes": "20331" } ], "symlink_target": "" }
using System; using Microsoft.Extensions.Configuration; namespace CustomConfigDockerSecrets { /// <summary> /// Extension methods for registering <see cref="DockerSecretsConfigurationProvider"/> with <see cref="IConfigurationBuilder"/>. /// </summary> public static class DockerSecretsConfigurationBuilderExtensions { /// <summary> /// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from docker secrets. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param> /// <returns>The <see cref="IConfigurationBuilder"/>.</returns> public static IConfigurationBuilder AddDockerSecrets(this IConfigurationBuilder builder) => builder.AddDockerSecrets(configureSource: null); /// <summary> /// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from docker secrets. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param> /// <param name="secretsPath">The path to the secrets directory.</param> /// <returns>The <see cref="IConfigurationBuilder"/>.</returns> public static IConfigurationBuilder AddDockerSecrets(this IConfigurationBuilder builder, string secretsPath) => builder.AddDockerSecrets(source => source.SecretsDirectory = secretsPath); /// <summary> /// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from docker secrets. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param> /// <param name="secretsPath">The path to the secrets directory.</param> /// <param name="optional">Whether the directory is optional.</param> /// <returns>The <see cref="IConfigurationBuilder"/>.</returns> public static IConfigurationBuilder AddDockerSecrets(this IConfigurationBuilder builder, string secretsPath, bool optional) => builder.AddDockerSecrets(source => { source.SecretsDirectory = secretsPath; source.Optional = optional; }); /// <summary> /// Adds a docker secrets configuration source to <paramref name="builder"/>. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param> /// <param name="configureSource">Configures the source.</param> /// <returns>The <see cref="IConfigurationBuilder"/>.</returns> public static IConfigurationBuilder AddDockerSecrets(this IConfigurationBuilder builder, Action<DockerSecretsConfigurationSource> configureSource) => builder.Add(configureSource); } }
{ "content_hash": "f8e5bdef030ecb9dc0c44f4cb0888262", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 154, "avg_line_length": 54.86274509803921, "alnum_prop": 0.6683345246604717, "repo_name": "Rafael-Miceli/PriceStoresBack", "id": "5d46b0a28d6bc29f8f7ddeef015a74c2a1e7d91a", "size": "2798", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/DockerSecretsConfigurationBuilderExtensions.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "56620" }, { "name": "Dockerfile", "bytes": "1621" }, { "name": "Shell", "bytes": "942" } ], "symlink_target": "" }
.navbar-nav a.active { background-color: #e7e7e7 !important; color: #555 !important; }
{ "content_hash": "367c141eb0c06cb13adbc0d6e54da6b0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 41, "avg_line_length": 23.5, "alnum_prop": 0.6702127659574468, "repo_name": "Transport-Protocol/MBC-Trump", "id": "e121d9bb448728cc05647de2e59634e53aeffea9", "size": "94", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frontend/styles.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1359" }, { "name": "HTML", "bytes": "7246" }, { "name": "JavaScript", "bytes": "1570" }, { "name": "TypeScript", "bytes": "37275" } ], "symlink_target": "" }
<!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Emerging Tech Weekender</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- /// font icons /// --> <link rel="stylesheet" type="text/css" href="assets/fonts/fontawesome/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="assets/fonts/linecons/css/linecons.css"> <!-- /// animate.css /// --> <link rel="stylesheet" type="text/css" href="assets/css/plugins/animate/animate.css"> <!-- /// bootstrap-select.css /// --> <link rel="stylesheet" type="text/css" href="assets/css/plugins/select/bootstrap-select.css"> <!-- /// bootstrap.css /// --> <link rel="stylesheet" type="text/css" href="bootstrap-3.1.1/css/bootstrap.css"> <!-- /// main CSS file /// --> <link rel="stylesheet" type="text/css" href="assets/css/main.css"> <script type="text/javascript" src="//use.typekit.net/omc3djj.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> </head> <body class="remove-scroll"> <!-- /// preloader /// --> <!-- <div class="preloader"> <img src="assets/img/loader.GIF" class="loader" alt=""> </div> --> <!-- /// begin header /// --> <header class="main-header"> <nav class="navbar navbar-custom navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Emerging Tech Weekender</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="navbar-collapse"> <ul class="nav navbar-nav navbar-right" id="nav"> <li><a href="http://www.eventbrite.co.uk/e/emerging-tech-weekender-tickets-13224501841" class="external">Tickets</a></li> <!-- <li class="active"><a href="#home">Home</a></li> --> <li><a href="#programme">Programme</a></li> <li><a href="#venue">Venue</a></li> <!-- <li><a href="#prize">Prize</a></li> --> <li><a href="#features">Tech</a></li> <li><a href="#speakers">Mentors</a></li> <!-- <li><a href="#price">Price</a></li> <li><a href="#faqSection">FAQ</a></li> --> <!-- <li><a href="#ourLocation">Contacts</a></li> --> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> </header> <!-- /// end header /// --> <!-- /// begin content /// --> <!-- /// begin promo /// --> <div class="promo" id="home" style="background-image:url(img/heading.jpg);"> <div class="color-correction"></div> <!-- /// begin entry /// --> <div class="container"> <div class="row"> <!-- /// begin text section /// --> <div class="col-md-6 wow fadeInDown" data-wow-duration="1s"> <div class="promo-text"> <h1>Emerging Tech Weekender</h1> <hr> <p class="lead">A hack weekend, bringing together Oxford’s finest business brains, designers and developers to explore new opportunities for bleeding edge digital tech.</p> <p>Oxford, 14th - 16th November 2014</p> </div> </div> <!-- /// end text section /// --> <!-- /// begin registration form /// --> <div class="col-md-4 col-md-offset-2 wow fadeInUp" data-wow-duration="2s"> <div class="register"> <a href="http://www.eventbrite.co.uk/e/emerging-tech-weekender-tickets-13224501841" class="btn btn-info btn-block btn-lg">Tickets</a> </div> </div> <!-- /// end registration form /// --> </div> </div> <!-- /// end entry /// --> </div> <!-- /// end promo /// --> <!-- /// begin countdown /// --> <div class="counter"> <div class="container"> <div class="row"> <!-- /// digits /// --> <div class="col-md-8"> <!-- /// to start the countdown the only requirement is the data-date attribute /// --> </div> </div> <div class="strapline"> <p>Present your idea <span>•</span> Build a team <span>•</span> Develop the idea <span>•</span> Pitch it to experts</p></div> <div class="col-md-4 date text-center wow fadeInUp" data-wow-delay="0.1s"> <h1>Emerging Tech Weekender</h1> <p class="lead"> Oxford<br> 14th - 16th November 2014 </p> <!-- <ul class="list-inline join-us"> <li><a href="" class="btn btn-empty-inverse btn-lg"><i class="fa fa-google-plus"></i></a></li> <li><a href="" class="btn btn-empty-inverse btn-lg"><i class="fa fa fa-twitter"></i></a></li> <li><a href="" class="btn btn-empty-inverse btn-lg"><i class="fa fa-facebook"></i></a></li> </ul> --> </div> </div> </div> </div> <!-- /// end countdown /// --> <!-- /// begin schedule /// --> <div class="schedule" id="programme"> <div class="container"> <div class="section-heading"> <h1>Programme</h1> <p class="lead">An intense weekend of making and pitching with advice from business and technology mentors</p> <p>Make sure you read the resources section before you arrive so you get the most out of the weekend</p> </div> <div class="row"> <div class="col-md-12 wow fadeInDown"> <!-- Nav tabs --> <ul class="nav nav-tabs nav-justified"> <li class="active"><a href="#first-day" data-toggle="tab">Fri 14th</a></li> <li><a href="#second-day" data-toggle="tab">Sat 15th</a></li> <li><a href="#third-day" data-toggle="tab">Sun 16th</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane active" id="first-day"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion" href="#collapseOne"> 18:00 Start </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> <!--h4>Dolor Ipsum Solor</h4> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, fuga delectus nam quia omnis accusamus autem temporibus iure cum voluptatem rerum neque quisquam sed provident similique quis natus fugiat id.</p--> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"> Lightning Talks </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> <p>5 minute talks from the Tech Mentors</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree"> Idea Pitching </a> </h4> </div> <div id="collapseThree" class="panel-collapse collapse"> <div class="panel-body"> <p>Chance to pitch ideas to the group. Followed by voting to select the best ideas to develop over the weekend</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseFour"> Team Formation </a> </h4> </div> <div id="collapseFour" class="panel-collapse collapse"> <div class="panel-body"> <p>Multi-disciplinary teams will be created for each idea selected</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion" href="#collapseFour"> 22:00 End </a> </h4> </div> <div id="collapseFive" class="panel-collapse collapse"> <div class="panel-body"> <!--h4>Dolor Ipsum Solor</h4> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, fuga delectus nam quia omnis accusamus autem temporibus iure cum voluptatem rerum neque quisquam sed provident similique quis natus fugiat id.</p--> </div> </div> </div> </div> </div> <div class="tab-pane" id="second-day"> <div class="panel-group" id="accordion2"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion2" href="#collapseOne2"> 9:00 Start </a> </h4> </div> <div id="collapseOne2" class="panel-collapse collapse"> <div class="panel-body"> <!--h4>Dolor Ipsum Solor</h4> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, fuga delectus nam quia omnis accusamus autem temporibus iure cum voluptatem rerum neque quisquam sed provident similique quis natus fugiat id.</p--> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo2"> Idea Development One </a> </h4> </div> <div id="collapseTwo2" class="panel-collapse collapse"> <div class="panel-body"> <p>Time for teams to develop the ideas. Mentors will be available throughout the day for advice and support</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseThree2"> Pitching Workshop </a> </h4> </div> <div id="collapseThree2" class="panel-collapse collapse"> <div class="panel-body"> <p>Placi Espejo from Bicester Vision will run a pitching techniques workshop</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a>Lunch provided</a></h4> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseFour2"> Feedback Sessions </a> </h4> </div> <div id="collapseFour2" class="panel-collapse collapse"> <div class="panel-body"> <p>Book a feedback session with a business mentor throughout the day</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion2" href="#collapseFive2"> 18:00 End </a> </h4> </div> <div id="collapseFive2" class="panel-collapse collapse"> <div class="panel-body"> </div> </div> </div> </div> </div> <div class="tab-pane" id="third-day"> <div class="panel-group" id="accordion3"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion3" href="#collapseOne3"> 09:00 Start </a> </h4> </div> <div id="collapseOne3" class="panel-collapse collapse"> <div class="panel-body"> <!--h4>Dolor Ipsum Solor</h4> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, fuga delectus nam quia omnis accusamus autem temporibus iure cum voluptatem rerum neque quisquam sed provident similique quis natus fugiat id.</p--> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion3" href="#collapseTwo3"> Idea Development Two </a> </h4> </div> <div id="collapseTwo3" class="panel-collapse collapse"> <div class="panel-body"> <p>More time to develop the ideas</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion3" href="#collapseThree3"> Pitch Preparation </a> </h4> </div> <div id="collapseThree3" class="panel-collapse collapse"> <div class="panel-body"> <p>Time to prepare pitches ready to present to the expert panel</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseFour3"> Lunch provided </a> </h4> </div> <div id="collapseFour3" class="panel-collapse collapse"> <div class="panel-body"> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseFive3"> Pitching </a> </h4> </div> <div id="collapseFive3" class="panel-collapse collapse"> <div class="panel-body"> <p>Teams pitch their ideas to the expert panel</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion2" href="#collapseSeven3"> Judging &amp; Winner Announced </a> </h4> </div> <div id="collapseSix3" class="panel-collapse collapse"> <div class="panel-body"> <p>The expert panel will award a winner</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle-x="collapse" data-parent="#accordion2" href="#collapseSeven3"> 18:00 End </a> </h4> </div> <div id="collapseSeven3" class="panel-collapse collapse"> <div class="panel-body"> <p>All teams update each other on their progress to date in 1 minute.</p> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /// end schedule /// --> <!-- /// begin photos /// --> <!--div class="photo" id="prize"> <div class="container"> <div class="row mt20"> <div class="col-md-6 wow fadeInLeft"> <h1>The Prize</h1> <hr> <p>Following pitches on the Sunday to our panel of judges, two members from the winning team will be flown to San Francisco to pitch their ideas to [Name of VC firm], leading silicon valley VCs.</p> </div> <div class="col-md-6 wow fadeInRight"> <div class="photo-wrapper"> <div id="photoSlider" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="item active"> <img src="assets/img/carousel/slide.jpg" alt=""> </div> <div class="item"> <img src="assets/img/carousel/slide3.jpg" alt=""> </div> </div> </div> </div> <div class="text-center"> <div class="btn-group"> <a href="#photoSlider" data-slide="prev" class="btn btn-empty-inverse"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a href="#photoSlider" data-slide="next" class="btn btn-empty-inverse"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> </div> </div> </div--> <!-- /// end photos /// --> <!-- /// begin features /// --> <div class="theses" id="features"> <div class="container"> <div class="row text-center"> <div class="col-md-12"> <h1>Technology</h1> <p><a href="http://www.esa.int/Our_Activities/Technology/Electronics_communication_technologies">Take a look at the European Space Agency Patents for ideas</a></p> </div> </div> <div class="row text-center"> <div class="col-md-4 wow bounceIn" data-wow-delay=".6s"> <div class="icon-wrap"> <i class="icon-mobile fa-3x"></i> </div> <h3>Multi-device web</h3> <hr> <p>Explore the potential for browser-to-browser real-time data connections to create new experiences and services.</p> <h4>Resources</h4> <ul class="list"> <li><a href="http://www.pubnub.com/use-cases/">Pubnub use cases</a></li> <li><a href="http://www.leggetter.co.uk/2014/09/29/real-time-web-2014-beyond.html">Realtime web in 2014 &amp; beyond</a></li> <li><a href="http://www.oreilly.com/pub/e/2740">Designing Multi-Device Experiences</a></li> <li><a href="https://vimeo.com/110060328">Visualising transient data</a></li> <li><a href="http://www.html5rocks.com/en/tutorials/webrtc/datachannels/">WebRTC datachannels</a></li> <li><a href="http://www.chromeexperiments.com/detail/racer/">Google Racer (Chrome Experiment)</a></li> <li><a href="http://www.chromeexperiments.com/detail/roll-it/">Roll It (Chrome Experiment)</a></li> <li><a href="http://www.chromeexperiments.com/detail/super-sync-sports/">Super Sync Sports (Chrome Experiment)</a></li> </ul> </div> <div class="col-md-4 wow bounceIn" data-wow-delay=".4s"> <div class="icon-wrap"> <i class="icon-lightbulb fa-3x"></i> </div> <h3>Internet of Things</h3> <hr> <p>Build projects that connect devices to the Internet.</p> <h4>Resources</h4> <ul class="list"> <li><a href="http://www.bbc.co.uk/news/business-23326035">Introduction to the Internet of Things</a></li> <li><a href="http://www.oxfordtimes.co.uk/news/11545293.Flood_early_warning_system_tests_will_use____white_space____in_city_s_airwaves/">An example of the Internet of things here in Oxford: "Oxford Flood Network"</a></li> <li><a href="https://www.youtube.com/watch?v=Q3ur8wzzhBU">Internet of Things jauntily introduced by Intel</a></li> <li><a href="https://www.youtube.com/watch?v=IlC5taBgLp0">Little Printer, an Internet Connected printer</a></li> <li><a href="https://nest.com/uk/">Nest Thermostat - Bought in Jan 2014 for $3.2bn by Google</a></li> <li><a href="http://blog.safecast.org/maps/">Safecast - Crowdsourced radiation map in Japan</a></li> </ul> </div> <div class="col-md-4 wow bounceIn" data-wow-delay=".8s"> <div class="icon-wrap"> <i class="icon-globe fa-3x"></i> </div> <h3>Mesh networks</h3> <hr> <p>Create public or private internets, limited in time and place, to extend the reach of the internet or use the mobility of a crowd.</p> <h4>Resources</h4> <ul class="list"> <li><a href="http://www.theatlantic.com/technology/archive/2014/10/firechat-the-hong-kong-protest-tool-aims-to-connect-the-next-billion/381113/">Firechat: device to device communications without carriers or WiFi</a></li> <li><a href="http://techpresident.com/news/23127/red-hook-mesh-network-connects-sandy-survivors-still-without-power">Mesh network used to connect after hurricane Sandy</a></li> <li><a href="http://www.motherjones.com/politics/2013/08/mesh-internet-privacy-nsa-isp">Community mesh in Athens</a></li> <li><a href="https://developer.apple.com/library/ios/DOCUMENTATION/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html">iOS Multipeer Connectivity Framework: Apple's API for decentralised networking</a></li> <li><a href="http://arduino.cc/en/Main/ArduinoWirelessShield">Wireless SD Shield: Zigbee to Arduino</a></li> <li><a href="http://www.flutterwireless.com">Flutter Wireless: Long range mesh networking for hackers</a></li> </ul> </div> </div> <!-- <div> <h2>Patents from the European Space Agency</h2> <ul class="list"> <li> <a href="http://www.esa.int/Our_Activities/Technology/Beam-forming_network_for_an_array_antenna_and_array_antenna_comprising_the_same">Beam-forming network for an array antenna and array antenna comprising the same</a> </li> <li> <a href="http://www.esa.int/Our_Activities/Technology/Multibeam_satellite_communication_system_and_method_and_satellite_payload_for_carrying_out_such_a_method">Multibeam satellite communication system and method, and satellite payload for carrying out such a method</a> </li> <li> <a href="http://www.esa.int/Our_Activities/Technology/Multibeam_Active_Discrete_Lens_Antenna">Multibeam Active Discrete Lens Antenna</a> </li> <li> <a href="http://www.esa.int/Our_Activities/Technology/Flexible_Channel_Decoder">Flexible Channel Decoder</a> </li> <li> <a href="http://www.esa.int/Our_Activities/Technology/Method_and_Telemetric_Device_for_Resampling_Time_Series_Data">Method and Telemetric Device for Resampling Time Series Data</a> </li> </ul> </div> --> </div> </div> <!-- /// end features /// --> <!-- /// begin speakers /// --> <div class="speakers" id="speakers"> <div class="container"> <div class="section-heading"> <h1>Tech mentors</h1> <p class="lead">Each technology will be introduced by an expert in the field, who will stick around to help teams over the weekend.</p> </div> <div class="row"> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-ben-f.jpg" alt="Ben Foxall"> <a href="http://twitter.com/benjaminbenben" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> --> <!-- <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> --> <!-- <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Ben Foxall</h2> <span>Ben will provide code and mentoring for teams working with real-time browser connections.</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-ben-w.jpg" alt=""> <a href="http://twitter.com/welovehz" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Ben Ward</h2> <span>Ben will provide advice and mentoring for teams working with internet of things.</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-tom-n.png" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Tom Nickson</h2> <span>Tom is very excited about all things mesh and will provide support and encouragement for teams working with mesh networking</span> </div> </div> </div> </div> </div> </div> <!-- /// end speakers /// --> <div class="speakers" id="speakers"> <div class="container"> <div class="section-heading"> <h1>Business mentors</h1> <p class="lead">Business mentors will be around to support with pitches and commercial advice</p> </div> <div class="row"> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-placi-e.png" alt=""> <a href="http://twitter.com/PlaciEspejo" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Placi Espejo</h2> <span>Placi has a passion for helping businesses, particularly finding ways in which she can help them improve their pitching technique</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-mark-e.png" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Mark Evans</h2> <span>Big company finance/general management guy turned entrepreneur. Leads a small tech company and chairs three others. Mark loves connecting people</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-dave-f.jpg" alt=""> <a href="http://twitter.com/dafletcher" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Dave Fletcher</h2> <span>Dave is founder and Managing Director of White October, a digital agency in Oxford. He has also launched two major technical conferences in Oxford</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-steve.png" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Steve Moyle</h2> <span>Steve is an experienced "zero-to-exit" technology inventor/entrepreneur, with software, security and big data expertise</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-andy.jpg" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Andrew Norton</h2> <span>Creative restaurateur serving up disruptive technology to the UK hospitality sector. Andrew founded the Jam Factory from where he launched and now runs technology startup <a href="https://www.tellthechef.com/">TellTheChef.com</a>.</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-jonathan.jpg" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Jonathan Gittos</h2> <span>Jonathan is an active entrepreneur and founded his first web software startup fifteen years ago, and sold it six years later. He has since worked on successful technology businesses in education, finance, advertising and big data</span> </div> </div> </div> <div class="speakers" id="speakers"> <div class="container"> <div class="section-heading"> <h1>Judges</h1> <p class="lead">Judges will decide on the best pitches, considering the tech, design and business proposition</p> </div> <div class="row"> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-nigel-c.png" alt=""> <a href="http://twitter.com/NigelCrook" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> --> <!-- <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> --> <!-- <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Nigel Crook</h2> <span>Nigel Crook is Head of Computing and Communication Technologies at Oxford Brookes University where he is leading research in cognitive robotics</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-julian.jpg" alt=""> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Julian Jantke</h2> <span>Julian loves building start ups and develop early stage companies. He co-founded hardware and software start ups.</span> </div> </div> <div class="col-md-4 speaker wow fadeInDown" data-wow-delay=".8s"> <div class="speaker-img"> <img src="img/mentors-tony-h.png" alt=""> <a href="http://twitter.com/tonyhart2k" class="speaker-contacts left-top"><i class="fa fa-twitter fa-2x"></i></a> <!-- <a href="" class="speaker-contacts left-top"><i class="fa fa-google-plus fa-2x"></i></a> <a href="" class="speaker-contacts left-bottom"><i class="fa fa-facebook fa-2x"></i></a> <a href="" class="speaker-contacts right-bottom"><i class="fa fa-twitter fa-2x"></i></a> <a href="" class="speaker-contacts right-top"><i class="fa fa-envelope fa-2x"></i></a> --> </div> <div class="speaker-desc"> <h2>Tony Hart</h2> <span>Building partnerships and collaborations to create commercially viable tech start-ups</span> </div> </div> </div> <!-- /// end speakers /// --> <!-- /// end speakers /// --> <!-- /// begin video /// --> <div class="multimedia" id="venue"> <div class="container"> <div class="row mt20"> <div class="col-md-6 wow fadeInLeft"> <img src="img/brookes-image.jpg" class="img-responsive" /> </div> <div class="col-md-6 wow fadeInRight"> <h1>Venue</h1> <hr /> <p class="lead">The weekender will take place in the new John Henry Brookes building in the Headington Campus of Oxford Brookes University. This amazing space provides the perfect environment to support teams in generating and developing their concepts, pitching, sharing ideas and making new connections. </p> </div> </div> </div> </div> <!-- /// end video /// --> <!-- /// begin testimonials /// --> <!-- <div class="testimonials wow flipInX" style="background-image: url(assets/img/bg/smiling-portraits.jpg)"> --> <div class="testimonials wow flipInX"> <div class="color-correction"></div> <div class="container"> <div class="row"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <div class="carousel-caption"> <blockquote> <p>Invention, it must be humbly admitted, does not consist in creating out of void, but out of chaos.</p> <footer>Mary Shelley</footer> </blockquote> </div> </div> <!-- <div class="item"> <div class="carousel-caption"> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer> </blockquote> </div> </div> <div class="item"> <div class="carousel-caption"> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer> </blockquote> </div> </div> --> </div> <!-- <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> --> </div> </div> </div> </div> <!-- /// end testimonials /// --> <!-- /// begin price /// --> <!-- <div class="price" id="price"> <div class="container"> <div class="section-heading"> <h1>Pricing Tables</h1> <p class="lead">Lorem ipsum dolor sit amet</p> </div> <div class="row"> <div class="col-sm-3 gray-bg wow fadeInDown" data-wow-delay=".4s"> <header class="price-header"> <h4>Basic</h4> <p>24$</p> </header> <ul class="list-group"> <li class="list-group-item"> <p class="pull-left">One day success</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Coffee Break</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Seat</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Certificate</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Lorem</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Ipsum</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Dolor</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Sit</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> </ul> </div> <div class="col-sm-3 gray-bg wow fadeInUp" data-wow-delay=".8s"> <header class="price-header"> <h4>Standart</h4> <p>40$</p> </header> <ul class="list-group"> <li class="list-group-item"> <p class="pull-left">One day success</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Coffee Break</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Seat</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Certificate</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Lorem</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Ipsum</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Dolor</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Sit</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> </ul> </div> <div class="col-sm-3 gray-bg wow fadeInDown" data-wow-delay="1.2s"> <header class="price-header"> <h4>Advance</h4> <p>65$</p> </header> <ul class="list-group"> <li class="list-group-item"> <p class="pull-left">One day success</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Coffee Break</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Seat</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Certificate</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Lorem</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Ipsum</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Dolor</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Sit</p> <p class="pull-right"><i class="fa fa-minus text-muted fa-lg"></i></p> </li> </ul> </div> <div class="col-sm-3 gray-bg wow fadeInUp" data-wow-delay="1.6s"> <header class="price-header"> <h4>Professional</h4> <p>100$</p> </header> <ul class="list-group"> <li class="list-group-item"> <p class="pull-left">One day success</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Coffee Break</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Seat</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Certificate</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Lorem</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Ipsum</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Dolor</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> <li class="list-group-item"> <p class="pull-left">Sit</p> <p class="pull-right"><i class="fa fa-check fa-lg"></i></p> </li> </ul> </div> </div> </div> </div> --> <!-- /// end price /// --> <!-- /// begin faq /// --> <!-- <div class="faq" id="faqSection"> <div class="container"> <div class="row"> <div class="col-md-4 wow fadeInLeft"> <h1>FAQ</h1> <p class="lead">Lorem ipsum dolor sit amet</p> <hr> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam, officiis, nisi temporibus reiciendis possimus inventore fugit. Natus, omnis, earum consectetur aperiam harum sequi qui soluta deserunt provident maxime voluptate dolores.</p> </div> <div class="col-md-8 wow fadeInRight"> <div class="panel-group" id="faq"> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq1"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq1" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq2"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq2" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq3"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq3" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq4"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq4" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq5"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq5" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> <div class="panel"> <a data-toggle="collapse" data-parent="#faq" href="#faq6"> Lorem ipsum dolor sit amet, consectetur adipisicing elit? </a> <div id="faq6" class="panel-collapse collapse"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, perferendis facere non laudantium nostrum odit corporis repudiandae voluptas dolorem consequuntur! Assumenda, eveniet, voluptates quos id at facilis perferendis obcaecati recusandae?</p> </div> </div> </div> </div> </div> </div> </div> --> <!-- /// end faq /// --> <!-- /// begin partners /// --> <div class="partners wow fadeInUp"> <div class="container"> <div class="section-heading"> <h1>Partners</h1> <p class="lead">The Emerging Tech Weekender is supported by</p> </div> <div class="row text-center"> <div class="col-lg-12"> <ul class="list-inline"> <li> <a href="http://www.digitaloxford.com/"> <img src="img/do-logo.png" /> </a> </li> <li> <a href="http://www.whiteoctober.co.uk/"> <img src="img/wo-logo.png" /> </a> </li> <li> <a href="https://www.brookes.ac.uk/"> <img src="img/brookes-logo.png" /> </a> </li> <!-- <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/twitter.png" alt=""></li> <li><img src="assets/img/partners/wordpress.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/twitter.png" alt=""></li> <li><img src="assets/img/partners/wordpress.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> --> </ul> </div> </div> </div> </div> <!-- /// end partners /// --> <!-- /// begin sponsors /// --> <div class="partners wow fadeInUp"> <div class="container"> <div class="section-heading"> <h1>Sponsors</h1> <p class="lead">The Emerging Tech Weekender is sponsored by</p> </div> <div class="row text-center"> <div class="col-lg-12"> <ul class="list-inline"> <li> <a href="http://www.oxfordshirelep.org.uk/cms/"> <img src="img/Oxlep-logo.png" /> </a> </li> <li> <a href="http://www.stfc.ac.uk/home.aspx"> <img src="img/STFC-logo.png" /> </a> </li> <!-- <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/twitter.png" alt=""></li> <li><img src="assets/img/partners/wordpress.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/twitter.png" alt=""></li> <li><img src="assets/img/partners/wordpress.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> <li><img src="assets/img/partners/magento.png" alt=""></li> <li><img src="assets/img/partners/facebook.png" alt=""></li> --> </ul> </div> </div> </div> </div> <!-- /// end partners /// --> <!-- /// begin map, subscribe, contacts /// --> <!-- /// set your venue address in data-location attribute /// --> <div class="map" id="ourLocation" data-location="John Henry Brookes Building, Oxford, OX3 0BP"> <!-- <div class="subscribe"> <div class="container wow fadeInDown"> <div class="row form-wrapper"> <div class="col-lg-12 body-bg"> <form class="input-group input-group-lg" id="subscribeForm" method="POST"> <span class="input-group-addon"><i class="fa fa-envelope"></i></span> <input type="email" class="form-control" data-validation="email" id="sEmail" name="sEmail"> <span class="input-group-btn"> <button class="btn btn-info" type="submit">Subscribe</button> </span> </form> <span class="help-block danger-color text-center"></span> </div> <div class="ok"> <h3>Success!</h3> </div> </div> </div> </div> --> <div class="container-fluid"> <div class="row"> <div class="col-lg-12 map-container" id="map"> </div> </div> </div> <div class="location wow flipInY"> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="popover bottom"> <!-- <div class="arrow"></div> --> <h2 class="popover-title">Location</h2> <div class="popover-content"> <div class="row"> <div class="col-sm-6"> <ul class="list-unstyled"> <!-- <div class="street-view" id="streetView"></div> --> <li><i class="fa fa-map-marker info-color"></i> <br />John Henry Brookes Building<br /> Oxford Brookes University - Headington Campus<br /> Oxford OX3 0BP</li> </ul> <!-- </li> --> </div> <div class="col-sm-6"> <ul class="list-unstyled"> <li><i class="fa fa-envelope info-color"></i> <br /> <a href="info@digitaloxford.com">info@digitaloxford.com</a> </li> <li>+44 (0)1865 706 013</li> <!-- <li><i class="fa fa-phone info-color"></i> +0 888 9090 909</li> --> </ul> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /// end map, subscribe, contacts /// --> <!-- /// end content /// --> <!-- /// begin footer /// --> <footer class="main-footer"> <div class="container"> <div class="row"> <div class="col-sm-12 social text-center"> <ul class="list-inline"> <li> <a href="https://twitter.com/digitaloxford"><i class="fa fa-twitter-square"></i></a> <a href="http://www.linkedin.com/groups?gid=4731680"><i class="fa fa-linkedin"></i></a> <!-- <a href="#"><i class="fa fa-facebook"></i></a> <a href="#"><i class="fa fa-google-plus"></i></a> <a href="#"><i class="fa fa-skype"></i></a> <a href="#"><i class="fa fa-xing"></i></a> <a href="#"><i class="fa fa-vimeo-square"></i></a> <a href="#"><i class="fa fa-youtube"></i></a> <a href="#"><i class="fa fa-envelope"></i></a> --> </li> </ul> </div> <div class="col-sm-12 text-center"> <span>All rights reserved</span> </div> </div> </div> </footer> <!-- /// end footer /// --> <!-- /// start script /// --> <!-- /// libs /// --> <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <script src="assets/js/libs/modernizr-latest.js"></script> <script src="assets/js/libs/jquery-1.11.0.min.js"></script> <script src="bootstrap-3.1.1/js/bootstrap.min.js"></script> <!-- /// plugins /// --> <script src="assets/js/plugins/fitvids/jquery.fitvids.js"></script> <script src="assets/js/plugins/select/bootstrap-select.min.js"></script> <script src="assets/js/plugins/gmap3/gmap3.min.js"></script> <script src="assets/js/plugins/scrollTo/jquery.scrollTo.js"></script> <script src="assets/js/plugins/nav/jquery.nav.js"></script> <script src="assets/js/plugins/countdown/countdown.js"></script> <script src="assets/js/plugins/placeholder/jquery.placeholder.js"></script> <script src="assets/js/plugins/validator/jquery.form-validator.min.js"></script> <script src="assets/js/plugins/wow/wow.min.js"></script> <script src="assets/js/main.js"></script> </body> </html>
{ "content_hash": "5f08496d0ae6881dabd0021de2ed9a24", "timestamp": "", "source": "github", "line_count": 1249, "max_line_length": 318, "avg_line_length": 50.95276220976781, "alnum_prop": 0.49063482086737903, "repo_name": "whiteoctober/emerging-tech-weekender", "id": "5c37819e536dab9df616dc10f7ed9dfb0db81473", "size": "63648", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages-old", "path": "index.html", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "140339" }, { "name": "JavaScript", "bytes": "208134" }, { "name": "Ruby", "bytes": "49" } ], "symlink_target": "" }
package common; /** * Represents the action of using an object card in the game * * @see Action * @author Andrea Sessa * @author Giorgio Pea * @version 1.0 */ public class UseObjAction extends Action { // A field automatically created for serialization purposes private static final long serialVersionUID = 1L; private final ObjectCard objectCard; /** * Constructs an action of using an object card from the object card it * refers to * * @param objectCard * the object card it's referred by the use object action */ public UseObjAction(ObjectCard objectCard) { this.objectCard = objectCard; } /** * Gets the object card associated with the use object action * * @return the object card associated with the use object action */ public ObjectCard getCard() { return objectCard; } /** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((objectCard == null) ? 0 : objectCard.hashCode()); return result; } /** * @see Object#equals(Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; UseObjAction other = (UseObjAction) obj; if (objectCard == null) { if (other.objectCard != null) return false; } else if (!objectCard.equals(other.objectCard)) return false; return true; } }
{ "content_hash": "3add3796a128e06e17b39df635587d3d", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 72, "avg_line_length": 21.6231884057971, "alnum_prop": 0.6675603217158177, "repo_name": "DeadManPoe/AFOSpaceProject", "id": "b0f080894e542a6ef618c70cea56fa64b2abd9d8", "size": "1492", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/common/UseObjAction.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "487234" } ], "symlink_target": "" }