max_stars_count
int64
301
224k
text
stringlengths
6
1.05M
token_count
int64
3
727k
385
/** * @file StageResourceList.h * @brief Storage container for a stages' resources. */ #pragma once #include "StageInfo.h" #include "types.h" namespace al { class StageResourceList { public: StageResourceList(char const *fileName, s32, char const *innerFileName); u32 getStageResourceNum() const; al::StageInfo* getStageInfo(s32 idx) const; u32 mResourceNum; // _0 u32 mPad; al::StageInfo* mStageInfos; // _8 }; };
203
1,140
<filename>utils.py import sys import pprint import numpy as np import tensorflow as tf eps = 1e-12 pp = pprint.PrettyPrinter() try: xrange except NameError: xrange = range def progress(progress): barLength = 20 # Modify this to change the length of the progress bar status = "" if isinstance(progress, int): progress = float(progress) if not isinstance(progress, float): progress = 0 status = "error: progress var must be float\r\n" if progress < 0: progress = 0 status = "Halt...\r\n" if progress >= 1: progress = 1 status = "Finished.\r\n" block = int(round(barLength*progress)) text = "\rPercent: [%s] %.2f%% %s" % ("#"*block + " "*(barLength-block), progress*100, status) sys.stdout.write(text) sys.stdout.flush() def pprint(seq): seq = np.array(seq) seq = np.char.mod('%d', np.around(seq)) seq[seq == '1'] = '#' seq[seq == '0'] = ' ' print("\n".join(["".join(x) for x in seq.tolist()])) def gather(m_or_v, idx): if len(m_or_v.get_shape()) > 1: return tf.gather(m_or_v, idx) else: assert idx == 0, "Error: idx should be 0 but %d" % idx return m_or_v def argmax(x): index = 0 max_num = x[index] for idx in xrange(1, len(x)-1): if x[idx] > max_num: index = idx max_num = x[idx] return index, max_num def softmax(x): """Compute softmax. Args: x: a 2-D `Tensor` (matrix) or 1-D `Tensor` (vector) """ try: return tf.nn.softmax(x + eps) except: return tf.reshape(tf.nn.softmax(tf.reshape(x + eps, [1, -1])), [-1]) def matmul(x, y): """Compute matrix multiplication. Args: x: a 2-D `Tensor` (matrix) y: a 2-D `Tensor` (matrix) or 1-D `Tensor` (vector) """ try: return tf.matmul(x, y) except: return tf.reshape(tf.matmul(x, tf.reshape(y, [-1, 1])), [-1])
946
12,252
package org.keycloak.testsuite.authz; import java.io.ByteArrayInputStream; import org.hamcrest.Matchers; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.EnvironmentVariables; import org.junit.rules.ExpectedException; import org.keycloak.authorization.client.AuthzClient; public class AuthzClientTest { @Rule public final EnvironmentVariables envVars = new EnvironmentVariables(); @Rule public ExpectedException expectedException = ExpectedException.none(); @Test public void testCreateWithEnvVars() { envVars.set("KEYCLOAK_REALM", "test"); envVars.set("KEYCLOAK_AUTH_SERVER", "http://test"); expectedException.expect(RuntimeException.class); expectedException.expectMessage(Matchers.containsString("Could not obtain configuration from server")); AuthzClient.create(new ByteArrayInputStream(("{\n" + " \"realm\": \"${env.KEYCLOAK_REALM}\",\n" + " \"auth-server-url\": \"${env.KEYCLOAK_AUTH_SERVER}\",\n" + " \"ssl-required\": \"external\",\n" + " \"enable-cors\": true,\n" + " \"resource\": \"my-server\",\n" + " \"credentials\": {\n" + " \"secret\": \"${env.KEYCLOAK_SECRET}\"\n" + " },\n" + " \"confidential-port\": 0,\n" + " \"policy-enforcer\": {\n" + " \"enforcement-mode\": \"ENFORCING\"\n" + " }\n" + "}").getBytes())); } }
725
491
<filename>k2/python/host/csrc/fsa_util.cc // k2/python/host/csrc/fsa_util.cc // Copyright (c) 2020 Mobvoi Inc. (authors: <NAME>) // See ../../../LICENSE for clarification regarding multiple authors #include "k2/python/host/csrc/fsa_util.h" #include "k2/csrc/host/fsa_util.h" void PybindFsaUtil(py::module &m) { m.def("fsa_to_str", &k2host::FsaToString, py::arg("fsa")); }
174
2,542
<reponame>AnthonyM/service-fabric // ------------------------------------------------------------ // 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 Transport { typedef std::shared_ptr<MulticastDatagramSender> MulticastDatagramSenderSPtr; // // MulticastDatagramSender allows efficient transmission of message to a collection of transport targets. // class MulticastDatagramSender { DENY_COPY(MulticastDatagramSender) public: // // Construct a MulticastDatagramSender that will use the specified unicast datagram // transport to send message to a collection of transport targets. // MulticastDatagramSender(IDatagramTransportSPtr unicastTransport); virtual ~MulticastDatagramSender(); // // Resolve a list of transport addresses to SendTargets. Requires a begin and end iterator // to a collection of NamedAddress. // template<class TAddressIterator> MulticastSendTargetSPtr Resolve(TAddressIterator begin, TAddressIterator end, size_t & failedResolves) { failedResolves = 0; vector<ISendTarget::SPtr> targets; for(TAddressIterator iter = begin; iter < end; iter++) { auto target = transport_->ResolveTarget(iter->Address, iter->Name); if (!target) { ++failedResolves; } targets.push_back(std::move(target)); } return make_shared<MulticastSendTarget>(targets.begin(), targets.end()); } // // Send specified message to a collection of SendTargets. The specified message must not // contain any target specific content. All target specific headers must be specified via // targetHeaders parameter. The TargetHeadersCollection must be created from // SendTargetCollection. The iterator of TargetHeaderCollection has position equivalence to // corresponding iterator in SendTargetCollections. void Send( MulticastSendTargetSPtr const & multicastTarget, MessageUPtr && message, MessageHeadersCollection && targetHeaders = std::move(MessageHeadersCollection(0))); private: IDatagramTransportSPtr transport_; }; }
946
2,151
/* * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. * */ #ifndef _MIPSSP_H_ #define _MIPSSP_H_ #include "dl/api/omxtypes.h" #ifdef __cplusplus extern "C" { #endif /* * Number of sub-transforms performed in the final stage of the 65536-size FFT. * The number of sub-transforms for all other stages can be derived from this * number. This sequence of numbers is equivalent to the Jacobsthal number * sequence (see http://en.wikipedia.org/wiki/Jacobsthal_number). */ #define SUBTRANSFORM_CONST (0x2aab) #define SQRT1_2 (0.7071067812f) /* sqrt(0.5f) */ extern OMX_F32 mipsSP_FFT_F32TwiddleTable[]; typedef struct MIPSFFTSpec_R_FC32_Tag { OMX_U32 order; OMX_U16* pBitRev; OMX_U16* pBitRevInv; const OMX_U16* pOffset; const OMX_F32* pTwiddle; OMX_F32* pBuf; } MIPSFFTSpec_R_FC32; #ifdef __cplusplus } #endif #endif
435
3,651
/* * Copyright 2010-2016 OrientDB LTD (http://orientdb.com) * * 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.orientechnologies.orient.graph.sql; import com.orientechnologies.orient.core.id.ORID; import com.orientechnologies.orient.core.id.ORecordId; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.sql.OCommandSQL; import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; import com.orientechnologies.orient.graph.gremlin.OGremlinHelper; import com.tinkerpop.blueprints.impls.orient.OrientEdge; import com.tinkerpop.blueprints.impls.orient.OrientGraph; import com.tinkerpop.blueprints.impls.orient.OrientVertex; import java.util.List; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class SQLGraphFunctionsTest { private static OrientGraph graph; public SQLGraphFunctionsTest() {} @BeforeClass public static void beforeClass() { String url = "memory:" + SQLGraphFunctionsTest.class.getSimpleName(); graph = new OrientGraph(url); OrientVertex v1 = graph.addVertex(null, "name", "A"); OrientVertex v2 = graph.addVertex(null, "name", "B"); OrientVertex v3 = graph.addVertex(null, "name", "C"); OrientVertex v4 = graph.addVertex(null, "name", "D-D"); OrientVertex v5 = graph.addVertex(null, "name", "E"); OrientVertex v6 = graph.addVertex(null, "name", "F"); v1.addEdge("label", v2, null, null, "weight", 10); v2.addEdge("label", v3, null, null, "weight", 20); v3.addEdge("label", v4, null, null, "weight", 30); v4.addEdge("label", v5, null, null, "weight", 40); v5.addEdge("label", v6, null, null, "weight", 50); v5.addEdge("label", v1, null, null, "weight", 100); graph.commit(); } @AfterClass public static void afterClass() { graph.shutdown(); } @Test public void checkDijkstra() { String subquery = "select $current, $target, Dijkstra($current, $target , 'weight') as path from V let $target = ( select from V where name = \'C\' ) where 1 > 0"; Iterable<OrientVertex> result = graph.command(new OSQLSynchQuery<OrientVertex>(subquery)).execute(); Assert.assertTrue(result.iterator().hasNext()); for (OrientVertex d : result) { OrientVertex $current = d.getProperty("$current"); Object name = $current.getProperty("name"); Iterable<OrientVertex> $target = (Iterable<OrientVertex>) d.getProperty("$target"); Object name1 = $target.iterator().next().getProperty("name"); System.out.println( "Shortest path from " + name + " and " + name1 + " is: " + d.getProperty("path")); } } @Test public void checkMinusInString() { Iterable<OrientVertex> result = graph.command(new OCommandSQL("select expand( out()[name='D-D'] ) from V")).execute(); Assert.assertTrue(result.iterator().hasNext()); } @Test public void testGremlinTraversal() { OGremlinHelper.global().create(); graph.setAutoStartTx(false); graph.commit(); graph.command(new OCommandSQL("create class tc1 extends V clusters 1")).execute(); graph.command(new OCommandSQL("create class edge1 extends E clusters 1")).execute(); graph.setAutoStartTx(true); OrientVertex v1 = graph.command(new OCommandSQL("create vertex tc1 SET id='1', name='name1'")).execute(); OrientVertex v2 = graph.command(new OCommandSQL("create vertex tc1 SET id='2', name='name2'")).execute(); graph.commit(); int tc1Id = graph.getRawGraph().getClusterIdByName("tc1"); int edge1Id = graph.getRawGraph().getClusterIdByName("edge1"); Iterable<OrientEdge> e = graph .command( new OCommandSQL( "create edge edge1 from #" + tc1Id + ":0 to #" + tc1Id + ":1 set f='fieldValue';")) .execute(); graph.commit(); List<ODocument> result = graph .getRawGraph() .query(new OSQLSynchQuery<ODocument>("select gremlin('current.outE') from tc1")); Assert.assertEquals(2, result.size()); ODocument firstItem = result.get(0); List<OrientEdge> firstResult = firstItem.field("gremlin"); Assert.assertEquals(1, firstResult.size()); OrientEdge edge = firstResult.get(0); Assert.assertEquals(new ORecordId(edge1Id, 0), (ORID) edge.getId()); ODocument secondItem = result.get(1); List<OrientEdge> secondResult = secondItem.field("gremlin"); Assert.assertTrue(secondResult.isEmpty()); OGremlinHelper.global().destroy(); } }
1,992
9,724
<reponame>albertobarri/idk /**************************************************************************** GLUI User Interface Toolkit --------------------------- glui_column.cpp - GLUI_Column control class -------------------------------------------------- Copyright (c) 1998 <NAME> WWW: http://sourceforge.net/projects/glui/ Forums: http://sourceforge.net/forum/?group_id=92496 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ #include "glui_internal_control.h" /******************************** GLUI_Column::GLUI_Column() ************/ GLUI_Column::GLUI_Column( GLUI_Node *parent, int draw_bar ) { common_init(); int_val = draw_bar; /* Whether to draw vertical bar or not */ parent->add_control( this ); } /**************************************** GLUI_Column::draw() ************/ void GLUI_Column::draw( int x, int y ) { int panel_x, panel_y, panel_w, panel_h, panel_x_off, panel_y_off; int y_diff; if ( int_val == 1 ) { /* Draw a vertical bar */ GLUI_DRAWINGSENTINAL_IDIOM if ( parent() != NULL ) { get_this_column_dims(&panel_x, &panel_y, &panel_w, &panel_h, &panel_x_off, &panel_y_off); y_diff = y_abs - panel_y; if ( 0 ) { glLineWidth(1.0); glBegin( GL_LINES ); glColor3f( .5, .5, .5 ); glVertex2i( -GLUI_XOFF+1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); glVertex2i( -GLUI_XOFF+1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); glColor3f( 1.0, 1.0, 1.0 ); glVertex2i( -GLUI_XOFF+2, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); glVertex2i( -GLUI_XOFF+2, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); glEnd(); } else { glLineWidth(1.0); glBegin( GL_LINES ); glColor3f( .5, .5, .5 ); glVertex2i( -2, 0 ); glVertex2i( -2, h ); /*glVertex2i( 0, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); */ /*glVertex2i( 0, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); */ glColor3f( 1.0, 1.0, 1.0 ); glVertex2i( -1, 0 ); glVertex2i( -1, h ); /*glVertex2i( 1, -y_diff + GLUI_SEPARATOR_HEIGHT/2 ); */ /*glVertex2i( 1, -y_diff + panel_h - GLUI_SEPARATOR_HEIGHT/2); */ glEnd(); } } } }
1,127
1,666
int main() { bool b = __has_trivial_copy(int); (void) b; return 0; }
35
6,663
# mode: run from __future__ import print_function import cython # https://github.com/cython/cython/issues/3954 # calls to the __class__ attributes of builtin types were optimized to something invalid @cython.locals(d=dict) def test_dict(d): """ >>> test_dict({}) dict {} """ print(d.__class__.__name__) print(d.__class__()) @cython.locals(i=int) def test_int(i): """ >>> test_int(0) int 0 """ print(i.__class__.__name__) print(i.__class__()) @cython.cclass class C: def __str__(self): return "I'm a C object" @cython.locals(c=C) def test_cdef_class(c): """ # This wasn't actually broken but is worth testing anyway >>> test_cdef_class(C()) C I'm a C object """ print(c.__class__.__name__) print(c.__class__()) @cython.locals(d=object) def test_object(o): """ >>> test_object({}) dict {} >>> test_object(1) int 0 >>> test_object(C()) C I'm a C object """ print(o.__class__.__name__) print(o.__class__())
493
567
<gh_stars>100-1000 package org.jolokia.backend; /* * Copyright 2009-2011 <NAME> * * 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. */ import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.management.*; import org.jolokia.backend.executor.MBeanServerExecutor; import org.jolokia.config.ConfigKey; import org.jolokia.config.Configuration; import org.jolokia.detector.ServerHandle; import org.jolokia.util.LogHandler; import org.testng.annotations.Test; import static org.testng.Assert.*; /** * @author roland * @since 02.09.11 */ public class MBeanServerHandlerTestNegative { private MBeanServerHandler handler; @Test public void mbeanRegistrationWithFailingTestDetector() throws JMException, IOException { TestDetector.setThrowAddException(true); // New setup because detection happens at construction time init(); try { ObjectName oName = new ObjectName(handler.getObjectName()); MBeanServerExecutor servers = handler.getMBeanServerManager(); final List<Boolean> results = new ArrayList<Boolean>(); servers.each(oName, new MBeanServerExecutor.MBeanEachCallback() { public void callback(MBeanServerConnection pConn, ObjectName pName) throws ReflectionException, InstanceNotFoundException, IOException, MBeanException { results.add(pConn.isRegistered(pName)); } }); assertTrue(results.contains(Boolean.TRUE),"MBean not registered"); } finally { TestDetector.setThrowAddException(false); handler.destroy(); } } @Test public void fallThrough() throws JMException { TestDetector.setFallThrough(true); init(); try { ServerHandle handle = handler.getServerHandle(); assertNull(handle.getProduct()); } finally { TestDetector.setFallThrough(false); handler.destroy(); } } // =================================================================================================== private void init() throws MalformedObjectNameException { TestDetector.reset(); Configuration config = new Configuration(ConfigKey.MBEAN_QUALIFIER,"qualifier=test"); handler = new MBeanServerHandler(config, new LogHandler() { public void debug(String message) { } public void info(String message) { } public void error(String message, Throwable t) { } }); } }
1,177
679
/************************************************************** * * 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 _SOT_DATA_HXX #define _SOT_DATA_HXX /************************************************************************* *************************************************************************/ #ifndef _TOOLS_SOLAR_H #include <tools/solar.h> #endif #include "sot/sotdllapi.h" //==================class SotData_Impl==================================== class List; class SotFactory; class SotFactoryList; class SotObjectList; struct SotData_Impl { sal_uInt32 nSvObjCount; SotObjectList * pObjectList; SotFactoryList * pFactoryList; SotFactory * pSotObjectFactory; SotFactory * pSotStorageStreamFactory; SotFactory * pSotStorageFactory; List* pDataFlavorList; SotData_Impl(); }; SOT_DLLPUBLIC SotData_Impl* SOTDATA(); #endif
483
488
<reponame>maurizioabba/rose #error "Chose the wrong header. For system includes GCC first looks inside the directories specified by '-I', then into the system include directories."
45
704
<reponame>plausiblelabs/ftl /* * Copyright (c) 2013 <NAME> * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. */ #include <ftl/maybe.h> #include <ftl/vector.h> #include <ftl/list.h> #include "concept_tests.h" test_set concept_tests{ std::string("concepts"), { std::make_tuple( std::string("Monoid: curried mappend"), std::function<bool()>([]() -> bool { using namespace ftl; auto m1 = just(sum(2)); auto m2 = just(sum(2)); auto m3 = mappend % m1 * m2; return m3 == just(sum(4)); }) ), std::make_tuple( std::string("Functor: curried fmap"), std::function<bool()>([]() -> bool { using namespace ftl; auto f = [](int x){ return x+1; }; auto fm = fmap(f); auto m = fm(just(2)); return m == just(3) && m == fmap(f)(just(2)); }) ), /* DISABLED, because current libc++ version does not generate an * operator() const for mem_fn's. std::make_tuple( std::string("Functor: fmap [member fn]"), std::function<bool()>([]() -> bool { using namespace ftl; struct test { test(int x) : x(x) {} int foo() { return x + 3; } int x; }; auto r = &test::foo % just(test{3}); return get<int>(r) == 6; }) ), */ std::make_tuple( std::string("Applicative: curried aapply"), std::function<bool()>([]() -> bool { using namespace ftl; auto mf = just(function<int(int)>([](int x){ return x+1; })); auto ap = aapply(mf); return ap(just(2)) == just(3) && aapply(mf)(just(2)) == just(3); }) ), std::make_tuple( std::string("Monad: curried mbind"), std::function<bool()>([]() -> bool { using namespace ftl; auto m = just(2); auto cbind = mbind(m); auto f = [](int x){ return just(x+1); }; return cbind(f) == just(3); }) ), std::make_tuple( std::string("Monad: >>="), std::function<bool()>([]() -> bool { using namespace ftl; auto m1 = just(2); auto f1 = [](int x){ return just(float(x)*0.5f); }; auto f2 = [](float x){ return just(int(x*3.33f)); }; return ((m1 >>= f1) >>= f2) == just(3); }) ), /* DISABLED, because current libc++ version does not generate an * operator() const for mem_fn's. std::make_tuple( std::string("Monad: >>= [member fn]"), std::function<bool()>([]() -> bool { using namespace ftl; struct foo { explicit foo(int x) : x(x) {} maybe<int> bar() const { return just(2*x); } int x; }; auto m = just(foo{3}); return (m >>= &foo::bar) == just(6); }) ), */ std::make_tuple( std::string("Monad: >>"), std::function<bool()>([]() -> bool { using namespace ftl; auto m1 = just(1); auto m2 = just(2); maybe<int> m3 = Nothing{}; return m1 >> m2 == just(2) && m3 >> m1 == nothing<int>(); }) ), std::make_tuple( std::string("Monad: <<"), std::function<bool()>([]() -> bool { using namespace ftl; auto m1 = just(1); auto m2 = just(2); maybe<int> m3 = Nothing{}; return m1 << m2 == just(1) && m1 << m3 == nothing<int>(); }) ), std::make_tuple( std::string("Monad: <<="), std::function<bool()>([]() -> bool { using namespace ftl; auto m1 = just(0.f); auto m2 = just(2.f); auto f = [](float x){ return x == 0 ? Nothing{} : just(8.f / x); }; return (f <<= f <<= m1) == nothing<float>() && (f <<= f <<= m2) == just(2.f); }) ), std::make_tuple( std::string("Monad: mixed, non-trivial sequence"), std::function<bool()>([]() -> bool { using namespace ftl; auto plusOne = [](int x){ return just(x+1); }; auto mulTwo = [](int x){ return just(2*x); }; auto mNothing = nothing<int>(); auto mOne = just(1); auto m1 = ((mOne >>= plusOne) >>= mulTwo) << (mulTwo <<= mOne); return m1 == just(4); }) ), std::make_tuple( std::string("Foldable: curried foldMap"), std::function<bool()>([]() -> bool { using namespace ftl; auto foldmap = foldMap(sum<int>); std::vector<int> v{3,3,4}; return foldmap(v) == 10; }) ), std::make_tuple( std::string("Foldable: curried foldr"), std::function<bool()>([]() -> bool { using namespace ftl; auto foldr2 = foldr(std::plus<int>()); auto foldr1 = foldr2(0); std::vector<int> v{3,3,4}; return foldr(std::plus<int>(), 0, v) == 10 && foldr2(0, v) == 10 && foldr1(v) == 10 && foldr(std::plus<int>())(0)(v) == 10; }) ), std::make_tuple( std::string("Foldable: curried foldl"), std::function<bool()>([]() -> bool { using namespace ftl; auto f = [](int x, int y){ return x+y; }; auto foldl2 = foldl(f); auto foldl1 = foldl(f, 0); std::vector<int> v{3,3,4}; return foldl(f, 0, v) == 10 && foldl2(0, v) == 10 && foldl1(v) == 10 && foldl(f, 0)(v) == 10; }) ), std::make_tuple( std::string("Foldable: foldl associativity"), std::function<bool()>([]() -> bool { using namespace ftl; auto rCons = [](std::list<int> xs, int x){ xs.push_front(x); return xs; }; std::list<int> l{2,3,4}; return foldl(rCons, std::list<int>{}, l) == std::list<int>{4,3,2}; }) ), std::make_tuple( std::string("Zippable: curried zipWith"), std::function<bool()>([]() -> bool { using namespace ftl; auto f = [](int x, int y){ return x+y; }; auto zipWithF = zipWith(f); std::vector<int> v1{3,3,4}; std::vector<int> v2{1,3,5}; auto zipWithFV1 = zipWith(f, v1); std::vector<int> expected{4,6,9}; return zipWithF(v1, v2) == expected && zipWithFV1(v2) == expected; }) ), std::make_tuple( std::string("Zippable: zip"), std::function<bool()>([]() -> bool { using namespace ftl; std::vector<int> v1{3,3,4}; std::vector<int> v2{1,3,5,6}; std::vector<std::tuple<int,int>> expected1{ std::make_tuple(3,1), std::make_tuple(3,3), std::make_tuple(4,5) }; std::vector<std::tuple<int,int>> expected2{ std::make_tuple(1,3), std::make_tuple(3,3), std::make_tuple(5,4) }; return zip(v1, v2) == expected1 && zip(v2, v1) == expected2; }) ), std::make_tuple( std::string("fmap(fold, v)"), std::function<bool()>([]() -> bool { using namespace ftl; std::vector<std::vector<sum_monoid<int>>> v{ {sum(1), sum(2)}, {sum(3), sum(4)} }; auto r = fmap(fold, v); return r == std::vector<sum_monoid<int>>{sum(3), sum(7)}; }) ) } };
3,383
451
/*Header-MicMac-eLiSe-25/06/2007 MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation eLiSe : ELements of an Image Software Environnement www.micmac.ign.fr Copyright : Institut Geographique National Author : <NAME> Contributors : <NAME>, <NAME>. [1] <NAME>, <NAME>. "A multiresolution and optimization-based image matching approach: An application to surface reconstruction from SPOT5-HRS stereo imagery." In IAPRS vol XXXVI-1/W41 in ISPRS Workshop On Topographic Mapping From Space (With Special Emphasis on Small Satellites), Ankara, Turquie, 02-2006. [2] <NAME>, "MicMac, un lociel de mise en correspondance d'images, adapte au contexte geograhique" to appears in Bulletin d'information de l'Institut Geographique National, 2007. Francais : MicMac est un logiciel de mise en correspondance d'image adapte au contexte de recherche en information geographique. Il s'appuie sur la bibliotheque de manipulation d'image eLiSe. Il est distibue sous la licences Cecill-B. Voir en bas de fichier et http://www.cecill.info. English : MicMac is an open source software specialized in image matching for research in geographic information. MicMac is built on the eLiSe image library. MicMac is governed by the "Cecill-B licence". See below and http://www.cecill.info. Header-MicMac-eLiSe-25/06/2007*/ #include "tieptrifar.h" #include "../Detector.h" int TiepTriFar_Main(int argc,char ** argv) { std::string aFullNameXML,anOri; Pt3dr aVWin; cParamTiepTriFar aParam; ElInitArgMain ( argc,argv, LArgMain() << EAMC(aFullNameXML, "Name XML for Triangu", eSAM_IsPatFile) << EAMC(aParam.aNameMesh, "Mesh of far scene part", eSAM_IsExistFile) << EAMC(anOri, "Orientation dir") << EAMC(aParam.aDirZBuf, "ZBuffer directory", eSAM_IsDir), LArgMain() << EAM(aVWin, "VWin", true, "[Pt2di(SzW), double Zoom]") << EAM(aParam.aDispVertices, "DispVrtc", true, "Display vertices") << EAM(aParam.aRad, "Rad", true, "Radius of detector") ); if (EAMIsInit(&aVWin)) { aParam.aDisp = true; aParam.aSzW = Pt2di(aVWin.x, aVWin.y); aParam.aZoom = aVWin.z; } else { aParam.aDisp = false; aParam.aDispVertices = false; } std::string aDir,aNameXML; SplitDirAndFile(aDir,aNameXML,aFullNameXML); if (! StdCorrecNameOrient(anOri,aDir,true)) { StdCorrecNameOrient(anOri,"./"); aDir = "./"; } cInterfChantierNameManipulateur * anICNM = cInterfChantierNameManipulateur::BasicAlloc(aDir); cXml_TriAngulationImMaster aTriang = StdGetFromSI(aFullNameXML,Xml_TriAngulationImMaster); vector<string> aNameIm; for (uint aKImg=0; aKImg<aTriang.NameSec().size(); aKImg++) { aNameIm.push_back(aTriang.NameSec()[aKImg]); } cAppliTiepTriFar * aAppli = new cAppliTiepTriFar( aParam, anICNM, aNameIm, aDir, anOri ); aAppli->LoadMesh(aParam.aNameMesh); aAppli->loadMask2D(); aAppli->FilterContrast(); aAppli->Matching(); return EXIT_SUCCESS; } /*Footer-MicMac-eLiSe-25/06/2007 Ce logiciel est un programme informatique servant à la mise en correspondances d'images pour la reconstruction du relief. Ce logiciel est régi par la licence CeCILL-B soumise au droit français et respectant les principes de diffusion des logiciels libres. Vous pouvez utiliser, modifier et/ou redistribuer ce programme sous les conditions de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA sur le site "http://www.cecill.info". En contrepartie de l'accessibilité au code source et des droits de copie, de modification et de redistribution accordés par cette licence, il n'est offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, seule une responsabilité restreinte pèse sur l'auteur du programme, le titulaire des droits patrimoniaux et les concédants successifs. A cet égard l'attention de l'utilisateur est attirée sur les risques associés au chargement, à l'utilisation, à la modification et/ou au développement et à la reproduction du logiciel par l'utilisateur étant donné sa spécificité de logiciel libre, qui peut le rendre complexe à manipuler et qui le réserve donc à des développeurs et des professionnels avertis possédant des connaissances informatiques approfondies. Les utilisateurs sont donc invités à charger et tester l'adéquation du logiciel à leurs besoins dans des conditions permettant d'assurer la sécurité de leurs systèmes et ou de leurs données et, plus généralement, à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la licence CeCILL-B, et que vous en avez accepté les termes. aooter-MicMac-eLiSe-25/06/2007*/
2,380
11,356
<filename>deps/src/boost_1_65_1/libs/function_types/test/classification/is_cv_function.cpp // (C) Copyright <NAME> // // Use modification and distribution are subject to the boost Software License, // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). //------------------------------------------------------------------------------ #include <boost/mpl/assert.hpp> #include <boost/function_types/is_function.hpp> namespace ft = boost::function_types; template<typename C, typename T> void test_non_cv(T C::*) { BOOST_MPL_ASSERT(( ft::is_function<T, ft::non_const > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::non_volatile > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::tag<ft::non_const,ft::non_volatile> > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::const_qualified > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::volatile_qualified > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::tag<ft::const_qualified,ft::volatile_qualified> > )); } template<typename C, typename T> void test_c_non_v(T C::*) { BOOST_MPL_ASSERT(( ft::is_function<T, ft::const_qualified > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::non_volatile > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::tag<ft::const_qualified,ft::non_volatile> > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::non_const > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::volatile_qualified > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::tag<ft::non_const,ft::volatile_qualified> > )); } template<typename C, typename T> void test_v_non_c(T C::*) { BOOST_MPL_ASSERT(( ft::is_function<T, ft::non_const > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::volatile_qualified > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::tag<ft::non_const,ft::volatile_qualified> > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::const_qualified > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::non_volatile > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::tag<ft::const_qualified,ft::non_volatile> > )); } template<typename C, typename T> void test_cv(T C::*) { BOOST_MPL_ASSERT(( ft::is_function<T, ft::const_qualified > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::volatile_qualified > )); BOOST_MPL_ASSERT(( ft::is_function<T, ft::tag<ft::const_qualified,ft::volatile_qualified> > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::non_const > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::non_volatile > )); BOOST_MPL_ASSERT_NOT(( ft::is_function<T, ft::tag<ft::non_const,ft::non_volatile> > )); } struct C { void non_cv(int) { } void c_non_v(int) const { } void v_non_c(int) volatile { } void cv(int) const volatile { } }; void instanitate() { test_non_cv(& C::non_cv); test_c_non_v(& C::c_non_v); test_v_non_c(& C::v_non_c); test_cv(& C::cv); }
1,306
7,782
# Copyright (c) 2019 PaddlePaddle Authors. 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. import unittest import os import yaml import logging import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 4))) if parent_path not in sys.path: sys.path.append(parent_path) from ppdet.utils.download import get_path from ppdet.utils.download import DATASET_HOME from ppdet.core.workspace import load_config, merge_config from ppdet.data.reader import create_reader from ppdet.utils.check import enable_static_mode COCO_VAL_URL = 'http://images.cocodataset.org/zips/val2017.zip' COCO_VAL_MD5SUM = '442b8da7639aecaf257c1dceb8ba8c80' COCO_ANNO_URL = 'http://images.cocodataset.org/annotations/annotations_trainval2017.zip' COCO_ANNO_MD5SUM = 'f4bbac642086de4f52a3fdda2de5fa2c' FORMAT = '[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]' logging.basicConfig(level=logging.INFO, format=FORMAT) logger = logging.getLogger(__name__) class TestReaderYAML(unittest.TestCase): @classmethod def setUpClass(cls): """ setup """ root_path = os.path.join(DATASET_HOME, 'coco') _, _ = get_path(COCO_VAL_URL, root_path, COCO_VAL_MD5SUM) _, _ = get_path(COCO_ANNO_URL, root_path, COCO_ANNO_MD5SUM) cls.anno_path = 'annotations/instances_val2017.json' cls.image_dir = 'val2017' cls.root_path = root_path @classmethod def tearDownClass(cls): """ tearDownClass """ pass def test_loader_yaml(self): cfg_file = 'ppdet/data/tests/test.yml' cfg = load_config(cfg_file) data_cfg = '[!COCODataSet {{image_dir: {0}, dataset_dir: {1}, ' \ 'anno_path: {2}, sample_num: 10}}]'.format( self.image_dir, self.root_path, self.anno_path) dataset_ins = yaml.load(data_cfg, Loader=yaml.Loader) update_train_cfg = {'TrainReader': {'dataset': dataset_ins[0]}} update_test_cfg = {'EvalReader': {'dataset': dataset_ins[0]}} merge_config(update_train_cfg) merge_config(update_test_cfg) reader = create_reader(cfg['TrainReader'], 10)() for samples in reader: for sample in samples: im_shape = sample[0].shape self.assertEqual(im_shape[0], 3) self.assertEqual(im_shape[1] % 32, 0) self.assertEqual(im_shape[2] % 32, 0) im_info_shape = sample[1].shape self.assertEqual(im_info_shape[-1], 3) im_id_shape = sample[2].shape self.assertEqual(im_id_shape[-1], 1) gt_bbox_shape = sample[3].shape self.assertEqual(gt_bbox_shape[-1], 4) gt_class_shape = sample[4].shape self.assertEqual(gt_class_shape[-1], 1) self.assertEqual(gt_class_shape[0], gt_bbox_shape[0]) is_crowd_shape = sample[5].shape self.assertEqual(is_crowd_shape[-1], 1) self.assertEqual(is_crowd_shape[0], gt_bbox_shape[0]) mask = sample[6] self.assertEqual(len(mask), gt_bbox_shape[0]) self.assertEqual(mask[0][0].shape[-1], 2) reader = create_reader(cfg['EvalReader'], 10)() for samples in reader: for sample in samples: im_shape = sample[0].shape self.assertEqual(im_shape[0], 3) self.assertEqual(im_shape[1] % 32, 0) self.assertEqual(im_shape[2] % 32, 0) im_info_shape = sample[1].shape self.assertEqual(im_info_shape[-1], 3) im_id_shape = sample[2].shape self.assertEqual(im_id_shape[-1], 1) if __name__ == '__main__': enable_static_mode() unittest.main()
2,068
988
/** * Copyright (C) 2011-2015 The XDocReport Team <<EMAIL>> * * All rights reserved. * * 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. */ package fr.opensagres.xdocreport.core.utils; import java.util.ArrayList; import java.util.List; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; import fr.opensagres.xdocreport.core.internal.IXMLPrettyPrinter; import fr.opensagres.xdocreport.core.internal.IndentNumberPrettyPrinter; import fr.opensagres.xdocreport.core.internal.NoIndentNumberPrettyPrinter; import fr.opensagres.xdocreport.core.internal.NoPrettyPrinter; import fr.opensagres.xdocreport.core.internal.XSLTPrettyPrinter; /** * XML Utilities to indent XML. */ public class XMLUtils { public static final Integer INDENT_NUMBER = new Integer( 4 ); public static final List<IXMLPrettyPrinter> PRINTERS; private static IXMLPrettyPrinter wellPrinter = null; static { PRINTERS = new ArrayList<IXMLPrettyPrinter>(); PRINTERS.add( IndentNumberPrettyPrinter.INSTANCE ); PRINTERS.add( XSLTPrettyPrinter.INSTANCE ); PRINTERS.add( NoIndentNumberPrettyPrinter.INSTANCE ); PRINTERS.add( NoPrettyPrinter.INSTANCE ); } /** * Indent the given xml with the 4 indentation. * * @param xml XML to indent * @return * @throws Exception */ public static String prettyPrint( String xml ) { return prettyPrint( xml, INDENT_NUMBER ); } /** * Indent the given xml with the given indent number. * * @param xml XML to indent * @param indent the indent number. * @return * @throws Exception */ public static String prettyPrint( String xml, int indent ) { if ( wellPrinter == null ) { // Loop for printers to get the well printer which doesn't crash. for ( IXMLPrettyPrinter printer : PRINTERS ) { try { String result = printer.prettyPrint( xml, indent ); wellPrinter = printer; return result; } catch ( Throwable e ) { } } // If error occurs, returns the xml source (with no indentation). return xml; } // Here printer was found, use it. try { return wellPrinter.prettyPrint( xml, indent ); } catch ( Throwable e ) { // If error occurs, returns the xml source (with no indentation). return xml; } } /** * Get the SAX {@link AttributesImpl} of teh given attributes to modify attribute values. * * @param attributes * @return */ public static AttributesImpl toAttributesImpl( Attributes attributes ) { if ( attributes instanceof AttributesImpl ) { return (AttributesImpl) attributes; } // Another SAX Implementation, create a new instance. AttributesImpl attributesImpl = new AttributesImpl(); int length = attributes.getLength(); for ( int i = 0; i < length; i++ ) { attributesImpl.addAttribute( attributes.getURI( i ), attributes.getLocalName( i ), attributes.getQName( i ), attributes.getType( i ), attributes.getValue( i ) ); } return attributesImpl; } }
1,781
342
package com.test.openvpn; /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ public class ClientAPI_ConnectionInfo { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected ClientAPI_ConnectionInfo(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(ClientAPI_ConnectionInfo obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; ovpncliJNI.delete_ClientAPI_ConnectionInfo(swigCPtr); } swigCPtr = 0; } } public void setDefined(boolean value) { ovpncliJNI.ClientAPI_ConnectionInfo_defined_set(swigCPtr, this, value); } public boolean getDefined() { return ovpncliJNI.ClientAPI_ConnectionInfo_defined_get(swigCPtr, this); } public void setUser(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_user_set(swigCPtr, this, value); } public String getUser() { return ovpncliJNI.ClientAPI_ConnectionInfo_user_get(swigCPtr, this); } public void setServerHost(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_serverHost_set(swigCPtr, this, value); } public String getServerHost() { return ovpncliJNI.ClientAPI_ConnectionInfo_serverHost_get(swigCPtr, this); } public void setServerPort(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_serverPort_set(swigCPtr, this, value); } public String getServerPort() { return ovpncliJNI.ClientAPI_ConnectionInfo_serverPort_get(swigCPtr, this); } public void setServerProto(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_serverProto_set(swigCPtr, this, value); } public String getServerProto() { return ovpncliJNI.ClientAPI_ConnectionInfo_serverProto_get(swigCPtr, this); } public void setServerIp(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_serverIp_set(swigCPtr, this, value); } public String getServerIp() { return ovpncliJNI.ClientAPI_ConnectionInfo_serverIp_get(swigCPtr, this); } public void setVpnIp4(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_vpnIp4_set(swigCPtr, this, value); } public String getVpnIp4() { return ovpncliJNI.ClientAPI_ConnectionInfo_vpnIp4_get(swigCPtr, this); } public void setVpnIp6(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_vpnIp6_set(swigCPtr, this, value); } public String getVpnIp6() { return ovpncliJNI.ClientAPI_ConnectionInfo_vpnIp6_get(swigCPtr, this); } public void setGw4(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_gw4_set(swigCPtr, this, value); } public String getGw4() { return ovpncliJNI.ClientAPI_ConnectionInfo_gw4_get(swigCPtr, this); } public void setGw6(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_gw6_set(swigCPtr, this, value); } public String getGw6() { return ovpncliJNI.ClientAPI_ConnectionInfo_gw6_get(swigCPtr, this); } public void setClientIp(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_clientIp_set(swigCPtr, this, value); } public String getClientIp() { return ovpncliJNI.ClientAPI_ConnectionInfo_clientIp_get(swigCPtr, this); } public void setTunName(String value) { ovpncliJNI.ClientAPI_ConnectionInfo_tunName_set(swigCPtr, this, value); } public String getTunName() { return ovpncliJNI.ClientAPI_ConnectionInfo_tunName_get(swigCPtr, this); } public ClientAPI_ConnectionInfo() { this(ovpncliJNI.new_ClientAPI_ConnectionInfo(), true); } }
1,432
363
/* Copyright 2009, 2011, 2012 predic8 GmbH, www.predic8.com 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.predic8.membrane.core; import java.util.ArrayList; import java.util.List; import com.predic8.membrane.core.interceptor.DispatchingInterceptor; import com.predic8.membrane.core.interceptor.HTTPClientInterceptor; import com.predic8.membrane.core.interceptor.Interceptor; import com.predic8.membrane.core.interceptor.RuleMatchingInterceptor; import com.predic8.membrane.core.interceptor.UserFeatureInterceptor; import com.predic8.membrane.core.transport.Transport; import com.predic8.membrane.core.transport.http.HttpTransport; import com.predic8.membrane.core.transport.http.client.ProxyConfiguration; public class HttpRouter extends Router { public HttpRouter() { this(null); } public HttpRouter(ProxyConfiguration proxyConfiguration) { transport = createTransport(proxyConfiguration); resolverMap.getHTTPSchemaResolver().getHttpClientConfig().setProxy(proxyConfiguration); } /** * Same as the default config from monitor-beans.xml */ private Transport createTransport(ProxyConfiguration proxyConfiguration) { Transport transport = new HttpTransport(); List<Interceptor> interceptors = new ArrayList<Interceptor>(); interceptors.add(new RuleMatchingInterceptor()); interceptors.add(new DispatchingInterceptor()); interceptors.add(new UserFeatureInterceptor()); HTTPClientInterceptor httpClientInterceptor = new HTTPClientInterceptor(); interceptors.add(httpClientInterceptor); transport.setInterceptors(interceptors); return transport; } @Override public HttpTransport getTransport() { return (HttpTransport)transport; } public void addUserFeatureInterceptor(Interceptor i) { List<Interceptor> is = getTransport().getInterceptors(); is.add(is.size()-2, i); } }
714
3,055
/* Fontname: -FreeType-pearfont-Medium-R-Normal--16-160-72-72-P-30-ISO10646-1 Copyright: rubna Glyphs: 95/107 BBX Build Mode: 0 */ const uint8_t u8g2_font_pearfont_tr[634] U8G2_FONT_SECTION("u8g2_font_pearfont_tr") = "_\0\2\2\3\3\2\3\4\5\6\0\377\3\377\4\0\0\317\1\236\2] \4\200l!\6\241TT" "\0\42\6\223f\222\12#\7\234\354\322X\11$\7\243\343\342\210\11%\11\235tb\6\31\304\0&\10" "\254\354b\212\225\32'\5\221V\4(\6\242\334T\14)\7\242\134bR\0*\6\233eR\7+\7" "\233\344\322J\0,\6\222\333\24\0-\5\212]\4.\5\211T\2/\6\233dS\11\60\6\222\134F" "\0\61\5\221T\4\62\6\223d\244\0\63\6\232\134\342\0\64\7\233cR\222\1\65\6\223\344F\2\66" "\6\232\134\322\10\67\6\232[\224\2\70\5\232\134\16\71\6\232[F\12:\6\331\134R\0;\7\242\333" "\62P\0<\6\232\334d\0=\6\233d\66\30>\6\232\134\242\2\77\7\242\134T\6\1@\12\255\363" "d\225T\6i\1A\7\233\344\322H\1B\7\233d\324P\0C\6\232\134\226\0D\7\233dTZ" "\0E\5\232\134\16F\6\232\134\206\2G\10\243cFJ#\1H\7\233d\322P\1I\6\233dV" "\32J\7\243cf\134\0K\6\233d\322*L\6\232\134R\22M\6\234l.\31N\7\234l\224\232" "\1O\7\233dF\32\1P\7\243cTZ\21Q\7\243\343V\222\1R\6\233d\224*S\7\233\344" "TR\0T\7\233dVL\0U\7\233d\222\32\1V\7\233d\222\252\0W\7\234l\342\32\2X" "\6\233dR\7Y\7\233d\322H\11Z\6\233dd\24[\6\242\134V\22\134\7\233d\62\310 ]" "\6\242\134T\32^\5\223\346\32_\5\213c\6`\6\222^b\0a\6\223d\324\0b\6\232\134\322" "\10c\6\222\134F\0d\6\232\334\206\0e\6\232[f\0f\6\232\334T\2g\6\232[F\12h" "\7\233d\342H\1i\6\231TR\0j\6\241S\222\0k\7\233c\322\6\1l\6\232\134R\14m" "\6\224l\256\0n\6\223dF\12o\6\222\134F\0p\6\232[\206\2q\6\232[F\12r\6\222" "\134\26\0s\6\223\344F\2t\6\232\134\322\2u\6\223d\322\10v\6\223dR\5w\6\224l\324" "\20x\6\233cR\7y\7\233cR\231\0z\6\223d\244\0{\10\253\344T\15\242\0|\6\241T" "F\0}\11\253dd\6))\0~\7\224\355\222J\0\0\0\0\4\377\377\0";
1,215
1,006
<reponame>alvin1991/incubator-nuttx /**************************************************************************** * arch/mips/src/pic32mz/pic32mz_gpio.c * * 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <stdint.h> #include <assert.h> #include <errno.h> #include <nuttx/irq.h> #include <nuttx/arch.h> #include <arch/board/board.h> #include "mips_arch.h" #include "hardware/pic32mz_ioport.h" #include "pic32mz_gpio.h" #if CHIP_NPORTS > 0 /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** * Public Data ****************************************************************************/ /* This table can be used to map a port number to a IOPORT base address. For * example, an index of zero would correspond to IOPORTA, one with IOPORTB, * etc. */ const uintptr_t g_gpiobase[CHIP_NPORTS] = { PIC32MZ_IOPORTA_K1BASE #if CHIP_NPORTS > 1 , PIC32MZ_IOPORTB_K1BASE #endif #if CHIP_NPORTS > 2 , PIC32MZ_IOPORTC_K1BASE #endif #if CHIP_NPORTS > 3 , PIC32MZ_IOPORTD_K1BASE #endif #if CHIP_NPORTS > 4 , PIC32MZ_IOPORTE_K1BASE #endif #if CHIP_NPORTS > 5 , PIC32MZ_IOPORTF_K1BASE #endif #if CHIP_NPORTS > 6 , PIC32MZ_IOPORTG_K1BASE #endif #if CHIP_NPORTS > 7 , PIC32MZ_IOPORTH_K1BASE #endif #if CHIP_NPORTS > 8 , PIC32MZ_IOPORTJ_K1BASE #endif #if CHIP_NPORTS > 9 , PIC32MZ_IOPORTK_K1BASE #endif }; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Name: Inline PIN set field extractors ****************************************************************************/ static inline bool pic32mz_output(pinset_t pinset) { return ((pinset & GPIO_OUTPUT) != 0); } static inline bool pic32mz_opendrain(pinset_t pinset) { return ((pinset & GPIO_MODE_MASK) == GPIO_OPENDRAIN); } static inline bool pic32mz_outputhigh(pinset_t pinset) { return ((pinset & GPIO_VALUE_MASK) != 0); } static inline unsigned int pic32mz_portno(pinset_t pinset) { return ((pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT); } static inline unsigned int pic32mz_pinno(pinset_t pinset) { return ((pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT); } static inline unsigned int pic32mz_analog(pinset_t pinset) { return ((pinset & GPIO_ANALOG_MASK) != 0); } static inline unsigned int pic32mz_slewrate(pinset_t pinset) { return ((pinset & GPIO_SR_MASK) >> GPIO_SR_SHIFT); } static inline unsigned int pic32mz_slewratecon0(pinset_t pinset) { return (pic32mz_slewrate(pinset) & GPIO_SR_CON0_MASK) >> GPIO_SR_CON0_SHIFT; } static inline unsigned int pic32mz_slewratecon1(pinset_t pinset) { return (pic32mz_slewrate(pinset) & GPIO_SR_CON1_MASK) >> GPIO_SR_CON1_SHIFT; } /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: pic32mz_configgpio * * Description: * Configure a GPIO pin based on bit-encoded description of the pin (the * interrupt will be configured when pic32mz_attach() is called. * * Returned Value: * OK on success; negated errno on failure. * ****************************************************************************/ int pic32mz_configgpio(pinset_t cfgset) { unsigned int port = pic32mz_portno(cfgset); unsigned int pin = pic32mz_pinno(cfgset); uint32_t mask = (1 << pin); uintptr_t base; /* Verify that the port number is within range */ if (port < CHIP_NPORTS) { /* Get the base address of the ports */ base = g_gpiobase[port]; sched_lock(); /* Is Slew Rate control enabled? */ if (pic32mz_slewrate(cfgset) != GPIO_FASTEST) { /* Note: not every port nor every pin has the Slew Rate feature. * Writing to an unimplemented port/pin will have no effect. */ putreg32(pic32mz_slewratecon0(cfgset), base + PIC32MZ_IOPORT_SRCON0_OFFSET); putreg32(pic32mz_slewratecon1(cfgset), base + PIC32MZ_IOPORT_SRCON1_OFFSET); } /* Is this an input or an output? */ if (pic32mz_output(cfgset)) { /* Not analog */ putreg32(mask, base + PIC32MZ_IOPORT_ANSELCLR_OFFSET); /* It is an output; clear the corresponding bit in TRIS register */ putreg32(mask, base + PIC32MZ_IOPORT_TRISCLR_OFFSET); /* Is it an open drain output? */ if (pic32mz_opendrain(cfgset)) { /* It is an open drain output. Set the corresponding bit in * the ODC register. */ putreg32(mask, base + PIC32MZ_IOPORT_ODCSET_OFFSET); } else { /* Is is a normal output. Clear the corresponding bit in the * ODC register. */ putreg32(mask, base + PIC32MZ_IOPORT_ODCCLR_OFFSET); } /* Set the initial output value */ pic32mz_gpiowrite(cfgset, pic32mz_outputhigh(cfgset)); } else { /* It is an input; set the corresponding bit in TRIS register. */ putreg32(mask, base + PIC32MZ_IOPORT_TRISSET_OFFSET); putreg32(mask, base + PIC32MZ_IOPORT_ODCCLR_OFFSET); /* Is it an analog input? */ if (pic32mz_analog(cfgset)) { putreg32(mask, base + PIC32MZ_IOPORT_ANSELSET_OFFSET); } else { putreg32(mask, base + PIC32MZ_IOPORT_ANSELCLR_OFFSET); } } sched_unlock(); return OK; } return -EINVAL; } /**************************************************************************** * Name: pic32mz_gpiowrite * * Description: * Write one or zero to the selected GPIO pin * ****************************************************************************/ void pic32mz_gpiowrite(pinset_t pinset, bool value) { unsigned int port = pic32mz_portno(pinset); unsigned int pin = pic32mz_pinno(pinset); uintptr_t base; /* Verify that the port number is within range */ if (port < CHIP_NPORTS) { /* Get the base address of the ports */ base = g_gpiobase[port]; /* Set or clear the output */ if (value) { putreg32(1 << pin, base + PIC32MZ_IOPORT_LATSET_OFFSET); } else { putreg32(1 << pin, base + PIC32MZ_IOPORT_LATCLR_OFFSET); } } } /**************************************************************************** * Name: pic32mz_gpioread * * Description: * Read one or zero from the selected GPIO pin * ****************************************************************************/ bool pic32mz_gpioread(pinset_t pinset) { unsigned int port = pic32mz_portno(pinset); unsigned int pin = pic32mz_pinno(pinset); uintptr_t base; /* Verify that the port number is within range */ if (port < CHIP_NPORTS) { /* Get the base address of the ports */ base = g_gpiobase[port]; /* Get and return the input value */ return (getreg32(base + PIC32MZ_IOPORT_PORT_OFFSET) & (1 << pin)) != 0; } return false; } /**************************************************************************** * Function: pic32mz_dumpgpio * * Description: * Dump all GPIO registers associated with the provided base address * ****************************************************************************/ #ifdef CONFIG_DEBUG_GPIO_INFO void pic32mz_dumpgpio(pinset_t pinset, const char *msg) { unsigned int port = pic32mz_portno(pinset); irqstate_t flags; uintptr_t base; /* Verify that the port number is within range */ if (port < CHIP_NPORTS) { /* Get the base address of the ports */ base = g_gpiobase[port]; /* The following requires exclusive access to the GPIO registers */ sched_lock(); gpioinfo("IOPORT%c pinset: %04x base: %08x -- %s\n", 'A'+port, pinset, base, msg); gpioinfo(" TRIS: %08x PORT: %08x LAT: %08x ODC: %08x\n", getreg32(base + PIC32MZ_IOPORT_TRIS_OFFSET), getreg32(base + PIC32MZ_IOPORT_PORT_OFFSET), getreg32(base + PIC32MZ_IOPORT_LAT_OFFSET), getreg32(base + PIC32MZ_IOPORT_ODC_OFFSET)); gpioinfo(" CNCON: %08x CNEN: %08x CNPU: %08x\n", getreg32(base + PIC32MZ_IOPORT_CNCON_OFFSET), getreg32(base + PIC32MZ_IOPORT_CNEN_OFFSET), getreg32(base + PIC32MZ_IOPORT_CNPU_OFFSET)); sched_unlock(); } } #endif #endif /* CHIP_NPORTS > 0 */
3,899
738
<reponame>zhquake/hudi /* * 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.hudi.gcp.bigquery; import org.apache.hudi.common.config.TypedProperties; import org.apache.hudi.common.fs.FSUtils; import org.apache.hudi.common.model.HoodieTableType; import org.apache.hudi.common.util.ValidationUtils; import org.apache.hudi.sync.common.AbstractSyncTool; import org.apache.hudi.sync.common.util.ManifestFileWriter; import com.beust.jcommander.JCommander; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; /** * Tool to sync a hoodie table with a big query table. Either use it as an api * BigQuerySyncTool.syncHoodieTable(BigQuerySyncConfig) or as a command line java -cp hoodie-hive.jar BigQuerySyncTool [args] * <p> * This utility will get the schema from the latest commit and will sync big query table schema. * * @Experimental */ public class BigQuerySyncTool extends AbstractSyncTool { private static final Logger LOG = LogManager.getLogger(BigQuerySyncTool.class); public final BigQuerySyncConfig cfg; public final String manifestTableName; public final String versionsTableName; public final String snapshotViewName; public BigQuerySyncTool(TypedProperties properties, Configuration conf, FileSystem fs) { super(properties, conf, fs); cfg = BigQuerySyncConfig.fromProps(properties); manifestTableName = cfg.tableName + "_manifest"; versionsTableName = cfg.tableName + "_versions"; snapshotViewName = cfg.tableName; } @Override public void syncHoodieTable() { try (HoodieBigQuerySyncClient bqSyncClient = new HoodieBigQuerySyncClient(BigQuerySyncConfig.fromProps(props), fs)) { switch (bqSyncClient.getTableType()) { case COPY_ON_WRITE: syncCoWTable(bqSyncClient); break; case MERGE_ON_READ: default: throw new UnsupportedOperationException(bqSyncClient.getTableType() + " table type is not supported yet."); } } catch (Exception e) { throw new HoodieBigQuerySyncException("Got runtime exception when big query syncing " + cfg.tableName, e); } } private void syncCoWTable(HoodieBigQuerySyncClient bqSyncClient) { ValidationUtils.checkState(bqSyncClient.getTableType() == HoodieTableType.COPY_ON_WRITE); LOG.info("Sync hoodie table " + snapshotViewName + " at base path " + bqSyncClient.getBasePath()); if (!bqSyncClient.datasetExists()) { throw new HoodieBigQuerySyncException("Dataset not found: " + cfg); } ManifestFileWriter manifestFileWriter = ManifestFileWriter.builder() .setConf(conf) .setBasePath(cfg.basePath) .setUseFileListingFromMetadata(cfg.useFileListingFromMetadata) .setAssumeDatePartitioning(cfg.assumeDatePartitioning) .build(); manifestFileWriter.writeManifestFile(); if (!bqSyncClient.tableExists(manifestTableName)) { bqSyncClient.createManifestTable(manifestTableName, manifestFileWriter.getManifestSourceUri()); LOG.info("Manifest table creation complete for " + manifestTableName); } if (!bqSyncClient.tableExists(versionsTableName)) { bqSyncClient.createVersionsTable(versionsTableName, cfg.sourceUri, cfg.sourceUriPrefix, cfg.partitionFields); LOG.info("Versions table creation complete for " + versionsTableName); } if (!bqSyncClient.tableExists(snapshotViewName)) { bqSyncClient.createSnapshotView(snapshotViewName, versionsTableName, manifestTableName); LOG.info("Snapshot view creation complete for " + snapshotViewName); } // TODO: Implement automatic schema evolution when you add a new column. LOG.info("Sync table complete for " + snapshotViewName); } public static void main(String[] args) { BigQuerySyncConfig cfg = new BigQuerySyncConfig(); JCommander cmd = new JCommander(cfg, null, args); if (cfg.help || args.length == 0) { cmd.usage(); System.exit(1); } FileSystem fs = FSUtils.getFs(cfg.basePath, new Configuration()); new BigQuerySyncTool(cfg.toProps(), fs.getConf(), fs).syncHoodieTable(); } }
1,628
571
<filename>univocity-trader-core/src/main/java/com/univocity/trader/simulation/MarketSimulator.java package com.univocity.trader.simulation; import com.univocity.trader.*; import com.univocity.trader.account.*; import com.univocity.trader.candles.*; import com.univocity.trader.config.*; import com.univocity.trader.strategy.*; import org.apache.commons.lang3.*; import org.slf4j.*; import java.time.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.stream.*; import static com.univocity.trader.indicators.base.TimeInterval.*; /** * @author uniVocity Software Pty Ltd - <a href="mailto:<EMAIL>"><EMAIL></a> */ public abstract class MarketSimulator<C extends Configuration<C, A>, A extends AccountConfiguration<A>> extends AbstractSimulator<C, A> { private static final Logger log = LoggerFactory.getLogger(MarketSimulator.class); private final Supplier<Exchange<?, A>> exchangeSupplier; private CandleRepository candleRepository; private ExecutorService executor; protected MarketSimulator(C configuration, Supplier<Exchange<?, A>> exchangeSupplier) { super(configuration); this.exchangeSupplier = exchangeSupplier; } protected void initialize() { resetBalances(); } protected CandleRepository createCandleRepository() { FileRepositoryConfiguration fileRepository = configure().fileRepository(); if (fileRepository.isConfigured()) { return new FileCandleRepository(fileRepository.dir(), fileRepository.rowFormat()); } else { return new DatabaseCandleRepository(configure().database()); } } @Override protected final void executeSimulation(Stream<Parameters> parameters) { getCandleRepository(); executor = Executors.newCachedThreadPool(); try { executeWithParameters(parameters); } finally { executor.shutdown(); candleRepository.clearCaches(); } } protected void executeWithParameters(Stream<Parameters> parameters) { parameters.forEach(p -> { initialize(); try { executeSimulation(createEngines(p)); // liquidateOpenPositions(); } finally { reportResults(p); } }); } protected final Map<String, Engine[]> createEngines(Parameters parameters) { Set<Object> allInstances = new HashSet<>(); Map<String, List<Engine>> tmp = new HashMap<>(); for (AccountManager account : accounts()) { SimulatedExchange exchange = new SimulatedExchange(account); for (String symbol : account.getAllSymbolPairs().keySet()) { account.createTradingManager(symbol, exchange, null, parameters); } account.forEachTradingManager(tradingManager -> { Engine engine = new TradingEngine(tradingManager, parameters, allInstances); tmp.computeIfAbsent(engine.getSymbol(), s -> new ArrayList<>()).add(engine); }); } allInstances.clear(); Map<String, Engine[]> symbolHandlers = new HashMap<>(); tmp.forEach((k, v) -> symbolHandlers.put(k, v.toArray(Engine[]::new))); return symbolHandlers; } protected final void executeSimulation(Map<String, Engine[]> symbolHandlers) { ConcurrentHashMap<String, Enumeration<Candle>> markets = new ConcurrentHashMap<>(); LocalDateTime start = getSimulationStart(); LocalDateTime end = getSimulationEnd(); start = start.minus(configuration.warmUpPeriod()); Instant from = start.toInstant(ZoneOffset.UTC); Instant to = end.toInstant(ZoneOffset.UTC); int activeQueries = 0; Map<String, CompletableFuture<Enumeration<Candle>>> futures = new HashMap<>(); for (String symbol : symbolHandlers.keySet()) { activeQueries++; boolean loadAllDataFirst = simulation.cacheCandles() || activeQueries > simulation.activeQueryLimit(); futures.put(symbol, CompletableFuture.supplyAsync( () -> candleRepository.iterate(symbol, from, to, loadAllDataFirst), executor) ); } futures.forEach((symbol, candles) -> { try { markets.put(symbol, candles.get()); } catch (Exception e) { log.error("Error querying " + symbol + " candles from database", e); } }); final var sortedMarkets = new TreeMap<>(markets); MarketReader[] readers = buildMarketReaderList(sortedMarkets, symbolHandlers); executeSimulation(readers); } private void determineStartTimes(MarketReader[] readers) { LocalDateTime start = getSimulationStart(); LocalDateTime end = getSimulationEnd(); final long warmUpStart = getStartTime(configuration.warmUpPeriod()); final long simulationStart = getStartTime(null); boolean hasCandles = false; for (MarketReader reader : readers) { if (reader.pending == null) { if (reader.input.hasMoreElements()) { Candle next = reader.input.nextElement(); if (next != null) { reader.pending = next; } } } if (reader.pending != null) { hasCandles = true; long openTime = reader.pending.openTime; long actualStart; if (openTime >= simulationStart) { actualStart = simulationStart + (simulationStart - warmUpStart); } else { actualStart = simulationStart + (openTime - warmUpStart); } reader.startTime = actualStart; } } if (!hasCandles) { throw new IllegalStateException("No candles processed in real time trading simulation from " + start + " to " + end); } } protected void executeSimulation(MarketReader[] readers) { final long startTime = getStartTime(configuration.warmUpPeriod()); final long endTime = getEndTime(); boolean randomize = configuration.simulation().randomizeTicks(); determineStartTimes(readers); for (long clock = startTime; clock <= endTime; clock += MINUTE.ms) { if (randomize) { ArrayUtils.shuffle(readers); } boolean resetClock = false; for (int i = 0; i < readers.length; i++) { MarketReader reader = readers[i]; Candle candle = reader.pending; if (candle != null && candle.close > 0) { if (candle.openTime + 1 >= clock && candle.openTime <= clock + MINUTE.ms - 1) { for (int j = 0; j < reader.engines.length; j++) { reader.engines[j].process(candle, clock <= reader.startTime); } reader.pending = null; if (reader.input.hasMoreElements()) { Candle next = reader.input.nextElement(); if (next != null) { reader.pending = next; if (!resetClock && next.openTime + 1 >= clock && next.openTime <= clock + MINUTE.ms - 1) { resetClock = true; } } } } } else { if (reader.input.hasMoreElements()) { Candle next = reader.input.nextElement(); if (next != null) { reader.pending = next; } } } } if (resetClock) { clock -= MINUTE.ms; } } } private MarketReader[] buildMarketReaderList(Map<String, Enumeration<Candle>> markets, Map<String, Engine[]> symbolHandlers) { List<MarketReader> out = new ArrayList<>(); for (Map.Entry<String, Enumeration<Candle>> e : markets.entrySet()) { MarketReader reader = new MarketReader(); reader.symbol = e.getKey(); reader.engines = symbolHandlers.get(e.getKey()); reader.input = e.getValue(); out.add(reader); } return out.toArray(new MarketReader[0]); } protected void liquidateOpenPositions() { for (AccountManager account : accounts()) { account.forEachTradingManager(t -> t.getTrader().liquidateOpenPositions()); } } protected void reportResults(Parameters parameters) { super.reportResults(parameters); for (AccountManager account : accounts()) { reportResults(account, parameters); } } protected void reportResults(AccountManager account, Parameters parameters) { String id = account.getClient().getId(); System.out.print("-------"); if (parameters != null && parameters != Parameters.NULL) { System.out.print(" | Parameters: " + parameters); } if (StringUtils.isNotBlank(id)) { System.out.print(" | Client: " + id); } System.out.println(" | -------"); System.out.print(account.toString()); System.out.println("Approximate holdings: $" + account.getTotalFundsInReferenceCurrency() + " " + account.getReferenceCurrencySymbol()); account.forEachTradingManager(t -> t.getTrader().notifySimulationEnd()); } public final void backfillHistory() { TreeSet<String> allSymbols = new TreeSet<>(); configuration.accounts().forEach(a -> allSymbols.addAll(a.symbolPairs().keySet())); allSymbols.addAll(new DatabaseCandleRepository(configure().database()).getKnownSymbols()); backfillHistory(allSymbols); } public final void backfillHistory(String... symbolsToUpdate) { LinkedHashSet<String> allSymbols = new LinkedHashSet<>(); Collections.addAll(allSymbols, symbolsToUpdate); backfillHistory(allSymbols); } public final void backfillHistory(Collection<String> symbols) { Exchange<?, A> exchange = exchangeSupplier.get(); backfillHistory(exchange, symbols); } protected void backfillHistory(Exchange<?, A> exchange, Collection<String> symbols) { DatabaseCandleRepository candleRepository = new DatabaseCandleRepository(configure().database()); final Instant start = simulation.backfillFrom().toInstant(ZoneOffset.UTC); final Instant end = simulation.backfillTo().toInstant(ZoneOffset.UTC); CandleHistoryBackfill backfill = new CandleHistoryBackfill(candleRepository); backfill.resumeBackfill(configuration.simulation().resumeBackfill()); for (String symbol : symbols) { backfill.fillHistoryGaps(exchange, symbol, start, end, configuration.tickInterval()); } } protected static class MarketReader { String symbol; Enumeration<Candle> input; Candle pending; Engine[] engines; long startTime; } public final CandleRepository getCandleRepository() { if (candleRepository == null) { candleRepository = createCandleRepository(); } return candleRepository; } }
3,376
1,132
package javarepl.completion; import com.googlecode.totallylazy.Group; import com.googlecode.totallylazy.Sequence; import com.googlecode.totallylazy.comparators.Comparators; import com.googlecode.totallylazy.functions.Function1; import com.googlecode.totallylazy.match; import javarepl.reflection.ClassReflection; import javarepl.reflection.MemberReflection; import javarepl.reflection.MethodReflection; import java.lang.reflect.*; import static com.googlecode.totallylazy.Sequences.sequence; import static com.googlecode.totallylazy.numbers.Numbers.maximum; public class Completions { public static Function1<MemberReflection<?>, String> candidateName() { return memberReflection -> new match<MemberReflection<?>, String>() { String value(MethodReflection expr) { return expr.name() + "("; } String value(ClassReflection expr) { return expr.member().getSimpleName(); } String value(MemberReflection<?> expr) { return expr.name(); } }.apply(memberReflection).get(); } public static Function1<MemberReflection<?>, String> candidateForm() { return memberReflection -> new match<MemberReflection<?>, String>() { String value(MethodReflection expr) { return genericMethodSignature(expr.member()); } String value(ClassReflection expr) { return expr.member().getSimpleName(); } String value(MemberReflection<?> expr) { return expr.name(); } }.apply(memberReflection).get(); } public static Function1<Group<String, MemberReflection<?>>, CompletionCandidate> candidate() { return group -> new CompletionCandidate(group.key(), group.map(candidateForm()).sort(Comparators.ascending(String.class))); } private static String renderSimpleGenericType(Type type) { return new match<Type, String>() { String value(ParameterizedType t) { return renderSimpleGenericType(t.getRawType()) + sequence(t.getActualTypeArguments()).map(Completions::renderSimpleGenericType).toString("<", ", ", ">"); } String value(TypeVariable<?> t) { return t.getName(); } String value(GenericArrayType t) { return renderSimpleGenericType(t.getGenericComponentType()) + "[]"; } String value(Class<?> t) { return t.getSimpleName(); } String value(WildcardType t) { return t.toString(); } }.apply(type).getOrThrow(new IllegalArgumentException("Generic type not matched (" + type.getClass() + ")")); } private static String genericMethodSignature(Method method) { return renderSimpleGenericType(method.getGenericReturnType()) + " " + method.getName() + sequence(method.getGenericParameterTypes()) .map(Completions::renderSimpleGenericType) .toString("(", ", ", ")") + sequence(method.getGenericExceptionTypes()) .map(Completions::renderSimpleGenericType) .toString(method.getGenericExceptionTypes().length > 0 ? " throws " : "", ", ", ""); } public static int lastIndexOfSeparator(Sequence<Character> characters, String expression) { return characters .map(expression::lastIndexOf) .reduce(maximum()) .intValue(); } }
1,550
1,418
<gh_stars>1000+ package muduo.rpc; import java.util.zip.Adler32; import muduo.rpc.proto.RpcProto.RpcMessage; import org.jboss.netty.buffer.BigEndianHeapChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandler.Sharable; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; import com.google.protobuf.CodedOutputStream; @Sharable public class RpcEncoder extends OneToOneEncoder { public RpcEncoder() { super(); } @Override public Object encode(ChannelHandlerContext ctx, Channel channel, Object obj) throws Exception { if (!(obj instanceof RpcMessage)) { return obj; } RpcMessage message = (RpcMessage) obj; int size = message.getSerializedSize(); ChannelBuffer buffer = new BigEndianHeapChannelBuffer(4 + size + 4); buffer.writeBytes("RPC0".getBytes()); int writerIndex = buffer.writerIndex(); CodedOutputStream output = CodedOutputStream.newInstance( buffer.array(), buffer.writerIndex(), buffer.writableBytes() - 4); message.writeTo(output); output.checkNoSpaceLeft(); buffer.writerIndex(writerIndex + size); Adler32 checksum = new Adler32(); checksum.update(buffer.array(), buffer.arrayOffset(), buffer.readableBytes()); buffer.writeInt((int) checksum.getValue()); return buffer; } }
593
13,648
""" categories: Types,int description: No int conversion for int-derived types available cause: Unknown workaround: Avoid subclassing builtin types unless really needed. Prefer https://en.wikipedia.org/wiki/Composition_over_inheritance . """ class A(int): __add__ = lambda self, other: A(int(self) + other) a = A(42) print(a + a)
106
4,339
/* * 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.processors.cache; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Stream; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT; import static org.apache.ignite.testframework.GridTestUtils.assertThrows; /** * Class with common logic for tests {@link IgniteCache} API when cluster in a {@link ClusterState#ACTIVE_READ_ONLY} * mode. */ public abstract class IgniteCacheClusterReadOnlyModeAbstractTest extends GridCommonAbstractTest { /** Key. */ protected static final int KEY = 10; /** Value. */ protected static final int VAL = 11; /** Key 2. */ protected static final int KEY_2 = 20; /** Value 2. */ protected static final int VAL_2 = 21; /** Key 3. */ protected static final int KEY_3 = 30; /** Value 3. */ protected static final int VAL_3 = 31; /** Unknown key. */ protected static final int UNKNOWN_KEY = 3; /** Map with all pairs in caches. */ protected static final Map<Integer, Integer> kvMap; /** */ protected static final Predicate<CacheConfiguration> ATOMIC_CACHES_PRED = cfg -> cfg.getAtomicityMode() == ATOMIC; /** */ protected static final Predicate<CacheConfiguration> TX_CACHES_PRED = cfg -> cfg.getAtomicityMode() == TRANSACTIONAL; /** */ protected static final Predicate<CacheConfiguration> MVCC_CACHES_PRED = cfg -> cfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT; /** */ protected static final Predicate<CacheConfiguration> NO_MVCC_CACHES_PRED = ATOMIC_CACHES_PRED.or(TX_CACHES_PRED); /** Started cache configurations. */ protected static Collection<CacheConfiguration<?, ?>> cacheConfigurations; /** Started cache names. */ protected static Collection<String> cacheNames; static { Map<Integer, Integer> map = new HashMap<>(); map.put(KEY, VAL); map.put(KEY_2, VAL_2); map.put(KEY_3, VAL_3); kvMap = Collections.unmodifiableMap(map); } /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { CacheConfiguration<?, ?>[] cfgs = cacheConfigurations(); cacheConfigurations = Collections.unmodifiableCollection(Arrays.asList(cfgs)); cacheNames = Collections.unmodifiableSet( cacheConfigurations.stream() .map(CacheConfiguration::getName) .collect(toSet()) ); return super.getConfiguration(igniteInstanceName) .setCacheConfiguration(cfgs); } /** * @return Cache configurations for node start. */ protected CacheConfiguration<?, ?>[] cacheConfigurations() { CacheConfiguration<?, ?>[] cfgs = ClusterReadOnlyModeTestUtils.cacheConfigurations(); for (CacheConfiguration cfg : cfgs) cfg.setReadFromBackup(true); return cfgs; } /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); stopAllGrids(); cacheNames = null; cacheConfigurations = null; startGrids(2); startClientGridsMultiThreaded(3, 2); grid(0).cluster().state(ClusterState.ACTIVE); for (String cacheName : cacheNames) { grid(0).cache(cacheName).put(KEY, VAL); grid(0).cache(cacheName).put(KEY_2, VAL_2); grid(0).cache(cacheName).put(KEY_3, VAL_3); } grid(0).cluster().state(ClusterState.ACTIVE_READ_ONLY); } /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { stopAllGrids(); cacheNames = null; cacheConfigurations = null; super.afterTestsStopped(); } /** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); commonChecks(); } /** {@inheritDoc} */ @Override protected void afterTest() throws Exception { commonChecks(); super.afterTest(); } /** */ protected void performActionReadOnlyExceptionExpected(Consumer<IgniteCache<Integer, Integer>> clo) { performActionReadOnlyExceptionExpected(clo, null); } /** */ protected void performActionReadOnlyExceptionExpected( Consumer<IgniteCache<Integer, Integer>> clo, @Nullable Predicate<CacheConfiguration> cfgFilter ) { performAction( cache -> { Throwable ex = assertThrows(log, () -> clo.accept(cache), Exception.class, null); ClusterReadOnlyModeTestUtils.checkRootCause(ex, cache.getName()); }, cfgFilter ); } /** */ protected void performAction(Consumer<IgniteCache<Integer, Integer>> clo) { performAction(clo, null); } /** */ protected void performAction(BiConsumer<Ignite, IgniteCache<Integer, Integer>> clo) { performAction(clo, null); } /** */ protected void performAction( Consumer<IgniteCache<Integer, Integer>> clo, @Nullable Predicate<CacheConfiguration> cfgFilter ) { performAction((node, cache) -> clo.accept(cache), cfgFilter); } /** */ protected void performAction( BiConsumer<Ignite, IgniteCache<Integer, Integer>> clo, @Nullable Predicate<CacheConfiguration> cfgFilter ) { Collection<String> names = cfgFilter == null ? cacheNames : cacheConfigurations.stream() .filter(cfgFilter) .map(CacheConfiguration::getName) .collect(toList()); for (Ignite node : G.allGrids()) { for (String name : names) clo.accept(node, node.cache(name)); } } /** */ private void commonChecks() { assertEquals(kvMap.toString(), 3, kvMap.size()); for (Ignite node : G.allGrids()) { assertEquals(node.name(), ClusterState.ACTIVE_READ_ONLY, node.cluster().state()); for (String cacheName : cacheNames) { IgniteCache<Integer, Integer> cache = node.cache(cacheName); assertEquals(node.name() + " " + cacheName, kvMap.size(), cache.size()); for (Map.Entry<Integer, Integer> entry : kvMap.entrySet()) assertEquals(node.name() + " " + cacheName, entry.getValue(), cache.get(entry.getKey())); assertNull(node.name() + " " + cacheName, cache.get(UNKNOWN_KEY)); } } } /** */ protected static CacheConfiguration<?, ?>[] filterAndAddNearCacheConfig(CacheConfiguration<?, ?>[] cfgs) { return Stream.of(cfgs) // Near caches doesn't support in a MVCC mode. .filter(cfg -> cfg.getAtomicityMode() != CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT) .map(cfg -> cfg.setNearConfiguration(new NearCacheConfiguration<>())) .toArray(CacheConfiguration[]::new); } }
3,300
379
<filename>client/oim-client-base/src/main/java/com/only/common/result/ErrorInfo.java<gh_stars>100-1000 package com.only.common.result; /** * @author: XiaHui * @date: 2016年11月22日 上午10:10:05 */ public class ErrorInfo { private String code; private String text; public ErrorInfo(String code, String text) { this.code = code; this.text = text; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getText() { return text; } public void setText(String text) { this.text = text; } }
219
5,133
<filename>processor/src/test/java/org/mapstruct/ap/test/bugs/_1801/Issue1801Test.java /* * Copyright MapStruct Authors. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.mapstruct.ap.test.bugs._1801; import org.mapstruct.ap.spi.AccessorNamingStrategy; import org.mapstruct.ap.spi.BuilderProvider; import org.mapstruct.ap.spi.ImmutablesAccessorNamingStrategy; import org.mapstruct.ap.test.bugs._1801.domain.ImmutableItem; import org.mapstruct.ap.test.bugs._1801.domain.Item; import org.mapstruct.ap.test.bugs._1801.dto.ImmutableItemDTO; import org.mapstruct.ap.test.bugs._1801.dto.ItemDTO; import org.mapstruct.ap.testutil.IssueKey; import org.mapstruct.ap.testutil.ProcessorTest; import org.mapstruct.ap.testutil.WithClasses; import org.mapstruct.ap.testutil.WithServiceImplementation; import org.mapstruct.ap.testutil.WithServiceImplementations; import static org.assertj.core.api.Assertions.assertThat; /** * @author <NAME> */ @WithClasses({ ItemMapper.class, Item.class, ImmutableItem.class, ItemDTO.class, ImmutableItemDTO.class }) @IssueKey("1801") @WithServiceImplementations( { @WithServiceImplementation( provides = BuilderProvider.class, value = Issue1801BuilderProvider.class), @WithServiceImplementation( provides = AccessorNamingStrategy.class, value = ImmutablesAccessorNamingStrategy.class) }) public class Issue1801Test { @ProcessorTest public void shouldIncludeBuildeType() { ItemDTO item = ImmutableItemDTO.builder().id( "test" ).build(); Item target = ItemMapper.INSTANCE.map( item ); assertThat( target ).isNotNull(); assertThat( target.getId() ).isEqualTo( "test" ); } }
623
473
/* Copyright (c) 2009-2016, <NAME> All rights reserved. This file is part of Elemental and is under the BSD 2-Clause License, which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_BLAS_MAKESYMMETRIC_HPP #define EL_BLAS_MAKESYMMETRIC_HPP namespace El { template<typename T> void MakeSymmetric( UpperOrLower uplo, Matrix<T>& A, bool conjugate ) { EL_DEBUG_CSE const Int n = A.Width(); if( A.Height() != n ) LogicError("Cannot make non-square matrix symmetric"); if( conjugate ) MakeDiagonalReal(A); T* ABuf = A.Buffer(); const Int ldim = A.LDim(); if( uplo == LOWER ) { for( Int j=0; j<n; ++j ) { for( Int i=j+1; i<n; ++i ) { if( conjugate ) ABuf[j+i*ldim] = Conj(ABuf[i+j*ldim]); else ABuf[j+i*ldim] = ABuf[i+j*ldim]; } } } else { for( Int j=0; j<n; ++j ) { for( Int i=0; i<j; ++i ) { if( conjugate ) ABuf[j+i*ldim] = Conj(ABuf[i+j*ldim]); else ABuf[j+i*ldim] = ABuf[i+j*ldim]; } } } } template<typename T> void MakeSymmetric ( UpperOrLower uplo, ElementalMatrix<T>& A, bool conjugate ) { EL_DEBUG_CSE if( A.Height() != A.Width() ) LogicError("Cannot make non-square matrix symmetric"); MakeTrapezoidal( uplo, A ); if( conjugate ) MakeDiagonalReal(A); unique_ptr<ElementalMatrix<T>> ATrans( A.Construct(A.Grid(),A.Root()) ); Transpose( A, *ATrans, conjugate ); if( uplo == LOWER ) AxpyTrapezoid( UPPER, T(1), *ATrans, A, 1 ); else AxpyTrapezoid( LOWER, T(1), *ATrans, A, -1 ); } template<typename T> void MakeSymmetric( UpperOrLower uplo, SparseMatrix<T>& A, bool conjugate ) { EL_DEBUG_CSE if( A.Height() != A.Width() ) LogicError("Cannot make non-square matrix symmetric"); MakeTrapezoidal( uplo, A ); const Int m = A.Height(); const Int numEntries = A.NumEntries(); { const Int* sBuf = A.LockedSourceBuffer(); const Int* tBuf = A.LockedTargetBuffer(); T* vBuf = A.ValueBuffer(); // Iterate over the diagonal entries Int numDiagonal = 0; for( Int i=0; i<m; ++i ) { const Int e = A.Offset( i, i ); if( e < numEntries && sBuf[e] == i && tBuf[e] == i ) { ++numDiagonal; if( conjugate && IsComplex<T>::value ) vBuf[e] = RealPart(vBuf[e]); } } A.Reserve( numEntries-numDiagonal ); // sBuf, tBuf, and vBuf are now invalidated due to reallocation } const Int* sBuf = A.LockedSourceBuffer(); const Int* tBuf = A.LockedTargetBuffer(); T* vBuf = A.ValueBuffer(); for( Int k=0; k<numEntries; ++k ) { if( sBuf[k] != tBuf[k] ) { if( conjugate ) A.QueueUpdate( tBuf[k], sBuf[k], Conj(vBuf[k]) ); else A.QueueUpdate( tBuf[k], sBuf[k], vBuf[k] ); } } A.ProcessQueues(); } template<typename T> void MakeSymmetric( UpperOrLower uplo, DistSparseMatrix<T>& A, bool conjugate ) { EL_DEBUG_CSE if( A.Height() != A.Width() ) LogicError("Cannot make non-square matrix symmetric"); MakeTrapezoidal( uplo, A ); const Int numLocalEntries = A.NumLocalEntries(); { T* vBuf = A.ValueBuffer(); const Int* sBuf = A.LockedSourceBuffer(); const Int* tBuf = A.LockedTargetBuffer(); // Force the diagonal to be real // ============================= if( conjugate && IsComplex<T>::value ) { for( Int k=0; k<numLocalEntries; ++k ) if( sBuf[k] == tBuf[k] ) vBuf[k] = RealPart(vBuf[k]); } // Compute the number of entries to send // ===================================== Int numSend = 0; for( Int k=0; k<numLocalEntries; ++k ) { const Int i = sBuf[k]; const Int j = tBuf[k]; if( i != j ) ++numSend; } A.Reserve( numSend, numSend ); // vBuf, sBuf, and tBuf are now invalidated due to reallocation } // Apply the updates // ================= T* vBuf = A.ValueBuffer(); const Int* sBuf = A.LockedSourceBuffer(); const Int* tBuf = A.LockedTargetBuffer(); for( Int k=0; k<numLocalEntries; ++k ) { const Int i = sBuf[k]; const Int j = tBuf[k]; if( i != j ) A.QueueUpdate( j, i, ( conjugate ? Conj(vBuf[k]) : vBuf[k] ) ); } A.ProcessQueues(); } template<typename T> void MakeHermitian( UpperOrLower uplo, Matrix<T>& A ) { EL_DEBUG_CSE MakeSymmetric( uplo, A, true ); } template<typename T> void MakeHermitian( UpperOrLower uplo, ElementalMatrix<T>& A ) { EL_DEBUG_CSE MakeSymmetric( uplo, A, true ); } template<typename T> void MakeHermitian( UpperOrLower uplo, SparseMatrix<T>& A ) { EL_DEBUG_CSE MakeSymmetric( uplo, A, true ); } template<typename T> void MakeHermitian( UpperOrLower uplo, DistSparseMatrix<T>& A ) { EL_DEBUG_CSE MakeSymmetric( uplo, A, true ); } #ifdef EL_INSTANTIATE_BLAS_LEVEL1 # define EL_EXTERN #else # define EL_EXTERN extern #endif #define PROTO(T) \ EL_EXTERN template void MakeSymmetric \ ( UpperOrLower uplo, Matrix<T>& A, bool conjugate ); \ EL_EXTERN template void MakeSymmetric \ ( UpperOrLower uplo, ElementalMatrix<T>& A, bool conjugate ); \ EL_EXTERN template void MakeSymmetric \ ( UpperOrLower uplo, SparseMatrix<T>& A, bool conjugate ); \ EL_EXTERN template void MakeSymmetric \ ( UpperOrLower uplo, DistSparseMatrix<T>& A, bool conjugate ); \ EL_EXTERN template void MakeHermitian \ ( UpperOrLower uplo, Matrix<T>& A ); \ EL_EXTERN template void MakeHermitian \ ( UpperOrLower uplo, ElementalMatrix<T>& A ); \ EL_EXTERN template void MakeHermitian \ ( UpperOrLower uplo, SparseMatrix<T>& A ); \ EL_EXTERN template void MakeHermitian \ ( UpperOrLower uplo, DistSparseMatrix<T>& A ); #define EL_ENABLE_DOUBLEDOUBLE #define EL_ENABLE_QUADDOUBLE #define EL_ENABLE_QUAD #define EL_ENABLE_BIGINT #define EL_ENABLE_BIGFLOAT #include <El/macros/Instantiate.h> #undef EL_EXTERN } // namespace El #endif // ifndef EL_BLAS_MAKESYMMETRIC_HPP
3,191
350
/* * Copyright (C) 2005-2017 <NAME> (<EMAIL>). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * See the file COPYING for License information. */ #include "0root/root.h" #include <string.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> // Always verify that a file of level N does not include headers > N! #include "1base/util.h" #include "1globals/globals.h" #ifndef UPS_ROOT_H # error "root.h was not included" #endif namespace upscaledb { static int dbg_snprintf(char *str, size_t size, const char *format, ...) { int s; va_list ap; va_start(ap, format); s = util_vsnprintf(str, size, format, ap); va_end(ap); return s; } void UPS_CALLCONV default_errhandler(int level, const char *message) { #ifdef NDEBUG if (level == UPS_DEBUG_LEVEL_DEBUG) return; #endif fprintf(stderr, "%s\n", message); } void dbg_prepare(int level, const char *file, int line, const char *function, const char *expr) { Globals::ms_error_level = level; Globals::ms_error_file = file; Globals::ms_error_line = line; Globals::ms_error_expr = expr; Globals::ms_error_function = function; } void dbg_log(const char *format, ...) { int s = 0; char buffer[1024 * 4]; va_list ap; va_start(ap, format); #ifdef UPS_DEBUG s = dbg_snprintf(buffer, sizeof(buffer), "%s[%d]: ", Globals::ms_error_file, Globals::ms_error_line); util_vsnprintf(buffer + s, sizeof(buffer) - s, format, ap); #else if (Globals::ms_error_function) s = dbg_snprintf(buffer, sizeof(buffer), "%s: ", Globals::ms_error_function); util_vsnprintf(buffer + s, sizeof(buffer) - s, format, ap); #endif va_end(ap); Globals::ms_error_handler(Globals::ms_error_level, buffer); } } // namespace upscaledb
850
964
<gh_stars>100-1000 [ { "queryName": "Responses With Wrong HTTP Status Code (v3)", "severity": "INFO", "line": 13, "filename": "positive1.json" }, { "queryName": "Responses With Wrong HTTP Status Code (v3)", "severity": "INFO", "line": 39, "filename": "positive1.json" }, { "queryName": "Responses With Wrong HTTP Status Code (v3)", "severity": "INFO", "line": 11, "filename": "positive2.yaml" }, { "queryName": "Responses With Wrong HTTP Status Code (v3)", "severity": "INFO", "line": 25, "filename": "positive2.yaml" }, { "queryName": "Responses With Wrong HTTP Status Code (v2)", "severity": "INFO", "line": 13, "filename": "positive3.json" }, { "queryName": "Responses With Wrong HTTP Status Code (v2)", "severity": "INFO", "line": 39, "filename": "positive3.json" }, { "queryName": "Responses With Wrong HTTP Status Code (v2)", "severity": "INFO", "line": 11, "filename": "positive4.yaml" }, { "queryName": "Responses With Wrong HTTP Status Code (v2)", "severity": "INFO", "line": 25, "filename": "positive4.yaml" } ]
497
1,816
<reponame>StevenMHernandez/masonite import unittest from src.masonite.cookies import CookieJar from src.masonite.utils.time import cookie_expire_time class TestCookies(unittest.TestCase): def test_cookies_can_get_set(self): cookiejar = CookieJar() cookiejar.add("cookie", "name") self.assertEqual(cookiejar.get("cookie").value, "name") self.assertEqual(cookiejar.get("cookie").name, "cookie") def test_cookies_can_put_to_dict(self): cookiejar = CookieJar() cookiejar.add("cookie", "name") self.assertEqual(cookiejar.to_dict(), {"cookie": "name"}) def test_cookie_jar_can_render_cookie_string(self): cookiejar = CookieJar() cookiejar.add("cookie", "name", http_only=False) self.assertEqual( cookiejar.render_response(), [("Set-Cookie", "cookie=name;Path=/;")] ) def test_cookie_jar_can_render_multiple_cookies(self): cookiejar = CookieJar() cookiejar.add("cookie1", "name", http_only=False) cookiejar.add("cookie2", "name", http_only=False) self.assertEqual( cookiejar.render_response(), [ ("Set-Cookie", "cookie1=name;Path=/;"), ("Set-Cookie", "cookie2=name;Path=/;"), ], ) def test_cookie_jar_can_render_multiple_cookies_with_different_options(self): cookiejar = CookieJar() cookiejar.add("cookie1", "name", path="/") self.assertEqual( cookiejar.render_response(), [("Set-Cookie", "cookie1=name;HttpOnly;Path=/;")], ) def test_cookie_with_expires(self): cookiejar = CookieJar() time = cookie_expire_time("2 months") cookiejar.add("cookie1", "name", path="/", expires=time, timezone="GMT") self.assertEqual( cookiejar.render_response(), [("Set-Cookie", f"cookie1=name;HttpOnly;Expires={time} GMT;Path=/;")], ) def test_cookie_with_expired_already(self): cookiejar = CookieJar() time = cookie_expire_time("expired") cookiejar.add("cookie1", "name", path="/", expires=time, timezone="GMT") self.assertEqual( cookiejar.render_response(), [("Set-Cookie", f"cookie1=name;HttpOnly;Expires={time} GMT;Path=/;")], ) def test_cookie_can_load(self): cookiejar = CookieJar() cookiejar.add("cookie1", "name", http_only=False) cookiejar.load("csrf_token=tok") self.assertEqual( cookiejar.render_response(), [("Set-Cookie", "cookie1=name;Path=/;")] ) self.assertEqual(cookiejar.get("csrf_token").value, "tok") def test_cookie_can_make_secure_cookies(self): cookiejar = CookieJar() cookiejar.add("cookie1", "name", http_only=False, secure=True) self.assertEqual( cookiejar.render_response(), [("Set-Cookie", "cookie1=name;Secure;Path=/;")] )
1,342
2,490
<filename>Extension/i18n/trk/src/Debugger/configurationProvider.i18n.json /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { "default.configuration.menuitem": "Varsayılan Yapılandırma", "select.configuration": "Yapılandırma seçin", "debugger.not.available": "'{0}' türündeki hata ayıklayıcısı yalnızca Windows'da kullanılabilir. Geçerli işletim sistemi platformunda '{1}' türünü kullanın.", "debugger.deprecated.config": "{0}' anahtarı kullanım dışı. Lütfen bunun yerine '{1}' kullanın.", "lldb.framework.install.xcode": "Daha Fazla Bilgi", "lldb.framework.not.found": "lldb-mi için 'LLDB.framework' bulunamıyor. Lütfen XCode'u veya XCode Komut Satırı Araçları'nı yükleyin.", "debugger.launchConfig": "Yapılandırmayı başlat:", "pre.Launch.Task": "preLaunchTask: {0}", "build.and.debug.active.file": "etkin dosyayı derle ve dosyada hata ayıkla", "cl.exe.not.available": "{0} derlemesi ve hata ayıklama yalnızca VS Code, VS için Geliştirici Komut İstemi'nden çalıştırıldığında kullanılabilir.", "lldb.find.failed": "lldb-mi yürütülebilir dosyası için '{0}' bağımlılığı eksik.", "lldb.search.paths": "Şurada arandı:", "lldb.install.help": "Bu sorunu çözmek için, Apple App Store üzerinden XCode'u yükleyin ya da bir Terminal penceresinde '{0}' çalıştırarak XCode Komut Satırı Araçları'nı yükleyin.", "envfile.failed": "{0} kullanılamadı. Neden: {1}", "replacing.sourcepath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.", "replacing.targetpath": "{0} değişkeninin '{1}' olan değeri '{2}' olarak değiştiriliyor.", "replacing.editorPath": "'{1}' adlı {0}, '{2}' ile değiştiriliyor.", "resolving.variables.in.sourcefilemap": "{0} değişkenleri çözümleniyor...", "open.envfile": "{0} öğesini aç", "recently.used.task": "Son Kullanılan Görev", "configured.task": "Yapılandırılan Görev", "detected.task": "Algılanan Görev", "cannot.build.non.cpp": "Etkin dosya bir C ya da C++ kaynak dosyası olmadığından derleme veya hata ayıklama yapılamıyor.", "no.compiler.found": "Derleyici bulunamadı", "select.debug.configuration": "Bir hata ayıklama yapılandırması seçin", "unexpected.os": "Beklenmeyen işletim sistemi türü", "path.to.pipe.program": "Kanal programının tam yolu, örneğin {0}", "enable.pretty.printing": "{0} için düzgün yazdırmayı etkinleştir", "enable.intel.disassembly.flavor": "Ayrıştırılmış Kod Varyantını {0} olarak ayarla" }
1,168
501
#!/usr/bin/env python # Author: <NAME> <<EMAIL>> ''' Scan H2 molecule dissociation curve comparing UHF and RHF solutions per the example of Szabo and Ostlund section 3.8.7 The initial guess is obtained by mixing the HOMO and LUMO and is implemented as a function that can be used in other applications. See also 16-h2_scan.py, 30-scan_pes.py, 32-break_spin_symm.py ''' import numpy import pyscf from pyscf import scf from pyscf import gto erhf = [] euhf = [] dm = None def init_guess_mixed(mol,mixing_parameter=numpy.pi/4): ''' Generate density matrix with broken spatial and spin symmetry by mixing HOMO and LUMO orbitals following ansatz in Szabo and Ostlund, Sec 3.8.7. psi_1a = numpy.cos(q)*psi_homo + numpy.sin(q)*psi_lumo psi_1b = numpy.cos(q)*psi_homo - numpy.sin(q)*psi_lumo psi_2a = -numpy.sin(q)*psi_homo + numpy.cos(q)*psi_lumo psi_2b = numpy.sin(q)*psi_homo + numpy.cos(q)*psi_lumo Returns: Density matrices, a list of 2D ndarrays for alpha and beta spins ''' # opt: q, mixing parameter 0 < q < 2 pi #based on init_guess_by_1e h1e = scf.hf.get_hcore(mol) s1e = scf.hf.get_ovlp(mol) mo_energy, mo_coeff = rhf.eig(h1e, s1e) mo_occ = rhf.get_occ(mo_energy=mo_energy, mo_coeff=mo_coeff) homo_idx=0 lumo_idx=1 for i in range(len(mo_occ)-1): if mo_occ[i]>0 and mo_occ[i+1]<0: homo_idx=i lumo_idx=i+1 psi_homo=mo_coeff[:, homo_idx] psi_lumo=mo_coeff[:, lumo_idx] Ca=numpy.zeros_like(mo_coeff) Cb=numpy.zeros_like(mo_coeff) #mix homo and lumo of alpha and beta coefficients q=mixing_parameter for k in range(mo_coeff.shape[0]): if k == homo_idx: Ca[:,k] = numpy.cos(q)*psi_homo + numpy.sin(q)*psi_lumo Cb[:,k] = numpy.cos(q)*psi_homo - numpy.sin(q)*psi_lumo continue if k==lumo_idx: Ca[:,k] = -numpy.sin(q)*psi_homo + numpy.cos(q)*psi_lumo Cb[:,k] = numpy.sin(q)*psi_homo + numpy.cos(q)*psi_lumo continue Ca[:,k]=mo_coeff[:,k] Cb[:,k]=mo_coeff[:,k] dm =scf.UHF(mol).make_rdm1( (Ca,Cb), (mo_occ,mo_occ) ) return dm for b in numpy.arange(0.7, 4.01, 0.1): mol = gto.M(atom=[["H", 0., 0., 0.], ["H", 0., 0., b ]], basis='sto-3g', verbose=0) rhf = scf.RHF(mol) uhf = scf.UHF(mol) erhf.append(rhf.kernel(dm)) euhf.append(uhf.kernel(init_guess_mixed(mol))) dm = rhf.make_rdm1() print('R E(RHF) E(UHF)') for i, b in enumerate(numpy.arange(0.7, 4.01, 0.1)): print('%.2f %.8f %.8f' % (b, erhf[i], euhf[i]))
1,404
19,127
<reponame>pmesnier/openssl /* * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ /* * RC5 low level APIs are deprecated for public use, but still ok for internal * use. */ #include "internal/deprecated.h" #include <openssl/rc5.h> #include "rc5_local.h" /* * The input and output encrypted as though 64bit ofb mode is being used. * The extra state information to record how much of the 64bit block we have * used is contained in *num; */ void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, RC5_32_KEY *schedule, unsigned char *ivec, int *num) { register unsigned long v0, v1, t; register int n = *num; register long l = length; unsigned char d[8]; register char *dp; unsigned long ti[2]; unsigned char *iv; int save = 0; iv = (unsigned char *)ivec; c2l(iv, v0); c2l(iv, v1); ti[0] = v0; ti[1] = v1; dp = (char *)d; l2c(v0, dp); l2c(v1, dp); while (l--) { if (n == 0) { RC5_32_encrypt((unsigned long *)ti, schedule); dp = (char *)d; t = ti[0]; l2c(t, dp); t = ti[1]; l2c(t, dp); save++; } *(out++) = *(in++) ^ d[n]; n = (n + 1) & 0x07; } if (save) { v0 = ti[0]; v1 = ti[1]; iv = (unsigned char *)ivec; l2c(v0, iv); l2c(v1, iv); } t = v0 = v1 = ti[0] = ti[1] = 0; *num = n; }
850
399
/* * TypeBinder.java * * Copyright (c) 2012 <NAME> * * This source code is subject to terms and conditions of the Apache License, Version 2.0. * A copy of the license can be found in the License.html file at the root of this distribution. * By using this source code in any fashion, you are agreeing to be bound by the terms of the * Apache License, Version 2.0. * * You must not remove this notice, or any other, from this software. */ package com.strobel.reflection; import com.strobel.annotations.NotNull; import com.strobel.core.VerifyArgument; import com.strobel.util.ContractUtils; import com.strobel.util.TypeUtils; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; /** * @author <NAME> */ public class TypeBinder extends TypeMapper<TypeBindings> { final static Method GET_CLASS_METHOD; final static TypeBinder DEFAULT_BINDER; static { Method getClassMethod; try { getClassMethod = Object.class.getMethod("getClass"); } catch (final NoSuchMethodException ignored) { getClassMethod = null; } GET_CLASS_METHOD = getClassMethod; DEFAULT_BINDER = new TypeBinder(); } public static TypeBinder defaultBinder() { return DEFAULT_BINDER; } public ConstructorList visit(final Type<?> declaringType, final ConstructorList constructors, final TypeBindings bindings) { VerifyArgument.notNull(constructors, "constructors"); ConstructorInfo[] newConstructors = null; for (int i = 0, n = constructors.size(); i < n; i++) { final ConstructorInfo oldConstructor = constructors.get(i); final ConstructorInfo newConstructor = visitConstructor(declaringType, oldConstructor, bindings); if (newConstructor != oldConstructor) { if (newConstructors == null) { newConstructors = constructors.toArray(); } newConstructors[i] = newConstructor; } } if (newConstructors != null) { return new ConstructorList(newConstructors); } return constructors; } public FieldList visit(final Type<?> declaringType, final FieldList fields, final TypeBindings bindings) { VerifyArgument.notNull(fields, "fields"); FieldInfo[] newFields = null; for (int i = 0, n = fields.size(); i < n; i++) { final FieldInfo oldField = fields.get(i); final FieldInfo newField = visitField(declaringType, oldField, bindings); if (newField != oldField) { if (newFields == null) { newFields = fields.toArray(); } newFields[i] = newField; } } if (newFields != null) { return new FieldList(newFields); } return fields; } public MethodList visit(final Type<?> declaringType, final MethodList methods, final TypeBindings bindings) { VerifyArgument.notNull(methods, "methods"); MethodInfo[] newMethods = null; for (int i = 0, n = methods.size(); i < n; i++) { final MethodInfo oldMethod = methods.get(i); final MethodInfo newMethod = visitMethod(declaringType, oldMethod, bindings); if (newMethod != oldMethod) { if (newMethods == null) { newMethods = methods.toArray(); } newMethods[i] = newMethod; } } if (newMethods != null) { return new MethodList(newMethods); } return methods; } public TypeBindings visitTypeBindings(final TypeBindings typeBindings, final TypeBindings bindings) { TypeBindings newTypeBindings = typeBindings; for (final Type<?> genericParameter : typeBindings.getGenericParameters()) { final Type<?> oldBoundType = typeBindings.getBoundType(genericParameter); final Type<?> newBoundType = visit(oldBoundType, bindings); if (oldBoundType != newBoundType) { newTypeBindings = newTypeBindings.withAdditionalBinding( genericParameter, newBoundType ); } } return newTypeBindings; } public FieldInfo visitField(final Type<?> declaringType, final FieldInfo field, final TypeBindings bindings) { final Type<?> oldFieldType = field.getFieldType(); final Type<?> newFieldType = visit(field.getFieldType(), bindings); if (TypeUtils.areEquivalent(oldFieldType, newFieldType) && TypeUtils.areEquivalent(field.getDeclaringType(), declaringType)) { return field; } return new ReflectedField( declaringType, field.getReflectedType(), field.getRawField(), newFieldType ); } public ParameterList visitParameters(final ParameterList parameters, final TypeBindings bindings) { VerifyArgument.notNull(parameters, "parameters"); ParameterInfo[] newParameters = null; for (int i = 0, n = parameters.size(); i < n; i++) { final ParameterInfo oldParameter = parameters.get(i); final Type<?> oldParameterType = oldParameter.getParameterType(); final Type<?> newParameterType = visit(oldParameterType, bindings); if (newParameterType != oldParameterType) { if (newParameters == null) { newParameters = parameters.toArray(); } newParameters[i] = new ParameterInfo(oldParameter.getName(), i, newParameterType); } } if (newParameters != null) { return new ParameterList(newParameters); } return parameters; } public MemberInfo visitMember(final Type<?> declaringType, final MemberInfo member, final TypeBindings bindings) { switch (member.getMemberType()) { case Constructor: return visitConstructor(declaringType, (ConstructorInfo) member, bindings); case Field: return visitField(declaringType, (FieldInfo) member, bindings); case Method: return visitMethod(declaringType, (MethodInfo) member, bindings); case TypeInfo: case NestedType: return visitType((Type<?>) member, bindings); default: throw ContractUtils.unreachable(); } } public MethodInfo visitMethod(final Type<?> declaringType, final MethodInfo method, final TypeBindings bindings) { if (method.isGenericMethodDefinition()) { boolean hasChanged = false; final MethodInfo newDefinition; if (!method.isGenericMethodDefinition()) { final MethodInfo oldDefinition = method.getGenericMethodDefinition(); newDefinition = visitMethod(declaringType, oldDefinition, bindings); hasChanged = newDefinition != oldDefinition; } else { newDefinition = method.getGenericMethodDefinition(); } final TypeBindings oldBindings = method.getTypeBindings(); final TypeBindings newBindings; if (oldBindings.hasUnboundParameters()) { newBindings = visitTypeBindings( oldBindings, bindings.withAdditionalBindings(oldBindings) ); hasChanged |= newBindings != oldBindings; } else { newBindings = oldBindings; } if (hasChanged) { return visitMethod(declaringType, newDefinition.makeGenericMethod(newBindings.getBoundTypes()), newBindings); } } final Type<?> oldReturnType = method.getReturnType(); final Type<?> returnType = visit(oldReturnType, bindings); final ParameterList oldParameters = method.getParameters(); final ParameterList newParameters = visitParameters(oldParameters, bindings); final TypeList oldThrownTypes = method.getThrownTypes(); final Type<?>[] newThrownTypes = new Type<?>[oldThrownTypes.size()]; boolean hasChanged = !oldReturnType.equals(returnType) || oldParameters != newParameters; boolean thrownTypesChanged = false; for (int i = 0, n = newThrownTypes.length; i < n; i++) { final Type<?> oldThrownType = oldThrownTypes.get(i); final Type<?> newThrownType = visit(oldThrownType, bindings); newThrownTypes[i] = newThrownType; if (!oldThrownType.equals(newThrownType)) { thrownTypesChanged = true; } } hasChanged |= thrownTypesChanged; if (!hasChanged) { if (!TypeUtils.areEquivalent(method.getDeclaringType(), declaringType)) { return MethodInfo.declaredOn(method, declaringType, method.getReflectedType()); } return method; } return new ReflectedMethod( method, declaringType, method.getReflectedType(), method.getRawMethod(), newParameters, returnType, thrownTypesChanged ? new TypeList(newThrownTypes) : oldThrownTypes, method.getTypeBindings() ); } public ConstructorInfo visitConstructor(final Type<?> declaringType, final ConstructorInfo constructor, final TypeBindings bindings) { final ParameterList parameters = constructor.getParameters(); final TypeList thrown = constructor.getThrownTypes(); final Type<?>[] parameterTypes = new Type<?>[parameters.size()]; final Type<?>[] thrownTypes = new Type<?>[thrown.size()]; boolean hasChanged = false; boolean thrownTypesChanged = false; for (int i = 0, n = parameterTypes.length; i < n; i++) { final Type<?> oldParameterType = parameters.get(i).getParameterType(); parameterTypes[i] = visit(oldParameterType, bindings); if (!oldParameterType.equals(parameterTypes[i])) { hasChanged = true; } } for (int i = 0, n = thrownTypes.length; i < n; i++) { final Type<?> oldThrownType = thrown.get(i); final Type<?> newThrownType = visit(oldThrownType, bindings); thrownTypes[i] = newThrownType; if (!oldThrownType.equals(newThrownType)) { thrownTypesChanged = true; } } hasChanged |= thrownTypesChanged; if (!hasChanged) { if (!TypeUtils.areEquivalent(constructor.getDeclaringType(), declaringType)) { return new ReflectedConstructor( declaringType, constructor.getRawConstructor(), constructor.getParameters(), thrown ); } return constructor; } final ArrayList<ParameterInfo> newParameters = new ArrayList<>(); for (int i = 0, n = parameterTypes.length; i < n; i++) { newParameters.add( new ParameterInfo( parameters.get(i).getName(), i, parameterTypes[i] ) ); } return new ReflectedConstructor( declaringType, constructor.getRawConstructor(), new ParameterList(newParameters), new TypeList(thrownTypes) ); } @Override public Type<?> visitClassType(final Type<?> type, final TypeBindings bindings) { if (bindings.containsGenericParameter(type)) { return bindings.getBoundType(type); } final TypeBindings oldTypeBindings = type.getTypeBindings(); final TypeBindings newTypeBindings = visitTypeBindings(oldTypeBindings, bindings); if (oldTypeBindings != newTypeBindings) { return type.getGenericTypeDefinition().makeGenericType(newTypeBindings.getBoundTypes()); } return type; } @Override public Type<?> visitTypeParameter(final Type<?> type, final TypeBindings bindings) { return visitTypeParameterCore(type, bindings); } protected Type<?> visitTypeParameterCore(final Type<?> type, final TypeBindings bindings) { if (!bindings.containsGenericParameter(type) && Types.Object.equals(type.getExtendsBound())) { return type; } final CacheEntry entry = new CacheEntry(bindings, type); final Map<CacheEntry, CacheEntry> cache = cache(); if (cache.containsKey(entry)) { return type; } cache.put(entry, entry); try { if (bindings.containsGenericParameter(type)) { return visit(bindings.getBoundType(type), bindings); } final Type<?> upperBound = type.getExtendsBound(); final Type<?> newUpperBound = visit(upperBound, bindings); if (newUpperBound != upperBound) { if (type.getDeclaringMethod() != null) { return new GenericParameter( type.getFullName(), (MethodInfo) type.getDeclaringMethod(), newUpperBound, type.getGenericParameterPosition() ); } return new GenericParameter( type.getFullName(), type.getDeclaringType(), newUpperBound, type.getGenericParameterPosition() ); } return type; } finally { cache.remove(entry); } } @Override public Type<?> visitWildcardType(final Type<?> type, final TypeBindings bindings) { final Type<?> oldLower = type.getSuperBound(); final Type<?> oldUpper = type.getExtendsBound(); final Type<?> newLower = visit(oldLower, bindings); final Type<?> newUpper = visit(oldUpper, bindings); if (newLower != oldLower || newUpper != oldUpper) { return new WildcardType<>(newUpper, newLower); } return type; } @Override public Type<?> visitArrayType(final Type<?> type, final TypeBindings bindings) { final Type<?> oldElementType = type.getElementType(); final Type<?> newElementType = visit(oldElementType, bindings); if (TypeUtils.areEquivalent(oldElementType, newElementType)) { return type; } return newElementType.makeArrayType(); } // <editor-fold defaultstate="collapsed" desc="Generic Parameter Stack"> // // We keep a thread-local cache of generic parameters we have already visited, so as to avoid infinite recursion // when visiting type variables with self-referencing bounds, e.g., `T extends Comparable<? super T>`. // private static final ThreadLocal<Map<CacheEntry, CacheEntry>> CACHE = new ThreadLocal<Map<CacheEntry, CacheEntry>>() { @Override protected Map<CacheEntry, CacheEntry> initialValue() { return new LinkedHashMap<>(); } }; private static Map<CacheEntry, CacheEntry> cache() { return CACHE.get(); } private static final class CacheEntry { @NotNull final TypeBindings bindings; @NotNull final Type<?> type; CacheEntry(final @NotNull TypeBindings bindings, final @NotNull Type<?> type) { this.bindings = bindings; this.type = type; } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o instanceof CacheEntry) { final CacheEntry entry = (CacheEntry) o; return entry.bindings == this.bindings && entry.type == this.type; } return false; } @Override public int hashCode() { int result = System.identityHashCode(bindings); result = 31 * result + System.identityHashCode(type); return result; } @Override public String toString() { return "CacheEntry{" + "bindings=" + bindings + ", type=" + type + '}'; } } // </editor-fold> } class TypeEraser extends TypeBinder { @Override public Type<?> visit(final Type<?> type) { return visit(type, TypeBindings.empty()); } @Override public Type<?> visitClassType(final Type<?> type, final TypeBindings bindings) { if (type instanceof ErasedType<?>) { return type; } return type.getErasedType(); } @Override public Type<?> visitTypeParameter(final Type<?> type, final TypeBindings bindings) { return visit(type.getExtendsBound()); } @Override public Type<?> visitWildcardType(final Type<?> type, final TypeBindings bindings) { return visit(type.getExtendsBound()); } @Override public Type<?> visitArrayType(final Type<?> type, final TypeBindings bindings) { final Type<?> oldElementType = type.getElementType(); final Type<?> newElementType = visit(oldElementType); if (newElementType != oldElementType) { return newElementType.makeArrayType(); } return type; } @Override public FieldInfo visitField(final Type<?> declaringType, final FieldInfo field, final TypeBindings bindings) { final Type<?> oldFieldType = field.getFieldType(); final Type<?> newFieldType = visit(field.getFieldType(), bindings); if (TypeUtils.areEquivalent(oldFieldType, newFieldType) && TypeUtils.areEquivalent(field.getDeclaringType(), declaringType)) { return field; } return new ErasedField( field, declaringType, newFieldType ); } @Override public MethodInfo visitMethod(final Type<?> declaringType, final MethodInfo method, final TypeBindings bindings) { final Type<?> oldReturnType = method.getReturnType(); final Type<?> returnType = visit(oldReturnType, bindings); final ParameterList oldParameters = method.getParameters(); final ParameterList newParameters = visitParameters(oldParameters, bindings); final TypeList oldThrownTypes = method.getThrownTypes(); final Type<?>[] newThrownTypes = new Type<?>[oldThrownTypes.size()]; boolean hasChanged = !oldReturnType.equals(returnType) || oldParameters != newParameters; boolean thrownTypesChanged = false; for (int i = 0, n = newThrownTypes.length; i < n; i++) { final Type<?> oldThrownType = oldThrownTypes.get(i); final Type<?> newThrownType = visit(oldThrownType, bindings); newThrownTypes[i] = newThrownType; if (!oldThrownType.equals(newThrownType)) { thrownTypesChanged = true; } } hasChanged |= thrownTypesChanged; if (!hasChanged) { if (!TypeUtils.areEquivalent(method.getDeclaringType(), declaringType)) { return MethodInfo.declaredOn(method, declaringType, method.getReflectedType()); } return method; } return new ErasedMethod( method, declaringType, newParameters, returnType, thrownTypesChanged ? new TypeList(newThrownTypes) : oldThrownTypes, TypeBindings.empty() ); } }
9,355
5,798
# Copyright 2018 Google LLC. 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. # ============================================================================= """Test for the MNIST transfer learning CNN model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import shutil import tempfile import unittest import numpy as np from . import mnist_transfer_cnn class MnistTest(unittest.TestCase): def setUp(self): self._tmp_dir = tempfile.mkdtemp() super(MnistTest, self).setUp() def tearDown(self): if os.path.isdir(self._tmp_dir): shutil.rmtree(self._tmp_dir) super(MnistTest, self).tearDown() def _getFakeMnistData(self): """Generate some fake MNIST data for testing.""" x_train = np.random.rand(4, 28, 28) y_train = np.random.rand(4,) x_test = np.random.rand(4, 28, 28) y_test = np.random.rand(4,) return x_train, y_train, x_test, y_test def testWriteGte5DataToJsFiles(self): x_train, y_train, x_test, y_test = self._getFakeMnistData() js_file_prefix = os.path.join(self._tmp_dir, 'gte5') mnist_transfer_cnn.write_gte5_data(x_train, y_train, x_test, y_test, js_file_prefix) for js_path_suffix in ('.train.json', '.test.json'): with open(js_file_prefix + js_path_suffix, 'rt') as f: json_string = f.read() data = json.loads(json_string) if 'train' in js_path_suffix: self.assertEqual(x_train.shape[0], len(data)) else: self.assertEqual(x_test.shape[0], len(data)) self.assertEqual(28, len(data[0]['x'])) self.assertEqual(28, len(data[0]['x'][0])) def testTrainWithFakeDataAndSave(self): x_train, y_train, x_test, y_test = self._getFakeMnistData() mnist_transfer_cnn.train_and_save_model( 2, 2, 2, 2, 1, x_train, y_train, x_test, y_test, self._tmp_dir, optimizer='adam') # Check that the model json file is created. json.load(open(os.path.join(self._tmp_dir, 'model.json'), 'rt')) if __name__ == '__main__': unittest.main()
1,036
997
<gh_stars>100-1000 /* This file is for Niederreiter decryption */ #include "decrypt.h" #include "benes.h" #include "bm.h" #include "fft.h" #include "fft_tr.h" #include "params.h" #include "util.h" #include "vec.h" #include <stdio.h> static void scaling(vec out[][GFBITS], vec inv[][GFBITS], const unsigned char *sk, const vec *recv) { int i, j; vec irr_int[ GFBITS ]; vec eval[64][ GFBITS ]; vec tmp[ GFBITS ]; // PQCLEAN_MCELIECE348864F_VEC_irr_load(irr_int, sk); PQCLEAN_MCELIECE348864F_VEC_fft(eval, irr_int); for (i = 0; i < 64; i++) { PQCLEAN_MCELIECE348864F_VEC_vec_sq(eval[i], eval[i]); } PQCLEAN_MCELIECE348864F_VEC_vec_copy(inv[0], eval[0]); for (i = 1; i < 64; i++) { PQCLEAN_MCELIECE348864F_VEC_vec_mul(inv[i], inv[i - 1], eval[i]); } PQCLEAN_MCELIECE348864F_VEC_vec_inv(tmp, inv[63]); for (i = 62; i >= 0; i--) { PQCLEAN_MCELIECE348864F_VEC_vec_mul(inv[i + 1], tmp, inv[i]); PQCLEAN_MCELIECE348864F_VEC_vec_mul(tmp, tmp, eval[i + 1]); } PQCLEAN_MCELIECE348864F_VEC_vec_copy(inv[0], tmp); // for (i = 0; i < 64; i++) { for (j = 0; j < GFBITS; j++) { out[i][j] = inv[i][j] & recv[i]; } } } static void preprocess(vec *recv, const unsigned char *s) { int i; unsigned char r[ 512 ]; for (i = 0; i < SYND_BYTES; i++) { r[i] = s[i]; } for (i = SYND_BYTES; i < 512; i++) { r[i] = 0; } for (i = 0; i < 64; i++) { recv[i] = PQCLEAN_MCELIECE348864F_VEC_load8(r + i * 8); } } static void postprocess(unsigned char *e, vec *err) { int i; unsigned char error8[ (1 << GFBITS) / 8 ]; for (i = 0; i < 64; i++) { PQCLEAN_MCELIECE348864F_VEC_store8(error8 + i * 8, err[i]); } for (i = 0; i < SYS_N / 8; i++) { e[i] = error8[i]; } } static void scaling_inv(vec out[][GFBITS], vec inv[][GFBITS], const vec *recv) { int i, j; for (i = 0; i < 64; i++) { for (j = 0; j < GFBITS; j++) { out[i][j] = inv[i][j] & recv[i]; } } } static uint16_t weight_check(const unsigned char *e, const vec *error) { int i; uint16_t w0 = 0; uint16_t w1 = 0; uint16_t check; for (i = 0; i < (1 << GFBITS); i++) { w0 += (error[i / 64] >> (i % 64)) & 1; } for (i = 0; i < SYS_N; i++) { w1 += (e[i / 8] >> (i % 8)) & 1; } check = (w0 ^ SYS_T) | (w1 ^ SYS_T); check -= 1; check >>= 15; return check; } static uint16_t synd_cmp(vec s0[][ GFBITS ], vec s1[][ GFBITS ]) { int i, j; vec diff = 0; for (i = 0; i < 2; i++) { for (j = 0; j < GFBITS; j++) { diff |= (s0[i][j] ^ s1[i][j]); } } return (uint16_t)PQCLEAN_MCELIECE348864F_VEC_vec_testz(diff); } /* Niederreiter decryption with the Berlekamp decoder */ /* intput: sk, secret key */ /* c, ciphertext (syndrome) */ /* output: e, error vector */ /* return: 0 for success; 1 for failure */ int PQCLEAN_MCELIECE348864F_VEC_decrypt(unsigned char *e, const unsigned char *sk, const unsigned char *c) { int i; uint16_t check_synd; uint16_t check_weight; vec inv[ 64 ][ GFBITS ]; vec scaled[ 64 ][ GFBITS ]; vec eval[ 64 ][ GFBITS ]; vec error[ 64 ]; vec s_priv[ 2 ][ GFBITS ]; vec s_priv_cmp[ 2 ][ GFBITS ]; vec locator[ GFBITS ]; vec recv[ 64 ]; vec allone; // Berlekamp decoder preprocess(recv, c); PQCLEAN_MCELIECE348864F_VEC_benes(recv, sk + IRR_BYTES, 1); scaling(scaled, inv, sk, recv); PQCLEAN_MCELIECE348864F_VEC_fft_tr(s_priv, scaled); PQCLEAN_MCELIECE348864F_VEC_bm(locator, s_priv); PQCLEAN_MCELIECE348864F_VEC_fft(eval, locator); // reencryption and weight check allone = PQCLEAN_MCELIECE348864F_VEC_vec_setbits(1); for (i = 0; i < 64; i++) { error[i] = PQCLEAN_MCELIECE348864F_VEC_vec_or_reduce(eval[i]); error[i] ^= allone; } scaling_inv(scaled, inv, error); PQCLEAN_MCELIECE348864F_VEC_fft_tr(s_priv_cmp, scaled); check_synd = synd_cmp(s_priv, s_priv_cmp); // PQCLEAN_MCELIECE348864F_VEC_benes(error, sk + IRR_BYTES, 0); postprocess(e, error); check_weight = weight_check(e, error); return 1 - (check_synd & check_weight); }
2,254
852
#include "EventFilter/GctRawToDigi/src/GctUnpackCollections.h" GctUnpackCollections::GctUnpackCollections(edm::Event& event) : m_event(event), m_gctFibres(new L1GctFibreCollection()), // GCT input collections m_rctEm(new L1CaloEmCollection()), m_rctCalo(new L1CaloRegionCollection()), m_gctInternEm(new L1GctInternEmCandCollection()), // GCT internal collections m_gctInternJets(new L1GctInternJetDataCollection()), m_gctInternEtSums(new L1GctInternEtSumCollection()), m_gctInternHFData(new L1GctInternHFDataCollection()), m_gctInternHtMiss(new L1GctInternHtMissCollection()), m_gctIsoEm(new L1GctEmCandCollection()), // GCT output collections m_gctNonIsoEm(new L1GctEmCandCollection()), m_gctCenJets(new L1GctJetCandCollection()), m_gctForJets(new L1GctJetCandCollection()), m_gctTauJets(new L1GctJetCandCollection()), m_gctHfBitCounts(new L1GctHFBitCountsCollection()), m_gctHfRingEtSums(new L1GctHFRingEtSumsCollection()), m_gctEtTot(new L1GctEtTotalCollection()), m_gctEtHad(new L1GctEtHadCollection()), m_gctEtMiss(new L1GctEtMissCollection()), m_gctHtMiss(new L1GctHtMissCollection()), m_gctJetCounts(new L1GctJetCountsCollection()), // Deprecated (empty collection still needed by GT) m_errors(new L1TriggerErrorCollection()) // Misc { m_gctIsoEm->reserve(4); m_gctCenJets->reserve(4); m_gctForJets->reserve(4); m_gctTauJets->reserve(4); // ** DON'T RESERVE SPACE IN VECTORS FOR DEBUG UNPACK ITEMS! ** } GctUnpackCollections::~GctUnpackCollections() { // GCT input collections m_event.put(std::move(m_gctFibres)); m_event.put(std::move(m_rctEm)); m_event.put(std::move(m_rctCalo)); // GCT internal collections m_event.put(std::move(m_gctInternEm)); m_event.put(std::move(m_gctInternJets)); m_event.put(std::move(m_gctInternEtSums)); m_event.put(std::move(m_gctInternHFData)); m_event.put(std::move(m_gctInternHtMiss)); // GCT output collections m_event.put(std::move(m_gctIsoEm), "isoEm"); m_event.put(std::move(m_gctNonIsoEm), "nonIsoEm"); m_event.put(std::move(m_gctCenJets), "cenJets"); m_event.put(std::move(m_gctForJets), "forJets"); m_event.put(std::move(m_gctTauJets), "tauJets"); m_event.put(std::move(m_gctHfBitCounts)); m_event.put(std::move(m_gctHfRingEtSums)); m_event.put(std::move(m_gctEtTot)); m_event.put(std::move(m_gctEtHad)); m_event.put(std::move(m_gctEtMiss)); m_event.put(std::move(m_gctHtMiss)); m_event.put(std::move(m_gctJetCounts)); // Deprecated (empty collection still needed by GT) // Misc m_event.put(std::move(m_errors)); } std::ostream& operator<<(std::ostream& os, const GctUnpackCollections& rhs) { // GCT input collections os << "Read " << rhs.gctFibres()->size() << " GCT raw fibre data\n" << "Read " << rhs.rctEm()->size() << " RCT EM candidates\n" << "Read " << rhs.rctCalo()->size() << " RCT Calo Regions\n" // GCT internal collections << "Read " << rhs.gctInternEm()->size() << " GCT intermediate EM candidates\n" << "Read " << rhs.gctInternJets()->size() << " GCT intermediate jet candidates\n" << "Read " << rhs.gctInternEtSums()->size() << " GCT intermediate et sums\n" << "Read " << rhs.gctInternHFData()->size() << " GCT intermediate HF data\n" << "Read " << rhs.gctInternHtMiss()->size() << " GCT intermediate Missing Ht\n" // GCT output collections << "Read " << rhs.gctIsoEm()->size() << " GCT iso EM candidates\n" << "Read " << rhs.gctNonIsoEm()->size() << " GCT non-iso EM candidates\n" << "Read " << rhs.gctCenJets()->size() << " GCT central jet candidates\n" << "Read " << rhs.gctForJets()->size() << " GCT forward jet candidates\n" << "Read " << rhs.gctTauJets()->size() << " GCT tau jet candidates\n" << "Read " << rhs.gctHfBitCounts()->size() << " GCT HF ring bit counts\n" << "Read " << rhs.gctHfRingEtSums()->size() << " GCT HF ring et sums\n" << "Read " << rhs.gctEtTot()->size() << " GCT total et\n" << "Read " << rhs.gctEtHad()->size() << " GCT ht\n" << "Read " << rhs.gctEtMiss()->size() << " GCT met\n" << "Read " << rhs.gctHtMiss()->size() << " GCT mht"; // Any point in putting in an m_errors()->size()? Not sure. return os; }
1,928
348
<reponame>chamberone/Leaflet.PixiOverlay<filename>docs/data/leg-t2/070/07002328.json {"nom":"Malbouhans","circ":"2ème circonscription","dpt":"Haute-Saône","inscrits":294,"abs":131,"votants":163,"blancs":2,"nuls":20,"exp":141,"res":[{"nuance":"FN","nom":"M. <NAME>","voix":72},{"nuance":"REM","nom":"<NAME>","voix":69}]}
135
13,648
<gh_stars>1000+ //***************************************************************************** // // adc.c // // Driver for the ADC module. // // Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ // // // 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 Texas Instruments Incorporated 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 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. // //***************************************************************************** //***************************************************************************** // //! \addtogroup ADC_Analog_to_Digital_Converter_api //! @{ // //***************************************************************************** #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "inc/hw_ints.h" #include "inc/hw_adc.h" #include "inc/hw_apps_config.h" #include "interrupt.h" #include "adc.h" //***************************************************************************** // //! Enables the ADC //! //! \param ulBase is the base address of the ADC //! //! This function sets the ADC global enable //! //! \return None. // //***************************************************************************** void ADCEnable(unsigned long ulBase) { // // Set the global enable bit in the control register. // HWREG(ulBase + ADC_O_ADC_CTRL) |= 0x1; } //***************************************************************************** // //! Disable the ADC //! //! \param ulBase is the base address of the ADC //! //! This function clears the ADC global enable //! //! \return None. // //***************************************************************************** void ADCDisable(unsigned long ulBase) { // // Clear the global enable bit in the control register. // HWREG(ulBase + ADC_O_ADC_CTRL) &= ~0x1 ; } //***************************************************************************** // //! Enables specified ADC channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! //! This function enables specified ADC channel and configures the //! pin as analog pin. //! //! \return None. // //***************************************************************************** void ADCChannelEnable(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulCh; ulCh = (ulChannel == ADC_CH_0)? 0x02 : (ulChannel == ADC_CH_1)? 0x04 : (ulChannel == ADC_CH_2)? 0x08 : 0x10; HWREG(ulBase + ADC_O_ADC_CH_ENABLE) |= ulCh; } //***************************************************************************** // //! Disables specified ADC channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channelsber //! //! This function disables specified ADC channel. //! //! \return None. // //***************************************************************************** void ADCChannelDisable(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulCh; ulCh = (ulChannel == ADC_CH_0)? 0x02 : (ulChannel == ADC_CH_1)? 0x04 : (ulChannel == ADC_CH_2)? 0x08 : 0x10; HWREG(ulBase + ADC_O_ADC_CH_ENABLE) &= ~ulCh; } //***************************************************************************** // //! Enables and registers ADC interrupt handler for specified channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! \param pfnHandler is a pointer to the function to be called when the //! ADC channel interrupt occurs. //! //! This function enables and registers ADC interrupt handler for specified //! channel. Individual interrupt for each channel should be enabled using //! \sa ADCIntEnable(). It is the interrupt handler's responsibility to clear //! the interrupt source. //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \return None. // //***************************************************************************** void ADCIntRegister(unsigned long ulBase, unsigned long ulChannel, void (*pfnHandler)(void)) { unsigned long ulIntNo; // // Get the interrupt number associted with the specified channel // ulIntNo = (ulChannel == ADC_CH_0)? INT_ADCCH0 : (ulChannel == ADC_CH_1)? INT_ADCCH1 : (ulChannel == ADC_CH_2)? INT_ADCCH2 : INT_ADCCH3; // // Register the interrupt handler // IntRegister(ulIntNo,pfnHandler); // // Enable ADC interrupt // IntEnable(ulIntNo); } //***************************************************************************** // //! Disables and unregisters ADC interrupt handler for specified channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! //! This function disables and unregisters ADC interrupt handler for specified //! channel. This function also masks off the interrupt in the interrupt //! controller so that the interrupt handler no longer is called. //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \return None. // //***************************************************************************** void ADCIntUnregister(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulIntNo; // // Get the interrupt number associted with the specified channel // ulIntNo = (ulChannel == ADC_CH_0)? INT_ADCCH0 : (ulChannel == ADC_CH_1)? INT_ADCCH1 : (ulChannel == ADC_CH_2)? INT_ADCCH2 : INT_ADCCH3; // // Disable ADC interrupt // IntDisable(ulIntNo); // // Unregister the interrupt handler // IntUnregister(ulIntNo); } //***************************************************************************** // //! Enables individual interrupt sources for specified channel //! //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! \param ulIntFlags is the bit mask of the interrupt sources to be enabled. //! //! This function enables the indicated ADC interrupt sources. Only the //! sources that are enabled can be reflected to the processor interrupt; //! disabled sources have no effect on the processor. //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! The \e ulIntFlags parameter is the logical OR of any of the following: //! - \b ADC_DMA_DONE for DMA done //! - \b ADC_FIFO_OVERFLOW for FIFO over flow //! - \b ADC_FIFO_UNDERFLOW for FIFO under flow //! - \b ADC_FIFO_EMPTY for FIFO empty //! - \b ADC_FIFO_FULL for FIFO full //! //! \return None. // //***************************************************************************** void ADCIntEnable(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntFlags) { unsigned long ulOffset; unsigned long ulDmaMsk; // // Enable DMA Done interrupt // if(ulIntFlags & ADC_DMA_DONE) { ulDmaMsk = (ulChannel == ADC_CH_0)?0x00001000: (ulChannel == ADC_CH_1)?0x00002000: (ulChannel == ADC_CH_2)?0x00004000:0x00008000; HWREG(APPS_CONFIG_BASE + APPS_CONFIG_O_DMA_DONE_INT_MASK_CLR) = ulDmaMsk; } ulIntFlags = ulIntFlags & 0x0F; // // Get the interrupt enable register offset for specified channel // ulOffset = ADC_O_adc_ch0_irq_en + ulChannel; // // Unmask the specified interrupts // HWREG(ulBase + ulOffset) |= (ulIntFlags & 0xf); } //***************************************************************************** // //! Disables individual interrupt sources for specified channel //! //! //! \param ulBase is the base address of the ADC. //! \param ulChannel is one of the valid ADC channels //! \param ulIntFlags is the bit mask of the interrupt sources to be enabled. //! //! This function disables the indicated ADC interrupt sources. Only the //! sources that are enabled can be reflected to the processor interrupt; //! disabled sources have no effect on the processor. //! //! The parameters\e ulIntFlags and \e ulChannel should be as explained in //! ADCIntEnable(). //! //! \return None. // //***************************************************************************** void ADCIntDisable(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntFlags) { unsigned long ulOffset; unsigned long ulDmaMsk; // // Disable DMA Done interrupt // if(ulIntFlags & ADC_DMA_DONE) { ulDmaMsk = (ulChannel == ADC_CH_0)?0x00001000: (ulChannel == ADC_CH_1)?0x00002000: (ulChannel == ADC_CH_2)?0x00004000:0x00008000; HWREG(APPS_CONFIG_BASE + APPS_CONFIG_O_DMA_DONE_INT_MASK_SET) = ulDmaMsk; } // // Get the interrupt enable register offset for specified channel // ulOffset = ADC_O_adc_ch0_irq_en + ulChannel; // // Unmask the specified interrupts // HWREG(ulBase + ulOffset) &= ~ulIntFlags; } //***************************************************************************** // //! Gets the current channel interrupt status //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! //! This function returns the interrupt status of the specified ADC channel. //! //! The parameter \e ulChannel should be as explained in \sa ADCIntEnable(). //! //! \return Return the ADC channel interrupt status, enumerated as a bit //! field of values described in ADCIntEnable() // //***************************************************************************** unsigned long ADCIntStatus(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulOffset; unsigned long ulDmaMsk; unsigned long ulIntStatus; // // Get DMA Done interrupt status // ulDmaMsk = (ulChannel == ADC_CH_0)?0x00001000: (ulChannel == ADC_CH_1)?0x00002000: (ulChannel == ADC_CH_2)?0x00004000:0x00008000; ulIntStatus = HWREG(APPS_CONFIG_BASE + APPS_CONFIG_O_DMA_DONE_INT_STS_MASKED)& ulDmaMsk; // // Get the interrupt enable register offset for specified channel // ulOffset = ADC_O_adc_ch0_irq_status + ulChannel; // // Read ADC interrupt status // ulIntStatus |= HWREG(ulBase + ulOffset) & 0xf; // // Return the current interrupt status // return(ulIntStatus); } //***************************************************************************** // //! Clears the current channel interrupt sources //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! \param ulIntFlags is the bit mask of the interrupt sources to be cleared. //! //! This function clears individual interrupt source for the specified //! ADC channel. //! //! The parameter \e ulChannel should be as explained in \sa ADCIntEnable(). //! //! \return None. // //***************************************************************************** void ADCIntClear(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntFlags) { unsigned long ulOffset; unsigned long ulDmaMsk; // // Clear DMA Done interrupt // if(ulIntFlags & ADC_DMA_DONE) { ulDmaMsk = (ulChannel == ADC_CH_0)?0x00001000: (ulChannel == ADC_CH_1)?0x00002000: (ulChannel == ADC_CH_2)?0x00004000:0x00008000; HWREG(APPS_CONFIG_BASE + APPS_CONFIG_O_DMA_DONE_INT_ACK) = ulDmaMsk; } // // Get the interrupt enable register offset for specified channel // ulOffset = ADC_O_adc_ch0_irq_status + ulChannel; // // Clear the specified interrupts // HWREG(ulBase + ulOffset) = (ulIntFlags & ~(ADC_DMA_DONE)); } //***************************************************************************** // //! Enables the ADC DMA operation for specified channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! //! This function enables the DMA operation for specified ADC channel //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \return None. // //***************************************************************************** void ADCDMAEnable(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulBitMask; // // Get the bit mask for enabling DMA for specified channel // ulBitMask = (ulChannel == ADC_CH_0)?0x01: (ulChannel == ADC_CH_1)?0x04: (ulChannel == ADC_CH_2)?0x10:0x40; // // Enable DMA request for the specified channel // HWREG(ulBase + ADC_O_adc_dma_mode_en) |= ulBitMask; } //***************************************************************************** // //! Disables the ADC DMA operation for specified channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels //! //! This function disables the DMA operation for specified ADC channel //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \return None. // //***************************************************************************** void ADCDMADisable(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulBitMask; // // Get the bit mask for disabling DMA for specified channel // ulBitMask = (ulChannel == ADC_CH_0)?0x01: (ulChannel == ADC_CH_1)?0x04: (ulChannel == ADC_CH_2)?0x10:0x40; // // Disable DMA request for the specified channel // HWREG(ulBase + ADC_O_adc_dma_mode_en) &= ~ulBitMask; } //***************************************************************************** // //! Configures the ADC internal timer //! //! \param ulBase is the base address of the ADC //! \param ulValue is wrap arround value of the timer //! //! This function Configures the ADC internal timer. The ADC timer is a 17 bit //! used to timestamp the ADC data samples internally. //! User can read the timestamp along with the sample from the FIFO register(s). //! Each sample in the FIFO contains 14 bit actual data and 18 bit timestamp //! //! The parameter \e ulValue can take any value between 0 - 2^17 //! //! \returns None. // //***************************************************************************** void ADCTimerConfig(unsigned long ulBase, unsigned long ulValue) { unsigned long ulReg; // // Read the currrent config // ulReg = HWREG(ulBase + ADC_O_adc_timer_configuration); // // Mask and set timer count field // ulReg = ((ulReg & ~0x1FFFF) | (ulValue & 0x1FFFF)); // // Set the timer count value // HWREG(ulBase + ADC_O_adc_timer_configuration) = ulReg; } //***************************************************************************** // //! Resets ADC internal timer //! //! \param ulBase is the base address of the ADC //! //! This function resets 17-bit ADC internal timer //! //! \returns None. // //***************************************************************************** void ADCTimerReset(unsigned long ulBase) { // // Reset the timer // HWREG(ulBase + ADC_O_adc_timer_configuration) |= (1 << 24); } //***************************************************************************** // //! Enables ADC internal timer //! //! \param ulBase is the base address of the ADC //! //! This function enables 17-bit ADC internal timer //! //! \returns None. // //***************************************************************************** void ADCTimerEnable(unsigned long ulBase) { // // Enable the timer // HWREG(ulBase + ADC_O_adc_timer_configuration) |= (1 << 25); } //***************************************************************************** // //! Disables ADC internal timer //! //! \param ulBase is the base address of the ADC //! //! This function disables 17-bit ADC internal timer //! //! \returns None. // //***************************************************************************** void ADCTimerDisable(unsigned long ulBase) { // // Disable the timer // HWREG(ulBase + ADC_O_adc_timer_configuration) &= ~(1 << 25); } //***************************************************************************** // //! Gets the current value of ADC internal timer //! //! \param ulBase is the base address of the ADC //! //! This function the current value of 17-bit ADC internal timer //! //! \returns Return the current value of ADC internal timer. // //***************************************************************************** unsigned long ADCTimerValueGet(unsigned long ulBase) { return(HWREG(ulBase + ADC_O_adc_timer_current_count)); } //***************************************************************************** // //! Gets the current FIFO level for specified ADC channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels. //! //! This function returns the current FIFO level for specified ADC channel. //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \returns Return the current FIFO level for specified channel // //***************************************************************************** unsigned char ADCFIFOLvlGet(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulOffset; // // Get the fifo level register offset for specified channel // ulOffset = ADC_O_adc_ch0_fifo_lvl + ulChannel; // // Return FIFO level // return(HWREG(ulBase + ulOffset) & 0x7); } //***************************************************************************** // //! Reads FIFO for specified ADC channel //! //! \param ulBase is the base address of the ADC //! \param ulChannel is one of the valid ADC channels. //! //! This function returns one data sample from the channel fifo as specified by //! \e ulChannel parameter. //! //! The parameter \e ulChannel should be one of the following //! //! - \b ADC_CH_0 for channel 0 //! - \b ADC_CH_1 for channel 1 //! - \b ADC_CH_2 for channel 2 //! - \b ADC_CH_3 for channel 3 //! //! \returns Return one data sample from the channel fifo. // //***************************************************************************** unsigned long ADCFIFORead(unsigned long ulBase, unsigned long ulChannel) { unsigned long ulOffset; // // Get the fifo register offset for specified channel // ulOffset = ADC_O_channel0FIFODATA + ulChannel; // // Return FIFO level // return(HWREG(ulBase + ulOffset)); } //***************************************************************************** // // Close the Doxygen group. //! @} // //*****************************************************************************
6,228
5,250
<filename>modules/flowable-idm-rest/src/main/java/org/flowable/idm/rest/service/api/IdmRestApiInterceptor.java<gh_stars>1000+ /* 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.flowable.idm.rest.service.api; import org.flowable.idm.api.Group; import org.flowable.idm.api.GroupQuery; import org.flowable.idm.api.Privilege; import org.flowable.idm.api.PrivilegeQuery; import org.flowable.idm.api.User; import org.flowable.idm.api.UserQuery; public interface IdmRestApiInterceptor { void accessGroupInfoById(Group group); void accessGroupInfoWithQuery(GroupQuery groupQuery); void createNewGroup(Group group); void deleteGroup(Group group); void accessUserInfoById(User user); void accessUserInfoWithQuery(UserQuery userQuery); void createNewUser(User user); void deleteUser(User user); void accessPrivilegeInfoById(Privilege privilege); void accessPrivilegeInfoWithQuery(PrivilegeQuery privilegeQuery); void addUserPrivilege(Privilege privilege, String userId); void addGroupPrivilege(Privilege privilege, String groupId); void deleteUserPrivilege(Privilege privilege, String userId); void deleteGroupPrivilege(Privilege privilege, String groupId); void accessIdmManagementInfo(); }
610
9,953
<reponame>nicholasadamou/StockBird # # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2019, <NAME> <<EMAIL>> # License: http://snmplabs.com/pyasn1/license.html # # PKCS#1 syntax # # ASN.1 source from: # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.asn # # Sample captures could be obtained with "openssl genrsa" command # from pyasn1.type import constraint from pyasn1.type import namedval from pyasn1_modules.rfc2437 import * class OtherPrimeInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('prime', univ.Integer()), namedtype.NamedType('exponent', univ.Integer()), namedtype.NamedType('coefficient', univ.Integer()) ) class OtherPrimeInfos(univ.SequenceOf): componentType = OtherPrimeInfo() sizeSpec = univ.SequenceOf.sizeSpec + constraint.ValueSizeConstraint(1, MAX) class RSAPrivateKey(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('version', univ.Integer(namedValues=namedval.NamedValues(('two-prime', 0), ('multi', 1)))), namedtype.NamedType('modulus', univ.Integer()), namedtype.NamedType('publicExponent', univ.Integer()), namedtype.NamedType('privateExponent', univ.Integer()), namedtype.NamedType('prime1', univ.Integer()), namedtype.NamedType('prime2', univ.Integer()), namedtype.NamedType('exponent1', univ.Integer()), namedtype.NamedType('exponent2', univ.Integer()), namedtype.NamedType('coefficient', univ.Integer()), namedtype.OptionalNamedType('otherPrimeInfos', OtherPrimeInfos()) )
646
416
<reponame>bakedpotato191/sdks<filename>iPhoneOS12.4.sdk/System/Library/Frameworks/Vision.framework/Headers/VNDetectFaceRectanglesRequest.h // // VNDetectFaceRectanglesRequest.h // Vision // // Copyright © 2017 Apple Inc. All rights reserved. // #import <Vision/VNRequest.h> NS_ASSUME_NONNULL_BEGIN /*! @brief A request that will detect faces in an image. @details This request will generate VNFaceObservation objects with defined a boundingBox. */ API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0)) @interface VNDetectFaceRectanglesRequest : VNImageBasedRequest @end API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0)) static const NSUInteger VNDetectFaceRectanglesRequestRevision1 = 1; API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0)) static const NSUInteger VNDetectFaceRectanglesRequestRevision2 = 2; NS_ASSUME_NONNULL_END
314
1,801
package com.budwk.app.sys.models; import com.budwk.app.base.model.BaseModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.nutz.dao.entity.annotation.*; import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.integration.json4excel.annotation.J4EIgnore; import org.nutz.integration.json4excel.annotation.J4EName; import java.io.Serializable; import java.util.List; import java.util.Map; /** * Created by wizzer on 2016/6/21. */ @Data @EqualsAndHashCode(callSuper = true) @Table("sys_user") @J4EName("用户数据") @TableIndexes({@Index(name = "INDEX_SYS_USER_LOGINNAMAE", fields = {"loginname"}, unique = true)}) public class Sys_user extends BaseModel implements Serializable { private static final long serialVersionUID = 1L; @Column @Name @Comment("ID") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 32) @PrevInsert(uu32 = true) private String id; @Column @Comment("用户名") @J4EName("用户名") @ColDefine(type = ColType.VARCHAR, width = 120) private String loginname; @Column @Comment("密码") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 100) private String password;// transient 修饰符可让此字段不在对象里显示 @Column @Comment("密码盐") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 50) private String salt; @Column @Comment("姓名") @J4EName("姓名") @ColDefine(type = ColType.VARCHAR, width = 100) private String username; @Column @Comment("头像") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 255) private String avatar; @Column @Comment("是否在线") @J4EIgnore @ColDefine(type = ColType.BOOLEAN) private boolean userOnline; @Column @Comment("是否禁用") @J4EIgnore @ColDefine(type = ColType.BOOLEAN) private boolean disabled; @Column @Comment("电子邮箱") @J4EName("电子邮箱") @ColDefine(type = ColType.VARCHAR, width = 255) private String email; @Column @Comment("手机号码") @J4EName("手机号码") @ColDefine(type = ColType.VARCHAR, width = 32) private String mobile; @Column @Comment("创建时间") @J4EIgnore @PrevInsert(now = true) private Long createAt; @Column @Comment("登陆时间") @J4EIgnore private Long loginAt; @Column @Comment("登陆IP") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 255) private String loginIp; @Column @Comment("登陆次数") @J4EIgnore @ColDefine(type = ColType.INT) private Integer loginCount; @Column @Comment("登陆SessionId") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 50) private String loginSessionId; @Column @Comment("常用菜单") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 255) private String customMenu; @Column @Comment("皮肤样式") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 100) private String loginTheme; @Column @Comment("菜单样式") @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 100) private String menuTheme; @Column @J4EIgnore private boolean loginSidebar; @Column @J4EIgnore private boolean loginBoxed; @Column @J4EIgnore private boolean loginScroll; @Column @J4EIgnore private boolean loginPjax; @Column @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 32) private String unitId; @Column @J4EIgnore @ColDefine(type = ColType.VARCHAR, width = 100) private String unitPath; @One(field = "unitId") @J4EIgnore private Sys_unit unit; @ManyMany(from = "userId", relation = "sys_user_role", to = "roleId") @J4EIgnore private List<Sys_role> roles; @ManyMany(from = "userId", relation = "sys_user_unit", to = "unitId") @J4EIgnore protected List<Sys_unit> units; @J4EIgnore protected List<Sys_menu> menus; @J4EIgnore protected List<Sys_menu> firstMenus; @J4EIgnore protected Map<String, List<Sys_menu>> secondMenus; @J4EIgnore private List<Sys_menu> customMenus; }
1,890
575
<reponame>Ron423c/chromium // Copyright 2020 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 "components/no_state_prefetch/browser/no_state_prefetch_processor_impl.h" #include "components/no_state_prefetch/browser/no_state_prefetch_link_manager.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/common/referrer.h" namespace prerender { NoStatePrefetchProcessorImpl::NoStatePrefetchProcessorImpl( int render_process_id, int render_frame_id, const url::Origin& initiator_origin, mojo::PendingReceiver<blink::mojom::NoStatePrefetchProcessor> receiver, std::unique_ptr<NoStatePrefetchProcessorImplDelegate> delegate) : render_process_id_(render_process_id), render_frame_id_(render_frame_id), initiator_origin_(initiator_origin), delegate_(std::move(delegate)) { receiver_.Bind(std::move(receiver)); receiver_.set_disconnect_handler(base::BindOnce( &NoStatePrefetchProcessorImpl::Abandon, base::Unretained(this))); } NoStatePrefetchProcessorImpl::~NoStatePrefetchProcessorImpl() = default; // static void NoStatePrefetchProcessorImpl::Create( content::RenderFrameHost* frame_host, mojo::PendingReceiver<blink::mojom::NoStatePrefetchProcessor> receiver, std::unique_ptr<NoStatePrefetchProcessorImplDelegate> delegate) { // NoStatePrefetchProcessorImpl is a self-owned object. This deletes itself on // the mojo disconnect handler. new NoStatePrefetchProcessorImpl(frame_host->GetProcess()->GetID(), frame_host->GetRoutingID(), frame_host->GetLastCommittedOrigin(), std::move(receiver), std::move(delegate)); } void NoStatePrefetchProcessorImpl::Start( blink::mojom::PrerenderAttributesPtr attributes) { if (!initiator_origin_.opaque() && !content::ChildProcessSecurityPolicy::GetInstance() ->CanAccessDataForOrigin(render_process_id_, initiator_origin_)) { mojo::ReportBadMessage("NSPPI_INVALID_INITIATOR_ORIGIN"); return; } // Start() must be called only one time. if (link_trigger_id_) { mojo::ReportBadMessage("NSPPI_START_TWICE"); return; } auto* render_frame_host = content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!render_frame_host) return; auto* link_manager = GetNoStatePrefetchLinkManager(); if (!link_manager) return; DCHECK(!link_trigger_id_); link_trigger_id_ = link_manager->OnStartLinkTrigger( render_process_id_, render_frame_host->GetRenderViewHost()->GetRoutingID(), std::move(attributes), initiator_origin_); } void NoStatePrefetchProcessorImpl::Cancel() { if (!link_trigger_id_) return; auto* link_manager = GetNoStatePrefetchLinkManager(); if (link_manager) link_manager->OnCancelLinkTrigger(*link_trigger_id_); } void NoStatePrefetchProcessorImpl::Abandon() { if (link_trigger_id_) { auto* link_manager = GetNoStatePrefetchLinkManager(); if (link_manager) link_manager->OnAbandonLinkTrigger(*link_trigger_id_); } delete this; } NoStatePrefetchLinkManager* NoStatePrefetchProcessorImpl::GetNoStatePrefetchLinkManager() { auto* render_frame_host = content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!render_frame_host) return nullptr; return delegate_->GetNoStatePrefetchLinkManager( render_frame_host->GetProcess()->GetBrowserContext()); } } // namespace prerender
1,395
2,338
<filename>clang/test/Modules/Inputs/inherit-attribute/a.h #ifndef FOO #define FOO class Foo { public: void step(int v); Foo(); }; #endif
62
14,668
// Copyright 2017 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 "ios/chrome/browser/language/language_model_manager_factory.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/web/public/test/web_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/platform_test.h" using testing::Eq; using testing::IsNull; using testing::Not; using LanguageModelManagerFactoryTest = PlatformTest; // Check that Incognito language modeling is inherited from the user's profile. TEST_F(LanguageModelManagerFactoryTest, SharedWithIncognito) { web::WebTaskEnvironment task_environment; std::unique_ptr<TestChromeBrowserState> state( TestChromeBrowserState::Builder().Build()); const language::LanguageModelManager* const manager = LanguageModelManagerFactory::GetForBrowserState(state.get()); EXPECT_THAT(manager, Not(IsNull())); ChromeBrowserState* const incognito = state->GetOffTheRecordChromeBrowserState(); ASSERT_THAT(incognito, Not(IsNull())); EXPECT_THAT(LanguageModelManagerFactory::GetForBrowserState(incognito), Eq(manager)); }
391
734
<gh_stars>100-1000 /* ,--. ,--. ,--. ,--. ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2018 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details. */ #if TRACKTION_ENABLE_AUTOMAP namespace tracktion_engine { class AutoMap; class NovationAutomap : public ControlSurface, private juce::ChangeListener { public: NovationAutomap (ExternalControllerManager&); ~NovationAutomap(); void changeListenerCallback (juce::ChangeBroadcaster*) override; void currentEditChanged (Edit*) override; void paramChanged (AutomatableParameter*); void initialiseDevice (bool connect) override; void shutDownDevice() override; void updateMiscFeatures() override; void acceptMidiMessage (const juce::MidiMessage&) override; void moveFader (int channelNum, float newSliderPos) override; void moveMasterLevelFader (float newLeftSliderPos, float newRightSliderPos) override; void movePanPot (int channelNum, float newPan) override; void moveAux (int channel, const char* bus, float newPos) override; void clearAux (int channel) override; void updateSoloAndMute (int channelNum, Track::MuteAndSoloLightState, bool isBright) override; void soloCountChanged (bool) override; void playStateChanged (bool isPlaying) override; void recordStateChanged (bool isRecording) override; void automationReadModeChanged (bool isReading) override; void automationWriteModeChanged (bool isWriting) override; void faderBankChanged (int newStartChannelNumber, const juce::StringArray& trackNames) override; void channelLevelChanged (int channel, float level) override; void trackSelectionChanged(int channel, bool isSelected) override; void trackRecordEnabled (int channel, bool isEnabled) override; void masterLevelsChanged(float leftLevel, float rightLevel) override; void timecodeChanged (int barsOrHours, int beatsOrMinutes, int ticksOrSeconds, int millisecs, bool isBarsBeats, bool isFrames) override; void clickOnOffChanged (bool isClickOn) override; void snapOnOffChanged (bool isSnapOn) override; void loopOnOffChanged (bool isLoopOn) override; void slaveOnOffChanged (bool isSlaving) override; void punchOnOffChanged (bool isPunching) override; void undoStatusChanged (bool undo, bool redo) override; void parameterChanged (int parameterNumber, const ParameterSetting& newValue) override; void clearParameter (int parameterNumber) override; void markerChanged (int parameterNumber, const MarkerSetting& newValue) override; void clearMarker (int parameterNumber) override; void auxBankChanged (int bank) override; bool wantsMessage (const juce::MidiMessage&) override; bool eatsAllMessages() override; bool canSetEatsAllMessages() override; void setEatsAllMessages(bool eatAll) override; bool canChangeSelectedPlugin() override; void currentSelectionChanged (juce::String) override; bool showingPluginParams() override; bool showingMarkers() override; bool showingTracks() override; void pluginBypass (bool) override; bool isPluginSelected (Plugin*) override; void removePlugin (Plugin*); void pluginChanged (Plugin*); void save (Edit&); void load (Edit&); bool mapPlugin = false; bool mapNative = false; private: void createAllPluginAutomaps(); friend class PluginAutoMap; std::unique_ptr<AutoMap> hostAutomap; juce::OwnedArray<AutoMap> pluginAutomap; bool enabled = false; bool pluginSelected = false; SelectionManager* selectionManager = nullptr; mutable juce::StringPairArray guids; }; } // namespace tracktion_engine #endif
1,361
523
<reponame>jccari/UABIntegral #pragma once #include "Common.h" #include "Squad.h" #include "HLSearch.h" #include "SquadData.h" #include "CombatCommander.h" namespace UAlbertaBot { class HLCombatCommander { SquadData squadData; CombatCommander combatCommander; public: HLCombatCommander(); ~HLCombatCommander(); void update(std::set<BWAPI::UnitInterface*> combatUnits); bool squadUpdateFrame() const; }; }
173
3,301
package com.alibaba.alink.operator.stream.regression; import org.apache.flink.ml.api.misc.param.Params; import com.alibaba.alink.operator.batch.BatchOperator; import com.alibaba.alink.operator.common.regression.tensorflow.TFTableModelRegressionModelMapper; import com.alibaba.alink.operator.stream.utils.ModelMapStreamOp; import com.alibaba.alink.params.regression.TFTableModelRegressionPredictParams; public class TFTableModelRegressorPredictStreamOp<T extends TFTableModelRegressorPredictStreamOp <T>> extends ModelMapStreamOp <T> implements TFTableModelRegressionPredictParams <T> { public TFTableModelRegressorPredictStreamOp(BatchOperator model) { this(model, new Params()); } public TFTableModelRegressorPredictStreamOp(BatchOperator model, Params params) { super(model, TFTableModelRegressionModelMapper::new, params); } }
278
471
<gh_stars>100-1000 // This is a generated file. Not intended for manual editing. package org.plantuml.idea.grammar.psi; import com.intellij.psi.NavigatablePsiElement; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import org.jetbrains.annotations.NotNull; public class PumlVisitor extends PsiElementVisitor { public void visitInclude(@NotNull PumlInclude o) { visitNavigatablePsiElement(o); } public void visitItem(@NotNull PumlItem o) { visitNamedElement(o); } public void visitNavigatablePsiElement(@NotNull NavigatablePsiElement o) { visitElement(o); } public void visitNamedElement(@NotNull PumlNamedElement o) { visitPsiElement(o); } public void visitPsiElement(@NotNull PsiElement o) { visitElement(o); } }
332
414
#include <algorithm> #include <vector> #include "caffe/filler.hpp" #include "caffe/layers/neuron_layer.hpp" #include "caffe/layers/symmetric_rectify_layer.hpp" namespace caffe { template <typename Dtype> void SymmetricRectifyLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { CHECK_GE(bottom[0]->num_axes(), 2) << "Number of axes of bottom blob must be >=2."; SymmetricRectifyParameter symm_rectify_param = this->layer_param().symmetric_rectify_param(); int channels = bottom[0]->channels(); channel_shared_ = symm_rectify_param.channel_shared(); if (this->blobs_.size() > 0) { //LOG(INFO) << "Skipping parameter initialization"; LOG(FATAL) << "Skipping parameter initialization"; } else { this->blobs_.resize(1); if (channel_shared_) { this->blobs_[0].reset(new Blob<Dtype>(vector<int>(0))); } else { this->blobs_[0].reset(new Blob<Dtype>(vector<int>(1, channels))); } shared_ptr<Filler<Dtype> > filler; if (symm_rectify_param.has_filler()) { filler.reset(GetFiller<Dtype>(symm_rectify_param.filler())); } else { LOG(INFO)<<"Using default filler for layer " << this->layer_param_.name(); FillerParameter filler_param; filler_param.set_type("constant"); filler_param.set_value(0.0); filler.reset(GetFiller<Dtype>(filler_param)); } filler->Fill(this->blobs_[0].get()); } if (channel_shared_) { CHECK_EQ(this->blobs_[0]->count(), 1) << "Threshold size is inconsistent with prototxt config"; } else { CHECK_EQ(this->blobs_[0]->count(), channels) << "Threshold size is inconsistent with prototxt config"; } for(int i=0;i<this->blobs_[0]->count();i++){ CHECK_GE(this->blobs_[0]->cpu_data()[i],0) << "Threshold of rectifying must not be negtive."; } // Propagate gradients to the parameters (as directed by backward pass). this->param_propagate_down_.resize(this->blobs_.size(), true); multiplier_.Reshape(vector<int>(1, bottom[0]->count(1))); backward_buff_.Reshape(vector<int>(1, bottom[0]->count(1))); caffe_set(multiplier_.count(), Dtype(1), multiplier_.mutable_cpu_data()); } template <typename Dtype> void SymmetricRectifyLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { CHECK_GE(bottom[0]->num_axes(), 2) << "Number of axes of bottom blob must be >=2."; top[0]->ReshapeLike(*bottom[0]); //if (bottom[0] == top[0]) { // For in-place computation //bottom_memory_.ReshapeLike(*bottom[0]); //} } template <typename Dtype> void SymmetricRectifyLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const Dtype* bottom_data = bottom[0]->cpu_data(); Dtype* top_data = top[0]->mutable_cpu_data(); const int count = bottom[0]->count(); const int dim = bottom[0]->count(2); const int channels = bottom[0]->channels(); const Dtype* thre_data = this->blobs_[0]->cpu_data(); // For in-place computation //if (bottom[0] == top[0]) { // caffe_copy(count, bottom_data, bottom_memory_.mutable_cpu_data()); //} // After parameter updating, thresholds of rectifying must not be negtive. for(int i=0; i<this->blobs_[0]->count(); i++){ if(this->blobs_[0]->cpu_data()[i] < 0){ this->blobs_[0]->mutable_cpu_data()[i] = 0; } } // if channel_shared, channel index in the following computation becomes // always zero. const int div_factor = channel_shared_ ? channels : 1; for (int i = 0; i < count; ++i) { int c = (i / dim) % channels / div_factor; if(fabs(bottom_data[i])<=thre_data[c]) top_data[i] = 0; else if (bottom_data[i] > thre_data[c] ) top_data[i] = bottom_data[i] - thre_data[c]; else top_data[i] = bottom_data[i] + thre_data[c]; } //display if(this->layer_param_.display()){ ostringstream msg_stream; msg_stream << "Threshold(s) of layer " << this->layer_param_.name() <<": "; for(int i=0; i<this->blobs_[0]->count(); i++){ msg_stream << this->blobs_[0]->cpu_data()[i] << " "; } LOG(INFO) << msg_stream.str(); } } template <typename Dtype> void SymmetricRectifyLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) { const Dtype* top_data = top[0]->cpu_data(); //const Dtype* thre_data = this->blobs_[0]->cpu_data(); const Dtype* top_diff = top[0]->cpu_diff(); const int count = bottom[0]->count(); const int dim = bottom[0]->count(2); const int channels = bottom[0]->channels(); // For in-place computation //if (top[0] == bottom[0]) { // bottom_data = bottom_memory_.cpu_data(); //} // if channel_shared, channel index in the following computation becomes // always zero. const int div_factor = channel_shared_ ? channels : 1; // Propagte to param // Since to write bottom diff will affect top diff if top and bottom blobs // are identical (in-place computaion), we first compute param backward to // keep top_diff unchanged. if (this->param_propagate_down_[0]) { Dtype* thre_diff = this->blobs_[0]->mutable_cpu_diff(); const Dtype* thre_data = this->blobs_[0]->cpu_data(); for (int i = 0; i < count; ++i) { int c = (i / dim) % channels / div_factor; thre_diff[c] += top_diff[i] * ( (top_data[i] < 0) - (top_data[i] > 0) ); } for (int c_i = 0; c_i < this->blobs_[0]->count(); c_i++){ //biasing threshold to larger value for higher sparsity thre_diff[c_i] += ((thre_data[c_i]<0) - (thre_data[c_i]>=0)) * this->layer_param().symmetric_rectify_param().thre_decay(); } } // Propagate to bottom if (propagate_down[0]) { Dtype* bottom_diff = bottom[0]->mutable_cpu_diff(); for (int i = 0; i < count; ++i) { bottom_diff[i] = top_diff[i] * (fabs(top_data[i])>0); } } } #ifdef CPU_ONLY STUB_GPU(SymmetricRectifyLayer); #endif INSTANTIATE_CLASS(SymmetricRectifyLayer); REGISTER_LAYER_CLASS(SymmetricRectify); } // namespace caffe
2,450
3,372
<filename>aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/ListRecoveryPointsByBackupVaultRequest.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.backup.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRecoveryPointsByBackupVault" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ListRecoveryPointsByBackupVaultRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of a logical container where backups are stored. Backup vaults are identified by names that are unique * to the account used to create them and the Amazon Web Services Region where they are created. They consist of * lowercase letters, numbers, and hyphens. * </p> * <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> * </note> */ private String backupVaultName; /** * <p> * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list * starting at the location pointed to by the next token. * </p> */ private String nextToken; /** * <p> * The maximum number of items to be returned. * </p> */ private Integer maxResults; /** * <p> * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). * </p> */ private String byResourceArn; /** * <p> * Returns only recovery points that match the specified resource type. * </p> */ private String byResourceType; /** * <p> * Returns only recovery points that match the specified backup plan ID. * </p> */ private String byBackupPlanId; /** * <p> * Returns only recovery points that were created before the specified timestamp. * </p> */ private java.util.Date byCreatedBefore; /** * <p> * Returns only recovery points that were created after the specified timestamp. * </p> */ private java.util.Date byCreatedAfter; /** * <p> * The name of a logical container where backups are stored. Backup vaults are identified by names that are unique * to the account used to create them and the Amazon Web Services Region where they are created. They consist of * lowercase letters, numbers, and hyphens. * </p> * <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> * </note> * * @param backupVaultName * The name of a logical container where backups are stored. Backup vaults are identified by names that are * unique to the account used to create them and the Amazon Web Services Region where they are created. They * consist of lowercase letters, numbers, and hyphens.</p> <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> */ public void setBackupVaultName(String backupVaultName) { this.backupVaultName = backupVaultName; } /** * <p> * The name of a logical container where backups are stored. Backup vaults are identified by names that are unique * to the account used to create them and the Amazon Web Services Region where they are created. They consist of * lowercase letters, numbers, and hyphens. * </p> * <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> * </note> * * @return The name of a logical container where backups are stored. Backup vaults are identified by names that are * unique to the account used to create them and the Amazon Web Services Region where they are created. They * consist of lowercase letters, numbers, and hyphens.</p> <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> */ public String getBackupVaultName() { return this.backupVaultName; } /** * <p> * The name of a logical container where backups are stored. Backup vaults are identified by names that are unique * to the account used to create them and the Amazon Web Services Region where they are created. They consist of * lowercase letters, numbers, and hyphens. * </p> * <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> * </note> * * @param backupVaultName * The name of a logical container where backups are stored. Backup vaults are identified by names that are * unique to the account used to create them and the Amazon Web Services Region where they are created. They * consist of lowercase letters, numbers, and hyphens.</p> <note> * <p> * Backup vault name might not be available when a supported service creates the backup. * </p> * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withBackupVaultName(String backupVaultName) { setBackupVaultName(backupVaultName); return this; } /** * <p> * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list * starting at the location pointed to by the next token. * </p> * * @param nextToken * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your * list starting at the location pointed to by the next token. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** * <p> * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list * starting at the location pointed to by the next token. * </p> * * @return The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your * list starting at the location pointed to by the next token. */ public String getNextToken() { return this.nextToken; } /** * <p> * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list * starting at the location pointed to by the next token. * </p> * * @param nextToken * The next item following a partial list of returned items. For example, if a request is made to return * <code>maxResults</code> number of items, <code>NextToken</code> allows you to return more items in your * list starting at the location pointed to by the next token. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** * <p> * The maximum number of items to be returned. * </p> * * @param maxResults * The maximum number of items to be returned. */ public void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } /** * <p> * The maximum number of items to be returned. * </p> * * @return The maximum number of items to be returned. */ public Integer getMaxResults() { return this.maxResults; } /** * <p> * The maximum number of items to be returned. * </p> * * @param maxResults * The maximum number of items to be returned. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withMaxResults(Integer maxResults) { setMaxResults(maxResults); return this; } /** * <p> * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). * </p> * * @param byResourceArn * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). */ public void setByResourceArn(String byResourceArn) { this.byResourceArn = byResourceArn; } /** * <p> * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). * </p> * * @return Returns only recovery points that match the specified resource Amazon Resource Name (ARN). */ public String getByResourceArn() { return this.byResourceArn; } /** * <p> * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). * </p> * * @param byResourceArn * Returns only recovery points that match the specified resource Amazon Resource Name (ARN). * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withByResourceArn(String byResourceArn) { setByResourceArn(byResourceArn); return this; } /** * <p> * Returns only recovery points that match the specified resource type. * </p> * * @param byResourceType * Returns only recovery points that match the specified resource type. */ public void setByResourceType(String byResourceType) { this.byResourceType = byResourceType; } /** * <p> * Returns only recovery points that match the specified resource type. * </p> * * @return Returns only recovery points that match the specified resource type. */ public String getByResourceType() { return this.byResourceType; } /** * <p> * Returns only recovery points that match the specified resource type. * </p> * * @param byResourceType * Returns only recovery points that match the specified resource type. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withByResourceType(String byResourceType) { setByResourceType(byResourceType); return this; } /** * <p> * Returns only recovery points that match the specified backup plan ID. * </p> * * @param byBackupPlanId * Returns only recovery points that match the specified backup plan ID. */ public void setByBackupPlanId(String byBackupPlanId) { this.byBackupPlanId = byBackupPlanId; } /** * <p> * Returns only recovery points that match the specified backup plan ID. * </p> * * @return Returns only recovery points that match the specified backup plan ID. */ public String getByBackupPlanId() { return this.byBackupPlanId; } /** * <p> * Returns only recovery points that match the specified backup plan ID. * </p> * * @param byBackupPlanId * Returns only recovery points that match the specified backup plan ID. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withByBackupPlanId(String byBackupPlanId) { setByBackupPlanId(byBackupPlanId); return this; } /** * <p> * Returns only recovery points that were created before the specified timestamp. * </p> * * @param byCreatedBefore * Returns only recovery points that were created before the specified timestamp. */ public void setByCreatedBefore(java.util.Date byCreatedBefore) { this.byCreatedBefore = byCreatedBefore; } /** * <p> * Returns only recovery points that were created before the specified timestamp. * </p> * * @return Returns only recovery points that were created before the specified timestamp. */ public java.util.Date getByCreatedBefore() { return this.byCreatedBefore; } /** * <p> * Returns only recovery points that were created before the specified timestamp. * </p> * * @param byCreatedBefore * Returns only recovery points that were created before the specified timestamp. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withByCreatedBefore(java.util.Date byCreatedBefore) { setByCreatedBefore(byCreatedBefore); return this; } /** * <p> * Returns only recovery points that were created after the specified timestamp. * </p> * * @param byCreatedAfter * Returns only recovery points that were created after the specified timestamp. */ public void setByCreatedAfter(java.util.Date byCreatedAfter) { this.byCreatedAfter = byCreatedAfter; } /** * <p> * Returns only recovery points that were created after the specified timestamp. * </p> * * @return Returns only recovery points that were created after the specified timestamp. */ public java.util.Date getByCreatedAfter() { return this.byCreatedAfter; } /** * <p> * Returns only recovery points that were created after the specified timestamp. * </p> * * @param byCreatedAfter * Returns only recovery points that were created after the specified timestamp. * @return Returns a reference to this object so that method calls can be chained together. */ public ListRecoveryPointsByBackupVaultRequest withByCreatedAfter(java.util.Date byCreatedAfter) { setByCreatedAfter(byCreatedAfter); 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 (getBackupVaultName() != null) sb.append("BackupVaultName: ").append(getBackupVaultName()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()).append(","); if (getMaxResults() != null) sb.append("MaxResults: ").append(getMaxResults()).append(","); if (getByResourceArn() != null) sb.append("ByResourceArn: ").append(getByResourceArn()).append(","); if (getByResourceType() != null) sb.append("ByResourceType: ").append(getByResourceType()).append(","); if (getByBackupPlanId() != null) sb.append("ByBackupPlanId: ").append(getByBackupPlanId()).append(","); if (getByCreatedBefore() != null) sb.append("ByCreatedBefore: ").append(getByCreatedBefore()).append(","); if (getByCreatedAfter() != null) sb.append("ByCreatedAfter: ").append(getByCreatedAfter()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListRecoveryPointsByBackupVaultRequest == false) return false; ListRecoveryPointsByBackupVaultRequest other = (ListRecoveryPointsByBackupVaultRequest) obj; if (other.getBackupVaultName() == null ^ this.getBackupVaultName() == null) return false; if (other.getBackupVaultName() != null && other.getBackupVaultName().equals(this.getBackupVaultName()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; if (other.getMaxResults() == null ^ this.getMaxResults() == null) return false; if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false) return false; if (other.getByResourceArn() == null ^ this.getByResourceArn() == null) return false; if (other.getByResourceArn() != null && other.getByResourceArn().equals(this.getByResourceArn()) == false) return false; if (other.getByResourceType() == null ^ this.getByResourceType() == null) return false; if (other.getByResourceType() != null && other.getByResourceType().equals(this.getByResourceType()) == false) return false; if (other.getByBackupPlanId() == null ^ this.getByBackupPlanId() == null) return false; if (other.getByBackupPlanId() != null && other.getByBackupPlanId().equals(this.getByBackupPlanId()) == false) return false; if (other.getByCreatedBefore() == null ^ this.getByCreatedBefore() == null) return false; if (other.getByCreatedBefore() != null && other.getByCreatedBefore().equals(this.getByCreatedBefore()) == false) return false; if (other.getByCreatedAfter() == null ^ this.getByCreatedAfter() == null) return false; if (other.getByCreatedAfter() != null && other.getByCreatedAfter().equals(this.getByCreatedAfter()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBackupVaultName() == null) ? 0 : getBackupVaultName().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); hashCode = prime * hashCode + ((getByResourceArn() == null) ? 0 : getByResourceArn().hashCode()); hashCode = prime * hashCode + ((getByResourceType() == null) ? 0 : getByResourceType().hashCode()); hashCode = prime * hashCode + ((getByBackupPlanId() == null) ? 0 : getByBackupPlanId().hashCode()); hashCode = prime * hashCode + ((getByCreatedBefore() == null) ? 0 : getByCreatedBefore().hashCode()); hashCode = prime * hashCode + ((getByCreatedAfter() == null) ? 0 : getByCreatedAfter().hashCode()); return hashCode; } @Override public ListRecoveryPointsByBackupVaultRequest clone() { return (ListRecoveryPointsByBackupVaultRequest) super.clone(); } }
7,457
1,338
#include <TestSuite.h> #include <TestSuiteAddon.h> // ##### Include headers for your tests here ##### #include "barchivable/ArchivableTest.h" #include "bautolock/AutolockTest.h" #include "blocker/LockerTest.h" #include "bmemoryio/MemoryIOTest.h" #include "bmemoryio/MallocIOTest.h" #include "bstring/StringTest.h" #include "bblockcache/BlockCacheTest.h" #include "ByteOrderTest.h" #include "DateTimeTest.h" BTestSuite * getTestSuite() { BTestSuite *suite = new BTestSuite("Support"); // ##### Add test suites here ##### suite->addTest("BArchivable", ArchivableTestSuite()); suite->addTest("BAutolock", AutolockTestSuite()); suite->addTest("BDateTime", DateTimeTestSuite()); suite->addTest("BLocker", LockerTestSuite()); suite->addTest("BMemoryIO", MemoryIOTestSuite()); suite->addTest("BMallocIO", MallocIOTestSuite()); suite->addTest("BString", StringTestSuite()); suite->addTest("BBlockCache", BlockCacheTestSuite()); suite->addTest("ByteOrder", ByteOrderTestSuite()); return suite; }
366
1,398
package confluo.rpc; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.List; /** * The schema for the data in the atomic multilog */ public class Schema { private int recordSize; private List<Column> columns; /** * Initializes the schema to the list of columns passed in * * @param columns The list of columns that make up the schema */ public Schema(List<Column> columns) { recordSize = 0; this.columns = columns; for (Column column : this.columns) { this.recordSize += column.getDataType().size; } } /** * Adds data to the schema * * @param data The data to add * @return The record */ Record apply(ByteBuffer data) { return new Record(data, this); } /** * Pack record into a ByteBuffer. * * @param rec The record. * @return The packed ByteBuffer. */ ByteBuffer pack(List<String> rec) { ByteBuffer buffer = ByteBuffer.allocateDirect(recordSize); buffer.order(ByteOrder.LITTLE_ENDIAN); int off = 0; if (rec.size() == columns.size()) { off = 1; buffer.putLong(Long.parseLong(rec.get(0))); } else if (rec.size() == columns.size() - 1) { buffer.putLong(System.nanoTime()); } else { throw new IllegalArgumentException("Invalid number of attributes in record"); } for (int i = off; i < rec.size(); ++i) { columns.get(i).pack(buffer, rec.get(i)); } return buffer; } /** * Pack record into a ByteBuffer. * * @param rec The record. * @return The packed ByteBuffer. */ ByteBuffer pack(String... rec) { ByteBuffer buffer = ByteBuffer.allocateDirect(recordSize); buffer.order(ByteOrder.LITTLE_ENDIAN); int recordOff = 0; if (rec.length == columns.size()) { recordOff = 1; buffer.putLong(Long.parseLong(rec[0])); } else if (rec.length == columns.size() - 1) { buffer.putLong(System.nanoTime()); } else { throw new IllegalArgumentException("Invalid number of attributes in record"); } for (int i = 0; i < columns.size() - 1; ++i) { columns.get(i + 1).pack(buffer, rec[i + recordOff]); } buffer.rewind(); return buffer; } /** * Gets the columns in the schema * * @return The list of columns */ List<Column> getColumns() { return columns; } /** * Gets the record size * * @return The record size */ int getRecordSize() { return recordSize; } }
927
662
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import List import csv import h5py import numpy as np import copy import pickle import lmdb # install lmdb by "pip install lmdb" import base64 import pdb class ImageFeaturesH5Reader(object): """ A reader for H5 files containing pre-extracted image features. A typical H5 file is expected to have a column named "image_id", and another column named "features". Example of an H5 file: ``` faster_rcnn_bottomup_features.h5 |--- "image_id" [shape: (num_images, )] |--- "features" [shape: (num_images, num_proposals, feature_size)] +--- .attrs ("split", "train") ``` # TODO (kd): Add support to read boxes, classes and scores. Parameters ---------- features_h5path : str Path to an H5 file containing COCO train / val image features. in_memory : bool Whether to load the whole H5 file in memory. Beware, these files are sometimes tens of GBs in size. Set this to true if you have sufficient RAM - trade-off between speed and memory. """ def __init__(self, features_path: str, in_memory: bool = False): self.features_path = features_path self._in_memory = in_memory # with h5py.File(self.features_h5path, "r", libver='latest', swmr=True) as features_h5: # self._image_ids = list(features_h5["image_ids"]) # If not loaded in memory, then list of None. self.env = lmdb.open( self.features_path, max_readers=1, readonly=True, lock=False, readahead=False, meminit=False, ) with self.env.begin(write=False) as txn: self._image_ids = pickle.loads(txn.get("keys".encode())) self.features = [None] * len(self._image_ids) self.num_boxes = [None] * len(self._image_ids) self.boxes = [None] * len(self._image_ids) self.boxes_ori = [None] * len(self._image_ids) def __len__(self): return len(self._image_ids) def __getitem__(self, image_id): image_id = str(image_id).encode() index = self._image_ids.index(image_id) if self._in_memory: # Load features during first epoch, all not loaded together as it # has a slow start. if self.features[index] is not None: features = self.features[index] num_boxes = self.num_boxes[index] image_location = self.boxes[index] image_location_ori = self.boxes_ori[index] else: with self.env.begin(write=False) as txn: item = pickle.loads(txn.get(image_id)) image_id = item["image_id"] image_h = int(item["image_h"]) image_w = int(item["image_w"]) # num_boxes = int(item['num_boxes']) # features = np.frombuffer(base64.b64decode(item["features"]), dtype=np.float32).reshape(num_boxes, 2048) # boxes = np.frombuffer(base64.b64decode(item['boxes']), dtype=np.float32).reshape(num_boxes, 4) features = item["features"].reshape(-1, 2048) boxes = item["boxes"].reshape(-1, 4) num_boxes = features.shape[0] g_feat = np.sum(features, axis=0) / num_boxes num_boxes = num_boxes + 1 features = np.concatenate( [np.expand_dims(g_feat, axis=0), features], axis=0 ) self.features[index] = features image_location = np.zeros((boxes.shape[0], 5), dtype=np.float32) image_location[:, :4] = boxes image_location[:, 4] = ( (image_location[:, 3] - image_location[:, 1]) * (image_location[:, 2] - image_location[:, 0]) / (float(image_w) * float(image_h)) ) image_location_ori = copy.deepcopy(image_location) image_location[:, 0] = image_location[:, 0] / float(image_w) image_location[:, 1] = image_location[:, 1] / float(image_h) image_location[:, 2] = image_location[:, 2] / float(image_w) image_location[:, 3] = image_location[:, 3] / float(image_h) g_location = np.array([0, 0, 1, 1, 1]) image_location = np.concatenate( [np.expand_dims(g_location, axis=0), image_location], axis=0 ) self.boxes[index] = image_location g_location_ori = np.array( [0, 0, image_w, image_h, image_w * image_h] ) image_location_ori = np.concatenate( [np.expand_dims(g_location_ori, axis=0), image_location_ori], axis=0, ) self.boxes_ori[index] = image_location_ori self.num_boxes[index] = num_boxes else: # Read chunk from file everytime if not loaded in memory. with self.env.begin(write=False) as txn: item = pickle.loads(txn.get(image_id)) image_id = item["image_id"] image_h = int(item["image_h"]) image_w = int(item["image_w"]) # num_boxes = int(item['num_boxes']) # features = np.frombuffer(base64.b64decode(item["features"]), dtype=np.float32).reshape(num_boxes, 2048) # boxes = np.frombuffer(base64.b64decode(item['boxes']), dtype=np.float32).reshape(num_boxes, 4) features = item["features"].reshape(-1, 2048) boxes = item["boxes"].reshape(-1, 4) num_boxes = features.shape[0] g_feat = np.sum(features, axis=0) / num_boxes num_boxes = num_boxes + 1 features = np.concatenate( [np.expand_dims(g_feat, axis=0), features], axis=0 ) image_location = np.zeros((boxes.shape[0], 5), dtype=np.float32) image_location[:, :4] = boxes image_location[:, 4] = ( (image_location[:, 3] - image_location[:, 1]) * (image_location[:, 2] - image_location[:, 0]) / (float(image_w) * float(image_h)) ) image_location_ori = copy.deepcopy(image_location) image_location[:, 0] = image_location[:, 0] / float(image_w) image_location[:, 1] = image_location[:, 1] / float(image_h) image_location[:, 2] = image_location[:, 2] / float(image_w) image_location[:, 3] = image_location[:, 3] / float(image_h) g_location = np.array([0, 0, 1, 1, 1]) image_location = np.concatenate( [np.expand_dims(g_location, axis=0), image_location], axis=0 ) g_location_ori = np.array([0, 0, image_w, image_h, image_w * image_h]) image_location_ori = np.concatenate( [np.expand_dims(g_location_ori, axis=0), image_location_ori], axis=0 ) return features, num_boxes, image_location, image_location_ori def keys(self) -> List[int]: return self._image_ids
3,918
14,564
/** * */ package com.alibaba.datax.plugin.writer.gdbwriter.model; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import com.alibaba.datax.common.element.Record; import com.alibaba.datax.common.util.Configuration; import com.alibaba.datax.plugin.writer.gdbwriter.Key; import com.alibaba.datax.plugin.writer.gdbwriter.util.GdbDuplicateIdException; import groovy.lang.Tuple2; import lombok.extern.slf4j.Slf4j; /** * @author jerrywang * */ @Slf4j public class ScriptGdbGraph extends AbstractGdbGraph { private static final String VAR_PREFIX = "GDB___"; private static final String VAR_ID = VAR_PREFIX + "id"; private static final String VAR_LABEL = VAR_PREFIX + "label"; private static final String VAR_FROM = VAR_PREFIX + "from"; private static final String VAR_TO = VAR_PREFIX + "to"; private static final String VAR_PROP_KEY = VAR_PREFIX + "PK"; private static final String VAR_PROP_VALUE = VAR_PREFIX + "PV"; private static final String ADD_V_START = "g.addV(" + VAR_LABEL + ").property(id, " + VAR_ID + ")"; private static final String ADD_E_START = "g.addE(" + VAR_LABEL + ").property(id, " + VAR_ID + ").from(V(" + VAR_FROM + ")).to(V(" + VAR_TO + "))"; private static final String UPDATE_V_START = "g.V(" + VAR_ID + ")"; private static final String UPDATE_E_START = "g.E(" + VAR_ID + ")"; private Random random; public ScriptGdbGraph() { this.random = new Random(); } public ScriptGdbGraph(final Configuration config, final boolean session) { super(config, session); this.random = new Random(); log.info("Init as ScriptGdbGraph."); } /** * Apply list of {@link GdbElement} to GDB, return the failed records * * @param records * list of element to apply * @return */ @Override public List<Tuple2<Record, Exception>> add(final List<Tuple2<Record, GdbElement>> records) { final List<Tuple2<Record, Exception>> errors = new ArrayList<>(); try { beginTx(); for (final Tuple2<Record, GdbElement> elementTuple2 : records) { try { addInternal(elementTuple2.getSecond()); } catch (final Exception e) { errors.add(new Tuple2<>(elementTuple2.getFirst(), e)); } } doCommit(); } catch (final Exception ex) { doRollback(); throw new RuntimeException(ex); } return errors; } private void addInternal(final GdbElement element) { try { addInternal(element, false); } catch (final GdbDuplicateIdException e) { if (this.updateMode == Key.UpdateMode.SKIP) { log.debug("Skip duplicate id {}", element.getId()); } else if (this.updateMode == Key.UpdateMode.INSERT) { throw new RuntimeException(e); } else if (this.updateMode == Key.UpdateMode.MERGE) { if (element.getProperties().isEmpty()) { return; } try { addInternal(element, true); } catch (final GdbDuplicateIdException e1) { log.error("duplicate id {} while update...", element.getId()); throw new RuntimeException(e1); } } } } private void addInternal(final GdbElement element, final boolean update) throws GdbDuplicateIdException { boolean firstAdd = !update; final boolean isVertex = (element instanceof GdbVertex); final List<GdbElement.GdbProperty> params = element.getProperties(); final List<GdbElement.GdbProperty> subParams = new ArrayList<>(this.propertiesBatchNum); final int idLength = element.getId().length(); int attachLength = element.getLabel().length(); if (element instanceof GdbEdge) { attachLength += ((GdbEdge)element).getFrom().length(); attachLength += ((GdbEdge)element).getTo().length(); } int requestLength = idLength; for (final GdbElement.GdbProperty entry : params) { final String propKey = entry.getKey(); final Object propValue = entry.getValue(); int appendLength = propKey.length(); if (propValue instanceof String) { appendLength += ((String)propValue).length(); } if (checkSplitDsl(firstAdd, requestLength, attachLength, appendLength, subParams.size())) { setGraphDbElement(element, subParams, isVertex, firstAdd); firstAdd = false; subParams.clear(); requestLength = idLength; } requestLength += appendLength; subParams.add(entry); } if (!subParams.isEmpty() || firstAdd) { checkSplitDsl(firstAdd, requestLength, attachLength, 0, 0); setGraphDbElement(element, subParams, isVertex, firstAdd); } } private boolean checkSplitDsl(final boolean firstAdd, final int requestLength, final int attachLength, final int appendLength, final int propNum) { final int length = firstAdd ? requestLength + attachLength : requestLength; if (length > this.maxRequestLength) { throw new IllegalArgumentException("request length over limit(" + this.maxRequestLength + ")"); } return length + appendLength > this.maxRequestLength || propNum >= this.propertiesBatchNum; } private Tuple2<String, Map<String, Object>> buildDsl(final GdbElement element, final List<GdbElement.GdbProperty> properties, final boolean isVertex, final boolean firstAdd) { final Map<String, Object> params = new HashMap<>(); final StringBuilder sb = new StringBuilder(); if (isVertex) { sb.append(firstAdd ? ADD_V_START : UPDATE_V_START); } else { sb.append(firstAdd ? ADD_E_START : UPDATE_E_START); } for (int i = 0; i < properties.size(); i++) { final GdbElement.GdbProperty prop = properties.get(i); sb.append(".property("); if (prop.getCardinality() == Key.PropertyType.set) { sb.append("set, "); } sb.append(VAR_PROP_KEY).append(i).append(", ").append(VAR_PROP_VALUE).append(i).append(")"); params.put(VAR_PROP_KEY + i, prop.getKey()); params.put(VAR_PROP_VALUE + i, prop.getValue()); } if (firstAdd) { params.put(VAR_LABEL, element.getLabel()); if (!isVertex) { params.put(VAR_FROM, ((GdbEdge)element).getFrom()); params.put(VAR_TO, ((GdbEdge)element).getTo()); } } params.put(VAR_ID, element.getId()); return new Tuple2<>(sb.toString(), params); } private void setGraphDbElement(final GdbElement element, final List<GdbElement.GdbProperty> properties, final boolean isVertex, final boolean firstAdd) throws GdbDuplicateIdException { int retry = 10; int idleTime = this.random.nextInt(10) + 10; final Tuple2<String, Map<String, Object>> elementDsl = buildDsl(element, properties, isVertex, firstAdd); while (retry > 0) { try { runInternal(elementDsl.getFirst(), elementDsl.getSecond()); log.debug("AddElement {}", element.getId()); return; } catch (final Exception e) { final String cause = e.getCause() == null ? "" : e.getCause().toString(); if (cause.contains("rejected from") || cause.contains("Timeout waiting to lock key")) { retry--; try { Thread.sleep(idleTime); } catch (final InterruptedException e1) { // ... } idleTime = Math.min(idleTime * 2, 2000); continue; } else if (firstAdd && cause.contains("GraphDB id exists")) { throw new GdbDuplicateIdException(e); } log.error("Add Failed id {}, dsl {}, params {}, e {}", element.getId(), elementDsl.getFirst(), elementDsl.getSecond(), e); throw new RuntimeException(e); } } log.error("Add Failed id {}, dsl {}, params {}", element.getId(), elementDsl.getFirst(), elementDsl.getSecond()); throw new RuntimeException("failed to queue new element to server"); } }
3,962
4,054
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.jdisc.http.server.jetty; import com.google.common.base.Preconditions; import com.yahoo.jdisc.Request; import com.yahoo.jdisc.ResourceReference; import com.yahoo.jdisc.handler.AbstractRequestHandler; import com.yahoo.jdisc.handler.CompletionHandler; import com.yahoo.jdisc.handler.ContentChannel; import com.yahoo.jdisc.handler.DelegatedRequestHandler; import com.yahoo.jdisc.handler.RequestHandler; import com.yahoo.jdisc.handler.ResponseHandler; import com.yahoo.jdisc.http.HttpRequest; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; import java.nio.charset.StandardCharsets; import java.nio.charset.UnsupportedCharsetException; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import static com.yahoo.jdisc.Response.Status.UNSUPPORTED_MEDIA_TYPE; import static com.yahoo.jdisc.http.server.jetty.CompletionHandlerUtils.NOOP_COMPLETION_HANDLER; /** * Request handler that wraps POST requests of application/x-www-form-urlencoded data. * * The wrapper defers invocation of the "real" request handler until it has read the request content (body), * parsed the form parameters and merged them into the request's parameters. * * @author bakksjo * $Id$ */ class FormPostRequestHandler extends AbstractRequestHandler implements ContentChannel, DelegatedRequestHandler { private final ByteArrayOutputStream accumulatedRequestContent = new ByteArrayOutputStream(); private final RequestHandler delegateHandler; private final String contentCharsetName; private final boolean removeBody; private Charset contentCharset; private HttpRequest request; private ResourceReference requestReference; private ResponseHandler responseHandler; /** * @param delegateHandler the "real" request handler that this handler wraps * @param contentCharsetName name of the charset to use when interpreting the content data */ public FormPostRequestHandler( final RequestHandler delegateHandler, final String contentCharsetName, final boolean removeBody) { this.delegateHandler = Objects.requireNonNull(delegateHandler); this.contentCharsetName = Objects.requireNonNull(contentCharsetName); this.removeBody = removeBody; } @Override public ContentChannel handleRequest(final Request request, final ResponseHandler responseHandler) { Preconditions.checkArgument(request instanceof HttpRequest, "Expected HttpRequest, got " + request); Objects.requireNonNull(responseHandler, "responseHandler"); this.contentCharset = getCharsetByName(contentCharsetName); this.responseHandler = responseHandler; this.request = (HttpRequest) request; this.requestReference = request.refer(this); return this; } @Override public void write(final ByteBuffer buf, final CompletionHandler completionHandler) { assert buf.hasArray(); accumulatedRequestContent.write(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); completionHandler.completed(); } @SuppressWarnings("try") @Override public void close(final CompletionHandler completionHandler) { try (final ResourceReference ref = requestReference) { final byte[] requestContentBytes = accumulatedRequestContent.toByteArray(); final String content = new String(requestContentBytes, contentCharset); completionHandler.completed(); final Map<String, List<String>> parameterMap = parseFormParameters(content); mergeParameters(parameterMap, request.parameters()); final ContentChannel contentChannel = delegateHandler.handleRequest(request, responseHandler); if (contentChannel != null) { if (!removeBody) { final ByteBuffer byteBuffer = ByteBuffer.wrap(requestContentBytes); contentChannel.write(byteBuffer, NOOP_COMPLETION_HANDLER); } contentChannel.close(NOOP_COMPLETION_HANDLER); } } } /** * Looks up a Charset given a charset name. * * @param charsetName the name of the charset to look up * @return a valid Charset for the charset name (never returns null) * @throws RequestException if the charset name is invalid or unsupported */ private static Charset getCharsetByName(final String charsetName) throws RequestException { try { final Charset charset = Charset.forName(charsetName); if (charset == null) { throw new RequestException(UNSUPPORTED_MEDIA_TYPE, "Unsupported charset " + charsetName); } return charset; } catch (final IllegalCharsetNameException |UnsupportedCharsetException e) { throw new RequestException(UNSUPPORTED_MEDIA_TYPE, "Unsupported charset " + charsetName, e); } } /** * Parses application/x-www-form-urlencoded data into a map of parameters. * * @param formContent raw form content data (body) * @return map of decoded parameters */ private static Map<String, List<String>> parseFormParameters(final String formContent) { if (formContent.isEmpty()) { return Collections.emptyMap(); } final Map<String, List<String>> parameterMap = new HashMap<>(); final String[] params = formContent.split("&"); for (final String param : params) { final String[] parts = param.split("="); final String paramName = urlDecode(parts[0]); final String paramValue = parts.length > 1 ? urlDecode(parts[1]) : ""; List<String> currentValues = parameterMap.get(paramName); if (currentValues == null) { currentValues = new LinkedList<>(); parameterMap.put(paramName, currentValues); } currentValues.add(paramValue); } return parameterMap; } /** * Percent-decoding method that doesn't throw. * * @param encoded percent-encoded data * @return decoded data */ private static String urlDecode(final String encoded) { try { // Regardless of the charset used to transfer the request body, // all percent-escaping of non-ascii characters should use UTF-8 code points. return URLDecoder.decode(encoded, StandardCharsets.UTF_8.name()); } catch (final UnsupportedEncodingException e) { // Unfortunately, there is no URLDecoder.decode() method that takes a Charset, so we have to deal // with this exception. throw new IllegalStateException("Whoa, JVM doesn't support UTF-8 today.", e); } } /** * Merges source parameters into a destination map. * * @param source containing the parameters to copy into the destination * @param destination receiver of parameters, possibly already containing data */ private static void mergeParameters( final Map<String,List<String>> source, final Map<String,List<String>> destination) { for (Map.Entry<String, List<String>> entry : source.entrySet()) { final List<String> destinationValues = destination.get(entry.getKey()); if (destinationValues != null) { destinationValues.addAll(entry.getValue()); } else { destination.put(entry.getKey(), entry.getValue()); } } } @Override public RequestHandler getDelegate() { return delegateHandler; } }
2,893
3,083
// Copyright 2011-2016 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 // // 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.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JTree; import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.Gui.HotKeys; import com.google.security.zynamics.binnavi.Gui.MainWindow.Implementations.CProjectFunctions; import com.google.security.zynamics.binnavi.disassembly.INaviProject; /** * Action that can be used to load projects. */ public final class CLoadProjectAction extends AbstractAction { /** * Used for serialization. */ private static final long serialVersionUID = 3164027319049009140L; /** * Tree to be updated after the projects were loaded. */ private final JTree m_projectTree; /** * Projects to be loaded. */ private final INaviProject[] m_projects; /** * Creates a new action object. * * @param projectTree Tree to be updated after the address spaces were loaded. * @param projects Projects to be loaded. */ public CLoadProjectAction(final JTree projectTree, final INaviProject[] projects) { super("Load Project"); m_projectTree = Preconditions.checkNotNull(projectTree, "IE01904: Project tree argument can not be null"); m_projects = Preconditions.checkNotNull(projects, "IE01905: Projects argument can't be null").clone(); for (final INaviProject project : projects) { Preconditions.checkNotNull(project, "IE01906: Projects list contains a null-element"); } putValue(ACCELERATOR_KEY, HotKeys.LOAD_HK.getKeyStroke()); putValue(MNEMONIC_KEY, (int) "HK_MENU_LOAD_PROJECT".charAt(0)); } @Override public void actionPerformed(final ActionEvent event) { CProjectFunctions.openProjects(m_projectTree, m_projects); } }
749
4,081
<reponame>weiranyiran/alluxio<filename>core/common/src/main/java/alluxio/util/OSUtils.java /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied, as more fully set forth in the License. * * See the NOTICE file distributed with this work for information regarding copyright ownership. */ package alluxio.util; import org.apache.commons.lang3.SystemUtils; import javax.annotation.concurrent.ThreadSafe; /** * OS related utility functions. */ @ThreadSafe public final class OSUtils { /** The OS name. */ public static final String OS_NAME = System.getProperty("os.name"); /** The processor bit. */ public static final String PROCESSOR_BIT = System.getProperty("os.arch"); /** The java vendor name used in this platform. */ public static final String JAVA_VENDOR_NAME = System.getProperty("java.vendor"); /** Indicates the current java vendor is IBM java or not. */ public static final boolean IBM_JAVA = JAVA_VENDOR_NAME.contains("IBM"); /** * @return true if current processor is 64 bit */ public static boolean is64Bit() { return OSUtils.PROCESSOR_BIT.contains("64"); } /** * @return true if current OS is Windows */ public static boolean isWindows() { return SystemUtils.IS_OS_WINDOWS; } /** * @return true if current OS is MacOS */ public static boolean isMacOS() { return SystemUtils.IS_OS_MAC_OSX; } /** * @return true if current OS is Linux */ public static boolean isLinux() { return SystemUtils.IS_OS_LINUX; } /** * @return true if current OS is AIX */ public static boolean isAIX() { return OSUtils.OS_NAME.equals("AIX"); } private OSUtils() {} // prevent instantiation }
636
344
import math import os import random from collections import deque import numpy as np import scipy.linalg as sp_la import gym import torch import torch.nn as nn import torch.nn.functional as F from skimage.util.shape import view_as_windows from torch import distributions as pyd class eval_mode(object): def __init__(self, *models): self.models = models def __enter__(self): self.prev_states = [] for model in self.models: self.prev_states.append(model.training) model.train(False) def __exit__(self, *args): for model, state in zip(self.models, self.prev_states): model.train(state) return False def soft_update_params(net, target_net, tau): for param, target_param in zip(net.parameters(), target_net.parameters()): target_param.data.copy_(tau * param.data + (1 - tau) * target_param.data) def set_seed_everywhere(seed): torch.manual_seed(seed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(seed) np.random.seed(seed) random.seed(seed) def make_dir(*path_parts): dir_path = os.path.join(*path_parts) try: os.mkdir(dir_path) except OSError: pass return dir_path def tie_weights(src, trg): assert type(src) == type(trg) trg.weight = src.weight trg.bias = src.bias def weight_init(m): """Custom weight init for Conv2D and Linear layers.""" if isinstance(m, nn.Linear): nn.init.orthogonal_(m.weight.data) if hasattr(m.bias, 'data'): m.bias.data.fill_(0.0) elif isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d): gain = nn.init.calculate_gain('relu') nn.init.orthogonal_(m.weight.data, gain) if hasattr(m.bias, 'data'): m.bias.data.fill_(0.0) def mlp(input_dim, hidden_dim, output_dim, hidden_depth, output_mod=None): if hidden_depth == 0: mods = [nn.Linear(input_dim, output_dim)] else: mods = [nn.Linear(input_dim, hidden_dim), nn.ReLU(inplace=True)] for i in range(hidden_depth - 1): mods += [nn.Linear(hidden_dim, hidden_dim), nn.ReLU(inplace=True)] mods.append(nn.Linear(hidden_dim, output_dim)) if output_mod is not None: mods.append(output_mod) trunk = nn.Sequential(*mods) return trunk def to_np(t): if t is None: return None elif t.nelement() == 0: return np.array([]) else: return t.cpu().detach().numpy() class FrameStack(gym.Wrapper): def __init__(self, env, k): gym.Wrapper.__init__(self, env) self._k = k self._frames = deque([], maxlen=k) shp = env.observation_space.shape self.observation_space = gym.spaces.Box( low=0, high=1, shape=((shp[0] * k,) + shp[1:]), dtype=env.observation_space.dtype) self._max_episode_steps = env._max_episode_steps def reset(self): obs = self.env.reset() for _ in range(self._k): self._frames.append(obs) return self._get_obs() def step(self, action): obs, reward, done, info = self.env.step(action) self._frames.append(obs) return self._get_obs(), reward, done, info def _get_obs(self): assert len(self._frames) == self._k return np.concatenate(list(self._frames), axis=0) class TanhTransform(pyd.transforms.Transform): domain = pyd.constraints.real codomain = pyd.constraints.interval(-1.0, 1.0) bijective = True sign = +1 def __init__(self, cache_size=1): super().__init__(cache_size=cache_size) @staticmethod def atanh(x): return 0.5 * (x.log1p() - (-x).log1p()) def __eq__(self, other): return isinstance(other, TanhTransform) def _call(self, x): return x.tanh() def _inverse(self, y): # We do not clamp to the boundary here as it may degrade the performance of certain algorithms. # one should use `cache_size=1` instead return self.atanh(y) def log_abs_det_jacobian(self, x, y): # We use a formula that is more numerically stable, see details in the following link # https://github.com/tensorflow/probability/commit/ef6bb176e0ebd1cf6e25c6b5cecdd2428c22963f#diff-e120f70e92e6741bca649f04fcd907b7 return 2. * (math.log(2.) - x - F.softplus(-2. * x)) class SquashedNormal(pyd.transformed_distribution.TransformedDistribution): def __init__(self, loc, scale): self.loc = loc self.scale = scale self.base_dist = pyd.Normal(loc, scale) transforms = [TanhTransform()] super().__init__(self.base_dist, transforms) @property def mean(self): mu = self.loc for tr in self.transforms: mu = tr(mu) return mu
2,230
5,169
<reponame>Gantios/Specs { "name": "AccountKit", "version": "4.24.0", "summary": "AccountKit: Passwordless account creation via email or phone powered by Facebook", "description": "AccountKit helps you quickly sign in to apps using just your phone number or email address — no password needed. It's reliable, easy to use and gives you a choice about how you sign up for apps. It's built by Facebook but does not require a Facebook account to use.", "homepage": "https://developers.facebook.com/docs/accountkit/", "license": { "type": "Copyright", "text": " Copyright (c) 2016-present, Facebook, Inc. All rights reserved.\n\n You are hereby granted a non-exclusive, worldwide, royalty-free license to use,\n copy, modify, and distribute this software in source code or binary form for use\n in connection with the web services and APIs provided by Facebook.\n\n As with any software that integrates with the Facebook platform, your use of\n this software is subject to the Facebook Developer Principles and Policies\n [http://developers.facebook.com/policy/]. This copyright notice shall be\n included in all copies or substantial portions of the software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" }, "authors": "Facebook", "platforms": { "ios": "7.0" }, "source": { "http": "https://github.com/facebook/facebook-ios-sdk/releases/download/sdk-version-4.24.0/AccountKit-4.24.0.zip", "sha1": "32430c040366b8add5357a2d7456aa937ec7b03d" }, "source_files": "AccountKit.framework/**/*.h", "resources": [ "AccountKitStrings.bundle" ], "public_header_files": "AccountKit.framework/**/*.h", "weak_frameworks": [ "Accounts", "CoreLocation", "Social", "Security", "QuartzCore", "CoreGraphics", "UIKit", "Foundation", "AudioToolbox" ], "vendored_frameworks": "AccountKit.framework", "preserve_paths": "AccountKit.framework", "requires_arc": true }
935
2,659
package com._4paradigm.openmldb.taskmanager.server; public class StatusCode { public static final int SUCCESS = 0; public static final int FAILED = -1; }
57
441
// File: crn_dxt_hc_common.cpp // See Copyright Notice and license at the end of inc/crnlib.h #include "crn_core.h" #include "crn_dxt_hc_common.h" namespace crnlib { chunk_encoding_desc g_chunk_encodings[cNumChunkEncodings] = { {1, {{0, 0, 8, 8, 0}}}, {2, {{0, 0, 8, 4, 1}, {0, 4, 8, 4, 2}}}, {2, {{0, 0, 4, 8, 3}, {4, 0, 4, 8, 4}}}, {3, {{0, 0, 8, 4, 1}, {0, 4, 4, 4, 7}, {4, 4, 4, 4, 8}}}, {3, {{0, 4, 8, 4, 2}, {0, 0, 4, 4, 5}, {4, 0, 4, 4, 6}}}, {3, {{0, 0, 4, 8, 3}, {4, 0, 4, 4, 6}, {4, 4, 4, 4, 8}}}, {3, {{4, 0, 4, 8, 4}, {0, 0, 4, 4, 5}, {0, 4, 4, 4, 7}}}, {4, {{0, 0, 4, 4, 5}, {4, 0, 4, 4, 6}, {0, 4, 4, 4, 7}, {4, 4, 4, 4, 8}}}}; chunk_tile_desc g_chunk_tile_layouts[cNumChunkTileLayouts] = { // 2x2 {0, 0, 8, 8, 0}, // 2x1 {0, 0, 8, 4, 1}, {0, 4, 8, 4, 2}, // 1x2 {0, 0, 4, 8, 3}, {4, 0, 4, 8, 4}, // 1x1 {0, 0, 4, 4, 5}, {4, 0, 4, 4, 6}, {0, 4, 4, 4, 7}, {4, 4, 4, 4, 8}}; } // namespace crnlib
690
1,337
<gh_stars>1000+ # python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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. # ============================================================================ """Common plotting and analysis code. This code is based around plotnine = python implementation of ggplot. Typically, these plots will be imported and used within experiment analysis. """ from typing import Callable, Optional, Sequence from bsuite.utils import smoothers import matplotlib.style as style import numpy as np import pandas as pd import plotnine as gg # Updates the theme to preferred default settings gg.theme_set(gg.theme_bw(base_size=18, base_family='serif')) gg.theme_update(figure_size=(12, 8), panel_spacing_x=0.5, panel_spacing_y=0.5) style.use('seaborn-poster') style.use('ggplot') FIVE_COLOURS = [ '#313695', # DARK BLUE '#74add1', # LIGHT BLUE '#4daf4a', # GREEN '#f46d43', # ORANGE '#d73027', # RED ] * 10 # Hack to allow internal code to use functions without error CATEGORICAL_COLOURS = ([ '#313695', # DARK BLUE '#74add1', # LIGHT BLUE '#4daf4a', # GREEN '#f46d43', # ORANGE '#d73027', # RED '#984ea3', # PURPLE '#f781bf', # PINK '#ffc832', # YELLOW '#000000', # BLACK ]) * 100 # For very large sweeps the colours will just have to repeat. def ave_regret_score(df: pd.DataFrame, baseline_regret: float, episode: int, regret_column: str = 'total_regret') -> float: """Score performance by average regret, normalized to [0,1] by baseline.""" n_eps = np.minimum(df.episode.max(), episode) mean_regret = df.loc[df.episode == n_eps, regret_column].mean() / n_eps unclipped_score = (baseline_regret - mean_regret) / baseline_regret return np.clip(unclipped_score, 0, 1) def score_by_scaling(df: pd.DataFrame, score_fn: Callable[[pd.DataFrame], float], scaling_var: str) -> float: """Apply scoring function based on mean and std.""" scores = [] for _, sub_df in df.groupby(scaling_var): scores.append(score_fn(sub_df)) mean_score = np.clip(np.mean(scores), 0, 1) lcb_score = np.clip(np.mean(scores) - np.std(scores), 0, 1) return 0.5 * (mean_score + lcb_score) def facet_sweep_plot(base_plot: gg.ggplot, sweep_vars: Optional[Sequence[str]] = None, tall_plot: bool = False) -> gg.ggplot: """Add a facet_wrap to the plot based on sweep_vars.""" df = base_plot.data.copy() if sweep_vars: # Work out what size the plot should be based on the hypers + add facet. n_hypers = df[sweep_vars].drop_duplicates().shape[0] base_plot += gg.facet_wrap(sweep_vars, labeller='label_both') else: n_hypers = 1 if n_hypers == 1: fig_size = (7, 5) elif n_hypers == 2: fig_size = (13, 5) elif n_hypers == 4: fig_size = (13, 8) elif n_hypers <= 12: fig_size = (15, 4 * np.divide(n_hypers, 3) + 1) else: print('WARNING - comparing {} agents at once is more than recommended.' .format(n_hypers)) fig_size = (15, 12) if tall_plot: fig_size = (fig_size[0], fig_size[1] * 1.25) theme_settings = gg.theme_bw(base_size=18, base_family='serif') theme_settings += gg.theme( figure_size=fig_size, panel_spacing_x=0.5, panel_spacing_y=0.5,) return base_plot + theme_settings def plot_regret_learning(df_in: pd.DataFrame, group_col: Optional[str] = None, sweep_vars: Optional[Sequence[str]] = None, regret_col: str = 'total_regret', max_episode: Optional[int] = None) -> gg.ggplot: """Plots the average regret through time, grouped by group_var.""" df = df_in.copy() df['average_regret'] = df[regret_col] / df.episode df = df[df.episode <= (max_episode or np.inf)] if group_col is None: p = _plot_regret_single(df) else: p = _plot_regret_group(df, group_col) p += gg.geom_hline(gg.aes(yintercept=0.0), alpha=0) # axis hack p += gg.ylab('average regret per timestep') p += gg.coord_cartesian(xlim=(0, max_episode)) return facet_sweep_plot(p, sweep_vars, tall_plot=True) def _plot_regret_single(df: pd.DataFrame) -> gg.ggplot: """Plots the average regret through time for single variable.""" p = (gg.ggplot(df) + gg.aes(x='episode', y='average_regret') + gg.geom_smooth(method=smoothers.mean, span=0.1, size=1.75, alpha=0.1, colour='#313695', fill='#313695')) return p def _plot_regret_group(df: pd.DataFrame, group_col: str) -> gg.ggplot: """Plots the average regret through time when grouped.""" group_name = group_col.replace('_', ' ') df[group_name] = df[group_col].astype('category') p = (gg.ggplot(df) + gg.aes(x='episode', y='average_regret', group=group_name, colour=group_name, fill=group_name) + gg.geom_smooth(method=smoothers.mean, span=0.1, size=1.75, alpha=0.1) + gg.scale_colour_manual(values=FIVE_COLOURS) + gg.scale_fill_manual(values=FIVE_COLOURS)) return p def plot_regret_group_nosmooth(df_in: pd.DataFrame, group_col: str, sweep_vars: Optional[Sequence[str]] = None, regret_col: str = 'total_regret', max_episode: Optional[int] = None) -> gg.ggplot: """Plots the average regret through time without smoothing.""" df = df_in.copy() df['average_regret'] = df[regret_col] / df.episode df = df[df.episode <= max_episode] group_name = group_col.replace('_', ' ') df[group_name] = df[group_col] p = (gg.ggplot(df) + gg.aes(x='episode', y='average_regret', group=group_name, colour=group_name) + gg.geom_line(size=2, alpha=0.75) + gg.geom_hline(gg.aes(yintercept=0.0), alpha=0) # axis hack ) p += gg.coord_cartesian(xlim=(0, max_episode)) return facet_sweep_plot(p, sweep_vars, tall_plot=True) def _preprocess_ave_regret(df_in: pd.DataFrame, group_col: str, episode: int, sweep_vars: Optional[Sequence[str]] = None, regret_col: str = 'total_regret') -> gg.ggplot: """Preprocess the data at episode for average regret calculations.""" df = df_in.copy() group_vars = (sweep_vars or []) + [group_col] plt_df = (df[df.episode == episode] .groupby(group_vars)[regret_col].mean().reset_index()) if len(plt_df) == 0: # pylint:disable=g-explicit-length-test raise ValueError('Your experiment has not yet run the necessary {} episodes' .format(episode)) group_name = group_col.replace('_', ' ') plt_df[group_name] = plt_df[group_col].astype('category') plt_df['average_regret'] = plt_df[regret_col] / episode return plt_df def plot_regret_average(df_in: pd.DataFrame, group_col: str, episode: int, sweep_vars: Optional[Sequence[str]] = None, regret_col: str = 'total_regret') -> gg.ggplot: """Bar plot the average regret at end of learning.""" df = _preprocess_ave_regret(df_in, group_col, episode, sweep_vars, regret_col) group_name = group_col.replace('_', ' ') p = (gg.ggplot(df) + gg.aes(x=group_name, y='average_regret', fill=group_name) + gg.geom_bar(stat='identity') + gg.scale_fill_manual(values=FIVE_COLOURS) + gg.ylab('average regret after {} episodes'.format(episode)) ) return facet_sweep_plot(p, sweep_vars) def plot_regret_ave_scaling(df_in: pd.DataFrame, group_col: str, episode: int, regret_thresh: float, sweep_vars: Optional[Sequence[str]] = None, regret_col: str = 'total_regret') -> gg.ggplot: """Point plot of average regret investigating scaling to threshold.""" df = _preprocess_ave_regret(df_in, group_col, episode, sweep_vars, regret_col) group_name = group_col.replace('_', ' ') p = (gg.ggplot(df) + gg.aes(x=group_name, y='average_regret', colour='average_regret < {}'.format(regret_thresh)) + gg.geom_point(size=5, alpha=0.8) + gg.scale_x_log10(breaks=[1, 3, 10, 30, 100]) + gg.scale_colour_manual(values=['#d73027', '#313695']) + gg.ylab('average regret at {} episodes'.format(episode)) + gg.geom_hline(gg.aes(yintercept=0.0), alpha=0) # axis hack ) return facet_sweep_plot(p, sweep_vars) def _make_unique_group_col( df: pd.DataFrame, sweep_vars: Optional[Sequence[str]] = None) -> pd.DataFrame: """Adds a unique_group column based on sweep_vars + bsuite_id.""" unique_vars = ['bsuite_id'] if sweep_vars: unique_vars += sweep_vars unique_group = (df[unique_vars].astype(str) .apply(lambda x: x.name + '=' + x, axis=0) .apply(lambda x: '\n'.join(x), axis=1) # pylint:disable=unnecessary-lambda ) return unique_group def plot_individual_returns( df_in: pd.DataFrame, max_episode: int, return_column: str = 'episode_return', colour_var: Optional[str] = None, yintercept: Optional[float] = None, sweep_vars: Optional[Sequence[str]] = None) -> gg.ggplot: """Plot individual learning curves: one curve per sweep setting.""" df = df_in.copy() df['unique_group'] = _make_unique_group_col(df, sweep_vars) p = (gg.ggplot(df) + gg.aes(x='episode', y=return_column, group='unique_group') + gg.coord_cartesian(xlim=(0, max_episode)) ) if colour_var: p += gg.geom_line(gg.aes(colour=colour_var), size=1.1, alpha=0.75) if len(df[colour_var].unique()) <= 5: df[colour_var] = df[colour_var].astype('category') p += gg.scale_colour_manual(values=FIVE_COLOURS) else: p += gg.geom_line(size=1.1, alpha=0.75, colour='#313695') if yintercept: p += gg.geom_hline( yintercept=yintercept, alpha=0.5, size=2, linetype='dashed') return facet_sweep_plot(p, sweep_vars, tall_plot=True)
4,829
3,093
<filename>java-spring/common-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/common/transactions/CreditRecordedEvent.java<gh_stars>1000+ package net.chrisrichardson.eventstore.javaexamples.banking.backend.common.transactions; public class CreditRecordedEvent extends MoneyTransferEvent { private TransferDetails details; private CreditRecordedEvent() { } public CreditRecordedEvent(TransferDetails details) { this.details = details; } public TransferDetails getDetails() { return details; } }
165
3,262
<reponame>twicoder/angel package com.tencent.angel.psagent.matrix.transport.router.hash; import com.tencent.angel.common.collections.DynamicIntFloatArrayPair; import com.tencent.angel.ml.matrix.RowType; import com.tencent.angel.psagent.matrix.transport.router.operator.IIntKeyFloatValuePartOp; import io.netty.buffer.ByteBuf; public class HashIntKeysFloatValuesPart extends HashKeyValuePart implements IIntKeyFloatValuePartOp { private DynamicIntFloatArrayPair dynamicKeysValues; /** * Final key array, it is only used in server(after de-serialization) */ private int[] keys; /** * Final value array, it is only used in server(after de-serialization) */ private float[] values; public HashIntKeysFloatValuesPart(int rowId, DynamicIntFloatArrayPair dynamicKeysValues) { super(rowId); this.dynamicKeysValues = dynamicKeysValues; } public HashIntKeysFloatValuesPart(int rowId, int size) { this(rowId, new DynamicIntFloatArrayPair(size)); } public HashIntKeysFloatValuesPart(int size) { this(-1, new DynamicIntFloatArrayPair(size)); } public HashIntKeysFloatValuesPart() { this(-1, null); } @Override public int[] getKeys() { // It is recommended not to call this method on the client if(keys == null) { keys = dynamicKeysValues.getKeys(); } return keys; } @Override public float[] getValues() { // It is recommended not to call this method on the client if(values == null) { values = dynamicKeysValues.getValues(); } return values; } @Override public int size() { if(keys != null) { return keys.length; } else { return dynamicKeysValues.size(); } } @Override public RowType getKeyValueType() { return RowType.T_FLOAT_SPARSE; } @Override public void serialize(ByteBuf output) { super.serialize(output); dynamicKeysValues.serialize(output); } @Override public void deserialize(ByteBuf input) { super.deserialize(input); dynamicKeysValues = new DynamicIntFloatArrayPair(); dynamicKeysValues.deserialize(input); keys = dynamicKeysValues.getKeys(); values = dynamicKeysValues.getValues(); } @Override public int bufferLen() { return super.bufferLen() + dynamicKeysValues.bufferLen(); } public void add(int key, float value) { dynamicKeysValues.add(key, value); } @Override public void add(int[] keys, float[] values) { for(int i = 0; i < keys.length; i++) { add(keys[i], values[i]); } } }
877
623
<filename>java/com/google/gerrit/server/restapi/config/ConfirmEmail.java<gh_stars>100-1000 // 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 com.google.gerrit.server.restapi.config; import com.google.gerrit.entities.Account; import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.DefaultInput; import com.google.gerrit.extensions.restapi.Response; import com.google.gerrit.extensions.restapi.RestModifyView; import com.google.gerrit.extensions.restapi.UnprocessableEntityException; import com.google.gerrit.server.CurrentUser; import com.google.gerrit.server.account.AccountException; import com.google.gerrit.server.account.AccountManager; import com.google.gerrit.server.config.ConfigResource; import com.google.gerrit.server.mail.EmailTokenVerifier; import com.google.gerrit.server.restapi.config.ConfirmEmail.Input; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; import java.io.IOException; import org.eclipse.jgit.errors.ConfigInvalidException; /** * REST endpoint to confirm an email address for an account. * * <p>This REST endpoint handles {@code PUT /config/server/email.confirm} requests. * * <p>When a user registers a new email address for their account (see {@link * com.google.gerrit.server.restapi.account.CreateEmail}) an email with a confirmation link is sent * to that address. When the receiver confirms the email by clicking on the confirmation link, this * REST endpoint is invoked and the email address is added to the account. Confirming an email * address for an account creates an external ID that links the email address to the account. An * email address can only be added to an account if it is not assigned to any other account yet. */ @Singleton public class ConfirmEmail implements RestModifyView<ConfigResource, Input> { public static class Input { @DefaultInput public String token; } private final Provider<CurrentUser> self; private final EmailTokenVerifier emailTokenVerifier; private final AccountManager accountManager; @Inject public ConfirmEmail( Provider<CurrentUser> self, EmailTokenVerifier emailTokenVerifier, AccountManager accountManager) { this.self = self; this.emailTokenVerifier = emailTokenVerifier; this.accountManager = accountManager; } @Override public Response<?> apply(ConfigResource rsrc, Input input) throws AuthException, UnprocessableEntityException, IOException, ConfigInvalidException { CurrentUser user = self.get(); if (!user.isIdentifiedUser()) { throw new AuthException("Authentication required"); } if (input == null) { input = new Input(); } if (input.token == null) { throw new UnprocessableEntityException("missing token"); } try { EmailTokenVerifier.ParsedToken token = emailTokenVerifier.decode(input.token); Account.Id accId = user.getAccountId(); if (accId.equals(token.getAccountId())) { accountManager.link(accId, token.toAuthRequest()); return Response.none(); } throw new UnprocessableEntityException("invalid token"); } catch (EmailTokenVerifier.InvalidTokenException e) { throw new UnprocessableEntityException("invalid token", e); } catch (AccountException e) { throw new UnprocessableEntityException(e.getMessage()); } } }
1,183
575
<reponame>iridium-browser/iridium-browser<gh_stars>100-1000 // Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/themes/theme_helper_win.h" #include "base/bind.h" #include "base/callback.h" #include "base/win/windows_version.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/win/titlebar_config.h" #include "chrome/grit/theme_resources.h" #include "skia/ext/skia_utils_win.h" #include "ui/base/win/shell.h" #include "ui/gfx/color_utils.h" #include "ui/native_theme/native_theme.h" #include "ui/views/views_features.h" namespace { SkColor GetDefaultInactiveFrameColor() { return base::win::GetVersion() < base::win::Version::WIN10 ? SkColorSetRGB(0xEB, 0xEB, 0xEB) : SK_ColorWHITE; } } // namespace ThemeHelperWin::ThemeHelperWin() { // This just checks for Windows 8+ instead of calling DwmColorsAllowed() // because we want to monitor the frame color even when a custom frame is in // use, so that it will be correct if at any time the user switches to the // native frame. if (base::win::GetVersion() >= base::win::Version::WIN8) { dwm_key_.reset(new base::win::RegKey( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\DWM", KEY_READ)); if (dwm_key_->Valid()) OnDwmKeyUpdated(); else dwm_key_.reset(); } } ThemeHelperWin::~ThemeHelperWin() = default; bool ThemeHelperWin::ShouldUseNativeFrame( const CustomThemeSupplier* theme_supplier) const { const bool use_native_frame_if_enabled = ShouldCustomDrawSystemTitlebar() || !HasCustomImage(IDR_THEME_FRAME, theme_supplier); return use_native_frame_if_enabled && ui::win::IsAeroGlassEnabled(); } bool ThemeHelperWin::ShouldUseIncreasedContrastThemeSupplier( ui::NativeTheme* native_theme) const { // On Windows the platform provides the high contrast colors, so don't use the // IncreasedContrastThemeSupplier. return false; } SkColor ThemeHelperWin::GetDefaultColor( int id, bool incognito, const CustomThemeSupplier* theme_supplier) const { // In high contrast mode on Windows the platform provides the color. Try to // get that color first. SkColor color; if (ui::NativeTheme::GetInstanceForNativeUi()->InForcedColorsMode() && GetPlatformHighContrastColor(id, &color)) { return color; } if (DwmColorsAllowed(theme_supplier)) { // In Windows 10, native inactive borders are #555555 with 50% alpha. // Prior to version 1809, native active borders use the accent color. // In version 1809 and following, the active border is #262626 with 66% // alpha unless the accent color is also used for the frame. if (id == ThemeProperties::COLOR_ACCENT_BORDER_ACTIVE) { return (base::win::GetVersion() >= base::win::Version::WIN10_RS5 && !dwm_frame_color_) ? SkColorSetARGB(0xa8, 0x26, 0x26, 0x26) : dwm_accent_border_color_; } if (id == ThemeProperties::COLOR_ACCENT_BORDER_INACTIVE) return SkColorSetARGB(0x80, 0x55, 0x55, 0x55); // When we're custom-drawing the titlebar we want to use either the colors // we calculated in OnDwmKeyUpdated() or the default colors. When we're not // custom-drawing the titlebar we want to match the color Windows actually // uses because some things (like the incognito icon) use this color to // decide whether they should draw in light or dark mode. Incognito colors // should be the same as non-incognito in all cases here. if (id == ThemeProperties::COLOR_FRAME_ACTIVE) { if (dwm_frame_color_) return dwm_frame_color_.value(); if (!ShouldCustomDrawSystemTitlebar()) return SK_ColorWHITE; // Fall through and use default. } if (id == ThemeProperties::COLOR_FRAME_INACTIVE) { if (!ShouldCustomDrawSystemTitlebar()) { return inactive_frame_color_from_registry_ ? dwm_inactive_frame_color_.value() : GetDefaultInactiveFrameColor(); } if (dwm_frame_color_ && !inactive_frame_color_from_registry_) { // Tint to create inactive color. Always use the non-incognito version // of the tint, since the frame should look the same in both modes. return color_utils::HSLShift( dwm_frame_color_.value(), GetTint(ThemeProperties::TINT_FRAME_INACTIVE, false, theme_supplier)); } if (dwm_inactive_frame_color_) return dwm_inactive_frame_color_.value(); // Fall through and use default. } } return ThemeHelper::GetDefaultColor(id, incognito, theme_supplier); } bool ThemeHelperWin::GetPlatformHighContrastColor(int id, SkColor* color) const { ui::NativeTheme::SystemThemeColor system_theme_color = ui::NativeTheme::SystemThemeColor::kNotSupported; switch (id) { // Window Background case ThemeProperties::COLOR_FRAME_ACTIVE: case ThemeProperties::COLOR_FRAME_ACTIVE_INCOGNITO: case ThemeProperties::COLOR_FRAME_INACTIVE: case ThemeProperties::COLOR_FRAME_INACTIVE_INCOGNITO: case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_ACTIVE: case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_ACTIVE_INCOGNITO: case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_INACTIVE: case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_INACTIVE_INCOGNITO: case ThemeProperties::COLOR_TAB_BACKGROUND_INACTIVE_FRAME_ACTIVE: case ThemeProperties::COLOR_TAB_BACKGROUND_INACTIVE_FRAME_ACTIVE_INCOGNITO: case ThemeProperties::COLOR_TAB_BACKGROUND_INACTIVE_FRAME_INACTIVE: case ThemeProperties:: COLOR_TAB_BACKGROUND_INACTIVE_FRAME_INACTIVE_INCOGNITO: case ThemeProperties::COLOR_DOWNLOAD_SHELF: case ThemeProperties::COLOR_INFOBAR: case ThemeProperties::COLOR_TOOLBAR: case ThemeProperties::COLOR_STATUS_BUBBLE: system_theme_color = ui::NativeTheme::SystemThemeColor::kWindow; break; // Window Text case ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR: case ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR: case ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE: case ThemeProperties::COLOR_LOCATION_BAR_BORDER: system_theme_color = ui::NativeTheme::SystemThemeColor::kWindowText; break; // Button Background case ThemeProperties::COLOR_OMNIBOX_BACKGROUND: case ThemeProperties::COLOR_OMNIBOX_BACKGROUND_HOVERED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_BG: system_theme_color = ui::NativeTheme::SystemThemeColor::kButtonFace; break; // Button Text Foreground case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON: case ThemeProperties::COLOR_BOOKMARK_TEXT: case ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_ACTIVE: case ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_ACTIVE_INCOGNITO: case ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE: case ThemeProperties:: COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE_INCOGNITO: case ThemeProperties::COLOR_OMNIBOX_TEXT: case ThemeProperties::COLOR_OMNIBOX_SELECTED_KEYWORD: case ThemeProperties::COLOR_OMNIBOX_BUBBLE_OUTLINE: case ThemeProperties::COLOR_OMNIBOX_TEXT_DIMMED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_ICON: case ThemeProperties::COLOR_OMNIBOX_RESULTS_URL: case ThemeProperties::COLOR_OMNIBOX_RESULTS_TEXT_DIMMED: case ThemeProperties::COLOR_OMNIBOX_SECURITY_CHIP_DEFAULT: case ThemeProperties::COLOR_OMNIBOX_SECURITY_CHIP_SECURE: case ThemeProperties::COLOR_OMNIBOX_SECURITY_CHIP_DANGEROUS: system_theme_color = ui::NativeTheme::SystemThemeColor::kButtonText; break; // Highlight/Selected Background case ThemeProperties::COLOR_TOOLBAR_INK_DROP: if (!base::FeatureList::IsEnabled( views::features::kEnablePlatformHighContrastInkDrop)) return false; FALLTHROUGH; case ThemeProperties::COLOR_OMNIBOX_RESULTS_BG_SELECTED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_BG_HOVERED: system_theme_color = ui::NativeTheme::SystemThemeColor::kHighlight; break; // Highlight/Selected Text Foreground case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_HOVERED: case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_PRESSED: if (!base::FeatureList::IsEnabled( views::features::kEnablePlatformHighContrastInkDrop)) { return GetPlatformHighContrastColor( ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON, color); } FALLTHROUGH; case ThemeProperties::COLOR_TAB_FOREGROUND_ACTIVE_FRAME_ACTIVE: case ThemeProperties::COLOR_TAB_FOREGROUND_ACTIVE_FRAME_INACTIVE: case ThemeProperties::COLOR_OMNIBOX_RESULTS_TEXT_SELECTED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_TEXT_DIMMED_SELECTED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_ICON_SELECTED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_URL_SELECTED: case ThemeProperties::COLOR_OMNIBOX_RESULTS_FOCUS_BAR: system_theme_color = ui::NativeTheme::SystemThemeColor::kHighlightText; break; // Gray/Disabled Text case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE: system_theme_color = ui::NativeTheme::SystemThemeColor::kGrayText; break; default: return false; } *color = ui::NativeTheme::GetInstanceForNativeUi() ->GetSystemThemeColor(system_theme_color) .value(); return true; } bool ThemeHelperWin::DwmColorsAllowed( const CustomThemeSupplier* theme_supplier) const { return ShouldUseNativeFrame(theme_supplier) && (base::win::GetVersion() >= base::win::Version::WIN8); } void ThemeHelperWin::OnDwmKeyUpdated() { dwm_accent_border_color_ = GetDefaultInactiveFrameColor(); DWORD colorization_color, colorization_color_balance; if ((dwm_key_->ReadValueDW(L"ColorizationColor", &colorization_color) == ERROR_SUCCESS) && (dwm_key_->ReadValueDW(L"ColorizationColorBalance", &colorization_color_balance) == ERROR_SUCCESS)) { // The accent border color is a linear blend between the colorization // color and the neutral #d9d9d9. colorization_color_balance is the // percentage of the colorization color in that blend. // // On Windows version 1611 colorization_color_balance can be 0xfffffff3 if // the accent color is taken from the background and either the background // is a solid color or was just changed to a slideshow. It's unclear what // that value's supposed to mean, so change it to 80 to match Edge's // behavior. if (colorization_color_balance > 100) colorization_color_balance = 80; // colorization_color's high byte is not an alpha value, so replace it // with 0xff to make an opaque ARGB color. SkColor input_color = SkColorSetA(colorization_color, 0xff); dwm_accent_border_color_ = color_utils::AlphaBlend(input_color, SkColorSetRGB(0xd9, 0xd9, 0xd9), colorization_color_balance / 100.0f); } inactive_frame_color_from_registry_ = false; if (base::win::GetVersion() < base::win::Version::WIN10) { dwm_frame_color_ = dwm_accent_border_color_; } else { DWORD accent_color, color_prevalence; bool use_dwm_frame_color = dwm_key_->ReadValueDW(L"AccentColor", &accent_color) == ERROR_SUCCESS && dwm_key_->ReadValueDW(L"ColorPrevalence", &color_prevalence) == ERROR_SUCCESS && color_prevalence == 1; if (use_dwm_frame_color) { dwm_frame_color_ = skia::COLORREFToSkColor(accent_color); DWORD accent_color_inactive; if (dwm_key_->ReadValueDW(L"AccentColorInactive", &accent_color_inactive) == ERROR_SUCCESS) { dwm_inactive_frame_color_ = skia::COLORREFToSkColor(accent_color_inactive); inactive_frame_color_from_registry_ = true; } } else { dwm_frame_color_.reset(); dwm_inactive_frame_color_.reset(); } } // Notify native theme observers that the native theme has changed. ui::NativeTheme::GetInstanceForNativeUi()->NotifyOnNativeThemeUpdated(); // Watch for future changes. if (!dwm_key_->StartWatching(base::BindOnce(&ThemeHelperWin::OnDwmKeyUpdated, base::Unretained(this)))) { dwm_key_.reset(); } }
4,897
348
{"nom":"Saint-Didier-sous-Aubenas","circ":"3ème circonscription","dpt":"Ardèche","inscrits":677,"abs":331,"votants":346,"blancs":10,"nuls":23,"exp":313,"res":[{"nuance":"LR","nom":"<NAME>","voix":174},{"nuance":"REM","nom":"M. <NAME>","voix":139}]}
100
14,425
<reponame>amahussein/hadoop /** * 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.hadoop.security; import org.apache.hadoop.conf.Configuration; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; import javax.naming.NamingException; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import static org.apache.hadoop.security.RuleBasedLdapGroupsMapping .CONVERSION_RULE_KEY; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; /** * Test cases to verify the rules supported by RuleBasedLdapGroupsMapping. */ public class TestRuleBasedLdapGroupsMapping { @Test public void testGetGroupsToUpper() throws NamingException { RuleBasedLdapGroupsMapping groupsMapping = Mockito.spy( new RuleBasedLdapGroupsMapping()); Set<String> groups = new LinkedHashSet<>(); groups.add("group1"); groups.add("group2"); Mockito.doReturn(groups).when((LdapGroupsMapping) groupsMapping) .doGetGroups(eq("admin"), anyInt()); Configuration conf = new Configuration(); conf.set(LdapGroupsMapping.LDAP_URL_KEY, "ldap://test"); conf.set(CONVERSION_RULE_KEY, "to_upper"); groupsMapping.setConf(conf); List<String> groupsUpper = new ArrayList<>(); groupsUpper.add("GROUP1"); groupsUpper.add("GROUP2"); Assert.assertEquals(groupsUpper, groupsMapping.getGroups("admin")); } @Test public void testGetGroupsToLower() throws NamingException { RuleBasedLdapGroupsMapping groupsMapping = Mockito.spy( new RuleBasedLdapGroupsMapping()); Set<String> groups = new LinkedHashSet<>(); groups.add("GROUP1"); groups.add("GROUP2"); Mockito.doReturn(groups).when((LdapGroupsMapping) groupsMapping) .doGetGroups(eq("admin"), anyInt()); Configuration conf = new Configuration(); conf.set(LdapGroupsMapping.LDAP_URL_KEY, "ldap://test"); conf.set(CONVERSION_RULE_KEY, "to_lower"); groupsMapping.setConf(conf); List<String> groupsLower = new ArrayList<>(); groupsLower.add("group1"); groupsLower.add("group2"); Assert.assertEquals(groupsLower, groupsMapping.getGroups("admin")); } @Test public void testGetGroupsInvalidRule() throws NamingException { RuleBasedLdapGroupsMapping groupsMapping = Mockito.spy( new RuleBasedLdapGroupsMapping()); Set<String> groups = new LinkedHashSet<>(); groups.add("group1"); groups.add("GROUP2"); Mockito.doReturn(groups).when((LdapGroupsMapping) groupsMapping) .doGetGroups(eq("admin"), anyInt()); Configuration conf = new Configuration(); conf.set(LdapGroupsMapping.LDAP_URL_KEY, "ldap://test"); conf.set(CONVERSION_RULE_KEY, "none"); groupsMapping.setConf(conf); Assert.assertEquals(groups, groupsMapping.getGroupsSet("admin")); } }
1,264
375
/* * Copyright 2015 Nokia Solutions and Networks * Licensed under the Apache License, Version 2.0, * see license.txt file for details. */ package org.robotframework.ide.eclipse.main.plugin.tableeditor.dnd; import java.io.IOException; import java.io.Serializable; import java.util.Objects; import org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate; import org.robotframework.ide.eclipse.main.plugin.tableeditor.dnd.PositionCoordinateTransfer.SerializablePositionCoordinate; public class PositionCoordinateTransfer extends RedTransfer<SerializablePositionCoordinate> { private static final String TYPE_NAME = "red-position-coordinate-data-transfer-format"; private static final PositionCoordinateTransfer INSTANCE = new PositionCoordinateTransfer(TYPE_NAME); public PositionCoordinateTransfer(final String typeName) { super(typeName); } public static PositionCoordinateTransfer getInstance() { return INSTANCE; } @Override protected boolean canHandleSerialization(final Object data) { return data instanceof SerializablePositionCoordinate[]; } @Override protected byte[] javaToBytes(final Object data) throws IOException { return ArraysSerializerDeserializer.serialize((SerializablePositionCoordinate[]) data); } @Override protected SerializablePositionCoordinate[] bytesToJava(final byte[] bytes) throws ClassNotFoundException, IOException { return ArraysSerializerDeserializer.deserialize(SerializablePositionCoordinate.class, bytes); } public static class SerializablePositionCoordinate implements Serializable { public static SerializablePositionCoordinate[] createFrom(final PositionCoordinate[] coordinates) { final SerializablePositionCoordinate[] serializableCoordinates = new SerializablePositionCoordinate[coordinates.length]; for (int i = 0; i < coordinates.length; i++) { serializableCoordinates[i] = new SerializablePositionCoordinate(coordinates[i]); } return serializableCoordinates; } private static final long serialVersionUID = 1L; private final int columnPosition; private final int rowPosition; public SerializablePositionCoordinate(final PositionCoordinate positionCoordinate) { this(positionCoordinate.columnPosition, positionCoordinate.rowPosition); } public SerializablePositionCoordinate(final int columnPosition, final int rowPosition) { this.columnPosition = columnPosition; this.rowPosition = rowPosition; } public int getColumnPosition() { return columnPosition; } public int getRowPosition() { return rowPosition; } @Override public boolean equals(final Object obj) { if (obj == null) { return false; } else if (obj.getClass() == getClass()) { final SerializablePositionCoordinate other = (SerializablePositionCoordinate) obj; return Objects.equals(rowPosition, other.rowPosition) && Objects.equals(columnPosition, other.columnPosition); } return false; } @Override public int hashCode() { return Objects.hash(rowPosition, columnPosition); } @Override public String toString() { // debugging or junit reports purposes only return "[" + columnPosition + ", " + rowPosition + "]"; } } }
1,275
1,647
<reponame>davidbrochart/pythran #ifndef PYTHONIC_INCLUDE_BUILTIN_GENERATOREXIT_HPP #define PYTHONIC_INCLUDE_BUILTIN_GENERATOREXIT_HPP #include "pythonic/include/types/exceptions.hpp" PYTHONIC_NS_BEGIN namespace builtins { PYTHONIC_EXCEPTION_DECL(GeneratorExit) } PYTHONIC_NS_END #endif
143
764
{"symbol": "SUSHI","address": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2","overview":{"en": ""},"email": "","website": "https://sushiswap.org/","state": "NORMAL","links": {"blog": "https://medium.com/sushiswap/","twitter": "https://twitter.com/sushiswap","telegram": "","github": "https://github.com/sushiswap"}}
128
337
//statement throw exception;
6
317
<reponame>rachelaus/perma # Generated by Django 2.2.22 on 2021-05-21 00:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('perma', '0066_auto_20210520_1650'), ] operations = [ migrations.RemoveIndex( model_name='link', name='perma_link_user_de_25ae38_idx', ), migrations.AddIndex( model_name='link', index=models.Index(fields=['user_deleted', 'is_private', 'is_unlisted', 'cached_can_play_back', 'internet_archive_upload_status'], name='perma_link_user_de_b6e6a5_idx'), ), ]
295
2,151
// Copyright 2018 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 SERVICES_UI_WS2_WINDOW_SERVICE_DELEGATE_H_ #define SERVICES_UI_WS2_WINDOW_SERVICE_DELEGATE_H_ #include <stdint.h> #include <memory> #include <string> #include <vector> #include "base/component_export.h" #include "base/containers/flat_map.h" namespace aura { class PropertyConverter; class Window; } namespace ui { namespace ws2 { // A delegate used by the WindowService for context-specific operations. class COMPONENT_EXPORT(WINDOW_SERVICE) WindowServiceDelegate { public: // A client requested a new top-level window. Implementations should create a // new window, parenting it in the appropriate container. Return null to // reject the request. virtual std::unique_ptr<aura::Window> NewTopLevel( aura::PropertyConverter* property_converter, const base::flat_map<std::string, std::vector<uint8_t>>& properties) = 0; protected: virtual ~WindowServiceDelegate() = default; }; } // namespace ws2 } // namespace ui #endif // SERVICES_UI_WS2_WINDOW_SERVICE_DELEGATE_H_
387
852
#include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/Common/interface/ValueMap.h" #include "RecoParticleFlow/PFProducer/test/PFIsoReader.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" PFIsoReader::PFIsoReader(const edm::ParameterSet& iConfig) { inputTagGsfElectrons_ = iConfig.getParameter<edm::InputTag>("Electrons"); inputTagPhotons_ = iConfig.getParameter<edm::InputTag>("Photons"); inputTagPFCandidates_ = iConfig.getParameter<edm::InputTag>("PFCandidates"); useValueMaps_ = iConfig.getParameter<bool>("useEGPFValueMaps"); inputTagValueMapPhotons_ = iConfig.getParameter<edm::InputTag>("PhotonValueMap"); inputTagValueMapElectrons_ = iConfig.getParameter<edm::InputTag>("ElectronValueMap"); inputTagValueMapMerged_ = iConfig.getParameter<edm::InputTag>("MergedValueMap"); inputTagElectronIsoDeposits_ = iConfig.getParameter<std::vector<edm::InputTag> >("ElectronIsoDeposits"); inputTagPhotonIsoDeposits_ = iConfig.getParameter<std::vector<edm::InputTag> >("PhotonIsoDeposits"); } PFIsoReader::~PFIsoReader() { ; } void PFIsoReader::beginRun(edm::Run const&, edm::EventSetup const&) { ; } void PFIsoReader::analyze(const edm::Event& iEvent, const edm::EventSetup& c) { edm::Handle<reco::PFCandidateCollection> pfCandidatesH; bool found = iEvent.getByLabel(inputTagPFCandidates_, pfCandidatesH); if (!found) { std::ostringstream err; err << " cannot get PFCandidates: " << inputTagPFCandidates_ << std::endl; edm::LogError("PFIsoReader") << err.str(); throw cms::Exception("MissingProduct", err.str()); } edm::Handle<reco::GsfElectronCollection> gsfElectronH; found = iEvent.getByLabel(inputTagGsfElectrons_, gsfElectronH); if (!found) { std::ostringstream err; err << " cannot get GsfElectrons: " << inputTagGsfElectrons_ << std::endl; edm::LogError("PFIsoReader") << err.str(); throw cms::Exception("MissingProduct", err.str()); } edm::Handle<reco::PhotonCollection> photonH; found = iEvent.getByLabel(inputTagPhotons_, photonH); if (!found) { std::ostringstream err; err << " cannot get Photonss: " << inputTagPhotons_ << std::endl; edm::LogError("PFIsoReader") << err.str(); throw cms::Exception("MissingProduct", err.str()); } // Get the value maps edm::Handle<edm::ValueMap<reco::PFCandidatePtr> > electronValMapH; found = iEvent.getByLabel(inputTagValueMapElectrons_, electronValMapH); const edm::ValueMap<reco::PFCandidatePtr>& myElectronValMap(*electronValMapH); std::cout << " Read Electron Value Map " << myElectronValMap.size() << std::endl; // edm::Handle<edm::ValueMap<reco::PFCandidatePtr> > photonValMapH; // found = iEvent.getByLabel(inputTagValueMapPhotons_,photonValMapH); // const edm::ValueMap<reco::PFCandidatePtr> & myPhotonValMap(*photonValMapH); edm::Handle<edm::ValueMap<reco::PFCandidatePtr> > mergedValMapH; found = iEvent.getByLabel(inputTagValueMapMerged_, mergedValMapH); const edm::ValueMap<reco::PFCandidatePtr>& myMergedValMap(*mergedValMapH); // get the iso deposits IsoDepositMaps electronIsoDep(inputTagElectronIsoDeposits_.size()); IsoDepositMaps photonIsoDep(inputTagPhotonIsoDeposits_.size()); for (size_t j = 0; j < inputTagElectronIsoDeposits_.size(); ++j) { iEvent.getByLabel(inputTagElectronIsoDeposits_[j], electronIsoDep[j]); } for (size_t j = 0; j < inputTagPhotonIsoDeposits_.size(); ++j) { iEvent.getByLabel(inputTagPhotonIsoDeposits_[j], photonIsoDep[j]); } // Photons - from reco unsigned nphot = photonH->size(); std::cout << "Photon: " << nphot << std::endl; for (unsigned iphot = 0; iphot < nphot; ++iphot) { reco::PhotonRef myPhotRef(photonH, iphot); // const reco::PFCandidatePtr & pfPhotPtr(myPhotonValMap[myPhotRef]); const reco::PFCandidatePtr& pfPhotPtr(myMergedValMap[myPhotRef]); printIsoDeposits(photonIsoDep, pfPhotPtr); } // Photons - from PF Candidates unsigned ncandidates = pfCandidatesH->size(); std::cout << "Candidates: " << ncandidates << std::endl; for (unsigned icand = 0; icand < ncandidates; ++icand) { const reco::PFCandidate& cand((*pfCandidatesH)[icand]); // std::cout << " Pdg " << cand.pdgId() << " mva " << cand.mva_nothing_gamma() << std::endl; if (!(cand.pdgId() == 22 && cand.mva_nothing_gamma() > 0)) continue; reco::PFCandidatePtr myPFCandidatePtr(pfCandidatesH, icand); printIsoDeposits(photonIsoDep, myPFCandidatePtr); } // Electrons - from reco unsigned nele = gsfElectronH->size(); std::cout << "Electron: " << nele << std::endl; for (unsigned iele = 0; iele < nele; ++iele) { reco::GsfElectronRef myElectronRef(gsfElectronH, iele); if (myElectronRef->mva_e_pi() < -1) continue; //const reco::PFCandidatePtr & pfElePtr(myElectronValMap[myElectronRef]); const reco::PFCandidatePtr pfElePtr(myElectronValMap[myElectronRef]); printIsoDeposits(electronIsoDep, pfElePtr); } // Electrons - from PFCandidate nele = gsfElectronH->size(); std::cout << "Candidates: " << nele << std::endl; for (unsigned icand = 0; icand < ncandidates; ++icand) { const reco::PFCandidate& cand((*pfCandidatesH)[icand]); if (!(abs(cand.pdgId()) == 11)) continue; reco::PFCandidatePtr myPFCandidatePtr(pfCandidatesH, icand); printIsoDeposits(electronIsoDep, myPFCandidatePtr); } } void PFIsoReader::printIsoDeposits(const IsoDepositMaps& isodepmap, const reco::PFCandidatePtr& ptr) const { std::cout << " Isodeposits for " << ptr.id() << " " << ptr.key() << std::endl; unsigned nIsoDepTypes = isodepmap.size(); // should be 3 (charged hadrons, photons, neutral hadrons) for (unsigned ideptype = 0; ideptype < nIsoDepTypes; ++ideptype) { const reco::IsoDeposit& isoDep((*isodepmap[ideptype])[ptr]); typedef reco::IsoDeposit::const_iterator IM; std::cout << " Iso deposits type " << ideptype << std::endl; for (IM im = isoDep.begin(); im != isoDep.end(); ++im) { std::cout << "dR " << im->dR() << " val " << im->value() << std::endl; } } } DEFINE_FWK_MODULE(PFIsoReader);
2,477
318
<gh_stars>100-1000 package com.wapchief.jpushim.activity; import android.os.Bundle; import android.widget.ImageView; import android.widget.TextView; import com.wapchief.jpushim.R; import com.wapchief.jpushim.framework.base.BaseActivity; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; /** * Created by wapchief on 2017/7/21. */ public class AboutActivity extends BaseActivity { @BindView(R.id.title_bar_back) ImageView mTitleBarBack; @BindView(R.id.title_bar_title) TextView mTitleBarTitle; @Override protected int setContentView() { return R.layout.activity_about; } @Override protected void initView() { mTitleBarBack.setImageDrawable(getResources().getDrawable(R.mipmap.icon_back)); mTitleBarTitle.setText("关于"); } @Override protected void initData() { } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO: add setContentView(...) invocation ButterKnife.bind(this); } @OnClick(R.id.title_bar_back) public void onViewClicked() { finish(); } }
463
8,232
// Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // initialize standard wide input stream #include <fstream> #include <iostream> #pragma warning(disable : 4074) #pragma init_seg(compiler) static std::_Init_locks initlocks; _STD_BEGIN __PURE_APPDOMAIN_GLOBAL static wfilebuf wfin(_cpp_stdin); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern wistream wcin(&wfin); #else __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream wcin(&wfin); #endif struct _Init_wcin { // ensures that wcin is initialized __CLR_OR_THIS_CALL _Init_wcin() { // initialize wcin _Ptr_wcin = &wcin; wcin.tie(_Ptr_wcout); } }; __PURE_APPDOMAIN_GLOBAL static _Init_wcin init_wcin; _STD_END
344
335
<reponame>standarddeviant/M5StickC-IDF // ======================================================================== // This comes with no warranty, implied or otherwise // This data structure was designed to support Proportional fonts // fonts. Individual characters do not have to be multiples of 8 bits wide. // Any width is fine and does not need to be fixed. // The data bits are packed to minimize data requirements, but the tradeoff // is that a header is required per character. // Header Format: // ------------------------------------------------ // Character Width (Used as a marker to indicate use this format. i.e.: = 0x00) // Character Height // First Character (Reserved. 0x00) // Number Of Characters (Reserved. 0x00) // Individual Character Format: // ---------------------------- // Character Code // Adjusted Y Offset // Width // Height // xOffset // xDelta (the distance to move the cursor. Effective width of the character.) // Data[n] // NOTE: You can remove any of these characters if they are not needed in // your application. The first character number in each Glyph indicates // the ASCII character code. Therefore, these do not have to be sequential. // Just remove all the content for a particular character to save space. // ======================================================================== // dejavu // Point Size : 24 // Memory usage : 2724 bytes // # characters : 95 const unsigned char tft_Dejavu24[] = { 0x00, 0x17, 0x00, 0x00, // ' ' 0x20,0x13,0x00,0x00,0x00,0x08, // '!' 0x21,0x01,0x02,0x12,0x04,0x0A, 0xFF,0xFF,0xFF,0x03,0xF0, // '"' 0x22,0x01,0x06,0x07,0x02,0x0B, 0xCF,0x3C,0xF3,0xCF,0x3C,0xC0, // '#' 0x23,0x01,0x10,0x12,0x02,0x14, 0x03,0x08,0x03,0x18,0x03,0x18,0x03,0x18,0x02,0x18,0x7F,0xFF,0x7F,0xFF,0x06,0x30,0x04,0x30,0x0C,0x20,0x0C,0x60,0xFF,0xFE,0xFF,0xFE,0x18,0x40,0x18,0xC0,0x18,0xC0,0x18,0xC0,0x10,0xC0, // '$' 0x24,0x01,0x0B,0x16,0x02,0x0F, 0x04,0x00,0x80,0x10,0x0F,0xC7,0xFD,0xC8,0xB1,0x06,0x20,0xE4,0x0F,0x80,0xFE,0x03,0xE0,0x4E,0x08,0xC1,0x1E,0x27,0xFF,0xC7,0xE0,0x10,0x02,0x00,0x40,0x08,0x00, // '%' 0x25,0x01,0x14,0x12,0x01,0x17, 0x3C,0x03,0x06,0x60,0x60,0xC3,0x06,0x0C,0x30,0xC0,0xC3,0x1C,0x0C,0x31,0x80,0xC3,0x38,0x0C,0x33,0x00,0x66,0x63,0xC3,0xC6,0x66,0x00,0xCC,0x30,0x1C,0xC3,0x01,0x8C,0x30,0x38,0xC3,0x03,0x0C,0x30,0x60,0xC3,0x06,0x06,0x60,0xC0,0x3C, // '&' 0x26,0x01,0x10,0x12,0x01,0x13, 0x07,0xC0,0x1F,0xE0,0x38,0x20,0x30,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x1C,0x00,0x3E,0x00,0x77,0x06,0xE3,0x86,0xC1,0xCC,0xC0,0xFC,0xC0,0x78,0xE0,0x78,0x70,0xFC,0x3F,0xCE,0x0F,0x87, // ''' 0x27,0x01,0x02,0x07,0x02,0x07, 0xFF,0xFC, // '(' 0x28,0x01,0x05,0x15,0x02,0x09, 0x19,0x8C,0xC6,0x31,0x18,0xC6,0x31,0x8C,0x61,0x0C,0x63,0x0C,0x61,0x80, // ')' 0x29,0x01,0x05,0x15,0x02,0x09, 0xC3,0x18,0x63,0x18,0x43,0x18,0xC6,0x31,0x8C,0x46,0x31,0x98,0xCC,0x00, // '*' 0x2A,0x01,0x0B,0x0A,0x00,0x0C, 0x04,0x00,0x83,0x11,0xBA,0xE1,0xF0,0x3E,0x1D,0x76,0x23,0x04,0x00,0x80, // '+' 0x2B,0x03,0x10,0x10,0x03,0x14, 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0xFF,0xFF,0xFF,0xFF,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80, // ',' 0x2C,0x10,0x03,0x06,0x02,0x08, 0x6D,0xBD,0x80, // '-' 0x2D,0x0B,0x06,0x02,0x01,0x09, 0xFF,0xF0, // '.' 0x2E,0x10,0x02,0x03,0x03,0x08, 0xFC, // '/' 0x2F,0x01,0x08,0x14,0x00,0x08, 0x03,0x07,0x06,0x06,0x06,0x0C,0x0C,0x0C,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x60,0x60,0x60,0xE0,0xC0, // '0' 0x30,0x01,0x0C,0x12,0x02,0x0F, 0x0F,0x03,0xFC,0x70,0xE6,0x06,0x60,0x6C,0x03,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x36,0x06,0x60,0x67,0x0E,0x3F,0xC0,0xF0, // '1' 0x31,0x01,0x0A,0x12,0x03,0x0F, 0x3C,0x3F,0x0C,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0xFF,0xFF,0xF0, // '2' 0x32,0x01,0x0C,0x12,0x02,0x0F, 0x3F,0x0F,0xF8,0xC1,0xC0,0x0E,0x00,0x60,0x06,0x00,0x60,0x0C,0x01,0xC0,0x18,0x03,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xFF,0xEF,0xFE, // '3' 0x33,0x01,0x0C,0x12,0x02,0x0F, 0x3F,0x07,0xFC,0x41,0xC0,0x06,0x00,0x60,0x06,0x00,0x60,0x0C,0x1F,0x81,0xFC,0x00,0xE0,0x07,0x00,0x30,0x03,0x00,0x78,0x0E,0xFF,0xC3,0xF0, // '4' 0x34,0x01,0x0D,0x12,0x01,0x0F, 0x01,0xC0,0x1E,0x00,0xB0,0x0D,0x80,0xCC,0x06,0x60,0x63,0x03,0x18,0x30,0xC3,0x06,0x18,0x31,0x81,0x8F,0xFF,0xFF,0xFC,0x03,0x00,0x18,0x00,0xC0,0x06,0x00, // '5' 0x35,0x01,0x0B,0x12,0x02,0x0F, 0x7F,0xCF,0xF9,0x80,0x30,0x06,0x00,0xC0,0x1F,0xC3,0xFC,0x41,0xC0,0x1C,0x01,0x80,0x30,0x06,0x00,0xC0,0x3C,0x0E,0xFF,0x8F,0xC0, // '6' 0x36,0x01,0x0C,0x12,0x02,0x0F, 0x07,0xC1,0xFE,0x38,0x27,0x00,0x60,0x0C,0x00,0xCF,0x8D,0xFC,0xF8,0xEF,0x07,0xE0,0x3E,0x03,0xE0,0x36,0x03,0x70,0x77,0x8E,0x3F,0xC0,0xF8, // '7' 0x37,0x01,0x0B,0x12,0x02,0x0F, 0xFF,0xFF,0xFC,0x03,0x00,0x60,0x1C,0x03,0x00,0x60,0x18,0x03,0x00,0xE0,0x18,0x03,0x00,0xC0,0x18,0x07,0x00,0xC0,0x18,0x06,0x00, // '8' 0x38,0x01,0x0C,0x12,0x02,0x0F, 0x1F,0x87,0xFE,0x70,0xEC,0x03,0xC0,0x3C,0x03,0xC0,0x37,0x0E,0x3F,0xC3,0xFC,0x70,0xEC,0x03,0xC0,0x3C,0x03,0xC0,0x37,0x0E,0x7F,0xE1,0xF8, // '9' 0x39,0x01,0x0C,0x12,0x02,0x0F, 0x1F,0x03,0xFC,0x71,0xCE,0x0E,0xC0,0x6C,0x07,0xC0,0x7C,0x07,0xE0,0xF7,0x1F,0x3F,0xB1,0xF3,0x00,0x30,0x06,0x00,0xE4,0x1C,0x7F,0x83,0xE0, // ':' 0x3A,0x07,0x02,0x0C,0x03,0x08, 0xFC,0x00,0x3F, // ';' 0x3B,0x07,0x03,0x0F,0x02,0x08, 0x6D,0x80,0x00,0x0D,0xB7,0xB0, // '<' 0x3C,0x05,0x0F,0x0D,0x03,0x14, 0x00,0x02,0x00,0x3C,0x03,0xF0,0x3F,0x01,0xF8,0x1F,0x80,0x3C,0x00,0x7E,0x00,0x1F,0x80,0x0F,0xC0,0x03,0xF0,0x00,0xF0,0x00,0x20, // '=' 0x3D,0x08,0x0F,0x07,0x03,0x14, 0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0x80, // '>' 0x3E,0x05,0x0F,0x0D,0x03,0x14, 0x80,0x01,0xE0,0x01,0xF8,0x00,0x7E,0x00,0x3F,0x00,0x0F,0xC0,0x07,0x80,0x3F,0x03,0xF0,0x1F,0x81,0xF8,0x07,0x80,0x08,0x00,0x00, // '?' 0x3F,0x01,0x09,0x12,0x02,0x0D, 0x3E,0x3F,0xB0,0xF0,0x30,0x18,0x0C,0x0C,0x0E,0x0E,0x0E,0x06,0x03,0x01,0x80,0x00,0x00,0x30,0x18,0x0C,0x00, // '@' 0x40,0x02,0x15,0x15,0x02,0x18, 0x00,0xFC,0x00,0x3F,0xF8,0x03,0xC0,0xF0,0x38,0x01,0xC3,0x80,0x07,0x38,0x79,0x99,0x8F,0xEC,0xFC,0x71,0xE3,0xC7,0x07,0x1E,0x30,0x18,0xF1,0x80,0xC7,0x8C,0x06,0x3C,0x70,0x73,0x71,0xC7,0xB9,0x8F,0xEF,0x8E,0x1E,0x70,0x38,0x00,0x00,0xE0,0x04,0x03,0xC0,0xE0,0x0F,0xFE,0x00,0x0F,0x80,0x00, // 'A' 0x41,0x01,0x10,0x12,0x00,0x10, 0x03,0xC0,0x03,0xC0,0x03,0xC0,0x07,0xE0,0x06,0x60,0x06,0x60,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x18,0x18,0x18,0x18,0x38,0x1C,0x3F,0xFC,0x3F,0xFC,0x60,0x06,0x60,0x06,0x60,0x06,0xC0,0x03, // 'B' 0x42,0x01,0x0C,0x12,0x02,0x10, 0xFF,0x0F,0xFC,0xC0,0xEC,0x06,0xC0,0x6C,0x06,0xC0,0x6C,0x0C,0xFF,0x8F,0xFC,0xC0,0x6C,0x03,0xC0,0x3C,0x03,0xC0,0x3C,0x06,0xFF,0xEF,0xF8, // 'C' 0x43,0x01,0x0E,0x12,0x01,0x11, 0x07,0xE0,0x7F,0xE3,0xC1,0xDC,0x01,0x60,0x01,0x80,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x60,0x01,0x80,0x07,0x00,0x4F,0x07,0x1F,0xF8,0x1F,0x80, // 'D' 0x44,0x01,0x0F,0x12,0x02,0x12, 0xFF,0x81,0xFF,0xE3,0x01,0xE6,0x00,0xEC,0x00,0xD8,0x01,0xF0,0x01,0xE0,0x03,0xC0,0x07,0x80,0x0F,0x00,0x1E,0x00,0x3C,0x00,0xF8,0x01,0xB0,0x07,0x60,0x3C,0xFF,0xF1,0xFF,0x00, // 'E' 0x45,0x01,0x0B,0x12,0x02,0x0F, 0xFF,0xFF,0xFF,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xFF,0xDF,0xFB,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xFF,0xFF,0xFC, // 'F' 0x46,0x01,0x0A,0x12,0x02,0x0E, 0xFF,0xFF,0xFC,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xFF,0xBF,0xEC,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x00, // 'G' 0x47,0x01,0x0F,0x12,0x01,0x13, 0x07,0xE0,0x3F,0xF0,0xE0,0x73,0x80,0x26,0x00,0x1C,0x00,0x30,0x00,0x60,0x00,0xC0,0x7F,0x80,0xFF,0x00,0x1E,0x00,0x36,0x00,0x6C,0x00,0xDC,0x01,0x9E,0x07,0x1F,0xFC,0x0F,0xE0, // 'H' 0x48,0x01,0x0D,0x12,0x02,0x12, 0xC0,0x1E,0x00,0xF0,0x07,0x80,0x3C,0x01,0xE0,0x0F,0x00,0x78,0x03,0xFF,0xFF,0xFF,0xF0,0x07,0x80,0x3C,0x01,0xE0,0x0F,0x00,0x78,0x03,0xC0,0x1E,0x00,0xC0, // 'I' 0x49,0x01,0x02,0x12,0x02,0x07, 0xFF,0xFF,0xFF,0xFF,0xF0, // 'J' 0x4A,0x01,0x06,0x17,0xFE,0x07, 0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x1B,0xEF,0x00, // 'K' 0x4B,0x01,0x0F,0x12,0x02,0x10, 0xC0,0x71,0x81,0xC3,0x07,0x06,0x1C,0x0C,0x70,0x19,0xC0,0x37,0x00,0x7C,0x00,0xF8,0x01,0xB0,0x03,0x38,0x06,0x38,0x0C,0x38,0x18,0x38,0x30,0x38,0x60,0x38,0xC0,0x39,0x80,0x38, // 'L' 0x4C,0x01,0x0B,0x12,0x02,0x0D, 0xC0,0x18,0x03,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xC0,0x18,0x03,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xFF,0xFF,0xFC, // 'M' 0x4D,0x01,0x10,0x12,0x02,0x15, 0xE0,0x07,0xF0,0x0F,0xF0,0x0F,0xF8,0x1F,0xD8,0x1B,0xD8,0x1B,0xCC,0x33,0xCC,0x33,0xCC,0x33,0xC6,0x63,0xC6,0x63,0xC7,0xE3,0xC3,0xC3,0xC3,0xC3,0xC1,0x83,0xC0,0x03,0xC0,0x03,0xC0,0x03, // 'N' 0x4E,0x01,0x0D,0x12,0x02,0x12, 0xE0,0x1F,0x80,0xFC,0x07,0xF0,0x3D,0x81,0xE6,0x0F,0x30,0x78,0xC3,0xC6,0x1E,0x18,0xF0,0xC7,0x83,0x3C,0x19,0xE0,0x6F,0x03,0x78,0x0F,0xC0,0x7E,0x01,0xC0, // 'O' 0x4F,0x01,0x10,0x12,0x01,0x13, 0x07,0xE0,0x1F,0xF8,0x3C,0x3C,0x70,0x0E,0x60,0x06,0x60,0x06,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0x60,0x06,0x60,0x06,0x70,0x0E,0x3C,0x3C,0x1F,0xF8,0x07,0xE0, // 'P' 0x50,0x01,0x0B,0x12,0x02,0x0E, 0xFF,0x1F,0xFB,0x07,0x60,0x3C,0x07,0x80,0xF0,0x1E,0x0E,0xFF,0xDF,0xE3,0x00,0x60,0x0C,0x01,0x80,0x30,0x06,0x00,0xC0,0x18,0x00, // 'Q' 0x51,0x01,0x10,0x15,0x01,0x13, 0x07,0xE0,0x1F,0xF8,0x3C,0x3C,0x70,0x0E,0x60,0x06,0x60,0x06,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0x60,0x07,0x60,0x06,0x70,0x0E,0x3C,0x3C,0x1F,0xF8,0x07,0xF0,0x00,0x38,0x00,0x18,0x00,0x0C, // 'R' 0x52,0x01,0x0D,0x12,0x02,0x11, 0xFF,0x07,0xFE,0x30,0x31,0x80,0xCC,0x06,0x60,0x33,0x01,0x98,0x18,0xFF,0xC7,0xFC,0x30,0x71,0x81,0x8C,0x06,0x60,0x33,0x01,0xD8,0x06,0xC0,0x36,0x00,0xC0, // 'S' 0x53,0x01,0x0C,0x12,0x02,0x0F, 0x1F,0x87,0xFE,0x70,0x6C,0x00,0xC0,0x0C,0x00,0xC0,0x07,0x00,0x7F,0x01,0xFC,0x00,0xE0,0x07,0x00,0x30,0x03,0x00,0x3C,0x0E,0xFF,0xE3,0xF8, // 'T' 0x54,0x01,0x0E,0x12,0x00,0x0F, 0xFF,0xFF,0xFF,0xF0,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00, // 'U' 0x55,0x01,0x0D,0x12,0x02,0x12, 0xC0,0x1E,0x00,0xF0,0x07,0x80,0x3C,0x01,0xE0,0x0F,0x00,0x78,0x03,0xC0,0x1E,0x00,0xF0,0x07,0x80,0x3C,0x01,0xE0,0x0D,0x80,0xCE,0x0E,0x3F,0xE0,0x7C,0x00, // 'V' 0x56,0x01,0x10,0x12,0x00,0x10, 0xC0,0x03,0x60,0x06,0x60,0x06,0x60,0x06,0x30,0x0C,0x30,0x0C,0x38,0x1C,0x18,0x18,0x18,0x18,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x06,0x60,0x06,0x60,0x07,0x60,0x03,0xC0,0x03,0xC0,0x03,0xC0, // 'W' 0x57,0x01,0x16,0x12,0x01,0x18, 0xC0,0x78,0x0F,0x01,0xE0,0x36,0x07,0x81,0x98,0x1E,0x06,0x60,0xEC,0x19,0x83,0x30,0x63,0x0C,0xC3,0x0C,0x33,0x0C,0x30,0xCE,0x30,0xC6,0x18,0xC1,0x98,0x66,0x06,0x61,0x98,0x19,0x86,0x60,0x6C,0x0D,0x80,0xF0,0x3C,0x03,0xC0,0xF0,0x0F,0x03,0xC0,0x38,0x07,0x00, // 'X' 0x58,0x01,0x0F,0x12,0x01,0x11, 0x70,0x0E,0x60,0x18,0x60,0x60,0xE1,0xC0,0xC7,0x00,0xCC,0x01,0xF0,0x01,0xE0,0x03,0x80,0x07,0x80,0x1F,0x00,0x37,0x00,0xC6,0x03,0x86,0x0E,0x0E,0x18,0x0C,0x60,0x0D,0xC0,0x1C, // 'Y' 0x59,0x01,0x0E,0x12,0x00,0x0F, 0xE0,0x1D,0x80,0x63,0x03,0x0E,0x1C,0x18,0x60,0x33,0x00,0xFC,0x01,0xE0,0x07,0x80,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0xC0,0x03,0x00,0x0C,0x00, // 'Z' 0x5A,0x01,0x0E,0x12,0x01,0x10, 0xFF,0xFF,0xFF,0xF0,0x01,0x80,0x0E,0x00,0x70,0x01,0x80,0x0C,0x00,0x60,0x03,0x80,0x1C,0x00,0x60,0x03,0x00,0x18,0x00,0xE0,0x07,0x00,0x18,0x00,0xFF,0xFF,0xFF,0xF0, // '[' 0x5B,0x01,0x05,0x15,0x02,0x09, 0xFF,0xF1,0x8C,0x63,0x18,0xC6,0x31,0x8C,0x63,0x18,0xC6,0x31,0xFF,0x80, // '\' 0x5C,0x01,0x08,0x14,0x00,0x08, 0xC0,0xE0,0x60,0x60,0x60,0x30,0x30,0x30,0x18,0x18,0x18,0x18,0x0C,0x0C,0x0C,0x06,0x06,0x06,0x07,0x03, // ']' 0x5D,0x01,0x05,0x15,0x02,0x09, 0xFF,0xC6,0x31,0x8C,0x63,0x18,0xC6,0x31,0x8C,0x63,0x18,0xC7,0xFF,0x80, // '^' 0x5E,0x01,0x0F,0x07,0x03,0x14, 0x03,0x80,0x0F,0x80,0x3B,0x80,0xE3,0x83,0x83,0x8E,0x03,0xB8,0x03,0x80, // '_' 0x5F,0x17,0x0C,0x02,0x00,0x0C, 0xFF,0xFF,0xFF, // '`' 0x60,0x00,0x06,0x04,0x02,0x0C, 0x60,0xC1,0x83, // 'a' 0x61,0x06,0x0B,0x0D,0x01,0x0E, 0x3F,0x0F,0xF9,0x03,0x00,0x30,0x06,0x3F,0xDF,0xFF,0x03,0xC0,0x78,0x1F,0x87,0xBF,0xF3,0xE6, // 'b' 0x62,0x01,0x0C,0x12,0x02,0x0F, 0xC0,0x0C,0x00,0xC0,0x0C,0x00,0xC0,0x0C,0xF8,0xFF,0xCF,0x0E,0xE0,0x6C,0x03,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xE0,0x6F,0x0E,0xFF,0xCC,0xF8, // 'c' 0x63,0x06,0x0A,0x0D,0x01,0x0D, 0x0F,0x8F,0xF7,0x05,0x80,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x18,0x07,0x04,0xFF,0x0F,0x80, // 'd' 0x64,0x01,0x0C,0x12,0x01,0x0F, 0x00,0x30,0x03,0x00,0x30,0x03,0x00,0x31,0xF3,0x3F,0xF7,0x0F,0x60,0x7C,0x03,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0x60,0x77,0x0F,0x3F,0xF1,0xF3, // 'e' 0x65,0x06,0x0C,0x0D,0x01,0x0E, 0x0F,0x83,0xFC,0x70,0xE6,0x07,0xC0,0x3F,0xFF,0xFF,0xFC,0x00,0xC0,0x06,0x00,0x70,0x23,0xFE,0x0F,0xC0, // 'f' 0x66,0x01,0x08,0x12,0x01,0x08, 0x0F,0x1F,0x38,0x30,0x30,0xFF,0xFF,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, // 'g' 0x67,0x06,0x0C,0x12,0x01,0x0F, 0x1F,0x33,0xFF,0x70,0xF6,0x07,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x36,0x07,0x70,0xF3,0xFF,0x1F,0x30,0x03,0x00,0x72,0x0E,0x3F,0xC1,0xF8, // 'h' 0x68,0x01,0x0B,0x12,0x02,0x0F, 0xC0,0x18,0x03,0x00,0x60,0x0C,0x01,0x9F,0x3F,0xF7,0x87,0xE0,0x78,0x0F,0x01,0xE0,0x3C,0x07,0x80,0xF0,0x1E,0x03,0xC0,0x78,0x0C, // 'i' 0x69,0x01,0x02,0x12,0x02,0x07, 0xFC,0x3F,0xFF,0xFF,0xF0, // 'j' 0x6A,0x01,0x05,0x17,0xFF,0x07, 0x18,0xC6,0x00,0x0C,0x63,0x18,0xC6,0x31,0x8C,0x63,0x18,0xC6,0x33,0xFB,0x80, // 'k' 0x6B,0x01,0x0C,0x12,0x02,0x0E, 0xC0,0x0C,0x00,0xC0,0x0C,0x00,0xC0,0x0C,0x1C,0xC3,0x8C,0x70,0xCE,0x0D,0xC0,0xF8,0x0F,0x80,0xDC,0x0C,0xE0,0xC7,0x0C,0x38,0xC1,0xCC,0x0E, // 'l' 0x6C,0x01,0x02,0x12,0x02,0x06, 0xFF,0xFF,0xFF,0xFF,0xF0, // 'm' 0x6D,0x06,0x14,0x0D,0x02,0x18, 0xCF,0x87,0xCF,0xFC,0xFE,0xF0,0xF8,0x7E,0x07,0x03,0xC0,0x60,0x3C,0x06,0x03,0xC0,0x60,0x3C,0x06,0x03,0xC0,0x60,0x3C,0x06,0x03,0xC0,0x60,0x3C,0x06,0x03,0xC0,0x60,0x30, // 'n' 0x6E,0x06,0x0B,0x0D,0x02,0x0F, 0xCF,0x9F,0xFB,0xC3,0xF0,0x3C,0x07,0x80,0xF0,0x1E,0x03,0xC0,0x78,0x0F,0x01,0xE0,0x3C,0x06, // 'o' 0x6F,0x06,0x0C,0x0D,0x01,0x0E, 0x1F,0x83,0xFC,0x70,0xE6,0x06,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x36,0x06,0x70,0xE3,0xFC,0x1F,0x80, // 'p' 0x70,0x06,0x0C,0x12,0x02,0x0F, 0xCF,0x8F,0xFC,0xF0,0xEE,0x06,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x3E,0x06,0xF0,0xEF,0xFC,0xCF,0x8C,0x00,0xC0,0x0C,0x00,0xC0,0x0C,0x00, // 'q' 0x71,0x06,0x0C,0x12,0x01,0x0F, 0x1F,0x33,0xFF,0x70,0xF6,0x07,0xC0,0x3C,0x03,0xC0,0x3C,0x03,0xC0,0x36,0x07,0x70,0xF3,0xFF,0x1F,0x30,0x03,0x00,0x30,0x03,0x00,0x30,0x03, // 'r' 0x72,0x06,0x08,0x0D,0x02,0x0A, 0xCF,0xFF,0xF0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, // 's' 0x73,0x06,0x0B,0x0D,0x01,0x0C, 0x3F,0x0F,0xF3,0x82,0x60,0x0C,0x00,0xF0,0x0F,0xC0,0x3C,0x00,0xC0,0x1A,0x07,0x7F,0xC7,0xF0, // 't' 0x74,0x02,0x08,0x11,0x00,0x09, 0x30,0x30,0x30,0x30,0xFF,0xFF,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x1F,0x0F, // 'u' 0x75,0x06,0x0B,0x0D,0x02,0x0F, 0xC0,0x78,0x0F,0x01,0xE0,0x3C,0x07,0x80,0xF0,0x1E,0x03,0xC0,0x78,0x1F,0x87,0xBF,0xF3,0xE6, // 'v' 0x76,0x06,0x0D,0x0D,0x01,0x0F, 0xC0,0x1B,0x01,0x98,0x0C,0xC0,0x63,0x06,0x18,0x30,0x63,0x03,0x18,0x18,0xC0,0x6C,0x03,0x60,0x1F,0x00,0x70,0x00, // 'w' 0x77,0x06,0x12,0x0D,0x01,0x14, 0xC1,0xE0,0xF0,0x78,0x36,0x1E,0x19,0x87,0x86,0x63,0x31,0x9C,0xCC,0xE3,0x33,0x30,0xCC,0xCC,0x36,0x1B,0x07,0x87,0x81,0xE1,0xE0,0x78,0x78,0x1C,0x0E,0x00, // 'x' 0x78,0x06,0x0D,0x0D,0x01,0x0F, 0xE0,0x3B,0x83,0x8E,0x38,0x31,0x80,0xD8,0x07,0xC0,0x1C,0x01,0xF0,0x1D,0xC0,0xC6,0x0C,0x18,0xE0,0xEE,0x03,0x80, // 'y' 0x79,0x06,0x0D,0x12,0x01,0x0F, 0xC0,0x1B,0x01,0x98,0x0C,0xE0,0xE3,0x06,0x18,0x70,0x63,0x03,0x18,0x0D,0x80,0x6C,0x03,0xE0,0x0E,0x00,0x70,0x03,0x00,0x18,0x01,0x80,0x7C,0x03,0xC0,0x00, // 'z' 0x7A,0x06,0x0B,0x0D,0x01,0x0D, 0xFF,0xFF,0xFC,0x03,0x00,0xE0,0x38,0x0E,0x03,0x80,0xE0,0x38,0x0E,0x01,0x80,0x7F,0xFF,0xFE, // '{' 0x7B,0x01,0x09,0x16,0x03,0x0F, 0x03,0x83,0xC3,0x81,0x80,0xC0,0x60,0x30,0x18,0x0C,0x0E,0x3E,0x1F,0x01,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0xC0,0x78,0x1C, // '|' 0x7C,0x01,0x02,0x18,0x03,0x08, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // '}' 0x7D,0x01,0x09,0x16,0x03,0x0F, 0xE0,0x78,0x0E,0x03,0x01,0x80,0xC0,0x60,0x30,0x18,0x0E,0x03,0xE1,0xF1,0xC0,0xC0,0x60,0x30,0x18,0x0C,0x06,0x07,0x0F,0x07,0x00, // '~' 0x7E,0x09,0x0F,0x05,0x03,0x14, 0x00,0x00,0x7C,0x05,0xFE,0x1E,0x1F,0xE0,0x0F,0x80, // Terminator 0xFF };
13,206
597
/* * Copyright (c) 2021 Baidu.com, 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. * * Author: <NAME> (<EMAIL>) */ #include "ip.h" #include <netinet/in.h> #include <arpa/inet.h> #include <sys/types.h> #include <sys/socket.h> int ipaddr_init(ipaddr_t *ip, const char *str) { int ret = 0; int af = -1; memset(ip, 0, sizeof(ipaddr_t)); if (strchr(str, ':')) { af = AF_INET6; ret = inet_pton(af, str, &ip->in6); } else { af = AF_INET; ret = inet_pton(af, str, &ip->ip); } if (ret == 1) { return af; } return -1; } void ipaddr_inc(ipaddr_t *ip, uint32_t n) { uint32_t addr = 0; addr = ntohl(ip->ip) + n; ip->ip = htonl(addr); }
501
678
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/iWorkImport.framework/iWorkImport */ #import <iWorkImport/iWorkImport-Structs.h> #import <iWorkImport/GQDPointPath.h> #import <iWorkImport/GQDPath.h> __attribute__((visibility("hidden"))) @interface GQDPointPath : GQDPath { @private int mType; // 8 = 0x8 CGPoint mPoint; // 12 = 0xc CGSize mSize; // 20 = 0x14 } - (int)type; // 0x50e51 - (CGPoint)point; // 0x50e61 - (CGSize)size; // 0x50e79 - (CGPathRef)createBezierPath; // 0x5107d @end @interface GQDPointPath (Private) - (int)readAttributesFromReader:(xmlTextReader *)reader processor:(id)processor; // 0x514a9 - (int)mapStrType:(CFStringRef)type; // 0x51505 @end
295
1,006
/**************************************************************************** * arch/arm/src/lpc43xx/hardware/lpc43_wwdt.h * * 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 __ARCH_ARM_SRC_LPC43XX_HARDWARE_LPC43_WWDT_H #define __ARCH_ARM_SRC_LPC43XX_HARDWARE_LPC43_WWDT_H /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /* Register offsets *********************************************************/ #define LPC43_WWDT_MOD_OFFSET 0x0000 /* Watchdog mode register */ #define LPC43_WWDT_TC_OFFSET 0x0004 /* Watchdog timer constant register */ #define LPC43_WWDT_FEED_OFFSET 0x0008 /* Watchdog feed sequence register */ #define LPC43_WWDT_TV_OFFSET 0x000c /* Watchdog timer value register */ #define LPC43_WWDT_WARNINT_OFFSET 0x0014 /* Watchdog warning interrupt register */ #define LPC43_WWDT_WINDOW_OFFSET 0x0018 /* Watchdog timer window register */ /* Register addresses *******************************************************/ #define LPC43_WWDT_MOD (LPC43_WWDT_BASE+LPC43_WWDT_MOD_OFFSET) #define LPC43_WWDT_TC (LPC43_WWDT_BASE+LPC43_WWDT_TC_OFFSET) #define LPC43_WWDT_FEED (LPC43_WWDT_BASE+LPC43_WWDT_FEED_OFFSET) #define LPC43_WWDT_TV (LPC43_WWDT_BASE+LPC43_WWDT_TV_OFFSET) #define LPC43_WWDT_WDCLKSEL (LPC43_WWDT_BASE+LPC43_WWDT_WDCLKSEL_OFFSET) #define LPC43_WWDT_WARNINT (LPC43_WWDT_BASE+LPC43_WWDT_WARNINT_OFFSET) #define LPC43_WWDT_WINDOW (LPC43_WWDT_BASE+LPC43_WWDT_WINDOW_OFFSET) /* Register bit definitions *************************************************/ /* Watchdog mode register */ #define WWDT_MOD_WDEN (1 << 0) /* Bit 0: Watchdog enable */ #define WWDT_MOD_WDRESET (1 << 1) /* Bit 1: Watchdog reset enable */ #define WWDT_MOD_WDTOF (1 << 2) /* Bit 2: Watchdog time-out */ #define WWDT_MOD_WDINT (1 << 3) /* Bit 3: Watchdog interrupt */ #define WWDT_MOD_WDPROTECT (1 << 4) /* Bit 4: Watchdog update mode */ /* Bits 5-31: Reserved */ /* Watchdog timer constant register */ #define WWDT_TC_MASK 0x00ffffff /* Bits 0-23: Watchdog time-out value */ /* Bits 24-31: Reserved */ /* Watchdog feed sequence register */ #define WWDT_FEED_MASK 0xff /* Bits 0-7: Feed value: 0xaa followed by 0x55 */ /* Bits 14-31: Reserved */ /* Watchdog timer value register */ #define WWDT_TV_MASK 0x00ffffff /* Bits 0-23: Counter timer value */ /* Bits 24-31: Reserved */ /* Watchdog warning interrupt register */ #define WWDT_WARNINT_MASK 0x03ff /* Bits 0-9: Watchdog warning compare value */ /* Bits 10-31: Reserved */ /* Watchdog timer window register */ #define WWDT_WINDOW_MASK 0x00ffffff /* Bits 0-23: Watchdog window value */ /* Bits 24-31: Reserved */ /**************************************************************************** * Public Types ****************************************************************************/ /**************************************************************************** * Public Data ****************************************************************************/ /**************************************************************************** * Public Functions Prototypes ****************************************************************************/ #endif /* __ARCH_ARM_SRC_LPC43XX_HARDWARE_LPC43_WWDT_H */
1,748
529
<gh_stars>100-1000 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include <tinyhal.h> #include <usart_decl.h> #include "..\Log\Log.h" #ifndef _UART_NMT_ #define _UART_NMT_ 1 #define BUFFER_SIZE 8 #define FlowCtrlNone USART_FLOW_NONE #define FlowCtrlSW USART_FLOW_SW_IN_EN | USART_FLOW_SW_OUT_EN #define FlowCtrlHW USART_FLOW_HW_IN_EN | USART_FLOW_HW_OUT_EN typedef struct _UART : Log { int ComPort; // Com port, begins at 0 int BaudRate; //{1200, 9600, 57600, 115200, 230400, ...}; int Parity; int Stop; // Stop bit int Data; // Data bit int FlowValue; char XmitBuffer[BUFFER_SIZE]; char RecvBuffer[BUFFER_SIZE]; _UART(int ComNum, int BaudNum, int ParityNum, int StopNum, int DataNum, int FlowNum) { ComPort = ComNum; BaudRate = BaudNum; Parity = ParityNum; Stop = StopNum; Data = DataNum; FlowValue = FlowNum; InitXmitBuffer(); }; BOOL UART_Transmit(char *, int, int); BOOL UART_Receive(char *, int, int); BOOL UARTTest(NMT_STREAM Stream) { Log::Result=false; // // Initialize the Log object // Initialize(Stream); BeginTest("UART"); if (!USART_Initialize(ComPort, BaudRate, Parity, Stop, Data, FlowValue )) { return false; } if (UART_Transmit(XmitBuffer,BUFFER_SIZE, 3) && UART_Receive(RecvBuffer,BUFFER_SIZE, 3)) { Log::Result = Validate(BUFFER_SIZE); } EndTest(Log::Result); return Result; }; INT8 SomeValue(int i) { return ((i + 0x80) % 0x100); } BOOL Validate(int CountReceived) { if (CountReceived > BUFFER_SIZE) CountReceived = BUFFER_SIZE; for(INT16 i=0; i<CountReceived; i++) { if (RecvBuffer[i] != (char) SomeValue(i) ) { return false; } } return true; }; void InitXmitBuffer() { // // Initialize entire buffer in strips of 128-255 // for(INT16 i=0; i<BUFFER_SIZE; i++) XmitBuffer[i] = SomeValue(i); }; } UART; #endif
1,398
1,444
<gh_stars>1000+ package mage.cards.s; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ForecastAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** * * @author emerald000 */ public final class SkyHussar extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped white and/or blue creatures you control"); static { filter.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.BLUE))); filter.add(TappedPredicate.UNTAPPED); } public SkyHussar(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.KNIGHT); this.power = new MageInt(4); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // When Sky Hussar enters the battlefield, untap all creatures you control. this.addAbility(new EntersBattlefieldTriggeredAbility(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control"), false)); // Forecast - Tap two untapped white and/or blue creatures you control, Reveal Sky Hussar from your hand: Draw a card. this.addAbility(new ForecastAbility(new DrawCardSourceControllerEffect(1), new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, true)))); } private SkyHussar(final SkyHussar card) { super(card); } @Override public SkyHussar copy() { return new SkyHussar(this); } }
806
852
import FWCore.ParameterSet.Config as cms from PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi import * from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import * from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import * from PhysicsTools.PatAlgos.recoLayer0.pfParticleSelectionForIso_cff import * from PhysicsTools.PatAlgos.recoLayer0.pfMuonIsolationPAT_cff import * sourceMuons = patMuons.muonSource muPFIsoDepositChargedPAT.src = sourceMuons muPFIsoDepositChargedAllPAT.src = sourceMuons muPFIsoDepositNeutralPAT.src = sourceMuons muPFIsoDepositGammaPAT.src = sourceMuons muPFIsoDepositPUPAT.src = sourceMuons patMuons.isoDeposits = cms.PSet( pfChargedHadrons = cms.InputTag("muPFIsoDepositChargedPAT" ), pfChargedAll = cms.InputTag("muPFIsoDepositChargedAllPAT" ), pfPUChargedHadrons = cms.InputTag("muPFIsoDepositPUPAT" ), pfNeutralHadrons = cms.InputTag("muPFIsoDepositNeutralPAT" ), pfPhotons = cms.InputTag("muPFIsoDepositGammaPAT" ), ) patMuons.isolationValues = cms.PSet( pfChargedHadrons = cms.InputTag("muPFIsoValueCharged04PAT"), pfChargedAll = cms.InputTag("muPFIsoValueChargedAll04PAT"), pfPUChargedHadrons = cms.InputTag("muPFIsoValuePU04PAT" ), pfNeutralHadrons = cms.InputTag("muPFIsoValueNeutral04PAT" ), pfPhotons = cms.InputTag("muPFIsoValueGamma04PAT" ), ) ## for scheduled mode makePatMuonsTask = cms.Task( pfParticleSelectionForIsoTask, muonPFIsolationPATTask, muonMatch, patMuons ) makePatMuons = cms.Sequence(makePatMuonsTask)
646
7,517
<gh_stars>1000+ from .Vimeo_90K_interp import Vimeo_90K_interp __all__ = ( 'Vimeo_90K_interp', ) # Vimeo_90K = "/tmp4/wenbobao_data/vimeo_triplet"
84
353
<reponame>MiheevN/USharp CSEXPORT UField* CSCONV Export_UStruct_Get_Children(UStruct* instance) { return instance->Children; } CSEXPORT void CSCONV Export_UStruct_Set_Children(UStruct* instance, UField* value) { instance->Children = value; } CSEXPORT int32 CSCONV Export_UStruct_Get_PropertiesSize(UStruct* instance) { return instance->PropertiesSize; } CSEXPORT void CSCONV Export_UStruct_Set_PropertiesSize(UStruct* instance, int32 value) { instance->PropertiesSize = value; } CSEXPORT TArray<uint8>& CSCONV Export_UStruct_Get_Script(UStruct* instance) { return instance->Script; } CSEXPORT void CSCONV Export_UStruct_Set_Script(UStruct* instance, TArray<uint8>& value) { instance->Script = value; } CSEXPORT int32 CSCONV Export_UStruct_Get_MinAlignment(UStruct* instance) { return instance->MinAlignment; } CSEXPORT void CSCONV Export_UStruct_Set_MinAlignment(UStruct* instance, int32 value) { instance->MinAlignment = value; } CSEXPORT UProperty* CSCONV Export_UStruct_Get_PropertyLink(UStruct* instance) { return instance->PropertyLink; } CSEXPORT void CSCONV Export_UStruct_Set_PropertyLink(UStruct* instance, UProperty* value) { instance->PropertyLink = value; } CSEXPORT UProperty* CSCONV Export_UStruct_Get_RefLink(UStruct* instance) { return instance->RefLink; } CSEXPORT void CSCONV Export_UStruct_Set_RefLink(UStruct* instance, UProperty* value) { instance->RefLink = value; } CSEXPORT UProperty* CSCONV Export_UStruct_Get_DestructorLink(UStruct* instance) { return instance->DestructorLink; } CSEXPORT void CSCONV Export_UStruct_Set_DestructorLink(UStruct* instance, UProperty* value) { instance->DestructorLink = value; } CSEXPORT UProperty* CSCONV Export_UStruct_Get_PostConstructLink(UStruct* instance) { return instance->PostConstructLink; } CSEXPORT void CSCONV Export_UStruct_Set_PostConstructLink(UStruct* instance, UProperty* value) { instance->PropertyLink = value; } CSEXPORT TArray<UObject*>& CSCONV Export_UStruct_Get_ScriptObjectReferences(UStruct* instance) { return instance->ScriptObjectReferences; } CSEXPORT void CSCONV Export_UStruct_Set_ScriptObjectReferences(UStruct* instance, TArray<UObject*>& value) { instance->ScriptObjectReferences = value; } CSEXPORT void CSCONV Export_UStruct_AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector) { UStruct::AddReferencedObjects(InThis, Collector); } CSEXPORT UProperty* CSCONV Export_UStruct_FindPropertyByName(UStruct* instance, const FName& Name) { return instance->FindPropertyByName(Name); } CSEXPORT void CSCONV Export_UStruct_InstanceSubobjectTemplates(UStruct* instance, void* Data, void const* DefaultData, UStruct* DefaultStruct, UObject* Owner, FObjectInstancingGraph* InstanceGraph) { instance->InstanceSubobjectTemplates(Data, DefaultData, DefaultStruct, Owner, InstanceGraph); } CSEXPORT UStruct* CSCONV Export_UStruct_GetInheritanceSuper(UStruct* instance) { return instance->GetInheritanceSuper(); } CSEXPORT void CSCONV Export_UStruct_StaticLink(UStruct* instance, csbool bRelinkExistingProperties) { instance->StaticLink(!!bRelinkExistingProperties); } CSEXPORT void CSCONV Export_UStruct_Link(UStruct* instance, FArchive& Ar, csbool bRelinkExistingProperties) { instance->Link(Ar, !!bRelinkExistingProperties); } CSEXPORT void CSCONV Export_UStruct_SerializeBin(UStruct* instance, FArchive& Ar, void* Data) { instance->SerializeBin(Ar, Data); } CSEXPORT void CSCONV Export_UStruct_SerializeTaggedProperties(UStruct* instance, FArchive& Ar, uint8* Data, UStruct* DefaultsStruct, uint8* Defaults, const UObject* BreakRecursionIfFullyLoad) { instance->SerializeTaggedProperties(Ar, Data, DefaultsStruct, Defaults, BreakRecursionIfFullyLoad); } CSEXPORT void CSCONV Export_UStruct_InitializeStruct(UStruct* instance, void* Dest, int32 ArrayDim) { instance->InitializeStruct(Dest, ArrayDim); } CSEXPORT void CSCONV Export_UStruct_DestroyStruct(UStruct* instance, void* Dest, int32 ArrayDim) { instance->DestroyStruct(Dest, ArrayDim); } CSEXPORT EExprToken CSCONV Export_UStruct_SerializeExpr(UStruct* instance, int32& iCode, FArchive& Ar) { return instance->SerializeExpr(iCode, Ar); } CSEXPORT void CSCONV Export_UStruct_TagSubobjects(UStruct* instance, EObjectFlags NewFlags) { instance->TagSubobjects(NewFlags); } CSEXPORT void CSCONV Export_UStruct_GetPrefixCPP(UStruct* instance, FString& result) { result = instance->GetPrefixCPP(); } CSEXPORT int32 CSCONV Export_UStruct_GetPropertiesSize(UStruct* instance) { return instance->GetPropertiesSize(); } CSEXPORT int32 CSCONV Export_UStruct_GetMinAlignment(UStruct* instance) { return instance->GetMinAlignment(); } CSEXPORT int32 CSCONV Export_UStruct_GetStructureSize(UStruct* instance) { return instance->GetStructureSize(); } CSEXPORT void CSCONV Export_UStruct_SetPropertiesSize(UStruct* instance, int32 NewSize) { return instance->SetPropertiesSize(NewSize); } CSEXPORT csbool CSCONV Export_UStruct_IsChildOf(UStruct* instance, const UStruct* SomeBase) { return instance->IsChildOf(SomeBase); } CSEXPORT UStruct* CSCONV Export_UStruct_GetSuperStruct(UStruct* instance) { return instance->GetSuperStruct(); } CSEXPORT void CSCONV Export_UStruct_SetSuperStruct(UStruct* instance, UStruct* NewSuperStruct) { instance->SetSuperStruct(NewSuperStruct); } #if WITH_EDITOR CSEXPORT csbool CSCONV Export_UStruct_GetBoolMetaDataHierarchical(UStruct* instance, const FName& Key) { return instance->GetBoolMetaDataHierarchical(Key); } CSEXPORT csbool CSCONV Export_UStruct_GetStringMetaDataHierarchical(UStruct* instance, const FName& Key, FString* OutValue) { return instance->GetStringMetaDataHierarchical(Key, OutValue); } #endif CSEXPORT void CSCONV Export_UStruct(RegisterFunc registerFunc) { REGISTER_FUNC(Export_UStruct_Get_Children); REGISTER_FUNC(Export_UStruct_Set_Children); REGISTER_FUNC(Export_UStruct_Get_PropertiesSize); REGISTER_FUNC(Export_UStruct_Set_PropertiesSize); REGISTER_FUNC(Export_UStruct_Get_Script); REGISTER_FUNC(Export_UStruct_Set_Script); REGISTER_FUNC(Export_UStruct_Get_MinAlignment); REGISTER_FUNC(Export_UStruct_Set_MinAlignment); REGISTER_FUNC(Export_UStruct_Get_PropertyLink); REGISTER_FUNC(Export_UStruct_Set_PropertyLink); REGISTER_FUNC(Export_UStruct_Get_RefLink); REGISTER_FUNC(Export_UStruct_Set_RefLink); REGISTER_FUNC(Export_UStruct_Get_DestructorLink); REGISTER_FUNC(Export_UStruct_Set_DestructorLink); REGISTER_FUNC(Export_UStruct_Get_PostConstructLink); REGISTER_FUNC(Export_UStruct_Set_PostConstructLink); REGISTER_FUNC(Export_UStruct_Get_ScriptObjectReferences); REGISTER_FUNC(Export_UStruct_Set_ScriptObjectReferences); REGISTER_FUNC(Export_UStruct_AddReferencedObjects); REGISTER_FUNC(Export_UStruct_FindPropertyByName); REGISTER_FUNC(Export_UStruct_InstanceSubobjectTemplates); REGISTER_FUNC(Export_UStruct_GetInheritanceSuper); REGISTER_FUNC(Export_UStruct_StaticLink); REGISTER_FUNC(Export_UStruct_Link); REGISTER_FUNC(Export_UStruct_SerializeBin); REGISTER_FUNC(Export_UStruct_SerializeTaggedProperties); REGISTER_FUNC(Export_UStruct_InitializeStruct); REGISTER_FUNC(Export_UStruct_DestroyStruct); REGISTER_FUNC(Export_UStruct_SerializeExpr); REGISTER_FUNC(Export_UStruct_TagSubobjects); REGISTER_FUNC(Export_UStruct_GetPrefixCPP); REGISTER_FUNC(Export_UStruct_GetPropertiesSize); REGISTER_FUNC(Export_UStruct_GetMinAlignment); REGISTER_FUNC(Export_UStruct_GetStructureSize); REGISTER_FUNC(Export_UStruct_SetPropertiesSize); REGISTER_FUNC(Export_UStruct_IsChildOf); REGISTER_FUNC(Export_UStruct_GetSuperStruct); REGISTER_FUNC(Export_UStruct_SetSuperStruct); #if WITH_EDITOR REGISTER_FUNC(Export_UStruct_GetBoolMetaDataHierarchical); REGISTER_FUNC(Export_UStruct_GetStringMetaDataHierarchical); #endif }
2,764
1,099
package com.example.commonlibrary.keeplive.service; import android.app.job.JobInfo; import android.app.job.JobScheduler; import android.content.ComponentName; import android.content.Context; import android.os.Build; import android.os.PersistableBundle; import com.example.commonlibrary.BaseApplication; import com.example.commonlibrary.utils.CommonLogger; import androidx.annotation.RequiresApi; /** * 项目名称: NewFastFrame * 创建人: 陈锦军 * 创建时间: 2018/12/10 15:18 */ public class JobSchedulerManager { public static final String PENDING_CLASS_NAME = "className"; private static final int JOB_ID = 20; private static JobSchedulerManager sJobSchedulerManager; private final JobScheduler jobScheduleer; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static JobSchedulerManager getJobSchedulerManager() { if (sJobSchedulerManager == null) { sJobSchedulerManager = new JobSchedulerManager(); } return sJobSchedulerManager; } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private JobSchedulerManager() { jobScheduleer = (JobScheduler) BaseApplication.getInstance().getSystemService(Context.JOB_SCHEDULER_SERVICE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void startJobScheduler(String className) { if (AliveJobService.isLive() || isBelowLOLLIPOP()) { return; } jobScheduleer.cancel(JOB_ID); // 构建JobInfo对象,传递给JobSchedulerService JobInfo.Builder builder = new JobInfo.Builder(JOB_ID, new ComponentName(BaseApplication.getInstance(), AliveJobService.class)); if (Build.VERSION.SDK_INT >= 24) { builder.setMinimumLatency(JobInfo.DEFAULT_INITIAL_BACKOFF_MILLIS); //执行的最小延迟时间 builder.setOverrideDeadline(JobInfo.DEFAULT_INITIAL_BACKOFF_MILLIS); //执行的最长延时时间 builder.setMinimumLatency(JobInfo.DEFAULT_INITIAL_BACKOFF_MILLIS); builder.setBackoffCriteria(JobInfo.DEFAULT_INITIAL_BACKOFF_MILLIS, JobInfo.BACKOFF_POLICY_LINEAR);//线性重试方案 } else { builder.setPeriodic(JobInfo.DEFAULT_INITIAL_BACKOFF_MILLIS); } builder.setPersisted(true); // 设置设备重启时,执行该任务 builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY); builder.setRequiresCharging(true); // 当插入充电器,执行该任务 // 设置设备重启时,执行该任务 builder.setPersisted(true); // 当插入充电器,执行该任务 builder.setRequiresCharging(true); PersistableBundle persistableBundle = new PersistableBundle(); persistableBundle.putString(PENDING_CLASS_NAME, className); builder.setExtras(persistableBundle); JobInfo info = builder.build(); //开始定时执行该系统任务 int result = jobScheduleer.schedule(info); if (result == JobScheduler.RESULT_FAILURE) { CommonLogger.e("jobService启动失败"); } else { CommonLogger.e("jobService启动成功"); } } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void stopJobScheduler() { if (isBelowLOLLIPOP()) return; jobScheduleer.cancelAll(); } private boolean isBelowLOLLIPOP() { return Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP; } }
1,578
5,535
<gh_stars>1000+ /*------------------------------------------------------------------------- * * extaccess.h * external table access method definitions. * * Portions Copyright (c) 2007-2008, Greenplum inc * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates. * * * IDENTIFICATION * gpcontrib/gp_exttable_fdw/extaccess.h * *------------------------------------------------------------------------- */ #ifndef EXT_ACCESS_H #define EXT_ACCESS_H #include "access/formatter.h" #include "access/sdir.h" #include "access/url.h" #include "utils/rel.h" /* * ExternalInsertDescData is used for storing state related * to inserting data into a writable external table. */ typedef struct ExternalInsertDescData { Relation ext_rel; URL_FILE *ext_file; char *ext_uri; /* "command:<cmd>" or "tablespace:<path>" */ bool ext_noop; /* no op. this segdb needs to do nothing (e.g. * mirror seg) */ TupleDesc ext_tupDesc; FmgrInfo *ext_custom_formatter_func; /* function to convert to custom format */ List *ext_custom_formatter_params; /* list of defelems that hold user's format parameters */ FormatterData *ext_formatter_data; struct CopyStateData *ext_pstate; /* data parser control chars and state */ } ExternalInsertDescData; typedef ExternalInsertDescData *ExternalInsertDesc; /* * ExternalSelectDescData is used for storing state related * to selecting data from an external table. */ typedef struct ExternalSelectDescData { ProjectionInfo *projInfo; /* Information for column projection */ List *filter_quals; /* Information for filter pushdown */ } ExternalSelectDescData; /* * used for scan of external relations with the file protocol */ typedef struct FileScanDescData { /* scan parameters */ Relation fs_rd; /* target relation descriptor */ struct URL_FILE *fs_file; /* the file pointer to our URI */ char *fs_uri; /* the URI string */ bool fs_noop; /* no op. this segdb has no file to scan */ uint32 fs_scancounter; /* copied from struct ExternalScan in plan */ /* current file parse state */ struct CopyStateData *fs_pstate; AttrNumber num_phys_attrs; Datum *values; bool *nulls; FmgrInfo *in_functions; Oid *typioparams; Oid in_func_oid; /* current file scan state */ TupleDesc fs_tupDesc; HeapTupleData fs_ctup; /* current tuple in scan, if any */ /* custom data formatter */ FmgrInfo *fs_custom_formatter_func; /* function to convert to custom format */ List *fs_custom_formatter_params; /* list of defelems that hold user's format parameters */ FormatterData *fs_formatter; /* CHECK constraints and partition check quals, if any */ bool fs_hasConstraints; struct ExprState **fs_constraintExprs; bool fs_isPartition; struct ExprState *fs_partitionCheckExpr; } FileScanDescData; typedef FileScanDescData *FileScanDesc; typedef enum DataLineStatus { LINE_OK, LINE_ERROR, NEED_MORE_DATA, END_MARKER } DataLineStatus; extern FileScanDesc external_beginscan(Relation relation, uint32 scancounter, List *uriList, char fmtType, bool isMasterOnly, int rejLimit, bool rejLimitInRows, char logErrors, int encoding, List *extOptions); extern void external_rescan(FileScanDesc scan); extern void external_endscan(FileScanDesc scan); extern void external_stopscan(FileScanDesc scan); extern ExternalSelectDesc external_getnext_init(PlanState *state); extern HeapTuple external_getnext(FileScanDesc scan, ScanDirection direction, ExternalSelectDesc desc); extern ExternalInsertDesc external_insert_init(Relation rel); extern void external_insert(ExternalInsertDesc extInsertDesc, TupleTableSlot *slot); extern void external_insert_finish(ExternalInsertDesc extInsertDesc); extern List *appendCopyEncodingOption(List *copyFmtOpts, int encoding); #endif /* EXT_ACCESS_H */
1,310
2,542
<gh_stars>1000+ //---------------------------------------------------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------------------------------------------------- #pragma once namespace Reliability { class AvailableContainerImagesMessageBody : public Serialization::FabricSerializable { DENY_COPY(AvailableContainerImagesMessageBody); public: AvailableContainerImagesMessageBody() { } AvailableContainerImagesMessageBody( std::wstring const & nodeId, std::vector<wstring> const & availableImages) : nodeId_(nodeId), availableImages_(availableImages) { } __declspec (property(get = get_NodeId)) std::wstring const & NodeId; std::wstring const & get_NodeId() const { return nodeId_; } __declspec (property(get = get_AvailableImages)) std::vector<wstring> const & AvailableImages; std::vector<wstring> const & get_AvailableImages() const { return availableImages_; } void WriteTo(Common::TextWriter & w, Common::FormatOptions const &) const { w.WriteLine("{0} {1}", nodeId_, availableImages_); } FABRIC_FIELDS_02(nodeId_, availableImages_); private: std::wstring nodeId_; std::vector<wstring> availableImages_; }; }
525
720
<reponame>ioana-nicolae/java_new_name package com.pubnub.api.models.consumer.access_manager.v3; import lombok.Data; @Data public class PNRevokeTokenResult { }
64
1,831
/** * Copyright (c) 2018-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <zstd.h> #include <folly/Range.h> #include "logdevice/common/ThriftCodec.h" #include "logdevice/common/configuration/utils/gen-cpp2/ConfigurationCodec_types.h" #include "logdevice/common/debug.h" #include "logdevice/common/protocol/ProtocolWriter.h" #include "logdevice/include/Err.h" #include "thrift/lib/cpp2/protocol/BinaryProtocol.h" #include "thrift/lib/cpp2/protocol/Serializer.h" namespace facebook { namespace logdevice { namespace configuration { /** * @file ConfigurationCodec is the template class that provides a thrift-based * serialiation wrapper for a configuration type with existing thrift * serialization definitions. It provides the additional features: * 1) support compression (currently zstd is supported); * 2) support extracting config version without fully deserializting the whole * config; 3) TODO: full protocol version support for implementing compatibility * that thrift is not able to handle (e.g., adding enum values) * * Type parameters: * ConfigurationType: type of the configuration object. Must have a * getVersion() method that returns a version of * ConfigurationVersionType. * ConfigurationVersionType: type of the config version. Must be 64 bit. * ThriftConverter: class that handles serde of the configuration from/to * thrift. must define the following method/alias: * 1. define ThriftConfigType alias for the thrift type of * the configuraiton * 2. ThriftConfigType toThrift(const ConfigurationType&); * 3. std::shared_ptr<ConfigurationType> fromThrift( * const ThriftConfigType& obj); */ template <typename ConfigurationType, typename ConfigurationVersionType, typename ThriftConverter, uint32_t CURRENT_PROTO = 1> class ConfigurationCodec { public: using ProtocolVersion = uint32_t; // Will be prepended to the serialized configuration for forward and // backward compatibility; // // Note: normally backward and forward compatibility should be handled // by thrift itself. This version is only needed when extra compatibility // handling (e.g., adding a new enum value of an existing enum class) is // needed. static constexpr ProtocolVersion CURRENT_PROTO_VERSION = CURRENT_PROTO; struct SerializeOptions { // use zstd to compress the configuration data blob bool compression; }; /** * Serializes the object into the buffer handled by ProtocoWriter. * * @return nothing is returned. But if there is an error on serialization, * @param writer should enter error state (i.e., writer.error() * == true). */ static void serialize(const ConfigurationType& config, ProtocolWriter& writer, SerializeOptions options = {true}); // convenience wrappers for serialization / deserialization with linear buffer // such as strings. If a serialization error occurs, returns an empty string. static std::string serialize(const ConfigurationType& config, SerializeOptions options = {true}); static std::string debugJsonString(const ConfigurationType& config); static std::shared_ptr<const ConfigurationType> deserialize(Slice buf); static std::shared_ptr<const ConfigurationType> deserialize(folly::StringPiece buf); // extract the configuration version from the thrift wrapper header without // deserialize the entire config static folly::Optional<ConfigurationVersionType> extractConfigVersion(folly::StringPiece serialized_data); static_assert(sizeof(ConfigurationVersionType) == 8, "ConfigurationVersionType must be 64 bit"); static_assert( sizeof(*thrift::ConfigurationCodecHeader().config_version_ref()) == sizeof(ConfigurationVersionType), ""); static_assert( sizeof(*thrift::ConfigurationCodecHeader().proto_version_ref()) == sizeof(ProtocolVersion), ""); }; }}} // namespace facebook::logdevice::configuration #define LOGDEVICE_CONFIGURATION_CODEC_H_ #include "logdevice/common/configuration/utils/ConfigurationCodec-inl.h" #undef LOGDEVICE_CONFIGURATION_CODEC_H_
1,493
1,093
/** * Provides classes representing outbound RSocket components. */ @org.springframework.lang.NonNullApi package org.springframework.integration.rsocket.outbound;
44
348
<filename>docs/data/leg-t2/031/03108538.json {"nom":"Savères","circ":"8ème circonscription","dpt":"Haute-Garonne","inscrits":172,"abs":74,"votants":98,"blancs":7,"nuls":6,"exp":85,"res":[{"nuance":"SOC","nom":"M. <NAME>","voix":51},{"nuance":"REM","nom":"M. <NAME>","voix":34}]}
118
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_SIM_ADDP_2S_TRACE_AARCH64_H_ #define VIXL_SIM_ADDP_2S_TRACE_AARCH64_H_ const uint32_t kExpected_NEON_addp_2S[] = { 0x0000fd00, 0x0000fd00, 0x00000000, 0x00000000, 0x0000fd00, 0x00807c00, 0x00000000, 0x00000000, 0x0000fd00, 0x007ffd00, 0x00000000, 0x00000000, 0x0000fd00, 0x00000001, 0x00000000, 0x00000000, 0x0000fd00, 0x00000003, 0x00000000, 0x00000000, 0x0000fd00, 0x00000022, 0x00000000, 0x00000000, 0x0000fd00, 0x0000009d, 0x00000000, 0x00000000, 0x0000fd00, 0x000000fb, 0x00000000, 0x00000000, 0x0000fd00, 0x000000fd, 0x00000000, 0x00000000, 0x0000fd00, 0x0000807c, 0x00000000, 0x00000000, 0x0000fd00, 0x0000fffb, 0x00000000, 0x00000000, 0x0000fd00, 0x0000fffd, 0x00000000, 0x00000000, 0x0000fd00, 0x3333b332, 0x00000000, 0x00000000, 0x0000fd00, 0x88888888, 0x00000000, 0x00000000, 0x0000fd00, 0xd5555552, 0x00000000, 0x00000000, 0x0000fd00, 0xfffffffb, 0x00000000, 0x00000000, 0x0000fd00, 0xfffffffd, 0x00000000, 0x00000000, 0x0000fd00, 0xffffffff, 0x00000000, 0x00000000, 0x0000fd00, 0x00000001, 0x00000000, 0x00000000, 0x0000fd00, 0x2aaaaaab, 0x00000000, 0x00000000, 0x0000fd00, 0x77777776, 0x00000000, 0x00000000, 0x0000fd00, 0xcccc4ccc, 0x00000000, 0x00000000, 0x0000fd00, 0xffff0001, 0x00000000, 0x00000000, 0x0000fd00, 0xffff0003, 0x00000000, 0x00000000, 0x0000fd00, 0xffff0005, 0x00000000, 0x00000000, 0x0000fd00, 0xffff7f83, 0x00000000, 0x00000000, 0x0000fd00, 0xffffff01, 0x00000000, 0x00000000, 0x0000fd00, 0xffffff03, 0x00000000, 0x00000000, 0x0000fd00, 0xffffff05, 0x00000000, 0x00000000, 0x0000fd00, 0xffffff63, 0x00000000, 0x00000000, 0x0000fd00, 0xffffffdd, 0x00000000, 0x00000000, 0x00807c00, 0xfffffffb, 0x00000000, 0x00000000, 0x00807c00, 0xfffffffd, 0x00000000, 0x00000000, 0x00807c00, 0xffffffff, 0x00000000, 0x00000000, 0x00807c00, 0x00000001, 0x00000000, 0x00000000, 0x00807c00, 0x00000003, 0x00000000, 0x00000000, 0x00807c00, 0x00000022, 0x00000000, 0x00000000, 0x00807c00, 0x0000009d, 0x00000000, 0x00000000, 0x00807c00, 0x000000fb, 0x00000000, 0x00000000, 0x00807c00, 0x000000fd, 0x00000000, 0x00000000, 0x00807c00, 0x0000807c, 0x00000000, 0x00000000, 0x00807c00, 0x0000fffb, 0x00000000, 0x00000000, 0x00807c00, 0x0000fffd, 0x00000000, 0x00000000, 0x00807c00, 0x3333b332, 0x00000000, 0x00000000, 0x00807c00, 0x88888888, 0x00000000, 0x00000000, 0x00807c00, 0xd5555552, 0x00000000, 0x00000000, 0x00807c00, 0xfffffffb, 0x00000000, 0x00000000, 0x00807c00, 0xfffffffd, 0x00000000, 0x00000000, 0x00807c00, 0xffffffff, 0x00000000, 0x00000000, 0x00807c00, 0x00000001, 0x00000000, 0x00000000, 0x00807c00, 0x2aaaaaab, 0x00000000, 0x00000000, 0x00807c00, 0x77777776, 0x00000000, 0x00000000, 0x00807c00, 0xcccc4ccc, 0x00000000, 0x00000000, 0x00807c00, 0xffff0001, 0x00000000, 0x00000000, 0x00807c00, 0xffff0003, 0x00000000, 0x00000000, 0x00807c00, 0xffff0005, 0x00000000, 0x00000000, 0x00807c00, 0xffff7f83, 0x00000000, 0x00000000, 0x00807c00, 0xffffff01, 0x00000000, 0x00000000, 0x00807c00, 0xffffff03, 0x00000000, 0x00000000, 0x00807c00, 0xffffff05, 0x00000000, 0x00000000, 0x00807c00, 0xffffff63, 0x00000000, 0x00000000, 0x00807c00, 0xffffffdd, 0x00000000, 0x00000000, 0x007ffd00, 0xfffffffb, 0x00000000, 0x00000000, 0x007ffd00, 0xfffffffd, 0x00000000, 0x00000000, 0x007ffd00, 0xffffffff, 0x00000000, 0x00000000, 0x007ffd00, 0x00000001, 0x00000000, 0x00000000, 0x007ffd00, 0x00000003, 0x00000000, 0x00000000, 0x007ffd00, 0x00000022, 0x00000000, 0x00000000, 0x007ffd00, 0x0000009d, 0x00000000, 0x00000000, 0x007ffd00, 0x000000fb, 0x00000000, 0x00000000, 0x007ffd00, 0x000000fd, 0x00000000, 0x00000000, 0x007ffd00, 0x0000807c, 0x00000000, 0x00000000, 0x007ffd00, 0x0000fffb, 0x00000000, 0x00000000, 0x007ffd00, 0x0000fffd, 0x00000000, 0x00000000, 0x007ffd00, 0x3333b332, 0x00000000, 0x00000000, 0x007ffd00, 0x88888888, 0x00000000, 0x00000000, 0x007ffd00, 0xd5555552, 0x00000000, 0x00000000, 0x007ffd00, 0xfffffffb, 0x00000000, 0x00000000, 0x007ffd00, 0xfffffffd, 0x00000000, 0x00000000, 0x007ffd00, 0xffffffff, 0x00000000, 0x00000000, 0x007ffd00, 0x00000001, 0x00000000, 0x00000000, 0x007ffd00, 0x2aaaaaab, 0x00000000, 0x00000000, 0x007ffd00, 0x77777776, 0x00000000, 0x00000000, 0x007ffd00, 0xcccc4ccc, 0x00000000, 0x00000000, 0x007ffd00, 0xffff0001, 0x00000000, 0x00000000, 0x007ffd00, 0xffff0003, 0x00000000, 0x00000000, 0x007ffd00, 0xffff0005, 0x00000000, 0x00000000, 0x007ffd00, 0xffff7f83, 0x00000000, 0x00000000, 0x007ffd00, 0xffffff01, 0x00000000, 0x00000000, 0x007ffd00, 0xffffff03, 0x00000000, 0x00000000, 0x007ffd00, 0xffffff05, 0x00000000, 0x00000000, 0x007ffd00, 0xffffff63, 0x00000000, 0x00000000, 0x007ffd00, 0xffffffdd, 0x00000000, 0x00000000, 0x00000001, 0xfffffffb, 0x00000000, 0x00000000, 0x00000001, 0xfffffffd, 0x00000000, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000000, 0x00000001, 0x00000022, 0x00000000, 0x00000000, 0x00000001, 0x0000009d, 0x00000000, 0x00000000, 0x00000001, 0x000000fb, 0x00000000, 0x00000000, 0x00000001, 0x000000fd, 0x00000000, 0x00000000, 0x00000001, 0x0000807c, 0x00000000, 0x00000000, 0x00000001, 0x0000fffb, 0x00000000, 0x00000000, 0x00000001, 0x0000fffd, 0x00000000, 0x00000000, 0x00000001, 0x3333b332, 0x00000000, 0x00000000, 0x00000001, 0x88888888, 0x00000000, 0x00000000, 0x00000001, 0xd5555552, 0x00000000, 0x00000000, 0x00000001, 0xfffffffb, 0x00000000, 0x00000000, 0x00000001, 0xfffffffd, 0x00000000, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x2aaaaaab, 0x00000000, 0x00000000, 0x00000001, 0x77777776, 0x00000000, 0x00000000, 0x00000001, 0xcccc4ccc, 0x00000000, 0x00000000, 0x00000001, 0xffff0001, 0x00000000, 0x00000000, 0x00000001, 0xffff0003, 0x00000000, 0x00000000, 0x00000001, 0xffff0005, 0x00000000, 0x00000000, 0x00000001, 0xffff7f83, 0x00000000, 0x00000000, 0x00000001, 0xffffff01, 0x00000000, 0x00000000, 0x00000001, 0xffffff03, 0x00000000, 0x00000000, 0x00000001, 0xffffff05, 0x00000000, 0x00000000, 0x00000001, 0xffffff63, 0x00000000, 0x00000000, 0x00000001, 0xffffffdd, 0x00000000, 0x00000000, 0x00000003, 0xfffffffb, 0x00000000, 0x00000000, 0x00000003, 0xfffffffd, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000003, 0x00000022, 0x00000000, 0x00000000, 0x00000003, 0x0000009d, 0x00000000, 0x00000000, 0x00000003, 0x000000fb, 0x00000000, 0x00000000, 0x00000003, 0x000000fd, 0x00000000, 0x00000000, 0x00000003, 0x0000807c, 0x00000000, 0x00000000, 0x00000003, 0x0000fffb, 0x00000000, 0x00000000, 0x00000003, 0x0000fffd, 0x00000000, 0x00000000, 0x00000003, 0x3333b332, 0x00000000, 0x00000000, 0x00000003, 0x88888888, 0x00000000, 0x00000000, 0x00000003, 0xd5555552, 0x00000000, 0x00000000, 0x00000003, 0xfffffffb, 0x00000000, 0x00000000, 0x00000003, 0xfffffffd, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x00000003, 0x2aaaaaab, 0x00000000, 0x00000000, 0x00000003, 0x77777776, 0x00000000, 0x00000000, 0x00000003, 0xcccc4ccc, 0x00000000, 0x00000000, 0x00000003, 0xffff0001, 0x00000000, 0x00000000, 0x00000003, 0xffff0003, 0x00000000, 0x00000000, 0x00000003, 0xffff0005, 0x00000000, 0x00000000, 0x00000003, 0xffff7f83, 0x00000000, 0x00000000, 0x00000003, 0xffffff01, 0x00000000, 0x00000000, 0x00000003, 0xffffff03, 0x00000000, 0x00000000, 0x00000003, 0xffffff05, 0x00000000, 0x00000000, 0x00000003, 0xffffff63, 0x00000000, 0x00000000, 0x00000003, 0xffffffdd, 0x00000000, 0x00000000, 0x00000022, 0xfffffffb, 0x00000000, 0x00000000, 0x00000022, 0xfffffffd, 0x00000000, 0x00000000, 0x00000022, 0xffffffff, 0x00000000, 0x00000000, 0x00000022, 0x00000001, 0x00000000, 0x00000000, 0x00000022, 0x00000003, 0x00000000, 0x00000000, 0x00000022, 0x00000022, 0x00000000, 0x00000000, 0x00000022, 0x0000009d, 0x00000000, 0x00000000, 0x00000022, 0x000000fb, 0x00000000, 0x00000000, 0x00000022, 0x000000fd, 0x00000000, 0x00000000, 0x00000022, 0x0000807c, 0x00000000, 0x00000000, 0x00000022, 0x0000fffb, 0x00000000, 0x00000000, 0x00000022, 0x0000fffd, 0x00000000, 0x00000000, 0x00000022, 0x3333b332, 0x00000000, 0x00000000, 0x00000022, 0x88888888, 0x00000000, 0x00000000, 0x00000022, 0xd5555552, 0x00000000, 0x00000000, 0x00000022, 0xfffffffb, 0x00000000, 0x00000000, 0x00000022, 0xfffffffd, 0x00000000, 0x00000000, 0x00000022, 0xffffffff, 0x00000000, 0x00000000, 0x00000022, 0x00000001, 0x00000000, 0x00000000, 0x00000022, 0x2aaaaaab, 0x00000000, 0x00000000, 0x00000022, 0x77777776, 0x00000000, 0x00000000, 0x00000022, 0xcccc4ccc, 0x00000000, 0x00000000, 0x00000022, 0xffff0001, 0x00000000, 0x00000000, 0x00000022, 0xffff0003, 0x00000000, 0x00000000, 0x00000022, 0xffff0005, 0x00000000, 0x00000000, 0x00000022, 0xffff7f83, 0x00000000, 0x00000000, 0x00000022, 0xffffff01, 0x00000000, 0x00000000, 0x00000022, 0xffffff03, 0x00000000, 0x00000000, 0x00000022, 0xffffff05, 0x00000000, 0x00000000, 0x00000022, 0xffffff63, 0x00000000, 0x00000000, 0x00000022, 0xffffffdd, 0x00000000, 0x00000000, 0x0000009d, 0xfffffffb, 0x00000000, 0x00000000, 0x0000009d, 0xfffffffd, 0x00000000, 0x00000000, 0x0000009d, 0xffffffff, 0x00000000, 0x00000000, 0x0000009d, 0x00000001, 0x00000000, 0x00000000, 0x0000009d, 0x00000003, 0x00000000, 0x00000000, 0x0000009d, 0x00000022, 0x00000000, 0x00000000, 0x0000009d, 0x0000009d, 0x00000000, 0x00000000, 0x0000009d, 0x000000fb, 0x00000000, 0x00000000, 0x0000009d, 0x000000fd, 0x00000000, 0x00000000, 0x0000009d, 0x0000807c, 0x00000000, 0x00000000, 0x0000009d, 0x0000fffb, 0x00000000, 0x00000000, 0x0000009d, 0x0000fffd, 0x00000000, 0x00000000, 0x0000009d, 0x3333b332, 0x00000000, 0x00000000, 0x0000009d, 0x88888888, 0x00000000, 0x00000000, 0x0000009d, 0xd5555552, 0x00000000, 0x00000000, 0x0000009d, 0xfffffffb, 0x00000000, 0x00000000, 0x0000009d, 0xfffffffd, 0x00000000, 0x00000000, 0x0000009d, 0xffffffff, 0x00000000, 0x00000000, 0x0000009d, 0x00000001, 0x00000000, 0x00000000, 0x0000009d, 0x2aaaaaab, 0x00000000, 0x00000000, 0x0000009d, 0x77777776, 0x00000000, 0x00000000, 0x0000009d, 0xcccc4ccc, 0x00000000, 0x00000000, 0x0000009d, 0xffff0001, 0x00000000, 0x00000000, 0x0000009d, 0xffff0003, 0x00000000, 0x00000000, 0x0000009d, 0xffff0005, 0x00000000, 0x00000000, 0x0000009d, 0xffff7f83, 0x00000000, 0x00000000, 0x0000009d, 0xffffff01, 0x00000000, 0x00000000, 0x0000009d, 0xffffff03, 0x00000000, 0x00000000, 0x0000009d, 0xffffff05, 0x00000000, 0x00000000, 0x0000009d, 0xffffff63, 0x00000000, 0x00000000, 0x0000009d, 0xffffffdd, 0x00000000, 0x00000000, 0x000000fb, 0xfffffffb, 0x00000000, 0x00000000, 0x000000fb, 0xfffffffd, 0x00000000, 0x00000000, 0x000000fb, 0xffffffff, 0x00000000, 0x00000000, 0x000000fb, 0x00000001, 0x00000000, 0x00000000, 0x000000fb, 0x00000003, 0x00000000, 0x00000000, 0x000000fb, 0x00000022, 0x00000000, 0x00000000, 0x000000fb, 0x0000009d, 0x00000000, 0x00000000, 0x000000fb, 0x000000fb, 0x00000000, 0x00000000, 0x000000fb, 0x000000fd, 0x00000000, 0x00000000, 0x000000fb, 0x0000807c, 0x00000000, 0x00000000, 0x000000fb, 0x0000fffb, 0x00000000, 0x00000000, 0x000000fb, 0x0000fffd, 0x00000000, 0x00000000, 0x000000fb, 0x3333b332, 0x00000000, 0x00000000, 0x000000fb, 0x88888888, 0x00000000, 0x00000000, 0x000000fb, 0xd5555552, 0x00000000, 0x00000000, 0x000000fb, 0xfffffffb, 0x00000000, 0x00000000, 0x000000fb, 0xfffffffd, 0x00000000, 0x00000000, 0x000000fb, 0xffffffff, 0x00000000, 0x00000000, 0x000000fb, 0x00000001, 0x00000000, 0x00000000, 0x000000fb, 0x2aaaaaab, 0x00000000, 0x00000000, 0x000000fb, 0x77777776, 0x00000000, 0x00000000, 0x000000fb, 0xcccc4ccc, 0x00000000, 0x00000000, 0x000000fb, 0xffff0001, 0x00000000, 0x00000000, 0x000000fb, 0xffff0003, 0x00000000, 0x00000000, 0x000000fb, 0xffff0005, 0x00000000, 0x00000000, 0x000000fb, 0xffff7f83, 0x00000000, 0x00000000, 0x000000fb, 0xffffff01, 0x00000000, 0x00000000, 0x000000fb, 0xffffff03, 0x00000000, 0x00000000, 0x000000fb, 0xffffff05, 0x00000000, 0x00000000, 0x000000fb, 0xffffff63, 0x00000000, 0x00000000, 0x000000fb, 0xffffffdd, 0x00000000, 0x00000000, 0x000000fd, 0xfffffffb, 0x00000000, 0x00000000, 0x000000fd, 0xfffffffd, 0x00000000, 0x00000000, 0x000000fd, 0xffffffff, 0x00000000, 0x00000000, 0x000000fd, 0x00000001, 0x00000000, 0x00000000, 0x000000fd, 0x00000003, 0x00000000, 0x00000000, 0x000000fd, 0x00000022, 0x00000000, 0x00000000, 0x000000fd, 0x0000009d, 0x00000000, 0x00000000, 0x000000fd, 0x000000fb, 0x00000000, 0x00000000, 0x000000fd, 0x000000fd, 0x00000000, 0x00000000, 0x000000fd, 0x0000807c, 0x00000000, 0x00000000, 0x000000fd, 0x0000fffb, 0x00000000, 0x00000000, 0x000000fd, 0x0000fffd, 0x00000000, 0x00000000, 0x000000fd, 0x3333b332, 0x00000000, 0x00000000, 0x000000fd, 0x88888888, 0x00000000, 0x00000000, 0x000000fd, 0xd5555552, 0x00000000, 0x00000000, 0x000000fd, 0xfffffffb, 0x00000000, 0x00000000, 0x000000fd, 0xfffffffd, 0x00000000, 0x00000000, 0x000000fd, 0xffffffff, 0x00000000, 0x00000000, 0x000000fd, 0x00000001, 0x00000000, 0x00000000, 0x000000fd, 0x2aaaaaab, 0x00000000, 0x00000000, 0x000000fd, 0x77777776, 0x00000000, 0x00000000, 0x000000fd, 0xcccc4ccc, 0x00000000, 0x00000000, 0x000000fd, 0xffff0001, 0x00000000, 0x00000000, 0x000000fd, 0xffff0003, 0x00000000, 0x00000000, 0x000000fd, 0xffff0005, 0x00000000, 0x00000000, 0x000000fd, 0xffff7f83, 0x00000000, 0x00000000, 0x000000fd, 0xffffff01, 0x00000000, 0x00000000, 0x000000fd, 0xffffff03, 0x00000000, 0x00000000, 0x000000fd, 0xffffff05, 0x00000000, 0x00000000, 0x000000fd, 0xffffff63, 0x00000000, 0x00000000, 0x000000fd, 0xffffffdd, 0x00000000, 0x00000000, 0x0000807c, 0xfffffffb, 0x00000000, 0x00000000, 0x0000807c, 0xfffffffd, 0x00000000, 0x00000000, 0x0000807c, 0xffffffff, 0x00000000, 0x00000000, 0x0000807c, 0x00000001, 0x00000000, 0x00000000, 0x0000807c, 0x00000003, 0x00000000, 0x00000000, 0x0000807c, 0x00000022, 0x00000000, 0x00000000, 0x0000807c, 0x0000009d, 0x00000000, 0x00000000, 0x0000807c, 0x000000fb, 0x00000000, 0x00000000, 0x0000807c, 0x000000fd, 0x00000000, 0x00000000, 0x0000807c, 0x0000807c, 0x00000000, 0x00000000, 0x0000807c, 0x0000fffb, 0x00000000, 0x00000000, 0x0000807c, 0x0000fffd, 0x00000000, 0x00000000, 0x0000807c, 0x3333b332, 0x00000000, 0x00000000, 0x0000807c, 0x88888888, 0x00000000, 0x00000000, 0x0000807c, 0xd5555552, 0x00000000, 0x00000000, 0x0000807c, 0xfffffffb, 0x00000000, 0x00000000, 0x0000807c, 0xfffffffd, 0x00000000, 0x00000000, 0x0000807c, 0xffffffff, 0x00000000, 0x00000000, 0x0000807c, 0x00000001, 0x00000000, 0x00000000, 0x0000807c, 0x2aaaaaab, 0x00000000, 0x00000000, 0x0000807c, 0x77777776, 0x00000000, 0x00000000, 0x0000807c, 0xcccc4ccc, 0x00000000, 0x00000000, 0x0000807c, 0xffff0001, 0x00000000, 0x00000000, 0x0000807c, 0xffff0003, 0x00000000, 0x00000000, 0x0000807c, 0xffff0005, 0x00000000, 0x00000000, 0x0000807c, 0xffff7f83, 0x00000000, 0x00000000, 0x0000807c, 0xffffff01, 0x00000000, 0x00000000, 0x0000807c, 0xffffff03, 0x00000000, 0x00000000, 0x0000807c, 0xffffff05, 0x00000000, 0x00000000, 0x0000807c, 0xffffff63, 0x00000000, 0x00000000, 0x0000807c, 0xffffffdd, 0x00000000, 0x00000000, 0x0000fffb, 0xfffffffb, 0x00000000, 0x00000000, 0x0000fffb, 0xfffffffd, 0x00000000, 0x00000000, 0x0000fffb, 0xffffffff, 0x00000000, 0x00000000, 0x0000fffb, 0x00000001, 0x00000000, 0x00000000, 0x0000fffb, 0x00000003, 0x00000000, 0x00000000, 0x0000fffb, 0x00000022, 0x00000000, 0x00000000, 0x0000fffb, 0x0000009d, 0x00000000, 0x00000000, 0x0000fffb, 0x000000fb, 0x00000000, 0x00000000, 0x0000fffb, 0x000000fd, 0x00000000, 0x00000000, 0x0000fffb, 0x0000807c, 0x00000000, 0x00000000, 0x0000fffb, 0x0000fffb, 0x00000000, 0x00000000, 0x0000fffb, 0x0000fffd, 0x00000000, 0x00000000, 0x0000fffb, 0x3333b332, 0x00000000, 0x00000000, 0x0000fffb, 0x88888888, 0x00000000, 0x00000000, 0x0000fffb, 0xd5555552, 0x00000000, 0x00000000, 0x0000fffb, 0xfffffffb, 0x00000000, 0x00000000, 0x0000fffb, 0xfffffffd, 0x00000000, 0x00000000, 0x0000fffb, 0xffffffff, 0x00000000, 0x00000000, 0x0000fffb, 0x00000001, 0x00000000, 0x00000000, 0x0000fffb, 0x2aaaaaab, 0x00000000, 0x00000000, 0x0000fffb, 0x77777776, 0x00000000, 0x00000000, 0x0000fffb, 0xcccc4ccc, 0x00000000, 0x00000000, 0x0000fffb, 0xffff0001, 0x00000000, 0x00000000, 0x0000fffb, 0xffff0003, 0x00000000, 0x00000000, 0x0000fffb, 0xffff0005, 0x00000000, 0x00000000, 0x0000fffb, 0xffff7f83, 0x00000000, 0x00000000, 0x0000fffb, 0xffffff01, 0x00000000, 0x00000000, 0x0000fffb, 0xffffff03, 0x00000000, 0x00000000, 0x0000fffb, 0xffffff05, 0x00000000, 0x00000000, 0x0000fffb, 0xffffff63, 0x00000000, 0x00000000, 0x0000fffb, 0xffffffdd, 0x00000000, 0x00000000, 0x0000fffd, 0xfffffffb, 0x00000000, 0x00000000, 0x0000fffd, 0xfffffffd, 0x00000000, 0x00000000, 0x0000fffd, 0xffffffff, 0x00000000, 0x00000000, 0x0000fffd, 0x00000001, 0x00000000, 0x00000000, 0x0000fffd, 0x00000003, 0x00000000, 0x00000000, 0x0000fffd, 0x00000022, 0x00000000, 0x00000000, 0x0000fffd, 0x0000009d, 0x00000000, 0x00000000, 0x0000fffd, 0x000000fb, 0x00000000, 0x00000000, 0x0000fffd, 0x000000fd, 0x00000000, 0x00000000, 0x0000fffd, 0x0000807c, 0x00000000, 0x00000000, 0x0000fffd, 0x0000fffb, 0x00000000, 0x00000000, 0x0000fffd, 0x0000fffd, 0x00000000, 0x00000000, 0x0000fffd, 0x3333b332, 0x00000000, 0x00000000, 0x0000fffd, 0x88888888, 0x00000000, 0x00000000, 0x0000fffd, 0xd5555552, 0x00000000, 0x00000000, 0x0000fffd, 0xfffffffb, 0x00000000, 0x00000000, 0x0000fffd, 0xfffffffd, 0x00000000, 0x00000000, 0x0000fffd, 0xffffffff, 0x00000000, 0x00000000, 0x0000fffd, 0x00000001, 0x00000000, 0x00000000, 0x0000fffd, 0x2aaaaaab, 0x00000000, 0x00000000, 0x0000fffd, 0x77777776, 0x00000000, 0x00000000, 0x0000fffd, 0xcccc4ccc, 0x00000000, 0x00000000, 0x0000fffd, 0xffff0001, 0x00000000, 0x00000000, 0x0000fffd, 0xffff0003, 0x00000000, 0x00000000, 0x0000fffd, 0xffff0005, 0x00000000, 0x00000000, 0x0000fffd, 0xffff7f83, 0x00000000, 0x00000000, 0x0000fffd, 0xffffff01, 0x00000000, 0x00000000, 0x0000fffd, 0xffffff03, 0x00000000, 0x00000000, 0x0000fffd, 0xffffff05, 0x00000000, 0x00000000, 0x0000fffd, 0xffffff63, 0x00000000, 0x00000000, 0x0000fffd, 0xffffffdd, 0x00000000, 0x00000000, 0x3333b332, 0xfffffffb, 0x00000000, 0x00000000, 0x3333b332, 0xfffffffd, 0x00000000, 0x00000000, 0x3333b332, 0xffffffff, 0x00000000, 0x00000000, 0x3333b332, 0x00000001, 0x00000000, 0x00000000, 0x3333b332, 0x00000003, 0x00000000, 0x00000000, 0x3333b332, 0x00000022, 0x00000000, 0x00000000, 0x3333b332, 0x0000009d, 0x00000000, 0x00000000, 0x3333b332, 0x000000fb, 0x00000000, 0x00000000, 0x3333b332, 0x000000fd, 0x00000000, 0x00000000, 0x3333b332, 0x0000807c, 0x00000000, 0x00000000, 0x3333b332, 0x0000fffb, 0x00000000, 0x00000000, 0x3333b332, 0x0000fffd, 0x00000000, 0x00000000, 0x3333b332, 0x3333b332, 0x00000000, 0x00000000, 0x3333b332, 0x88888888, 0x00000000, 0x00000000, 0x3333b332, 0xd5555552, 0x00000000, 0x00000000, 0x3333b332, 0xfffffffb, 0x00000000, 0x00000000, 0x3333b332, 0xfffffffd, 0x00000000, 0x00000000, 0x3333b332, 0xffffffff, 0x00000000, 0x00000000, 0x3333b332, 0x00000001, 0x00000000, 0x00000000, 0x3333b332, 0x2aaaaaab, 0x00000000, 0x00000000, 0x3333b332, 0x77777776, 0x00000000, 0x00000000, 0x3333b332, 0xcccc4ccc, 0x00000000, 0x00000000, 0x3333b332, 0xffff0001, 0x00000000, 0x00000000, 0x3333b332, 0xffff0003, 0x00000000, 0x00000000, 0x3333b332, 0xffff0005, 0x00000000, 0x00000000, 0x3333b332, 0xffff7f83, 0x00000000, 0x00000000, 0x3333b332, 0xffffff01, 0x00000000, 0x00000000, 0x3333b332, 0xffffff03, 0x00000000, 0x00000000, 0x3333b332, 0xffffff05, 0x00000000, 0x00000000, 0x3333b332, 0xffffff63, 0x00000000, 0x00000000, 0x3333b332, 0xffffffdd, 0x00000000, 0x00000000, 0x88888888, 0xfffffffb, 0x00000000, 0x00000000, 0x88888888, 0xfffffffd, 0x00000000, 0x00000000, 0x88888888, 0xffffffff, 0x00000000, 0x00000000, 0x88888888, 0x00000001, 0x00000000, 0x00000000, 0x88888888, 0x00000003, 0x00000000, 0x00000000, 0x88888888, 0x00000022, 0x00000000, 0x00000000, 0x88888888, 0x0000009d, 0x00000000, 0x00000000, 0x88888888, 0x000000fb, 0x00000000, 0x00000000, 0x88888888, 0x000000fd, 0x00000000, 0x00000000, 0x88888888, 0x0000807c, 0x00000000, 0x00000000, 0x88888888, 0x0000fffb, 0x00000000, 0x00000000, 0x88888888, 0x0000fffd, 0x00000000, 0x00000000, 0x88888888, 0x3333b332, 0x00000000, 0x00000000, 0x88888888, 0x88888888, 0x00000000, 0x00000000, 0x88888888, 0xd5555552, 0x00000000, 0x00000000, 0x88888888, 0xfffffffb, 0x00000000, 0x00000000, 0x88888888, 0xfffffffd, 0x00000000, 0x00000000, 0x88888888, 0xffffffff, 0x00000000, 0x00000000, 0x88888888, 0x00000001, 0x00000000, 0x00000000, 0x88888888, 0x2aaaaaab, 0x00000000, 0x00000000, 0x88888888, 0x77777776, 0x00000000, 0x00000000, 0x88888888, 0xcccc4ccc, 0x00000000, 0x00000000, 0x88888888, 0xffff0001, 0x00000000, 0x00000000, 0x88888888, 0xffff0003, 0x00000000, 0x00000000, 0x88888888, 0xffff0005, 0x00000000, 0x00000000, 0x88888888, 0xffff7f83, 0x00000000, 0x00000000, 0x88888888, 0xffffff01, 0x00000000, 0x00000000, 0x88888888, 0xffffff03, 0x00000000, 0x00000000, 0x88888888, 0xffffff05, 0x00000000, 0x00000000, 0x88888888, 0xffffff63, 0x00000000, 0x00000000, 0x88888888, 0xffffffdd, 0x00000000, 0x00000000, 0xd5555552, 0xfffffffb, 0x00000000, 0x00000000, 0xd5555552, 0xfffffffd, 0x00000000, 0x00000000, 0xd5555552, 0xffffffff, 0x00000000, 0x00000000, 0xd5555552, 0x00000001, 0x00000000, 0x00000000, 0xd5555552, 0x00000003, 0x00000000, 0x00000000, 0xd5555552, 0x00000022, 0x00000000, 0x00000000, 0xd5555552, 0x0000009d, 0x00000000, 0x00000000, 0xd5555552, 0x000000fb, 0x00000000, 0x00000000, 0xd5555552, 0x000000fd, 0x00000000, 0x00000000, 0xd5555552, 0x0000807c, 0x00000000, 0x00000000, 0xd5555552, 0x0000fffb, 0x00000000, 0x00000000, 0xd5555552, 0x0000fffd, 0x00000000, 0x00000000, 0xd5555552, 0x3333b332, 0x00000000, 0x00000000, 0xd5555552, 0x88888888, 0x00000000, 0x00000000, 0xd5555552, 0xd5555552, 0x00000000, 0x00000000, 0xd5555552, 0xfffffffb, 0x00000000, 0x00000000, 0xd5555552, 0xfffffffd, 0x00000000, 0x00000000, 0xd5555552, 0xffffffff, 0x00000000, 0x00000000, 0xd5555552, 0x00000001, 0x00000000, 0x00000000, 0xd5555552, 0x2aaaaaab, 0x00000000, 0x00000000, 0xd5555552, 0x77777776, 0x00000000, 0x00000000, 0xd5555552, 0xcccc4ccc, 0x00000000, 0x00000000, 0xd5555552, 0xffff0001, 0x00000000, 0x00000000, 0xd5555552, 0xffff0003, 0x00000000, 0x00000000, 0xd5555552, 0xffff0005, 0x00000000, 0x00000000, 0xd5555552, 0xffff7f83, 0x00000000, 0x00000000, 0xd5555552, 0xffffff01, 0x00000000, 0x00000000, 0xd5555552, 0xffffff03, 0x00000000, 0x00000000, 0xd5555552, 0xffffff05, 0x00000000, 0x00000000, 0xd5555552, 0xffffff63, 0x00000000, 0x00000000, 0xd5555552, 0xffffffdd, 0x00000000, 0x00000000, 0xfffffffb, 0xfffffffb, 0x00000000, 0x00000000, 0xfffffffb, 0xfffffffd, 0x00000000, 0x00000000, 0xfffffffb, 0xffffffff, 0x00000000, 0x00000000, 0xfffffffb, 0x00000001, 0x00000000, 0x00000000, 0xfffffffb, 0x00000003, 0x00000000, 0x00000000, 0xfffffffb, 0x00000022, 0x00000000, 0x00000000, 0xfffffffb, 0x0000009d, 0x00000000, 0x00000000, 0xfffffffb, 0x000000fb, 0x00000000, 0x00000000, 0xfffffffb, 0x000000fd, 0x00000000, 0x00000000, 0xfffffffb, 0x0000807c, 0x00000000, 0x00000000, 0xfffffffb, 0x0000fffb, 0x00000000, 0x00000000, 0xfffffffb, 0x0000fffd, 0x00000000, 0x00000000, 0xfffffffb, 0x3333b332, 0x00000000, 0x00000000, 0xfffffffb, 0x88888888, 0x00000000, 0x00000000, 0xfffffffb, 0xd5555552, 0x00000000, 0x00000000, 0xfffffffb, 0xfffffffb, 0x00000000, 0x00000000, 0xfffffffb, 0xfffffffd, 0x00000000, 0x00000000, 0xfffffffb, 0xffffffff, 0x00000000, 0x00000000, 0xfffffffb, 0x00000001, 0x00000000, 0x00000000, 0xfffffffb, 0x2aaaaaab, 0x00000000, 0x00000000, 0xfffffffb, 0x77777776, 0x00000000, 0x00000000, 0xfffffffb, 0xcccc4ccc, 0x00000000, 0x00000000, 0xfffffffb, 0xffff0001, 0x00000000, 0x00000000, 0xfffffffb, 0xffff0003, 0x00000000, 0x00000000, 0xfffffffb, 0xffff0005, 0x00000000, 0x00000000, 0xfffffffb, 0xffff7f83, 0x00000000, 0x00000000, 0xfffffffb, 0xffffff01, 0x00000000, 0x00000000, 0xfffffffb, 0xffffff03, 0x00000000, 0x00000000, 0xfffffffb, 0xffffff05, 0x00000000, 0x00000000, 0xfffffffb, 0xffffff63, 0x00000000, 0x00000000, 0xfffffffb, 0xffffffdd, 0x00000000, 0x00000000, 0xfffffffd, 0xfffffffb, 0x00000000, 0x00000000, 0xfffffffd, 0xfffffffd, 0x00000000, 0x00000000, 0xfffffffd, 0xffffffff, 0x00000000, 0x00000000, 0xfffffffd, 0x00000001, 0x00000000, 0x00000000, 0xfffffffd, 0x00000003, 0x00000000, 0x00000000, 0xfffffffd, 0x00000022, 0x00000000, 0x00000000, 0xfffffffd, 0x0000009d, 0x00000000, 0x00000000, 0xfffffffd, 0x000000fb, 0x00000000, 0x00000000, 0xfffffffd, 0x000000fd, 0x00000000, 0x00000000, 0xfffffffd, 0x0000807c, 0x00000000, 0x00000000, 0xfffffffd, 0x0000fffb, 0x00000000, 0x00000000, 0xfffffffd, 0x0000fffd, 0x00000000, 0x00000000, 0xfffffffd, 0x3333b332, 0x00000000, 0x00000000, 0xfffffffd, 0x88888888, 0x00000000, 0x00000000, 0xfffffffd, 0xd5555552, 0x00000000, 0x00000000, 0xfffffffd, 0xfffffffb, 0x00000000, 0x00000000, 0xfffffffd, 0xfffffffd, 0x00000000, 0x00000000, 0xfffffffd, 0xffffffff, 0x00000000, 0x00000000, 0xfffffffd, 0x00000001, 0x00000000, 0x00000000, 0xfffffffd, 0x2aaaaaab, 0x00000000, 0x00000000, 0xfffffffd, 0x77777776, 0x00000000, 0x00000000, 0xfffffffd, 0xcccc4ccc, 0x00000000, 0x00000000, 0xfffffffd, 0xffff0001, 0x00000000, 0x00000000, 0xfffffffd, 0xffff0003, 0x00000000, 0x00000000, 0xfffffffd, 0xffff0005, 0x00000000, 0x00000000, 0xfffffffd, 0xffff7f83, 0x00000000, 0x00000000, 0xfffffffd, 0xffffff01, 0x00000000, 0x00000000, 0xfffffffd, 0xffffff03, 0x00000000, 0x00000000, 0xfffffffd, 0xffffff05, 0x00000000, 0x00000000, 0xfffffffd, 0xffffff63, 0x00000000, 0x00000000, 0xfffffffd, 0xffffffdd, 0x00000000, 0x00000000, 0xffffffff, 0xfffffffb, 0x00000000, 0x00000000, 0xffffffff, 0xfffffffd, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000000, 0xffffffff, 0x00000003, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x00000000, 0xffffffff, 0x0000009d, 0x00000000, 0x00000000, 0xffffffff, 0x000000fb, 0x00000000, 0x00000000, 0xffffffff, 0x000000fd, 0x00000000, 0x00000000, 0xffffffff, 0x0000807c, 0x00000000, 0x00000000, 0xffffffff, 0x0000fffb, 0x00000000, 0x00000000, 0xffffffff, 0x0000fffd, 0x00000000, 0x00000000, 0xffffffff, 0x3333b332, 0x00000000, 0x00000000, 0xffffffff, 0x88888888, 0x00000000, 0x00000000, 0xffffffff, 0xd5555552, 0x00000000, 0x00000000, 0xffffffff, 0xfffffffb, 0x00000000, 0x00000000, 0xffffffff, 0xfffffffd, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000000, 0xffffffff, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffffff, 0x77777776, 0x00000000, 0x00000000, 0xffffffff, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffffff, 0xffff0001, 0x00000000, 0x00000000, 0xffffffff, 0xffff0003, 0x00000000, 0x00000000, 0xffffffff, 0xffff0005, 0x00000000, 0x00000000, 0xffffffff, 0xffff7f83, 0x00000000, 0x00000000, 0xffffffff, 0xffffff01, 0x00000000, 0x00000000, 0xffffffff, 0xffffff03, 0x00000000, 0x00000000, 0xffffffff, 0xffffff05, 0x00000000, 0x00000000, 0xffffffff, 0xffffff63, 0x00000000, 0x00000000, 0xffffffff, 0xffffffdd, 0x00000000, 0x00000000, 0x00000001, 0xfffffffb, 0x00000000, 0x00000000, 0x00000001, 0xfffffffd, 0x00000000, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000000, 0x00000001, 0x00000022, 0x00000000, 0x00000000, 0x00000001, 0x0000009d, 0x00000000, 0x00000000, 0x00000001, 0x000000fb, 0x00000000, 0x00000000, 0x00000001, 0x000000fd, 0x00000000, 0x00000000, 0x00000001, 0x0000807c, 0x00000000, 0x00000000, 0x00000001, 0x0000fffb, 0x00000000, 0x00000000, 0x00000001, 0x0000fffd, 0x00000000, 0x00000000, 0x00000001, 0x3333b332, 0x00000000, 0x00000000, 0x00000001, 0x88888888, 0x00000000, 0x00000000, 0x00000001, 0xd5555552, 0x00000000, 0x00000000, 0x00000001, 0xfffffffb, 0x00000000, 0x00000000, 0x00000001, 0xfffffffd, 0x00000000, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x2aaaaaab, 0x00000000, 0x00000000, 0x00000001, 0x77777776, 0x00000000, 0x00000000, 0x00000001, 0xcccc4ccc, 0x00000000, 0x00000000, 0x00000001, 0xffff0001, 0x00000000, 0x00000000, 0x00000001, 0xffff0003, 0x00000000, 0x00000000, 0x00000001, 0xffff0005, 0x00000000, 0x00000000, 0x00000001, 0xffff7f83, 0x00000000, 0x00000000, 0x00000001, 0xffffff01, 0x00000000, 0x00000000, 0x00000001, 0xffffff03, 0x00000000, 0x00000000, 0x00000001, 0xffffff05, 0x00000000, 0x00000000, 0x00000001, 0xffffff63, 0x00000000, 0x00000000, 0x00000001, 0xffffffdd, 0x00000000, 0x00000000, 0x2aaaaaab, 0xfffffffb, 0x00000000, 0x00000000, 0x2aaaaaab, 0xfffffffd, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffffff, 0x00000000, 0x00000000, 0x2aaaaaab, 0x00000001, 0x00000000, 0x00000000, 0x2aaaaaab, 0x00000003, 0x00000000, 0x00000000, 0x2aaaaaab, 0x00000022, 0x00000000, 0x00000000, 0x2aaaaaab, 0x0000009d, 0x00000000, 0x00000000, 0x2aaaaaab, 0x000000fb, 0x00000000, 0x00000000, 0x2aaaaaab, 0x000000fd, 0x00000000, 0x00000000, 0x2aaaaaab, 0x0000807c, 0x00000000, 0x00000000, 0x2aaaaaab, 0x0000fffb, 0x00000000, 0x00000000, 0x2aaaaaab, 0x0000fffd, 0x00000000, 0x00000000, 0x2aaaaaab, 0x3333b332, 0x00000000, 0x00000000, 0x2aaaaaab, 0x88888888, 0x00000000, 0x00000000, 0x2aaaaaab, 0xd5555552, 0x00000000, 0x00000000, 0x2aaaaaab, 0xfffffffb, 0x00000000, 0x00000000, 0x2aaaaaab, 0xfffffffd, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffffff, 0x00000000, 0x00000000, 0x2aaaaaab, 0x00000001, 0x00000000, 0x00000000, 0x2aaaaaab, 0x2aaaaaab, 0x00000000, 0x00000000, 0x2aaaaaab, 0x77777776, 0x00000000, 0x00000000, 0x2aaaaaab, 0xcccc4ccc, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffff0001, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffff0003, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffff0005, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffff7f83, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffff01, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffff03, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffff05, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffff63, 0x00000000, 0x00000000, 0x2aaaaaab, 0xffffffdd, 0x00000000, 0x00000000, 0x77777776, 0xfffffffb, 0x00000000, 0x00000000, 0x77777776, 0xfffffffd, 0x00000000, 0x00000000, 0x77777776, 0xffffffff, 0x00000000, 0x00000000, 0x77777776, 0x00000001, 0x00000000, 0x00000000, 0x77777776, 0x00000003, 0x00000000, 0x00000000, 0x77777776, 0x00000022, 0x00000000, 0x00000000, 0x77777776, 0x0000009d, 0x00000000, 0x00000000, 0x77777776, 0x000000fb, 0x00000000, 0x00000000, 0x77777776, 0x000000fd, 0x00000000, 0x00000000, 0x77777776, 0x0000807c, 0x00000000, 0x00000000, 0x77777776, 0x0000fffb, 0x00000000, 0x00000000, 0x77777776, 0x0000fffd, 0x00000000, 0x00000000, 0x77777776, 0x3333b332, 0x00000000, 0x00000000, 0x77777776, 0x88888888, 0x00000000, 0x00000000, 0x77777776, 0xd5555552, 0x00000000, 0x00000000, 0x77777776, 0xfffffffb, 0x00000000, 0x00000000, 0x77777776, 0xfffffffd, 0x00000000, 0x00000000, 0x77777776, 0xffffffff, 0x00000000, 0x00000000, 0x77777776, 0x00000001, 0x00000000, 0x00000000, 0x77777776, 0x2aaaaaab, 0x00000000, 0x00000000, 0x77777776, 0x77777776, 0x00000000, 0x00000000, 0x77777776, 0xcccc4ccc, 0x00000000, 0x00000000, 0x77777776, 0xffff0001, 0x00000000, 0x00000000, 0x77777776, 0xffff0003, 0x00000000, 0x00000000, 0x77777776, 0xffff0005, 0x00000000, 0x00000000, 0x77777776, 0xffff7f83, 0x00000000, 0x00000000, 0x77777776, 0xffffff01, 0x00000000, 0x00000000, 0x77777776, 0xffffff03, 0x00000000, 0x00000000, 0x77777776, 0xffffff05, 0x00000000, 0x00000000, 0x77777776, 0xffffff63, 0x00000000, 0x00000000, 0x77777776, 0xffffffdd, 0x00000000, 0x00000000, 0xcccc4ccc, 0xfffffffb, 0x00000000, 0x00000000, 0xcccc4ccc, 0xfffffffd, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffffff, 0x00000000, 0x00000000, 0xcccc4ccc, 0x00000001, 0x00000000, 0x00000000, 0xcccc4ccc, 0x00000003, 0x00000000, 0x00000000, 0xcccc4ccc, 0x00000022, 0x00000000, 0x00000000, 0xcccc4ccc, 0x0000009d, 0x00000000, 0x00000000, 0xcccc4ccc, 0x000000fb, 0x00000000, 0x00000000, 0xcccc4ccc, 0x000000fd, 0x00000000, 0x00000000, 0xcccc4ccc, 0x0000807c, 0x00000000, 0x00000000, 0xcccc4ccc, 0x0000fffb, 0x00000000, 0x00000000, 0xcccc4ccc, 0x0000fffd, 0x00000000, 0x00000000, 0xcccc4ccc, 0x3333b332, 0x00000000, 0x00000000, 0xcccc4ccc, 0x88888888, 0x00000000, 0x00000000, 0xcccc4ccc, 0xd5555552, 0x00000000, 0x00000000, 0xcccc4ccc, 0xfffffffb, 0x00000000, 0x00000000, 0xcccc4ccc, 0xfffffffd, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffffff, 0x00000000, 0x00000000, 0xcccc4ccc, 0x00000001, 0x00000000, 0x00000000, 0xcccc4ccc, 0x2aaaaaab, 0x00000000, 0x00000000, 0xcccc4ccc, 0x77777776, 0x00000000, 0x00000000, 0xcccc4ccc, 0xcccc4ccc, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffff0001, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffff0003, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffff0005, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffff7f83, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffff01, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffff03, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffff05, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffff63, 0x00000000, 0x00000000, 0xcccc4ccc, 0xffffffdd, 0x00000000, 0x00000000, 0xffff0001, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0001, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0001, 0xffffffff, 0x00000000, 0x00000000, 0xffff0001, 0x00000001, 0x00000000, 0x00000000, 0xffff0001, 0x00000003, 0x00000000, 0x00000000, 0xffff0001, 0x00000022, 0x00000000, 0x00000000, 0xffff0001, 0x0000009d, 0x00000000, 0x00000000, 0xffff0001, 0x000000fb, 0x00000000, 0x00000000, 0xffff0001, 0x000000fd, 0x00000000, 0x00000000, 0xffff0001, 0x0000807c, 0x00000000, 0x00000000, 0xffff0001, 0x0000fffb, 0x00000000, 0x00000000, 0xffff0001, 0x0000fffd, 0x00000000, 0x00000000, 0xffff0001, 0x3333b332, 0x00000000, 0x00000000, 0xffff0001, 0x88888888, 0x00000000, 0x00000000, 0xffff0001, 0xd5555552, 0x00000000, 0x00000000, 0xffff0001, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0001, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0001, 0xffffffff, 0x00000000, 0x00000000, 0xffff0001, 0x00000001, 0x00000000, 0x00000000, 0xffff0001, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffff0001, 0x77777776, 0x00000000, 0x00000000, 0xffff0001, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffff0001, 0xffff0001, 0x00000000, 0x00000000, 0xffff0001, 0xffff0003, 0x00000000, 0x00000000, 0xffff0001, 0xffff0005, 0x00000000, 0x00000000, 0xffff0001, 0xffff7f83, 0x00000000, 0x00000000, 0xffff0001, 0xffffff01, 0x00000000, 0x00000000, 0xffff0001, 0xffffff03, 0x00000000, 0x00000000, 0xffff0001, 0xffffff05, 0x00000000, 0x00000000, 0xffff0001, 0xffffff63, 0x00000000, 0x00000000, 0xffff0001, 0xffffffdd, 0x00000000, 0x00000000, 0xffff0003, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0003, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0003, 0xffffffff, 0x00000000, 0x00000000, 0xffff0003, 0x00000001, 0x00000000, 0x00000000, 0xffff0003, 0x00000003, 0x00000000, 0x00000000, 0xffff0003, 0x00000022, 0x00000000, 0x00000000, 0xffff0003, 0x0000009d, 0x00000000, 0x00000000, 0xffff0003, 0x000000fb, 0x00000000, 0x00000000, 0xffff0003, 0x000000fd, 0x00000000, 0x00000000, 0xffff0003, 0x0000807c, 0x00000000, 0x00000000, 0xffff0003, 0x0000fffb, 0x00000000, 0x00000000, 0xffff0003, 0x0000fffd, 0x00000000, 0x00000000, 0xffff0003, 0x3333b332, 0x00000000, 0x00000000, 0xffff0003, 0x88888888, 0x00000000, 0x00000000, 0xffff0003, 0xd5555552, 0x00000000, 0x00000000, 0xffff0003, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0003, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0003, 0xffffffff, 0x00000000, 0x00000000, 0xffff0003, 0x00000001, 0x00000000, 0x00000000, 0xffff0003, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffff0003, 0x77777776, 0x00000000, 0x00000000, 0xffff0003, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffff0003, 0xffff0001, 0x00000000, 0x00000000, 0xffff0003, 0xffff0003, 0x00000000, 0x00000000, 0xffff0003, 0xffff0005, 0x00000000, 0x00000000, 0xffff0003, 0xffff7f83, 0x00000000, 0x00000000, 0xffff0003, 0xffffff01, 0x00000000, 0x00000000, 0xffff0003, 0xffffff03, 0x00000000, 0x00000000, 0xffff0003, 0xffffff05, 0x00000000, 0x00000000, 0xffff0003, 0xffffff63, 0x00000000, 0x00000000, 0xffff0003, 0xffffffdd, 0x00000000, 0x00000000, 0xffff0005, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0005, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0005, 0xffffffff, 0x00000000, 0x00000000, 0xffff0005, 0x00000001, 0x00000000, 0x00000000, 0xffff0005, 0x00000003, 0x00000000, 0x00000000, 0xffff0005, 0x00000022, 0x00000000, 0x00000000, 0xffff0005, 0x0000009d, 0x00000000, 0x00000000, 0xffff0005, 0x000000fb, 0x00000000, 0x00000000, 0xffff0005, 0x000000fd, 0x00000000, 0x00000000, 0xffff0005, 0x0000807c, 0x00000000, 0x00000000, 0xffff0005, 0x0000fffb, 0x00000000, 0x00000000, 0xffff0005, 0x0000fffd, 0x00000000, 0x00000000, 0xffff0005, 0x3333b332, 0x00000000, 0x00000000, 0xffff0005, 0x88888888, 0x00000000, 0x00000000, 0xffff0005, 0xd5555552, 0x00000000, 0x00000000, 0xffff0005, 0xfffffffb, 0x00000000, 0x00000000, 0xffff0005, 0xfffffffd, 0x00000000, 0x00000000, 0xffff0005, 0xffffffff, 0x00000000, 0x00000000, 0xffff0005, 0x00000001, 0x00000000, 0x00000000, 0xffff0005, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffff0005, 0x77777776, 0x00000000, 0x00000000, 0xffff0005, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffff0005, 0xffff0001, 0x00000000, 0x00000000, 0xffff0005, 0xffff0003, 0x00000000, 0x00000000, 0xffff0005, 0xffff0005, 0x00000000, 0x00000000, 0xffff0005, 0xffff7f83, 0x00000000, 0x00000000, 0xffff0005, 0xffffff01, 0x00000000, 0x00000000, 0xffff0005, 0xffffff03, 0x00000000, 0x00000000, 0xffff0005, 0xffffff05, 0x00000000, 0x00000000, 0xffff0005, 0xffffff63, 0x00000000, 0x00000000, 0xffff0005, 0xffffffdd, 0x00000000, 0x00000000, 0xffff7f83, 0xfffffffb, 0x00000000, 0x00000000, 0xffff7f83, 0xfffffffd, 0x00000000, 0x00000000, 0xffff7f83, 0xffffffff, 0x00000000, 0x00000000, 0xffff7f83, 0x00000001, 0x00000000, 0x00000000, 0xffff7f83, 0x00000003, 0x00000000, 0x00000000, 0xffff7f83, 0x00000022, 0x00000000, 0x00000000, 0xffff7f83, 0x0000009d, 0x00000000, 0x00000000, 0xffff7f83, 0x000000fb, 0x00000000, 0x00000000, 0xffff7f83, 0x000000fd, 0x00000000, 0x00000000, 0xffff7f83, 0x0000807c, 0x00000000, 0x00000000, 0xffff7f83, 0x0000fffb, 0x00000000, 0x00000000, 0xffff7f83, 0x0000fffd, 0x00000000, 0x00000000, 0xffff7f83, 0x3333b332, 0x00000000, 0x00000000, 0xffff7f83, 0x88888888, 0x00000000, 0x00000000, 0xffff7f83, 0xd5555552, 0x00000000, 0x00000000, 0xffff7f83, 0xfffffffb, 0x00000000, 0x00000000, 0xffff7f83, 0xfffffffd, 0x00000000, 0x00000000, 0xffff7f83, 0xffffffff, 0x00000000, 0x00000000, 0xffff7f83, 0x00000001, 0x00000000, 0x00000000, 0xffff7f83, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffff7f83, 0x77777776, 0x00000000, 0x00000000, 0xffff7f83, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffff7f83, 0xffff0001, 0x00000000, 0x00000000, 0xffff7f83, 0xffff0003, 0x00000000, 0x00000000, 0xffff7f83, 0xffff0005, 0x00000000, 0x00000000, 0xffff7f83, 0xffff7f83, 0x00000000, 0x00000000, 0xffff7f83, 0xffffff01, 0x00000000, 0x00000000, 0xffff7f83, 0xffffff03, 0x00000000, 0x00000000, 0xffff7f83, 0xffffff05, 0x00000000, 0x00000000, 0xffff7f83, 0xffffff63, 0x00000000, 0x00000000, 0xffff7f83, 0xffffffdd, 0x00000000, 0x00000000, 0xffffff01, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff01, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff01, 0xffffffff, 0x00000000, 0x00000000, 0xffffff01, 0x00000001, 0x00000000, 0x00000000, 0xffffff01, 0x00000003, 0x00000000, 0x00000000, 0xffffff01, 0x00000022, 0x00000000, 0x00000000, 0xffffff01, 0x0000009d, 0x00000000, 0x00000000, 0xffffff01, 0x000000fb, 0x00000000, 0x00000000, 0xffffff01, 0x000000fd, 0x00000000, 0x00000000, 0xffffff01, 0x0000807c, 0x00000000, 0x00000000, 0xffffff01, 0x0000fffb, 0x00000000, 0x00000000, 0xffffff01, 0x0000fffd, 0x00000000, 0x00000000, 0xffffff01, 0x3333b332, 0x00000000, 0x00000000, 0xffffff01, 0x88888888, 0x00000000, 0x00000000, 0xffffff01, 0xd5555552, 0x00000000, 0x00000000, 0xffffff01, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff01, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff01, 0xffffffff, 0x00000000, 0x00000000, 0xffffff01, 0x00000001, 0x00000000, 0x00000000, 0xffffff01, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffff01, 0x77777776, 0x00000000, 0x00000000, 0xffffff01, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffff01, 0xffff0001, 0x00000000, 0x00000000, 0xffffff01, 0xffff0003, 0x00000000, 0x00000000, 0xffffff01, 0xffff0005, 0x00000000, 0x00000000, 0xffffff01, 0xffff7f83, 0x00000000, 0x00000000, 0xffffff01, 0xffffff01, 0x00000000, 0x00000000, 0xffffff01, 0xffffff03, 0x00000000, 0x00000000, 0xffffff01, 0xffffff05, 0x00000000, 0x00000000, 0xffffff01, 0xffffff63, 0x00000000, 0x00000000, 0xffffff01, 0xffffffdd, 0x00000000, 0x00000000, 0xffffff03, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff03, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff03, 0xffffffff, 0x00000000, 0x00000000, 0xffffff03, 0x00000001, 0x00000000, 0x00000000, 0xffffff03, 0x00000003, 0x00000000, 0x00000000, 0xffffff03, 0x00000022, 0x00000000, 0x00000000, 0xffffff03, 0x0000009d, 0x00000000, 0x00000000, 0xffffff03, 0x000000fb, 0x00000000, 0x00000000, 0xffffff03, 0x000000fd, 0x00000000, 0x00000000, 0xffffff03, 0x0000807c, 0x00000000, 0x00000000, 0xffffff03, 0x0000fffb, 0x00000000, 0x00000000, 0xffffff03, 0x0000fffd, 0x00000000, 0x00000000, 0xffffff03, 0x3333b332, 0x00000000, 0x00000000, 0xffffff03, 0x88888888, 0x00000000, 0x00000000, 0xffffff03, 0xd5555552, 0x00000000, 0x00000000, 0xffffff03, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff03, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff03, 0xffffffff, 0x00000000, 0x00000000, 0xffffff03, 0x00000001, 0x00000000, 0x00000000, 0xffffff03, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffff03, 0x77777776, 0x00000000, 0x00000000, 0xffffff03, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffff03, 0xffff0001, 0x00000000, 0x00000000, 0xffffff03, 0xffff0003, 0x00000000, 0x00000000, 0xffffff03, 0xffff0005, 0x00000000, 0x00000000, 0xffffff03, 0xffff7f83, 0x00000000, 0x00000000, 0xffffff03, 0xffffff01, 0x00000000, 0x00000000, 0xffffff03, 0xffffff03, 0x00000000, 0x00000000, 0xffffff03, 0xffffff05, 0x00000000, 0x00000000, 0xffffff03, 0xffffff63, 0x00000000, 0x00000000, 0xffffff03, 0xffffffdd, 0x00000000, 0x00000000, 0xffffff05, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff05, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff05, 0xffffffff, 0x00000000, 0x00000000, 0xffffff05, 0x00000001, 0x00000000, 0x00000000, 0xffffff05, 0x00000003, 0x00000000, 0x00000000, 0xffffff05, 0x00000022, 0x00000000, 0x00000000, 0xffffff05, 0x0000009d, 0x00000000, 0x00000000, 0xffffff05, 0x000000fb, 0x00000000, 0x00000000, 0xffffff05, 0x000000fd, 0x00000000, 0x00000000, 0xffffff05, 0x0000807c, 0x00000000, 0x00000000, 0xffffff05, 0x0000fffb, 0x00000000, 0x00000000, 0xffffff05, 0x0000fffd, 0x00000000, 0x00000000, 0xffffff05, 0x3333b332, 0x00000000, 0x00000000, 0xffffff05, 0x88888888, 0x00000000, 0x00000000, 0xffffff05, 0xd5555552, 0x00000000, 0x00000000, 0xffffff05, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff05, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff05, 0xffffffff, 0x00000000, 0x00000000, 0xffffff05, 0x00000001, 0x00000000, 0x00000000, 0xffffff05, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffff05, 0x77777776, 0x00000000, 0x00000000, 0xffffff05, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffff05, 0xffff0001, 0x00000000, 0x00000000, 0xffffff05, 0xffff0003, 0x00000000, 0x00000000, 0xffffff05, 0xffff0005, 0x00000000, 0x00000000, 0xffffff05, 0xffff7f83, 0x00000000, 0x00000000, 0xffffff05, 0xffffff01, 0x00000000, 0x00000000, 0xffffff05, 0xffffff03, 0x00000000, 0x00000000, 0xffffff05, 0xffffff05, 0x00000000, 0x00000000, 0xffffff05, 0xffffff63, 0x00000000, 0x00000000, 0xffffff05, 0xffffffdd, 0x00000000, 0x00000000, 0xffffff63, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff63, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff63, 0xffffffff, 0x00000000, 0x00000000, 0xffffff63, 0x00000001, 0x00000000, 0x00000000, 0xffffff63, 0x00000003, 0x00000000, 0x00000000, 0xffffff63, 0x00000022, 0x00000000, 0x00000000, 0xffffff63, 0x0000009d, 0x00000000, 0x00000000, 0xffffff63, 0x000000fb, 0x00000000, 0x00000000, 0xffffff63, 0x000000fd, 0x00000000, 0x00000000, 0xffffff63, 0x0000807c, 0x00000000, 0x00000000, 0xffffff63, 0x0000fffb, 0x00000000, 0x00000000, 0xffffff63, 0x0000fffd, 0x00000000, 0x00000000, 0xffffff63, 0x3333b332, 0x00000000, 0x00000000, 0xffffff63, 0x88888888, 0x00000000, 0x00000000, 0xffffff63, 0xd5555552, 0x00000000, 0x00000000, 0xffffff63, 0xfffffffb, 0x00000000, 0x00000000, 0xffffff63, 0xfffffffd, 0x00000000, 0x00000000, 0xffffff63, 0xffffffff, 0x00000000, 0x00000000, 0xffffff63, 0x00000001, 0x00000000, 0x00000000, 0xffffff63, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffff63, 0x77777776, 0x00000000, 0x00000000, 0xffffff63, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffff63, 0xffff0001, 0x00000000, 0x00000000, 0xffffff63, 0xffff0003, 0x00000000, 0x00000000, 0xffffff63, 0xffff0005, 0x00000000, 0x00000000, 0xffffff63, 0xffff7f83, 0x00000000, 0x00000000, 0xffffff63, 0xffffff01, 0x00000000, 0x00000000, 0xffffff63, 0xffffff03, 0x00000000, 0x00000000, 0xffffff63, 0xffffff05, 0x00000000, 0x00000000, 0xffffff63, 0xffffff63, 0x00000000, 0x00000000, 0xffffff63, 0xffffffdd, 0x00000000, 0x00000000, 0xffffffdd, 0xfffffffb, 0x00000000, 0x00000000, 0xffffffdd, 0xfffffffd, 0x00000000, 0x00000000, 0xffffffdd, 0xffffffff, 0x00000000, 0x00000000, 0xffffffdd, 0x00000001, 0x00000000, 0x00000000, 0xffffffdd, 0x00000003, 0x00000000, 0x00000000, 0xffffffdd, 0x00000022, 0x00000000, 0x00000000, 0xffffffdd, 0x0000009d, 0x00000000, 0x00000000, 0xffffffdd, 0x000000fb, 0x00000000, 0x00000000, 0xffffffdd, 0x000000fd, 0x00000000, 0x00000000, 0xffffffdd, 0x0000807c, 0x00000000, 0x00000000, 0xffffffdd, 0x0000fffb, 0x00000000, 0x00000000, 0xffffffdd, 0x0000fffd, 0x00000000, 0x00000000, 0xffffffdd, 0x3333b332, 0x00000000, 0x00000000, 0xffffffdd, 0x88888888, 0x00000000, 0x00000000, 0xffffffdd, 0xd5555552, 0x00000000, 0x00000000, 0xffffffdd, 0xfffffffb, 0x00000000, 0x00000000, 0xffffffdd, 0xfffffffd, 0x00000000, 0x00000000, 0xffffffdd, 0xffffffff, 0x00000000, 0x00000000, 0xffffffdd, 0x00000001, 0x00000000, 0x00000000, 0xffffffdd, 0x2aaaaaab, 0x00000000, 0x00000000, 0xffffffdd, 0x77777776, 0x00000000, 0x00000000, 0xffffffdd, 0xcccc4ccc, 0x00000000, 0x00000000, 0xffffffdd, 0xffff0001, 0x00000000, 0x00000000, 0xffffffdd, 0xffff0003, 0x00000000, 0x00000000, 0xffffffdd, 0xffff0005, 0x00000000, 0x00000000, 0xffffffdd, 0xffff7f83, 0x00000000, 0x00000000, 0xffffffdd, 0xffffff01, 0x00000000, 0x00000000, 0xffffffdd, 0xffffff03, 0x00000000, 0x00000000, 0xffffffdd, 0xffffff05, 0x00000000, 0x00000000, 0xffffffdd, 0xffffff63, 0x00000000, 0x00000000, 0xffffffdd, 0xffffffdd, 0x00000000, 0x00000000, }; const unsigned kExpectedCount_NEON_addp_2S = 961; #endif // VIXL_SIM_ADDP_2S_TRACE_AARCH64_H_
21,645