text
stringlengths
4
6.14k
# include<stdio.h> int main() { long long int n; long long int ans; while(1) { scanf("%lld",&n); if(n==0) break; n--; ans = 7*n + (3*n*(n-1))/2; ans += 5; printf("%lld\n",ans); } return 0; }
#pragma once #include <limits> #include <algorithm> #include <cmath> #include "hostdevice.h" #include "type_defs.h" namespace ctc_helper { static const float threshold = 1e-1; template<typename T> HOSTDEVICE T neg_inf() { return -T(INFINITY); } inline int div_up(int x, int y) { return (x + y - 1) / y; } template <typename Arg, typename Res = Arg> struct maximum { HOSTDEVICE Res operator()(const Arg& x, const Arg& y) const { return x < y ? y : x; } }; template <typename Arg, typename Res = Arg> struct add { HOSTDEVICE Res operator()(const Arg& x, const Arg& y) const { return x + y; } }; template <typename Arg, typename Res = Arg> struct identity { HOSTDEVICE Res operator()(const Arg& x) const {return Res(x);} }; template <typename Arg, typename Res = Arg> struct negate { HOSTDEVICE Res operator()(const Arg& x) const {return Res(-x);} }; template <typename Arg, typename Res = Arg> struct exponential { HOSTDEVICE Res operator()(const Arg& x) const {return std::exp(x);} }; template<typename Arg1, typename Arg2 = Arg1, typename Res=Arg1> struct log_plus { typedef Res result_type; HOSTDEVICE Res operator()(const Arg1& p1, const Arg2& p2) { if (p1 == neg_inf<Arg1>()) return p2; if (p2 == neg_inf<Arg2>()) return p1; Res result = log1p(exp(-fabs(p1 - p2))) + maximum<Res>()(p1, p2); return result; } }; }
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/datasync/DataSync_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace DataSync { namespace Model { /** * <p>Represents a single entry in a list of AWS resource tags. * <code>TagListEntry</code> returns an array that contains a list of tasks when * the <a>ListTagsForResource</a> operation is called.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/TagListEntry">AWS * API Reference</a></p> */ class AWS_DATASYNC_API TagListEntry { public: TagListEntry(); TagListEntry(Aws::Utils::Json::JsonView jsonValue); TagListEntry& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The key for an AWS resource tag.</p> */ inline const Aws::String& GetKey() const{ return m_key; } /** * <p>The key for an AWS resource tag.</p> */ inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; } /** * <p>The key for an AWS resource tag.</p> */ inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; } /** * <p>The key for an AWS resource tag.</p> */ inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); } /** * <p>The key for an AWS resource tag.</p> */ inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); } /** * <p>The key for an AWS resource tag.</p> */ inline TagListEntry& WithKey(const Aws::String& value) { SetKey(value); return *this;} /** * <p>The key for an AWS resource tag.</p> */ inline TagListEntry& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;} /** * <p>The key for an AWS resource tag.</p> */ inline TagListEntry& WithKey(const char* value) { SetKey(value); return *this;} /** * <p>The value for an AWS resource tag.</p> */ inline const Aws::String& GetValue() const{ return m_value; } /** * <p>The value for an AWS resource tag.</p> */ inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; } /** * <p>The value for an AWS resource tag.</p> */ inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; } /** * <p>The value for an AWS resource tag.</p> */ inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); } /** * <p>The value for an AWS resource tag.</p> */ inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); } /** * <p>The value for an AWS resource tag.</p> */ inline TagListEntry& WithValue(const Aws::String& value) { SetValue(value); return *this;} /** * <p>The value for an AWS resource tag.</p> */ inline TagListEntry& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;} /** * <p>The value for an AWS resource tag.</p> */ inline TagListEntry& WithValue(const char* value) { SetValue(value); return *this;} private: Aws::String m_key; bool m_keyHasBeenSet; Aws::String m_value; bool m_valueHasBeenSet; }; } // namespace Model } // namespace DataSync } // namespace Aws
/* * Copyright 2014 Thomas Fidler * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef STROMX_RASPI_RASPI_H #define STROMX_RASPI_RASPI_H #include <locale> #include "stromx/raspi/Config.h" #include "GpioTrigger.h" namespace stromx { namespace runtime { class Registry; } } extern "C" { STROMX_RASPI_API void stromxRaspiRegister(stromx::runtime::Registry& registry); } #endif // STROMX_RASPI_RASPI_H
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/config/ConfigService_EXPORTS.h> #include <aws/config/ConfigServiceRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace ConfigService { namespace Model { /** * <p>The input for the <a>DeleteDeliveryChannel</a> action. The action accepts the * following data, in JSON format. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteDeliveryChannelRequest">AWS * API Reference</a></p> */ class AWS_CONFIGSERVICE_API DeleteDeliveryChannelRequest : public ConfigServiceRequest { public: DeleteDeliveryChannelRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DeleteDeliveryChannel"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The name of the delivery channel to delete.</p> */ inline const Aws::String& GetDeliveryChannelName() const{ return m_deliveryChannelName; } /** * <p>The name of the delivery channel to delete.</p> */ inline bool DeliveryChannelNameHasBeenSet() const { return m_deliveryChannelNameHasBeenSet; } /** * <p>The name of the delivery channel to delete.</p> */ inline void SetDeliveryChannelName(const Aws::String& value) { m_deliveryChannelNameHasBeenSet = true; m_deliveryChannelName = value; } /** * <p>The name of the delivery channel to delete.</p> */ inline void SetDeliveryChannelName(Aws::String&& value) { m_deliveryChannelNameHasBeenSet = true; m_deliveryChannelName = std::move(value); } /** * <p>The name of the delivery channel to delete.</p> */ inline void SetDeliveryChannelName(const char* value) { m_deliveryChannelNameHasBeenSet = true; m_deliveryChannelName.assign(value); } /** * <p>The name of the delivery channel to delete.</p> */ inline DeleteDeliveryChannelRequest& WithDeliveryChannelName(const Aws::String& value) { SetDeliveryChannelName(value); return *this;} /** * <p>The name of the delivery channel to delete.</p> */ inline DeleteDeliveryChannelRequest& WithDeliveryChannelName(Aws::String&& value) { SetDeliveryChannelName(std::move(value)); return *this;} /** * <p>The name of the delivery channel to delete.</p> */ inline DeleteDeliveryChannelRequest& WithDeliveryChannelName(const char* value) { SetDeliveryChannelName(value); return *this;} private: Aws::String m_deliveryChannelName; bool m_deliveryChannelNameHasBeenSet; }; } // namespace Model } // namespace ConfigService } // namespace Aws
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "bleprph.h" /** * Utility function to log an array of bytes. */ void print_bytes(const uint8_t *bytes, int len) { int i; for (i = 0; i < len; i++) { BLEPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]); } } void print_addr(const void *addr) { const uint8_t *u8p; u8p = addr; BLEPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x", u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]); }
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/ec2/model/ResponseMetadata.h> #include <aws/ec2/model/PrefixList.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Xml { class XmlDocument; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** * <p>Contains the output of DescribePrefixLists.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixListsResult">AWS * API Reference</a></p> */ class AWS_EC2_API DescribePrefixListsResponse { public: DescribePrefixListsResponse(); DescribePrefixListsResponse(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); DescribePrefixListsResponse& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); /** * <p>All available prefix lists.</p> */ inline const Aws::Vector<PrefixList>& GetPrefixLists() const{ return m_prefixLists; } /** * <p>All available prefix lists.</p> */ inline void SetPrefixLists(const Aws::Vector<PrefixList>& value) { m_prefixLists = value; } /** * <p>All available prefix lists.</p> */ inline void SetPrefixLists(Aws::Vector<PrefixList>&& value) { m_prefixLists = std::move(value); } /** * <p>All available prefix lists.</p> */ inline DescribePrefixListsResponse& WithPrefixLists(const Aws::Vector<PrefixList>& value) { SetPrefixLists(value); return *this;} /** * <p>All available prefix lists.</p> */ inline DescribePrefixListsResponse& WithPrefixLists(Aws::Vector<PrefixList>&& value) { SetPrefixLists(std::move(value)); return *this;} /** * <p>All available prefix lists.</p> */ inline DescribePrefixListsResponse& AddPrefixLists(const PrefixList& value) { m_prefixLists.push_back(value); return *this; } /** * <p>All available prefix lists.</p> */ inline DescribePrefixListsResponse& AddPrefixLists(PrefixList&& value) { m_prefixLists.push_back(std::move(value)); return *this; } /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline const Aws::String& GetNextToken() const{ return m_nextToken; } /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline void SetNextToken(const Aws::String& value) { m_nextToken = value; } /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); } /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline void SetNextToken(const char* value) { m_nextToken.assign(value); } /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline DescribePrefixListsResponse& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;} /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline DescribePrefixListsResponse& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;} /** * <p>The token to use when requesting the next set of items. If there are no * additional items to return, the string is empty.</p> */ inline DescribePrefixListsResponse& WithNextToken(const char* value) { SetNextToken(value); return *this;} inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; } inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; } inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); } inline DescribePrefixListsResponse& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;} inline DescribePrefixListsResponse& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;} private: Aws::Vector<PrefixList> m_prefixLists; Aws::String m_nextToken; ResponseMetadata m_responseMetadata; }; } // namespace Model } // namespace EC2 } // namespace Aws
/** * eg0301.c * A trick about lseek. * We can get current offset of a file by setting argument offset of lseek as 0. * current = lseek( fd, 0, SET_CUR ); * We can also use that to test whether standard input is seekable. */ #include <unistd.h> #include <stdio.h> int main( int argc, char **argv ) { if ( lseek( STDIN_FILENO, 0, SEEK_CUR ) == -1 ) { fprintf( stderr, "Cannot seek\n" ); } else { printf( "Seek OK\n" ); } return 0; }
#import <Foundation/Foundation.h> #import <MapKit/MKAnnotation.h> @interface UserAnnotation : NSObject <MKAnnotation> { UIImageView *leftCalloutView; CLLocationCoordinate2D coordinate; NSString *currentAddress; } @property (nonatomic,readonly) UIImageView *leftCalloutView; @end
//################################################################################################# //### Function: CGI for Hidden Tools Func //### ESP 8266EX SOC Activities ... //### (C) EcSUHA //### Maik Schulze, Sandfuhren 4, 38448 Wolfsburg, Germany //### MSchulze780@GMAIL.COM //### EcSUHA - ECONOMIC SURVEILLANCE AND HOME AUTOMATION - WWW.EcSUHA.DE //################################################################################################## #include "ProjectConfig.h" #include <esp8266.h> #include "WebIf_Module.h" #include "Platform.h" //ToDo: // update debug msgs #define SCDE_WIFI_DBG 5 /* #include "c_types.h" #include <string.h> #include <osapi.h> #include "user_interface.h" #include "mem.h" #include "SCDED.h" */ //#include "CGI_StdUi.h" //#include "espmissingincludes.h" //#include "SCDE.h" //#include "CloudUpdate.h" #include "HTools_cgi.h" #include "CGI_NoAuthErr.h" #include "CGI_NotFoundErr.h" /* -------------------------------------------------------------------------------------------------- * FName: ReadFullFlash_cgi * Desc: Function to finally transmitts the data in the Send-Buffer (conn->sendBuff - if any) * This should be a hidden function - File download of mirrored 1st Megabyte of SPI Flash * Methods: POST || GET ; Scheme: http ; Mime: cgi ; Url: SOCHWCfg * Para: WebIf_HTTPDConnSlotData_t *conn -> ptr to connection slot * Rets: int -> cgi result cmd * -------------------------------------------------------------------------------------------------- */ int ICACHE_FLASH_ATTR ReadFullFlash_cgi(WebIf_HTTPDConnSlotData_t *conn) { // Connection aborted? Nothing to clean up. if (conn->conn == NULL) return HTTPD_CGI_DISCONNECT_CONN; // --------------------------------------------------------------------------------------------------- // Check if Parser is ready if (conn->SlotParserState != s_HTTPD_Msg_Prsd_Complete) return HTTPD_CGI_WAITRX_CONN; // --------------------------------------------------------------------------------------------------- /*spz // Check for valid authorization (AUTH_GENERIC_RESSOURCE) if (SCDED_AuthCheck(conn, AUTH_GENERIC_RESSOURCE)) { // set callback for "Not Authorized Error" conn->cgi = NoAuthErr_cgi; return HTTPD_CGI_REEXECUTE; } */ //--------------------------------------------------------------------------------------------------- # if SCDE_WIFI_DBG >= 3 char *Args; if (conn->parser_method == HTTP_GET) // GET Method ? { Args = conn->getArgs; } else //if (conn->parser_method == HTTP_POST) // POST Method ? { // all post data buffered? If not continue receiving all post data to buffer ... if (conn->parser_content_length) return HTTPD_CGI_PROCESS_CONN; Args = conn->p_body_data; } // # if SCDE_WIFI_DBG >= 3 if (Args == NULL) { os_printf(".cgi->NO Args!"); } else { os_printf(".cgi->Args:%s\n",Args); } # endif //-------------------------------------------------------------------------------------------------- // load TXed position int *pos = (int *) &conn->PCData; // Init / Start Downloading indicated by 0 if (*pos == 0) { # if SCDE_WIFI_DBG >= 4 os_printf("DL SPI-Flash.\n"); # endif SCDED_StartRespHeader(conn, 200); SCDED_AddHdrFld(conn, "Content-Type", "application/bin", -1); SCDED_EndHeader(conn); // dram0_0_seg : org = 0x3FFE8000, len = 0x14000 // iram1_0_seg : org = 0x40100000, len = 0x8000 // *pos=0x40200000; *pos=0x3FFE8000; // return HTTPD_CGI_PROCESS_CONN; } // transfer next 1024 Byte Block HTTPD_Send_To_Send_Buffer(conn, (const char *)(*pos), 1024); // increase TXed position *pos += 1024; // reached upper ROM-Mirror-End end = ready? // if (*pos>=0x40200000+(1024*1024)) if (*pos>=0x3FFE8000 + 0x14000) return HTTPD_CGI_DISCONNECT_CONN; // else continue till 1-MByte done else return HTTPD_CGI_PROCESS_CONN; }
/* 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. */ // // MainViewController.h // TaxiMeter // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. // #import <Cordova/CDVViewController.h> #import <Cordova/CDVCommandDelegateImpl.h> #import <Cordova/CDVCommandQueue.h> @interface MainViewController : CDVViewController @end @interface MainCommandDelegate : CDVCommandDelegateImpl @end @interface MainCommandQueue : CDVCommandQueue @end
// // JSUtility.h // JSKit // // Created by mallarke on 11/2/13. // Copyright (c) 2013 shadow coding. All rights reserved. // #import <Foundation/Foundation.h> #pragma mark - JSUtility methods - int get_os_version(); BOOL is_ipad(); BOOL is_text_valid(NSString *text); void dispatch_main_async(dispatch_block_t block); NSString *format_string(NSString *format, NSString *firstString, va_list list); #pragma mark - Swizzle methods - void js_swizzle_class_method(Class c, SEL originalSelector, SEL replacementSelector); void js_swizzle_instance_method(Class c, SEL originalSelector, SEL replacementSelector);
// // RFODataErrorHandler.h // ROADWebService // // Copyright (c) 2014 EPAM Systems, Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // Redistributions in binary form must reproduce the above copyright notice, this // list of conditions and the following disclaimer in the documentation and/or // other materials provided with the distribution. // Neither the name of the EPAM Systems, Inc. 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 HOLDER 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. // // See the NOTICE file and the LICENSE file distributed with this work // for additional information regarding copyright ownership and licensing #import "RFWebServiceErrorHandling.h" @interface RFODataErrorHandler : NSObject <RFWebServiceErrorHandling> + (id)generateErrorForResponse:(NSHTTPURLResponse *)response withData:(NSData *)data; @end
// // YR_AccountModel.h // __PRODUCTNAME__ // // Created by dllo on 16/09/19 // Copyright (c) __ORGANIZATIONNAME__. All rights reserved. // #import "YR_BaseModel.h" @class YR_AccountUserModel,YR_AccountSyncModel,YR_AccountBirthdayModel; @interface YR_AccountModel : YR_BaseModel @property (nonatomic, strong) YR_AccountUserModel *user; @property (nonatomic, strong) NSNumber *code; @end
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_keyed_service_factory.h" namespace history { class WebHistoryService; } // Used for creating and fetching a per-profile instance of the // WebHistoryService. class WebHistoryServiceFactory : public ProfileKeyedServiceFactory { public: // Get the singleton instance of the factory. static WebHistoryServiceFactory* GetInstance(); // Get the WebHistoryService for |profile|, creating one if needed. static history::WebHistoryService* GetForProfile(Profile* profile); protected: // Overridden from ProfileKeyedServiceFactory. virtual ProfileKeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const OVERRIDE; private: friend struct DefaultSingletonTraits<WebHistoryServiceFactory>; explicit WebHistoryServiceFactory(); virtual ~WebHistoryServiceFactory(); DISALLOW_COPY_AND_ASSIGN(WebHistoryServiceFactory); }; #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CLIF_TESTING_VIRTUAL_FUNCS_H_ #define CLIF_TESTING_VIRTUAL_FUNCS_H_ #include <Python.h> #include <memory> #include <vector> struct B { int c; int get_c() { return c; } virtual void set_c(int i) { c = i; } virtual ~B() {} B() : c(0) {} }; void Bset(B* b, int v) { b->set_c(v); } struct D : B { void set_c(int i) override { c = (i > 0) ? i : -i; } }; struct K { int i; K(): i(0) {} virtual ~K() {} virtual void inc(int) = 0; }; std::vector<int> Kseq(K* k, int step, int stop) { std::vector<int> r; while (k->i <= stop) { r.push_back(k->i); k->inc(step); } return r; } struct Q { virtual ~Q() {} virtual bool PossiblyPush(int) = 0; }; class AbstractClassNonDefConst { public: AbstractClassNonDefConst(int a, int b) : my_a(a), my_b(b) { } virtual ~AbstractClassNonDefConst() { } virtual int DoSomething() const = 0; int my_a; int my_b; }; inline int DoSomething(const AbstractClassNonDefConst& a) { return a.DoSomething(); } class ClassNonDefConst { public: ClassNonDefConst(int a, int b) : my_a(a), my_b(b) { } virtual ~ClassNonDefConst() { } virtual int DoSomething() const { return my_a + my_b; } int my_a; int my_b; }; class Manager { public: Manager(std::shared_ptr<ClassNonDefConst> c) : c_(c) {} int DoIt() { return c_->DoSomething(); } private: std::shared_ptr<ClassNonDefConst> c_; }; inline int DoSomething(const ClassNonDefConst& a) { return a.DoSomething(); } inline int add_seq(Q* q, int step, int stop) { int added = 0; for (int i=0; i <= stop; i+=step) { if (q->PossiblyPush(i)) ++added; } return added; } inline int DoUniq(std::unique_ptr<ClassNonDefConst> c) { return c->DoSomething(); } struct TestReturnsObject { virtual PyObject* CreateObject() = 0; virtual ~TestReturnsObject() {} int GetRefcntOfResult() { PyObject* result = CreateObject(); int refcnt = Py_REFCNT(result); Py_XDECREF(result); return refcnt; } }; #endif // CLIF_TESTING_VIRTUAL_FUNCS_H_
/** @file etk_filechooser_widget.h */ #ifndef _ETK_FILECHOOSER_WIDGET_H_ #define _ETK_FILECHOOSER_WIDGET_H_ #include <Evas.h> #include "etk_widget.h" #include "etk_types.h" /** * @defgroup Etk_Filechooser_Widget Etk_Filechooser_Widget * @{ */ /** Gets the type of a fileschooser widget */ #define ETK_FILECHOOSER_WIDGET_TYPE (etk_filechooser_widget_type_get()) /** Casts the object to an Etk_Filechooser_Widget */ #define ETK_FILECHOOSER_WIDGET(obj) (ETK_OBJECT_CAST((obj), ETK_FILECHOOSER_WIDGET_TYPE, Etk_Filechooser_Widget)) /** Checks if the object is an Etk_Filechooser_Widget */ #define ETK_IS_FILECHOOSER_WIDGET(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_FILECHOOSER_WIDGET_TYPE)) /** * @struct Etk_Filechooser_Widget * @brief An Etk_Filechooser_Widget is a widget used to select one or more files */ struct Etk_Filechooser_Widget { /* private: */ /* Inherit from Etk_Widget */ Etk_Widget widget; Etk_Widget *vbox; Etk_Widget *name_entry; Etk_Widget *places_tree; Etk_Tree_Col *places_col; Etk_Widget *fav_tree; Etk_Tree_Col *fav_col; Etk_Widget *files_tree; Etk_Tree_Col *files_name_col; Etk_Tree_Col *files_date_col; Etk_Bool select_multiple; Etk_Bool show_hidden; Etk_Bool is_save; char *current_folder; }; Etk_Type *etk_filechooser_widget_type_get(void); Etk_Widget *etk_filechooser_widget_new(void); void etk_filechooser_widget_select_multiple_set(Etk_Filechooser_Widget *filechooser_widget, Etk_Bool select_multiple); Etk_Bool etk_filechooser_widget_select_multiple_get(Etk_Filechooser_Widget *filechooser_widget); void etk_filechooser_widget_show_hidden_set(Etk_Filechooser_Widget *filechooser_widget, Etk_Bool show_hidden); Etk_Bool etk_filechooser_widget_show_hidden_get(Etk_Filechooser_Widget *filechooser_widget); void etk_filechooser_widget_is_save_set(Etk_Filechooser_Widget *filechooser_widget, Etk_Bool is_save); Etk_Bool etk_filechooser_widget_is_save_get(Etk_Filechooser_Widget *filechooser_widget); void etk_filechooser_widget_current_folder_set(Etk_Filechooser_Widget *filechooser_widget, const char *folder); const char *etk_filechooser_widget_current_folder_get(Etk_Filechooser_Widget *filechooser_widget); const char *etk_filechooser_widget_selected_file_get(Etk_Filechooser_Widget *widget); Evas_List *etk_filechooser_widget_selected_files_get(Etk_Filechooser_Widget *widget); /** @} */ #endif
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/worklink/WorkLink_EXPORTS.h> #include <aws/worklink/WorkLinkRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace WorkLink { namespace Model { /** */ class AWS_WORKLINK_API DescribeCompanyNetworkConfigurationRequest : public WorkLinkRequest { public: DescribeCompanyNetworkConfigurationRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DescribeCompanyNetworkConfiguration"; } Aws::String SerializePayload() const override; /** * <p>The ARN of the fleet.</p> */ inline const Aws::String& GetFleetArn() const{ return m_fleetArn; } /** * <p>The ARN of the fleet.</p> */ inline bool FleetArnHasBeenSet() const { return m_fleetArnHasBeenSet; } /** * <p>The ARN of the fleet.</p> */ inline void SetFleetArn(const Aws::String& value) { m_fleetArnHasBeenSet = true; m_fleetArn = value; } /** * <p>The ARN of the fleet.</p> */ inline void SetFleetArn(Aws::String&& value) { m_fleetArnHasBeenSet = true; m_fleetArn = std::move(value); } /** * <p>The ARN of the fleet.</p> */ inline void SetFleetArn(const char* value) { m_fleetArnHasBeenSet = true; m_fleetArn.assign(value); } /** * <p>The ARN of the fleet.</p> */ inline DescribeCompanyNetworkConfigurationRequest& WithFleetArn(const Aws::String& value) { SetFleetArn(value); return *this;} /** * <p>The ARN of the fleet.</p> */ inline DescribeCompanyNetworkConfigurationRequest& WithFleetArn(Aws::String&& value) { SetFleetArn(std::move(value)); return *this;} /** * <p>The ARN of the fleet.</p> */ inline DescribeCompanyNetworkConfigurationRequest& WithFleetArn(const char* value) { SetFleetArn(value); return *this;} private: Aws::String m_fleetArn; bool m_fleetArnHasBeenSet; }; } // namespace Model } // namespace WorkLink } // namespace Aws
// // technology.h // WeProject // // Created by 千锋 on 16/6/27. // Copyright (c) 2016年 千锋. All rights reserved. // #import "baseView.h" @interface technology : baseView @end
// // NSObject+emptyNullValue.h // Events // // Created by Thiago Lioy on 12/8/13. // Copyright (c) 2013 Thiago Lioy. All rights reserved. // #import <Foundation/Foundation.h> @interface NSObject (emptyNullValue) -(NSString*)emptyNullValue:(NSString*)value; @end
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * base class for rendering objects that can be split across lines, * columns, or pages */ #ifndef nsSplittableFrame_h___ #define nsSplittableFrame_h___ #include "mozilla/Attributes.h" #include "nsFrame.h" // Derived class that allows splitting class nsSplittableFrame : public nsFrame { public: NS_DECL_FRAMEARENA_HELPERS virtual void Init(nsIContent* aContent, nsContainerFrame* aParent, nsIFrame* aPrevInFlow) override; virtual nsSplittableType GetSplittableType() const override; virtual void DestroyFrom(nsIFrame* aDestructRoot) override; /* * Frame continuations can be either fluid or not: * Fluid continuations ("in-flows") are the result of line breaking, * column breaking, or page breaking. * Other (non-fluid) continuations can be the result of BiDi frame splitting. * A "flow" is a chain of fluid continuations. */ // Get the previous/next continuation, regardless of its type (fluid or non-fluid). virtual nsIFrame* GetPrevContinuation() const override; virtual nsIFrame* GetNextContinuation() const override; // Set a previous/next non-fluid continuation. virtual void SetPrevContinuation(nsIFrame*) override; virtual void SetNextContinuation(nsIFrame*) override; // Get the first/last continuation for this frame. virtual nsIFrame* FirstContinuation() const override; virtual nsIFrame* LastContinuation() const override; #ifdef DEBUG // Can aFrame2 be reached from aFrame1 by following prev/next continuations? static bool IsInPrevContinuationChain(nsIFrame* aFrame1, nsIFrame* aFrame2); static bool IsInNextContinuationChain(nsIFrame* aFrame1, nsIFrame* aFrame2); #endif // Get the previous/next continuation, only if it is fluid (an "in-flow"). nsIFrame* GetPrevInFlow() const; nsIFrame* GetNextInFlow() const; virtual nsIFrame* GetPrevInFlowVirtual() const override { return GetPrevInFlow(); } virtual nsIFrame* GetNextInFlowVirtual() const override { return GetNextInFlow(); } // Set a previous/next fluid continuation. virtual void SetPrevInFlow(nsIFrame*) override; virtual void SetNextInFlow(nsIFrame*) override; // Get the first/last frame in the current flow. virtual nsIFrame* FirstInFlow() const override; virtual nsIFrame* LastInFlow() const override; // Remove the frame from the flow. Connects the frame's prev-in-flow // and its next-in-flow. This should only be called in frame Destroy() methods. static void RemoveFromFlow(nsIFrame* aFrame); protected: explicit nsSplittableFrame(nsStyleContext* aContext) : nsFrame(aContext) {} /** * Determine the height consumed by our previous-in-flows. * * @note (bz) This makes laying out a splittable frame with N in-flows * O(N^2)! So, use this function with caution and minimize the number * of calls to this method. */ nscoord GetConsumedBSize() const; /** * Retrieve the effective computed block size of this frame, which is the * computed block size, minus the block size consumed by any previous in-flows. */ nscoord GetEffectiveComputedBSize(const nsHTMLReflowState& aReflowState, nscoord aConsumed = NS_INTRINSICSIZE) const; /** * @see nsIFrame::GetLogicalSkipSides() */ virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const override; #ifdef DEBUG virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent) override; #endif nsIFrame* mPrevContinuation; nsIFrame* mNextContinuation; }; #endif /* nsSplittableFrame_h___ */
// // BWMTakeCashTableViewController.h // BeautifulShop // // Created by btw on 15/3/25. // Copyright (c) 2015年 jenk. All rights reserved. // #import <UIKit/UIKit.h> @interface BWMTakeCashTableViewController : UITableViewController @end
// // KituraKit.h // KituraKit // // Created by Aaron Liberatore on 10/30/17. // Copyright © 2017 MIL. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for KituraKit. FOUNDATION_EXPORT double KituraKitVersionNumber; //! Project version string for KituraKit. FOUNDATION_EXPORT const unsigned char KituraKitVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <KituraKit/PublicHeader.h>
/* * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This is not an official Google product. */ extern const char* argv0; void xerror(const char* fmt, ...); // Get a copy of the password. Caller free()s. char* get_password(const char* opt);
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/wisdom/ConnectWisdomService_EXPORTS.h> #include <aws/wisdom/ConnectWisdomServiceRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace ConnectWisdomService { namespace Model { /** */ class AWS_CONNECTWISDOMSERVICE_API GetAssistantRequest : public ConnectWisdomServiceRequest { public: GetAssistantRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "GetAssistant"; } Aws::String SerializePayload() const override; /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline const Aws::String& GetAssistantId() const{ return m_assistantId; } /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline bool AssistantIdHasBeenSet() const { return m_assistantIdHasBeenSet; } /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline void SetAssistantId(const Aws::String& value) { m_assistantIdHasBeenSet = true; m_assistantId = value; } /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline void SetAssistantId(Aws::String&& value) { m_assistantIdHasBeenSet = true; m_assistantId = std::move(value); } /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline void SetAssistantId(const char* value) { m_assistantIdHasBeenSet = true; m_assistantId.assign(value); } /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline GetAssistantRequest& WithAssistantId(const Aws::String& value) { SetAssistantId(value); return *this;} /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline GetAssistantRequest& WithAssistantId(Aws::String&& value) { SetAssistantId(std::move(value)); return *this;} /** * <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs * cannot contain the ARN.</p> */ inline GetAssistantRequest& WithAssistantId(const char* value) { SetAssistantId(value); return *this;} private: Aws::String m_assistantId; bool m_assistantIdHasBeenSet; }; } // namespace Model } // namespace ConnectWisdomService } // namespace Aws
#include <pthread.h> int g; pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER; void *t1(void *arg) { g=1; pthread_mutex_lock(&mutex); g=1; g=0; pthread_mutex_unlock(&mutex); } void *t2(void *arg) { pthread_mutex_lock(&mutex); // this holds due to the lock assert(g==0); pthread_mutex_unlock(&mutex); } void *t3(void *arg) { pthread_mutex_lock(&mutex); assert(g==0); pthread_mutex_unlock(&mutex); } int main() { pthread_t id1, id2, id3; pthread_create(&id1, NULL, t1, NULL); pthread_create(&id2, NULL, t2, NULL); pthread_create(&id3, NULL, t3, NULL); }
// Copyright (C) 2007 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_TUPLe_TOP_ #define DLIB_TUPLe_TOP_ #include "tuple/tuple.h" #endif // DLIB_TUPLe_TOP__
/* * Copyright 2015 Jacques Berger * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> int main(int argc, char** argv) { int* ptr; ptr = (int*) malloc(sizeof(int)); if (!ptr) { printf("Erreur d'allocation de mémoire : %s\n", strerror(errno)); exit(1); } *ptr = 42; printf("Valeur du pointeur : %p\nValeur de l'entier : %d\n", ptr, *ptr); free(ptr); return 0; }
/* * 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. */ /** * @author Vladimir Nenashev * @version $Revision: 1.4 $ */ #include<stdio.h> #include<jni.h> #include<stdlib.h> #include"ExceptionsTest7.h" #include"share.h" JNIEXPORT void JNICALL Java_org_apache_harmony_test_stress_jni_exceptions_ExceptionsTest7_init(JNIEnv *env, jobject thisObject, jint id) { jclass c = (*env)->GetObjectClass(env, thisObject); ExceptionsTest_init_MT(env, c, id); } JNIEXPORT void JNICALL Java_org_apache_harmony_test_stress_jni_exceptions_ExceptionsTest7_nativeMethod( JNIEnv* env, jclass c, jint cnt, jint id){ jthrowable t; (*env)->CallStaticVoidMethod(env, clazz, mid, cnt + 1, id); t = (*env)->ExceptionOccurred(env); if (t) { if ((*env)->IsInstanceOf(env, t, excClass)) { counters[id]--; (*env)->ExceptionClear(env); (*env)->Throw(env, t); } else if ((*env)->IsInstanceOf(env, t, sofClass)) { counters[id] = cnt; printf("SOF caught\n"); (*env)->ExceptionClear(env); (*env)->ThrowNew(env, excClass, "StackOverflow caught in native code"); } else { printf("Native code: Unexpected exception caught\n"); } return; } else { printf("Native code: No exception caught\n"); return; } }
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ // // @author GS <sgazeos@gmail.com> // #ifndef __DIAG_H_HELPERS__ #define __DIAG_H_HELPERS__ #include <system/op_boilerplate.h> #include <array/NDArray.h> namespace sd { namespace ops { namespace helpers { void diagFunctor(sd::LaunchContext * context, NDArray const* input, NDArray* output); void diagPartFunctor(sd::LaunchContext * context, NDArray const* input, NDArray* output); } } } #endif
#ifndef KISS_FFT_H #define KISS_FFT_H #include <stdlib.h> #include <stdio.h> #include <math.h> //#include <string.h> /* Patched by create_tflm_arduino.py for Arduino compatibility */ #ifdef __cplusplus extern "C++" { #endif /* ATTENTION! If you would like a : -- a utility that will handle the caching of fft objects -- real-only (no imaginary time component ) FFT -- a multi-dimensional FFT -- a command-line utility to perform ffts -- a command-line utility to perform fast-convolution filtering Then see kfc.h kiss_fftr.h kiss_fftnd.h fftutil.c kiss_fastfir.c in the tools/ directory. */ #ifdef USE_SIMD # include <xmmintrin.h> # define kiss_fft_scalar __m128 #define KISS_FFT_MALLOC(nbytes) _mm_malloc(nbytes,16) #define KISS_FFT_FREE _mm_free #else #define KISS_FFT_MALLOC(X) (void*)(0x0) /* Patched. */ #define KISS_FFT_FREE(X) /* Patched. */ #endif #ifdef FIXED_POINT #include <stdint.h> /* Patched. */ # if (FIXED_POINT == 32) # define kiss_fft_scalar int32_t # else # define kiss_fft_scalar int16_t # endif #else # ifndef kiss_fft_scalar /* default is float */ # define kiss_fft_scalar float # endif #endif typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; typedef struct kiss_fft_state* kiss_fft_cfg; /* * kiss_fft_alloc * * Initialize a FFT (or IFFT) algorithm's cfg/state buffer. * * typical usage: kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL); * * The return value from fft_alloc is a cfg buffer used internally * by the fft routine or NULL. * * If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc. * The returned value should be free()d when done to avoid memory leaks. * * The state can be placed in a user supplied buffer 'mem': * If lenmem is not NULL and mem is not NULL and *lenmem is large enough, * then the function places the cfg in mem and the size used in *lenmem * and returns mem. * * If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough), * then the function returns NULL and places the minimum cfg * buffer size in *lenmem. * */ kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem); /* * kiss_fft(cfg,in_out_buf) * * Perform an FFT on a complex input buffer. * for a forward FFT, * fin should be f[0] , f[1] , ... ,f[nfft-1] * fout will be F[0] , F[1] , ... ,F[nfft-1] * Note that each element is complex and can be accessed like f[k].r and f[k].i * */ void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout); /* A more generic version of the above function. It reads its input from every Nth sample. * */ void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride); /* If kiss_fft_alloc allocated a buffer, it is one contiguous buffer and can be simply free()d when no longer needed*/ #define kiss_fft_free free /* Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up your compiler output to call this before you exit. */ void kiss_fft_cleanup(void); /* * Returns the smallest integer k, such that k>=n and k has only "fast" factors (2,3,5) */ int kiss_fft_next_fast_size(int n); /* for real ffts, we need an even size */ #define kiss_fftr_next_fast_size_real(n) \ (kiss_fft_next_fast_size( ((n)+1)>>1)<<1) #ifdef __cplusplus } #endif #endif
#define ZOO_VERSION "4.0.111"
#import "LocationManager.h" #import "LocationPredictor.h" #import "MWMViewController.h" #import <MyTargetSDKCorp/MTRGNativeAppwallAd.h> #include "geometry/point2d.hpp" #include "geometry/rect2d.hpp" #include "indexer/map_style.hpp" namespace search { struct AddressInfo; } @class MWMMapViewControlsManager; @class MWMAPIBar; @interface MapViewController : MWMViewController <LocationObserver> { LocationPredictor * m_predictor; } // called when app is terminated by system - (void)onTerminate; - (void)onEnterForeground; - (void)onEnterBackground; - (void)onGetFocus:(BOOL)isOnFocus; - (void)setMapStyle:(MapStyle)mapStyle; - (void)updateStatusBarStyle; - (void)showAPIBar; - (void)performAction:(NSString *)action; - (void)openMigration; - (void)openBookmarks; - (void)openMapsDownloader; - (void)openEditor; - (void)refreshAd; - (void)initialize; @property (nonatomic) MTRGNativeAppwallAd * appWallAd; @property (nonatomic, readonly) BOOL isAppWallAdActive; @property (nonatomic, readonly) MWMMapViewControlsManager * controlsManager; @property (nonatomic) m2::PointD restoreRouteDestination; @property (nonatomic) MWMAPIBar * apiBar; @end
// Copyright 2018 the V8 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. #ifndef V8_TORQUE_CFG_H_ #define V8_TORQUE_CFG_H_ #include <list> #include <memory> #include <unordered_map> #include <vector> #include "src/torque/ast.h" #include "src/torque/instructions.h" #include "src/torque/source-positions.h" #include "src/torque/types.h" namespace v8 { namespace internal { namespace torque { class Block { public: explicit Block(size_t id, base::Optional<Stack<const Type*>> input_types, bool is_deferred) : input_types_(std::move(input_types)), id_(id), is_deferred_(is_deferred) {} void Add(Instruction instruction) { DCHECK(!IsComplete()); instructions_.push_back(std::move(instruction)); } bool HasInputTypes() const { return input_types_ != base::nullopt; } const Stack<const Type*>& InputTypes() const { return *input_types_; } void SetInputTypes(const Stack<const Type*>& input_types); const std::vector<Instruction>& instructions() const { return instructions_; } bool IsComplete() const { return !instructions_.empty() && instructions_.back()->IsBlockTerminator(); } size_t id() const { return id_; } bool IsDeferred() const { return is_deferred_; } private: std::vector<Instruction> instructions_; base::Optional<Stack<const Type*>> input_types_; const size_t id_; bool is_deferred_; }; class ControlFlowGraph { public: explicit ControlFlowGraph(Stack<const Type*> input_types) { start_ = NewBlock(std::move(input_types), false); PlaceBlock(start_); } Block* NewBlock(base::Optional<Stack<const Type*>> input_types, bool is_deferred) { blocks_.emplace_back(next_block_id_++, std::move(input_types), is_deferred); return &blocks_.back(); } void PlaceBlock(Block* block) { placed_blocks_.push_back(block); } Block* start() const { return start_; } base::Optional<Block*> end() const { return end_; } void set_end(Block* end) { end_ = end; } void SetReturnType(const Type* t) { if (!return_type_) { return_type_ = t; return; } if (t != *return_type_) { ReportError("expected return type ", **return_type_, " instead of ", *t); } } const std::vector<Block*>& blocks() const { return placed_blocks_; } private: std::list<Block> blocks_; Block* start_; std::vector<Block*> placed_blocks_; base::Optional<Block*> end_; base::Optional<const Type*> return_type_; size_t next_block_id_ = 0; }; class CfgAssembler { public: explicit CfgAssembler(Stack<const Type*> input_types) : current_stack_(std::move(input_types)), cfg_(current_stack_) {} const ControlFlowGraph& Result() { if (!CurrentBlockIsComplete()) { cfg_.set_end(current_block_); } return cfg_; } Block* NewBlock( base::Optional<Stack<const Type*>> input_types = base::nullopt, bool is_deferred = false) { return cfg_.NewBlock(std::move(input_types), is_deferred); } bool CurrentBlockIsComplete() const { return current_block_->IsComplete(); } void Emit(Instruction instruction) { instruction.TypeInstruction(&current_stack_, &cfg_); current_block_->Add(std::move(instruction)); } const Stack<const Type*>& CurrentStack() const { return current_stack_; } StackRange TopRange(size_t slot_count) const { return CurrentStack().TopRange(slot_count); } void Bind(Block* block); void Goto(Block* block); // Goto block while keeping {preserved_slots} many slots on the top and // deleting additional the slots below these to match the input type of the // target block. // Returns the StackRange of the preserved slots in the target block. StackRange Goto(Block* block, size_t preserved_slots); // The condition must be of type bool and on the top of stack. It is removed // from the stack before branching. void Branch(Block* if_true, Block* if_false); // Delete the specified range of slots, moving upper slots to fill the gap. void DeleteRange(StackRange range); void DropTo(BottomOffset new_level); StackRange Peek(StackRange range, base::Optional<const Type*> type); void Poke(StackRange destination, StackRange origin, base::Optional<const Type*> type); void Print(std::string s); void Unreachable(); void DebugBreak(); private: Stack<const Type*> current_stack_; ControlFlowGraph cfg_; Block* current_block_ = cfg_.start(); }; } // namespace torque } // namespace internal } // namespace v8 #endif // V8_TORQUE_CFG_H_
void main() { float x, a; getid (a); x = a; while (abs (x* x - a) > 1e-6) x = (x + a/x)/2; printid (x); }
/*************************************************************** * * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, * University of Wisconsin-Madison, WI. * * 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. * ***************************************************************/ #if !defined( _CONDOR_BASENAME_H ) #define _CONDOR_BASENAME_H /* NOTE: The semantics of condor_basename() and condor_dirname() are slightly different tha the semantics of the default basename() and dirname(). For example, if the path is "foo/bar/", condor_basename() and condor_dirname() return "" and "foo/bar", while the default basename() and dirname() return "bar" and "foo". (See condor_unit_tests/FTEST_basename/dirname/fullpath for examples of how things work.) */ /* A basename() function that is happy on both Unix and NT. It returns a pointer to the last element of the path it was given, or the whole string, if there are no directory delimiters. There's no memory allocated, overwritten or changed in anyway. */ const char* condor_basename( const char* path ); /* given a pointer to a file basename (see condor_basename) returns a pointer to the file extension, if no extension returns a pointer to the terminating null. A file that contains only a single . at the beginning of the name is considered to have no extension. */ const char* condor_basename_extension_ptr(const char* basename); /* given a pointer to a full file pathname returns a pointer to the file extension if no extension returns a pointer to the terminating null. */ #define condor_filename_extension_ptr(path) condor_basename_extension_ptr(condor_basename(path)) /* A dirname() function that is happy on both Unix and NT. This allocates space for a new string that holds the path of the parent directory of the path it was given. If the given path has no directory delimiters, or is NULL, we just return ".". In all cases, the string we return is new space, and must be deallocated with free(). */ char* condor_dirname( const char* path ); /* DEPRECATED: just in case we need changes along the lines of condor_basename() some time in the future. A dirname() function that is happy on both Unix and NT. This allocates space for a new string that holds the path of the parent directory of the path it was given. If the given path has no directory delimiters, or is NULL, we just return ".". In all cases, the string we return is new space, and must be deallocated with free(). */ char* dirname( const char* path ); /* return TRUE if the given path is a full pathname, FALSE if not. by full pathname, we mean it either begins with "/" or "\" or "*:\" (something like "c:\..." on windoze). This does NOT mean it is in any sort of absolute "canonical" format. It may still contain references to ".." or to symlinks or whatever. */ int fullpath( const char* path ); #endif /* _CONDOR_BASENAME_H */
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_Swiftcraft_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_Swiftcraft_TestsVersionString[];
// // Created by Alexey Rogatkin on 04.06.14. // #import <Foundation/Foundation.h> #import "ITestParentProtocol.h" @protocol ITestChildThree <ITestParentProtocol> @end
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // EstimoteSDK #define COCOAPODS_POD_AVAILABLE_EstimoteSDK #define COCOAPODS_VERSION_MAJOR_EstimoteSDK 2 #define COCOAPODS_VERSION_MINOR_EstimoteSDK 3 #define COCOAPODS_VERSION_PATCH_EstimoteSDK 2
/* ** CodeParser.h ** ** Copyright (c) 2003, 2004 ** ** Author: Yen-Ju <yjchenx@hotmail.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CodeParser_H_ #define _CodeParser_H_ #import <Foundation/NSObject.h> #import <Foundation/NSString.h> #import "CodeHandler.h" @interface CodeParser: NSObject { id <CodeHandler> _handler; NSString *_string; unsigned int _length; unichar *_uchar; } - (CodeParser *) initWithCodeHandler: (id <CodeHandler>) handler withString: (NSString *) text; - (void) parse; @end #endif /* _CodeParser_H_ */
/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com */ #include "tomcrypt.h" /** @file cbc_decrypt.c CBC implementation, encrypt block, Tom St Denis */ #ifdef CBC /** CBC decrypt @param ct Ciphertext @param pt [out] Plaintext @param len The number of bytes to process (must be multiple of block length) @param cbc CBC state @return CRYPT_OK if successful */ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CBC *cbc) { int x, err; unsigned char tmp[16]; #ifdef LTC_FAST LTC_FAST_TYPE tmpy; #else unsigned char tmpy; #endif LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(cbc != NULL); if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { return err; } /* is blocklen valid? */ if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { return CRYPT_INVALID_ARG; } if (len % cbc->blocklen) { return CRYPT_INVALID_ARG; } #ifdef LTC_FAST if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { return CRYPT_INVALID_ARG; } #endif if (cipher_descriptor[cbc->cipher].accel_cbc_decrypt != NULL) { return cipher_descriptor[cbc->cipher].accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cbc->key); } else { while (len) { /* decrypt */ if ((err = cipher_descriptor[cbc->cipher].ecb_decrypt(ct, tmp, &cbc->key)) != CRYPT_OK) { return err; } /* xor IV against plaintext */ #if defined(LTC_FAST) for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { tmpy = *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^ *((LTC_FAST_TYPE*)((unsigned char *)tmp + x)); *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; } #else for (x = 0; x < cbc->blocklen; x++) { tmpy = tmp[x] ^ cbc->IV[x]; cbc->IV[x] = ct[x]; pt[x] = tmpy; } #endif ct += cbc->blocklen; pt += cbc->blocklen; len -= cbc->blocklen; } } return CRYPT_OK; } #endif /* $Source: /cvs/libtom/libtomcrypt/src/modes/cbc/cbc_decrypt.c,v $ */ /* $Revision: 1.13 $ */ /* $Date: 2006/03/31 14:15:35 $ */
#include "../state.h" #include "../fieldset.h" #ifndef PROBE_MODULES_H #define PROBE_MODULES_H #include "../proto_headers.h" typedef struct probe_response_type { const uint8_t is_success; const char *name; } response_type_t; typedef int (*probe_global_init_cb)(struct state_conf *); typedef int (*probe_thread_init_cb)(void* packetbuf, macaddr_t* src_mac, macaddr_t* gw_mac, port_n_t src_port); typedef int (*probe_make_packet_cb)(void* packetbuf, ipaddr_n_t src_ip, ipaddr_n_t dst_ip, uint32_t *validation, int probe_num); typedef void (*probe_print_packet_cb)(FILE *, void* packetbuf); typedef int (*probe_close_cb)(struct state_conf*, struct state_send*, struct state_recv*); #ifdef __FREEBSD__ typedef int (*probe_validate_packet_cb)(const struct zmap_iphdr *ip_hdr, uint32_t len, uint32_t *src_ip, uint32_t *validation); #else typedef int (*probe_validate_packet_cb)(const struct iphdr *ip_hdr, uint32_t len, uint32_t *src_ip, uint32_t *validation); #endif typedef void (*probe_classify_packet_cb)(const u_char* packetbuf, uint32_t len, fieldset_t*); typedef struct probe_module { const char *name; size_t packet_length; const char *pcap_filter; size_t pcap_snaplen; // Should ZMap complain if the user hasn't specified valid // source and target port numbers? uint8_t port_args; probe_global_init_cb global_initialize; probe_thread_init_cb thread_initialize; probe_make_packet_cb make_packet; probe_print_packet_cb print_packet; probe_validate_packet_cb validate_packet; probe_classify_packet_cb process_packet; probe_close_cb close; fielddef_t *fields; int numfields; const char *helptext; } probe_module_t; probe_module_t* get_probe_module_by_name(const char*); #ifdef __FREEBSD__ void fs_add_ip_fields(fieldset_t *fs, struct zmap_iphdr *ip); #else void fs_add_ip_fields(fieldset_t *fs, struct iphdr *ip); #endif void fs_add_system_fields(fieldset_t *fs, int is_repeat, int in_cooldown); void print_probe_modules(void); extern fielddef_t ip_fields[]; extern fielddef_t sys_fields[]; #endif // HEADER_PROBE_MODULES_H
/** * * Test variables * 011-value-casting-operators.phpt * 012-value-casting-operators-double.phpt * */ /** * Set up namespace */ namespace TestVariables { /* * Test Php::Value casting operators */ void value_casting(Php::Parameters &params) { Php::Value value = params[0]; long value1 = value; std::string value2 = value; bool value4 = value; Php::out << " long:" << value1 << "\n string:" << value2 << "\n bool:" << bool2str(value4) << std::endl; } /* * Test Php::Value casting operators */ void value_cast2double(Php::Parameters &params) { Php::Value value = params[0]; double value3 = value; /* * The remark (from valmat). * Somehow std::to_string truncates the tail of numbers of type `double` when converting it to a string. * So I wrote my own function `double2str()`, which does not have this drawback. */ Php::out << double2str(value3) << std::endl; } /** * End of namespace */ }
/* * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. 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. */ #ifndef FontPlatformDataHarfBuzz_h #define FontPlatformDataHarfBuzz_h #include "SkPaint.h" #include "core/platform/SharedBuffer.h" #include "core/platform/graphics/FontOrientation.h" #include "core/platform/graphics/chromium/FontRenderStyle.h" #include "core/platform/graphics/opentype/OpenTypeVerticalData.h" #include "wtf/Forward.h" #include "wtf/HashTableDeletedValueType.h" #include "wtf/RefPtr.h" #include "wtf/text/CString.h" #include "wtf/text/StringImpl.h" class SkTypeface; typedef uint32_t SkFontID; namespace WebCore { class FontDescription; class HarfBuzzFace; // ----------------------------------------------------------------------------- // FontPlatformData is the handle which WebKit has on a specific face. A face // is the tuple of (font, size, ...etc). Here we are just wrapping a Skia // SkTypeface pointer and dealing with the reference counting etc. // ----------------------------------------------------------------------------- class FontPlatformData { public: // Used for deleted values in the font cache's hash tables. The hash table // will create us with this structure, and it will compare other values // to this "Deleted" one. It expects the Deleted one to be differentiable // from the 0 one (created with the empty constructor), so we can't just // set everything to 0. FontPlatformData(WTF::HashTableDeletedValueType); FontPlatformData(); FontPlatformData(float textSize, bool fakeBold, bool fakeItalic); FontPlatformData(const FontPlatformData&); FontPlatformData(SkTypeface*, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal); FontPlatformData(const FontPlatformData& src, float textSize); ~FontPlatformData(); // ------------------------------------------------------------------------- // Return true iff this font is monospaced (i.e. every glyph has an equal x // advance) // ------------------------------------------------------------------------- bool isFixedPitch() const; // ------------------------------------------------------------------------- // Setup a Skia painting context to use this font. // ------------------------------------------------------------------------- void setupPaint(SkPaint*) const; // ------------------------------------------------------------------------- // Return Skia's unique id for this font. This encodes both the style and // the font's file name so refers to a single face. // ------------------------------------------------------------------------- SkFontID uniqueID() const; SkTypeface* typeface() const { return m_typeface.get(); } unsigned hash() const; float size() const { return m_textSize; } int emSizeInFontUnits() const; FontOrientation orientation() const { return m_orientation; } void setOrientation(FontOrientation orientation) { m_orientation = orientation; } void setFakeBold(bool fakeBold) { m_fakeBold = fakeBold; } void setFakeItalic(bool fakeItalic) { m_fakeItalic = fakeItalic; } bool operator==(const FontPlatformData&) const; FontPlatformData& operator=(const FontPlatformData&); bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } #if ENABLE(OPENTYPE_VERTICAL) PassRefPtr<OpenTypeVerticalData> verticalData() const; PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const; #endif #ifndef NDEBUG String description() const; #endif HarfBuzzFace* harfBuzzFace() const; // The returned styles are all actual styles without FontRenderStyle::NoPreference. const FontRenderStyle& fontRenderStyle() const { return m_style; } // ------------------------------------------------------------------------- // Global font preferences... static void setHinting(SkPaint::Hinting); static void setAutoHint(bool); static void setUseBitmaps(bool); static void setAntiAlias(bool); static void setSubpixelRendering(bool); static void setSubpixelPositioning(bool); private: void getRenderStyleForStrike(const char*, int); void querySystemForRenderStyle(); RefPtr<SkTypeface> m_typeface; CString m_family; float m_textSize; mutable int m_emSizeInFontUnits; bool m_fakeBold; bool m_fakeItalic; FontOrientation m_orientation; FontRenderStyle m_style; mutable RefPtr<HarfBuzzFace> m_harfBuzzFace; bool m_isHashTableDeletedValue; }; } // namespace WebCore #endif // ifdef FontPlatformDataHarfBuzz_h
// Copyright (c) 2021 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. #pragma once #include <string> #include <vector> #include "paddle/fluid/platform/macros.h" namespace paddle { namespace distributed { enum DistModelDataType { FLOAT16, FLOAT32, INT64, INT32, INT8 }; template <typename T> constexpr DistModelDataType DistModelGetDtype(); template <> constexpr DistModelDataType DistModelGetDtype<int32_t>() { return DistModelDataType::INT32; } template <> constexpr DistModelDataType DistModelGetDtype<int64_t>() { return DistModelDataType::INT64; } template <> constexpr DistModelDataType DistModelGetDtype<float>() { return DistModelDataType::FLOAT32; } class DistModelDataBuf { public: explicit DistModelDataBuf(size_t length) : data_(new char[length]), length_(length), memory_owned_(true) {} DistModelDataBuf(void* data, size_t length) : data_(data), length_(length), memory_owned_(false) {} void Reset(void* data, size_t length); size_t length() const { return length_; } void* data() const { return data_; } ~DistModelDataBuf() { Free(); } DistModelDataBuf() = default; void Resize(size_t length); DistModelDataBuf& operator=(const DistModelDataBuf& other); DistModelDataBuf& operator=(DistModelDataBuf&& other); DistModelDataBuf(DistModelDataBuf&& other); DistModelDataBuf(const DistModelDataBuf& other); private: void Free(); void* data_{nullptr}; size_t length_{0}; bool memory_owned_{true}; }; struct DistModelTensor { std::string name; std::vector<int> shape; DistModelDataBuf data; DistModelDataType dtype; std::vector<std::vector<size_t>> lod; }; } // namespace distributed } // namespace paddle
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright 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. #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Internal Type exposed to facilitate transition to Swift. API Subject to change or removal without warning. Do not use. FBSDKFeature enum Defines features in SDK Sample: FBSDKFeatureAppEvents = 0x00010000, ^ ^ ^ ^ | | | | kit | | | feature | | sub-feature | sub-sub-feature 1st byte: kit 2nd byte: feature 3rd byte: sub-feature 4th byte: sub-sub-feature @warning UNSAFE - DO NOT USE */ typedef NS_ENUM(NSUInteger, FBSDKFeature) { FBSDKFeatureNone = 0x00000000, // Features in CoreKit /** Essential of CoreKit */ FBSDKFeatureCore = 0x01000000, /** App Events */ FBSDKFeatureAppEvents = 0x01010000, FBSDKFeatureCodelessEvents = 0x01010100, FBSDKFeatureRestrictiveDataFiltering = 0x01010200, FBSDKFeatureAAM = 0x01010300, FBSDKFeaturePrivacyProtection = 0x01010400, FBSDKFeatureSuggestedEvents = 0x01010401, FBSDKFeatureIntelligentIntegrity = 0x01010402, FBSDKFeatureModelRequest = 0x01010403, FBSDKFeatureEventDeactivation = 0x01010500, FBSDKFeatureSKAdNetwork = 0x01010600, FBSDKFeatureSKAdNetworkConversionValue = 0x01010601, FBSDKFeatureATELogging = 0x01010700, FBSDKFeatureAEM = 0x01010800, /** Instrument */ FBSDKFeatureInstrument = 0x01020000, FBSDKFeatureCrashReport = 0x01020100, FBSDKFeatureCrashShield = 0x01020101, FBSDKFeatureErrorReport = 0x01020200, // Features in LoginKit /** Essential of LoginKit */ FBSDKFeatureLogin = 0x02000000, // Features in ShareKit /** Essential of ShareKit */ FBSDKFeatureShare = 0x03000000, // Features in GamingServicesKit /** Essential of GamingServicesKit */ FBSDKFeatureGamingServices = 0x04000000, } NS_SWIFT_NAME(SDKFeature); /** Internal Type exposed to facilitate transition to Swift. API Subject to change or removal without warning. Do not use. @warning UNSAFE - DO NOT USE */ typedef void (^FBSDKFeatureManagerBlock)(BOOL enabled); NS_ASSUME_NONNULL_END
/* BEGIN HEADER */ #ifndef example2_INCLUDE_ #define example2_INCLUDE_ #include <assert.h> #include <unordered_map> #include <utility> #include "classp.h" // Include files generated by bison #include "example2.yacc.hh" #include "location.hh" #include "position.hh" namespace example2 { using std::istream; using std::ostream; using classp::classpPrint; using classp::classpFormat; using classp::AttributeMap; // Location and state information from the parser. typedef location ParseState; extern ParseState defaultParseState; class AstNode; /* BEGIN FORWARD DECLARATIONS */ class Expression; class FunctionCall; class IntegerLiteral; class Product; class Sum; /* END FORWARD DECLARATIONS */ // Base class for example2 AST nodes class AstNode : public classp::ClasspNode { public: string className() override { return "AstNode"; } AstNode(ParseState parseState) : parseState(parseState) { } // Write out a bracketed form of this AST from the declared syntax. virtual void bracketFormat(std::ostream& out, AstNode* self) { assert(false); } ParseState parseState; }; /* BEGIN CLASS DEFINITIONS */ class Expression: public AstNode { public: string className() override { return "Expression"; } Expression(ParseState parseState); static Expression* parse(istream& input, ostream& errors); void printMembers(ostream& out) override; void bracketFormat(ostream& out, AstNode* self) override; }; class FunctionCall: public Expression { public: string className() override { return "FunctionCall"; } FunctionCall(ParseState parseState, identifier functionName, vector<Expression*> argList); void printMembers(ostream& out) override; void format(ostream& out, int precedence) override; identifier functionName; vector<Expression*> argList; }; class Sum: public Expression { public: string className() override { return "Sum"; } Sum(ParseState parseState, Expression* val1, Expression* val2); void printMembers(ostream& out) override; void format(ostream& out, int precedence) override; Expression* val1 = nullptr; Expression* val2 = nullptr; }; class Product: public Expression { public: string className() override { return "Product"; } Product(ParseState parseState, Expression* val1, Expression* val2); void printMembers(ostream& out) override; void format(ostream& out, int precedence) override; Expression* val1 = nullptr; Expression* val2 = nullptr; }; class IntegerLiteral: public Expression { public: string className() override { return "IntegerLiteral"; } IntegerLiteral(ParseState parseState, int val); void printMembers(ostream& out) override; void format(ostream& out, int precedence) override; int val; }; /* END CLASS DEFINITIONS */ } // namespace example2 #endif // example2_INCLUDE_ /* END HEADER */
/* * Copyright 2005-2017 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ /************************************** * Enrico Fucile **************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_padding IMPLEMENTS = init;preferred_size MEMBERS=const char* section_offset MEMBERS=const char* section_length END_CLASS_DEF */ /* START_CLASS_IMP */ /* Don't edit anything between START_CLASS_IMP and END_CLASS_IMP Instead edit values between START_CLASS_DEF and END_CLASS_DEF or edit "accessor.class" and rerun ./make_class.pl */ static void init(grib_accessor*,const long, grib_arguments* ); static void init_class(grib_accessor_class*); static size_t preferred_size(grib_accessor*,int); typedef struct grib_accessor_padtoeven { grib_accessor att; /* Members defined in gen */ /* Members defined in bytes */ /* Members defined in padding */ /* Members defined in padtoeven */ const char* section_offset; const char* section_length; } grib_accessor_padtoeven; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_padtoeven = { &grib_accessor_class_padding, /* super */ "padtoeven", /* name */ sizeof(grib_accessor_padtoeven), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ 0, /* post_init */ 0, /* free mem */ 0, /* describes himself */ 0, /* get length of section */ 0, /* get length of string */ 0, /* get number of values */ 0, /* get number of bytes */ 0, /* get offset to bytes */ 0, /* get native type */ 0, /* get sub_section */ 0, /* grib_pack procedures long */ 0, /* grib_pack procedures long */ 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ 0, /* grib_unpack procedures double */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack procedures bytes */ 0, /* grib_unpack procedures bytes */ 0, /* pack_expression */ 0, /* notify_change */ 0, /* update_size */ &preferred_size, /* preferred_size */ 0, /* resize */ 0, /* nearest_smaller_value */ 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ 0, /* unpack a subarray */ 0, /* clear */ }; grib_accessor_class* grib_accessor_class_padtoeven = &_grib_accessor_class_padtoeven; static void init_class(grib_accessor_class* c) { c->dump = (*(c->super))->dump; c->next_offset = (*(c->super))->next_offset; c->string_length = (*(c->super))->string_length; c->value_count = (*(c->super))->value_count; c->byte_count = (*(c->super))->byte_count; c->byte_offset = (*(c->super))->byte_offset; c->get_native_type = (*(c->super))->get_native_type; c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; c->unpack_double = (*(c->super))->unpack_double; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_bytes = (*(c->super))->pack_bytes; c->unpack_bytes = (*(c->super))->unpack_bytes; c->pack_expression = (*(c->super))->pack_expression; c->notify_change = (*(c->super))->notify_change; c->update_size = (*(c->super))->update_size; c->resize = (*(c->super))->resize; c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; } /* END_CLASS_IMP */ static size_t preferred_size(grib_accessor* a,int from_handle) { grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; long offset = 0; long length = 0; long seclen; grib_get_long_internal(a->parent->h,self->section_offset,&offset); grib_get_long_internal(a->parent->h,self->section_length,&length); if((length%2) && from_handle) { #if 0 grib_context_log(a->parent->h->context, GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", (long)length,a->name); #endif return 0; } /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ seclen = a->offset - offset; return seclen % 2 ? 1 : 0; } static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; self->section_offset = grib_arguments_get_name(a->parent->h,args,0); self->section_length = grib_arguments_get_name(a->parent->h,args,1); a->length = preferred_size(a,1); }
#ifndef FZRL_TILE_H #define FZRL_TILE_H #include "tile_types.h" /** * Public Tile Functions and Defines * * Tile Explanation: * - Tiles have a material type (e.g. dirt, grass, stone, wood, metal, water, fire, empty) * - Tiles have a form type (e.g. floor, path, paved, wall, empty) * - Material Types and Form Types have movement values (e.g. dirt floor < dirt path < paved stone) * - Material Types and Form Types have passability values (e.g. not passable, passable) */ typedef struct fzrl_tile { enum Tile_Material material; enum Tile_Form form; } Tile; enum Tile_Type { TILE_EMPTY, TILE_DIRT_FLOOR, TILE_GRASS_FLOOR, TILE_STONE_FLOOR, TILE_DIRT_WALL, TILE_STONE_WALL, TILE_GRASS_PAVED }; Tile *get_tile_by_type( enum Tile_Type type ); #endif
/** @file @section Internalization Translating scripts into different languages */ /** Translates a string to the current language. <b>key</b> represents an id of this message, should be like "scriptname.some_key1.some_key2". You should use string literal only for both arguments! Do not form them dynamically. scriptname should be the same as your script file (without .nut extension). Translated strings should be stored in json file Scripts/Lang/<language_name>.json. <b>language_name</b> should be the same as in program's translation filename Lang\<language_name>.lng Aliases for this function: Translate() (you can override these functions in your code). @since 1.3.1 */ std::string tr(std::string key, std::string englishText); /** @section Example Scripts/example.nut @code print(tr("example.hello_world", "Hello world!")); @endcode Scripts/Lang/Spanish.json @code { "example" : { "hello_world" : "¡Hola, mundo!" } } @endcode Output: @code ¡Hola, mundo! @endcode */
// // AppDelegate.h // 紧急救援 // // Created by 刘成勇 on 15/7/29. // Copyright (c) 2015年 紧急救援. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; @end
/** * Copyright 2017 Comcast Cable Communications Management, 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. * */ #include <assert.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <stdint.h> #include <ctype.h> #include <signal.h> #include <CUnit/Basic.h> #include "mem_wrapper.h" #include "../src/schedule.h" #include "../src/aker_mem.h" #include "../src/scheduler.h" #include "../src/process_data.h" #include "test_scheduler.h" #include "scheduler_data0.h" #include "scheduler_data1.h" #include "scheduler_data2.h" #include "scheduler_data3.h" #include "scheduler_data4.h" #define MAX_WRP_TEST_MSGS 5 // Tuesday, November 14, 2017 11:57:28 AM PST = 1510689448 static time_t kUnixCurrentTime = 1510689448; static time_t add_time; unsigned char *data_payloads[] = { scheduler_data0_bin, scheduler_data1_bin, scheduler_data2_bin, scheduler_data3_bin, scheduler_data4_bin, }; uint32_t data_sizes[] = { scheduler_data0_bin_len, scheduler_data1_bin_len, scheduler_data2_bin_len, scheduler_data3_bin_len, scheduler_data4_bin_len, }; pthread_t scheduler_thread_id; const char *firewall_cmd = "echo"; const char *file_name = "scheduler_data.bin"; const char *md5_file = "md5.md5"; /* Start the scheduler thread without any schedule data */ void test1() { int result; result = scheduler_start( &scheduler_thread_id, firewall_cmd ); CU_ASSERT(0 == result); } void test2() { int result; int cnt; for (cnt = 0; cnt < MAX_WRP_TEST_MSGS; cnt++) { result = process_update( file_name, md5_file, data_payloads[cnt], data_sizes[cnt] ); printf( "got[%d]: %d\n", cnt, result ); CU_ASSERT(0 == result); } malloc_fail = true; malloc_failure_limit = 32; for (cnt = 0; cnt < MAX_WRP_TEST_MSGS; cnt++) { result = process_update( file_name, md5_file, data_payloads[cnt], data_sizes[cnt] ); CU_ASSERT(0 >= result); } malloc_fail = false; add_time = -214980; result = process_update( file_name, md5_file, data_payloads[0], data_sizes[0] ); CU_ASSERT(0 == result); add_time = -214500; result = process_update( file_name, md5_file, data_payloads[1], data_sizes[1] ); CU_ASSERT(0 == result); add_time = -213000; result = process_update( file_name, md5_file, data_payloads[2], data_sizes[2] ); CU_ASSERT(0 == result); add_time = -212900; result = process_update( file_name, md5_file, data_payloads[3], data_sizes[3] ); CU_ASSERT(0 == result); add_time = -212800; result = process_delete( file_name, md5_file ); CU_ASSERT(0 == result); add_time = 0; // allow absolute to take effect ? result = process_update( file_name, md5_file, data_payloads[3], data_sizes[3] ); CU_ASSERT(0 == result); add_time = -212790; result = process_update( file_name, md5_file, data_payloads[0], data_sizes[0] ); CU_ASSERT(0 == result); } void test3() { // Just cover process_message_ret_now()->get_current_blocked_macs() uint8_t *data; ssize_t cnt; cnt = process_retrieve_now(&data); CU_ASSERT(cnt >= 0); CU_ASSERT(data != NULL); if( NULL != data ) { aker_free( data ); } } void add_suites( CU_pSuite *suite ) { printf("--------Start of Test Cases Execution For Scheduler---------\n"); *suite = CU_add_suite( "tests", NULL, NULL ); CU_add_test( *suite, "Scheduler Test 1", test1); CU_add_test( *suite, "Scheduler Test 2", test2); CU_add_test( *suite, "Scheduler Test 3", test3); } /*----------------------------------------------------------------------------*/ /* External Functions */ /*----------------------------------------------------------------------------*/ int main( int argc, char *argv[] ) { unsigned rv = 1; CU_pSuite suite = NULL; (void ) argc; (void ) argv; if( CUE_SUCCESS == CU_initialize_registry() ) { add_suites( &suite ); if( NULL != suite ) { CU_basic_set_mode( CU_BRM_VERBOSE ); CU_basic_run_tests(); printf( "\n" ); CU_basic_show_failures( CU_get_failure_list() ); printf( "\n\n" ); rv = CU_get_number_of_tests_failed(); } CU_cleanup_registry(); } sleep(1); terminate_scheduler_thread(); //pthread_kill(scheduler_thread_id, SIGTERM); return rv; } void aker_metrics_report_to_log(void) { } void aker_metrics_report(time_t time) { (void) time; } void aker_metric_set_schedule_enabled(int val) { (void) val; } void aker_metric_set_tz(const char *val) { (void) val; } void aker_metric_set_tz_offset(long int val) { (void) val; } void aker_metric_inc_device_block_count(uint32_t val) { (void) val; } void aker_metric_inc_window_trans_count() { } void aker_metric_inc_schedule_set_count() { } void destroy_akermetrics() { } int get_blocked_mac_count(const char* blocked) { (void) blocked; return 0; } time_t convert_unix_time_to_weekly(time_t unixtime) { time_t seconds_since_sunday_midnght; time_t t = unixtime; struct tm ts; ts = *localtime(&t); seconds_since_sunday_midnght = (ts.tm_wday * 24 * 3600) + (ts.tm_hour * 3600) + (ts.tm_min * 60) + ts.tm_sec; return seconds_since_sunday_midnght; } time_t get_unix_time(void) { return add_time + kUnixCurrentTime; } int32_t get_max_mac_limit(void) { return 2048; }
/* * Author: Peter Dickman * Version: 1.0 * Last edit: 2003-02-18 * Modified: 2011-02-22 by J Sventek * Modified: 2015-02-24 by W Vanderbauwhede for select/complete approach * * This file is a component of the test harness of the NetworkDriver exercise * for use in assessing: * the OS3 module in undergraduate Computing Science at dcs.gla.ac.uk * * It tests the ability to develop a small but complex software system * using PThreads to provide concurrency in C. * * * * Copyright: * (c) 2003 University of Glasgow and Dr Peter Dickman * * Licencing: * this software may not be used except with the author's permission. * */ /* * An unbounded store for Packet Descriptors * which is safe for concurrent access using PThreads.... */ /* here's the spec we must satisfy */ #include "freepacketdescriptorstore__full.h" #include <pthread.h> #include <stdlib.h> #include "diagnostics.h" #include "generic_queue.h" #include "packetdescriptor.h" /*----------- Get Methods ---------------*/ void blocking_get_pd(FreePacketDescriptorStore fpds, PacketDescriptor *pd_ptr) { int response = 0; real_fpds rfpds = (real_fpds) fpds; pthread_mutex_unlock(&rfpds->lock); while (rfpds->current_length == 0) { } response = gqueue_dequeue(rfpds->basic_store, (GQueueElement *) pd_ptr); if (response) rfpds->current_length--; else DIAGNOSTICS("BUG: Failed to recover element from non-empty FPDS\n"); pthread_mutex_lock(&rfpds->lock); }
#ifndef FNF_BASE_RESULT_H_INCLUDED #define FNF_BASE_RESULT_H_INCLUDED #include <errno.h> #include <stdbool.h> #include <base/result_type.h> struct result { enum result_type type; int error_code; }; inline bool result_is_success(struct result result) { return result_type_success == result.type; } inline struct result result_success(void) { return (struct result){ .type=result_type_success }; } inline struct result result_system_error(void) { return (struct result){ .type=result_type_system_error, .error_code=errno }; } inline struct result result_ncurses_err(void) { return (struct result){ .type=result_type_ncurses_err }; } inline struct result result_ncurses_errno(void) { return (struct result){ .type=result_type_ncurses_error, .error_code=errno }; } inline struct result result_ncurses_error(int error_code) { return (struct result){ .type=result_type_ncurses_error, .error_code=error_code }; } void result_print_error(struct result result); inline struct result result_set_system_error(int error_code) { errno = error_code; return result_system_error(); } #endif
#pragma once #include "Engine/Common.h" #if defined (__cplusplus) extern "C" { #endif // #if defined (__cplusplus) #include "microui.h" #if defined (__cplusplus) } #endif // #if defined (__cplusplus)
/* Copyright (c) 2012, Bastien Dejean * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 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. */ #ifndef BSPWM_EVENTS_H #define BSPWM_EVENTS_H #include <xcb/xcb.h> #include <xcb/xcb_event.h> uint8_t randr_base; uint16_t last_motion_x, last_motion_y; xcb_timestamp_t last_motion_time; void handle_event(xcb_generic_event_t *evt); void map_request(xcb_generic_event_t *evt); void configure_request(xcb_generic_event_t *evt); void destroy_notify(xcb_generic_event_t *evt); void unmap_notify(xcb_generic_event_t *evt); void property_notify(xcb_generic_event_t *evt); void client_message(xcb_generic_event_t *evt); void focus_in(xcb_generic_event_t *evt); void enter_notify(xcb_generic_event_t *evt); void motion_notify(xcb_generic_event_t *evt); void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action); #endif
/* Glidix Runtime Copyright (c) 2014-2017, Madd Games. 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. 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 HOLDER 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. */ #ifndef _SYS_UN_H #define _SYS_UN_H #include <sys/socket.h> struct sockaddr_un { sa_family_t sun_family; /* AF_UNIX/AF_LOCAL */ char sun_path[108]; }; #endif
// NSData+Godzippa.h // // Copyright (c) 2012 Mattt Thompson (http://mattt.me/) // // 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. #import <Foundation/Foundation.h> extern NSString * const GodzippaZlibErrorDomain; @interface NSData (Godzippa) - (NSData *)dataByGZipCompressingWithError:(NSError **)error; - (NSData *)dataByGZipDecompressingDataWithError:(NSError **)error; @end
/* M-Kernel - embedded RTOS Copyright (c) 2011-2012, Alexey Kramarenko All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 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. */ #ifndef SEM_H #define SEM_H /* Semaphore */ #include "time.h" #include "types.h" HANDLE semaphore_create(); void semaphore_signal(HANDLE sem); bool semaphore_wait(HANDLE sem, TIME* timeout); bool sempahore_wait_ms(HANDLE sem, unsigned int timeout_ms); bool semaphore_wait_us(HANDLE sem, unsigned int timeout_us); void semaphore_destroy(HANDLE sem); #endif // SEM_H
#ifndef DLL_H #define DLL_H #include <iostream> #include <cassert> class DLLnode { public: DLLnode (int k); DLLnode *Previous (); // Return a ptr to the predecessor // of the given node. DLLnode *Next (); // Return a ptr to the successor // of the given node. DLLnode *Insert (DLLnode *ptr); // Insert ptr node at head // of list and return pointer // to new element. DLLnode *Delete (); // Delete first node from the list; // return pointer to its successor, or 0. // Precondition: there is a node to delete. void Print (); bool LengthIs1 (); // Return true if the list contains exactly 1 element. private: int myValue; DLLnode* myPrevious; DLLnode* myNext; }; #endif
// // SFBDefaultButtonSuppressingTextView.h // SFBCrashReporter // // Created by Nicholas Riley on 12/24/10. // Copyright 2010 sbooth.org. All rights reserved. // #import <Cocoa/Cocoa.h> @interface SFBDefaultButtonSuppressingTextView : NSTextView { NSButtonCell *defaultButtonCell; } @end
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once #include "AISenseConfig.h" #include "AISense_Damage.h" #include "AISenseConfig_Damage.generated.h" class UAISense_Damage; UCLASS(meta = (DisplayName = "AI Damage sense config")) class AIMODULE_API UAISenseConfig_Damage : public UAISenseConfig { GENERATED_BODY() public: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Sense", NoClear, config) TSubclassOf<UAISense_Damage> Implementation; virtual TSubclassOf<UAISense> GetSenseImplementation() const override; };
/* Glidix Runtime Copyright (c) 2014-2017, Madd Games. 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. 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 HOLDER 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. */ #include <libgen.h> #include <string.h> char* dirname(char *buf) { if (buf == NULL || buf[0] == 0) { return (char*) "."; }; char *end = &buf[strlen(buf)-1]; while (*end == '/' && end != (buf-1)) *end-- = 0; if (buf[0] == 0) { return (char*) "/"; }; char *finalSlash = strrchr(buf, '/'); if (finalSlash == NULL) { return (char*) "."; }; if (finalSlash == buf) { return (char*) "/"; }; *finalSlash = 0; return buf; };
/*************************************************************************** * * Copyright (C) 2005 Elad Lahav (elad_lahav@users.sourceforge.net) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ***************************************************************************/ #ifndef QUERYPAGEBASE_H #define QUERYPAGEBASE_H #include <QtCore/QTextStream> #include <khbox.h> class QueryView; /** * Defines a page in a QueryWidget's tab widget. * This is a abstract base class for QueryPage and HistoryPage. It defines * the common behaviour for all pages, which includes appearance, display * of tab text, page locking, storage and retrieval of information to * and from files and basic navigation. * Each page embeds a list widget derived from QueryView. The actual type * of widget is defined by the different page classes. * @author Elad Lahav */ class QueryPageBase : public KHBox { Q_OBJECT public: QueryPageBase(QWidget* pParent = 0, const char* szName = 0); ~QueryPageBase(); void applyPrefs(); bool load(const QString&, const QString&); bool save(const QString&, QString&); void selectNext(); void selectPrev(); /** * Determines whether this page can be locked. * Can be used by inheriting classes to define non-lockable pages. * @return Always true */ virtual bool canLock() { return true; } /** * Locks or unlocks this page. * @param bLocked true to lock the page, false to unlock it. */ void setLocked(bool bLocked) { m_bLocked = bLocked; } /** * Determines whether this page is locked. * @return true if the page is locked, false otherwise */ bool isLocked() { return m_bLocked; } /** * Determines whether this page should be saved when the project is closed. * By default, pages are saved if and only if they are locked. * @return true to save the page, false otherwise */ virtual bool shouldSave() const { return m_bLocked; }; /** * Constructs a caption for this page. * The caption appears in the page's tab button and as the page's * tooltip. * @param bBrief true to generate a brief caption, false otherwise * @return The page's title */ virtual QString getCaption(bool bBrief = false) const = 0; signals: /** * Emitted when a record is selected in the view widget. * @param sFile The "File" field of the selected record * @param nLine The "Line" field of the selected record */ void lineRequested(const QString& sFile, uint nLine); protected: /** The embedded list. */ QueryView* m_pView; /** Indicates whether this page is locked. A locked page is never overriden by new data, and is also saved to a disc file when the session is closed. */ bool m_bLocked; /** * Creates a new list item and adds it to the embedded view. * This method is used to add records read from a stored file. * @param sFile The "File" field of the record * @param sFunc The "Function" field of the record * @param sLine The "Line" field of the record * @param sText The "Text" field of the record */ virtual void addRecord(const QString& sFile, const QString& sFunc, const QString& sLine, const QString& sText) = 0; /** * Creates a file path to store this page. * The path is composed of the project's path and a unique file name * in that directory. * @param sProjPath The project's directory * @return The page's file path */ virtual QString getFileName(const QString& sProjPath) const = 0; /** * Tries to read the file header of a stored page. * The contents of the header differ among inheriting classes. * @param str A text stream initialised to the open page file * @return true if the header was read successfully and contains the * expected information, false otherwise */ virtual bool readHeader(QTextStream& str) = 0; /** * Writes a header to a page's file. * The contents of the header differ among inheriting classes. * @param str A text stream initialised to the open page file */ virtual void writeHeader(QTextStream& str) = 0; }; #endif
#include <stdio.h> #include <stdlib.h> #include "hpccfft.h" #ifdef _OPENMP #include <omp.h> #endif hpcc_fftw_plan HPCC_fftw_create_plan(int n, fftw_direction dir, int flags) { hpcc_fftw_plan p; fftw_complex *a = NULL, *b = NULL; size_t w1_size, w2_size, ww1_size, ww2_size, ww3_size, ww4_size; p = (hpcc_fftw_plan)fftw_malloc( sizeof *p ); if (! p) return p; w1_size = Mmax( FFTE_NDA2/2 + FFTE_NP, (int)(1.100 * sqrt( n )) ); w2_size = Mmax( FFTE_NDA2/2 + FFTE_NP, (int)(0.375 * sqrt( n )) ); ww1_size = Mmax( FFTE_NDA2 + FFTE_NDA4*FFTE_NP + FFTE_NP, (int)(1.0 * sqrt( n )) ); ww2_size = Mmax( FFTE_NDA2 + FFTE_NDA4*FFTE_NP + FFTE_NP, (int)(3.9 * sqrt( n )) ); ww3_size = Mmax( FFTE_NDA2 + FFTE_NDA4*FFTE_NP + FFTE_NP, (int)(5.4773 * sqrt( n )) ); ww4_size = Mmax( FFTE_NDA2 + (1 << 13), (int)(1.0/256.0 * n) ); p->w1 = (fftw_complex *)fftw_malloc( w1_size * (sizeof *p->w1) ); p->w2 = (fftw_complex *)fftw_malloc( w2_size * (sizeof *p->w2) ); p->ww1 = (fftw_complex *)fftw_malloc( ww1_size * (sizeof *p->ww1) ); p->ww2 = (fftw_complex *)fftw_malloc( ww2_size * (sizeof *p->ww1) ); p->ww3 = (fftw_complex *)fftw_malloc( ww3_size * (sizeof *p->ww1) ); p->ww4 = (fftw_complex *)fftw_malloc( ww4_size * (sizeof *p->ww1) ); p->c_size = Mmax( (FFTE_NDA2+FFTE_NP) * FFTE_NBLK + FFTE_NP, (int)(16.75 * sqrt( n )) ); p->d_size = Mmax( FFTE_NDA2+FFTE_NP, (int)(1.0 * sqrt( n )) ); #ifdef _OPENMP #pragma omp parallel { #pragma omp single { int i; i = omp_get_num_threads(); p->c = (fftw_complex *)fftw_malloc( p->c_size * (sizeof *p->c) * i ); p->d = (fftw_complex *)fftw_malloc( p->d_size * (sizeof *p->d) * i ); } } #else p->c = (fftw_complex *)fftw_malloc( p->c_size * (sizeof *p->c) ); p->d = (fftw_complex *)fftw_malloc( p->d_size * (sizeof *p->d) ); #endif if (! p->w1 || ! p->w2 || ! p->ww1 || ! p->ww2 || ! p->ww3 || ! p->ww4 || ! p->c || ! p->d) { if (p->d) fftw_free( p->d ); if (p->c) fftw_free( p->c ); if (p->ww4) fftw_free( p->ww4 ); if (p->ww3) fftw_free( p->ww3 ); if (p->ww2) fftw_free( p->ww2 ); if (p->ww1) fftw_free( p->ww1 ); if (p->w2) fftw_free( p->w2 ); if (p->w1) fftw_free( p->w1 ); fftw_free( p ); return NULL; } HPCC_zfft1d( n, a, b, 0, p ); p->n = n; p->dir = dir; p->flags = flags; return p; } void HPCC_fftw_destroy_plan(hpcc_fftw_plan p) { if (! p) return; fftw_free( p->d ); fftw_free( p->c ); fftw_free( p->ww4 ); fftw_free( p->ww3 ); fftw_free( p->ww2 ); fftw_free( p->ww1 ); fftw_free( p->w2 ); fftw_free( p->w1 ); fftw_free( p ); } /* Without additional storage of size p->n there is no way to preserve FFTW 2 semantics (the `in' vector is not modified). But it doesn't matter for the calling code: it doesn't rely on this semantics. The change in semantics occured while going from FFTE 3.3 to FFTE 4.0. */ void HPCC_fftw_one(hpcc_fftw_plan p, fftw_complex *in, fftw_complex *out) { int i, n; if (FFTW_FORWARD == p->dir) HPCC_zfft1d( p->n, in, out, -1, p ); else HPCC_zfft1d( p->n, in, out, +1, p ); n = p->n; /* Copy the transform to `out' vector. */ for (i = 0; i < n; ++i) { c_assgn( out[i], in[i] ); } }
/////////////////////////////////////////////////////////////////////// // // *** INTERACTIVE DATA VISUALIZATION (IDV) CONFIDENTIAL AND PROPRIETARY INFORMATION *** // // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Interactive Data Visualization, Inc. and // may not be copied, disclosed, or exploited except in accordance with // the terms of that agreement. // // Copyright (c) 2003-2014 IDV, Inc. // All rights reserved in all media. // // IDV, Inc. // http://www.idvinc.com /////////////////////////////////////////////////////////////////////// // Preprocessor #pragma once #include "Core/ExportBegin.h" #include "Core/Types.h" #include <limits> #if defined(__GNUC__) || defined(__psp2__) #include <math.h> #include <cfloat> #else #include <cmath> #include <cfloat> #endif /////////////////////////////////////////////////////////////////////// // Packing #ifdef ST_SETS_PACKING_INTERNALLY #pragma pack(push, 4) #endif /////////////////////////////////////////////////////////////////////// // All SpeedTree SDK classes and variables are under the namespace "SpeedTree" namespace SpeedTree { /////////////////////////////////////////////////////////////////////// // Commonly used mathematical constants static const st_float32 c_fPi = 3.14159265358979323846f; static const st_float32 c_fTwoPi = 6.28318530717958647692528f; static const st_float32 c_fHalfPi = 1.57079632679489661923f; static const st_float32 c_fQuarterPi = 0.785398163397448309615f; #ifndef INT_MAX #define INT_MAX __INT_MAX__ #endif #ifndef FLT_MAX #define FLT_MAX __FLT_MAX__ #endif /////////////////////////////////////////////////////////////////////// // RadToDeg ST_INLINE st_float32 RadToDeg(st_float32 fRadians) { return fRadians * 57.2957795f; } ST_INLINE st_float32 DegToRad(st_float32 fDegrees) { return fDegrees * 0.01745329252f; } /////////////////////////////////////////////////////////////////////// // Forward references class Mat3x3; class Mat4x4; /////////////////////////////////////////////////////////////////////// // Class Vec2 class ST_DLL_LINK Vec2 { public: Vec2( ); // defaults to (0, 0, 0) Vec2(st_float32 _x, st_float32 _y); Vec2(const st_float32 afPos[2]); Vec2 operator+(const Vec2& vIn) const; Vec2 operator+=(const Vec2& vIn); st_bool operator==(const Vec2& vIn) const; void Set(st_float32 _x, st_float32 _y); st_float32 Distance(const Vec2& vIn) const; st_float32 x, y; }; /////////////////////////////////////////////////////////////////////// // Class Vec3 class ST_DLL_LINK Vec3 { public: Vec3( ); // defaults to (0, 0, 0) Vec3(st_float32 _x, st_float32 _y, st_float32 _z); Vec3(st_float32 _x, st_float32 _y); // z defaults to 0 Vec3(const st_float32 afPos[3]); // operators st_float32& operator[](int nIndex); operator st_float32*(void); operator const st_float32*(void) const; bool operator<(const Vec3& vIn) const; bool operator==(const Vec3& vIn) const; bool operator!=(const Vec3& vIn) const; Vec3 operator-(const Vec3& vIn) const; Vec3 operator+(const Vec3& vIn) const; Vec3 operator+=(const Vec3& vIn); Vec3 operator*(const Vec3& vIn) const; Vec3 operator*=(const Vec3& vIn); Vec3 operator/(const Vec3& vIn) const; Vec3 operator/=(const Vec3& vIn); Vec3 operator*(st_float32 fScalar) const; Vec3 operator*=(st_float32 fScalar); Vec3 operator/(st_float32 fDivisor) const; Vec3 operator/=(st_float32 fDivisor); Vec3 operator-(void) const; // utility void Set(st_float32 _x, st_float32 _y, st_float32 _z); void Set(st_float32 _x, st_float32 _y); void Set(const st_float32 afPos[3]); // mathematical operators Vec3 Cross(const Vec3& vIn) const; st_float32 Distance(const Vec3& vIn) const; st_float32 DistanceSquared(const Vec3& vIn) const; st_float32 Dot(const Vec3& vIn) const; st_float32 Magnitude(void) const; st_float32 MagnitudeSquared(void) const; Vec3 Normalize(void); void Scale(st_float32 fScalar); st_float32 x, y, z; }; /////////////////////////////////////////////////////////////////////// // Class Vec4 class ST_DLL_LINK Vec4 { public: Vec4( ); // defaults to (0.0, 0.0, 0.0, 1.0) Vec4(st_float32 _x, st_float32 _y, st_float32 _z, st_float32 _w); Vec4(st_float32 _x, st_float32 _y, st_float32 _z); // w defaults to 1.0 Vec4(st_float32 _x, st_float32 _y); // z defaults to 0.0, w to 1.0 Vec4(const Vec3& vVec, st_float32 _w); Vec4(const st_float32 afPos[4]); // operators st_float32& operator[](int nIndex); operator st_float32*(void); operator const st_float32*(void) const; bool operator==(const Vec4& vIn) const; bool operator!=(const Vec4& vIn) const; Vec4 operator*(const Vec4& vIn) const; Vec4 operator*(st_float32 fScalar) const; Vec4 operator*=(st_float32 fScalar); Vec4 operator/(st_float32 fScalar) const; Vec4 operator/=(st_float32 fScalar); Vec4 operator+(const Vec4& vIn) const; // utility void Set(st_float32 _x, st_float32 _y, st_float32 _z, st_float32 _w); void Set(st_float32 _x, st_float32 _y, st_float32 _z); void Set(st_float32 _x, st_float32 _y); void Set(const st_float32 afPos[4]); st_float32 x, y, z, w; }; // include inline functions #include "Core/Vector_inl.h" } // end namespace SpeedTree #ifdef ST_SETS_PACKING_INTERNALLY #pragma pack(pop) #endif #include "Core/ExportEnd.h"
// // UIPickerView+AKAIBBindingProperties.h // AKABeacon // // Created by Michael Utech on 24.11.15. // Copyright © 2015 Michael Utech & AKA Sarl. All rights reserved. // @import UIKit.UIPickerView; #import "AKAControlViewProtocol.h" IB_DESIGNABLE @interface UIPickerView (AKAIBBindingProperties_valueBinding) <AKAControlViewProtocol> @property(nonatomic) IBInspectable NSString* valueBinding_aka; @end
/* $NetBSD: bf_enc.c,v 1.10 2005/12/11 12:20:48 christos Exp $ */ /* crypto/bf/bf_enc.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <special_includes/sys/cdefs.h> __KERNEL_RCSID(0, "$NetBSD: bf_enc.c,v 1.10 2005/12/11 12:20:48 christos Exp $"); #include <special_includes/sys/types.h> #include <crypto/blowfish/blowfish.h> #include <crypto/blowfish/bf_locl.h> /* Blowfish as implemented from 'Blowfish: Springer-Verlag paper' * (From LECTURE NOTES IN COIMPUTER SCIENCE 809, FAST SOFTWARE ENCRYPTION, * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) */ #if (BF_ROUNDS != 16) && (BF_ROUNDS != 20) If you set BF_ROUNDS to some value other than 16 or 20, you will have to modify the code. #endif /* XXX "data" is host endian */ void BF_encrypt(BF_LONG *data, const BF_KEY *key) { BF_LONG l, r; const BF_LONG *p, *s; p = key->P; s= &key->S[0]; l = data[0]; r = data[1]; l^=p[0]; BF_ENC(r, l, s, p[ 1]); BF_ENC(l, r, s, p[ 2]); BF_ENC(r, l, s, p[ 3]); BF_ENC(l, r, s, p[ 4]); BF_ENC(r, l, s, p[ 5]); BF_ENC(l, r, s, p[ 6]); BF_ENC(r, l, s, p[ 7]); BF_ENC(l, r, s, p[ 8]); BF_ENC(r, l, s, p[ 9]); BF_ENC(l, r, s, p[10]); BF_ENC(r, l, s, p[11]); BF_ENC(l, r, s, p[12]); BF_ENC(r, l, s, p[13]); BF_ENC(l, r, s, p[14]); BF_ENC(r, l, s, p[15]); BF_ENC(l, r, s, p[16]); #if BF_ROUNDS == 20 BF_ENC(r, l, s, p[17]); BF_ENC(l, r, s, p[18]); BF_ENC(r, l, s, p[19]); BF_ENC(l, r, s, p[20]); #endif r ^= p[BF_ROUNDS + 1]; data[1] = l & 0xffffffff; data[0] = r & 0xffffffff; } /* XXX "data" is host endian */ void BF_decrypt(BF_LONG *data, const BF_KEY *key) { BF_LONG l, r; const BF_LONG *p, *s; p = key->P; s= &key->S[0]; l = data[0]; r = data[1]; l ^= p[BF_ROUNDS + 1]; #if BF_ROUNDS == 20 BF_ENC(r, l, s, p[20]); BF_ENC(l, r, s, p[19]); BF_ENC(r, l, s, p[18]); BF_ENC(l, r, s, p[17]); #endif BF_ENC(r, l, s, p[16]); BF_ENC(l, r, s, p[15]); BF_ENC(r, l, s, p[14]); BF_ENC(l, r, s, p[13]); BF_ENC(r, l, s, p[12]); BF_ENC(l, r, s, p[11]); BF_ENC(r, l, s, p[10]); BF_ENC(l, r, s, p[ 9]); BF_ENC(r, l, s, p[ 8]); BF_ENC(l, r, s, p[ 7]); BF_ENC(r, l, s, p[ 6]); BF_ENC(l, r, s, p[ 5]); BF_ENC(r, l, s, p[ 4]); BF_ENC(l, r, s, p[ 3]); BF_ENC(r, l, s, p[ 2]); BF_ENC(l, r, s, p[ 1]); r ^= p[0]; data[1] = l & 0xffffffff; data[0] = r & 0xffffffff; }
#include <assert.h> #include <err.h> #include <search.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include "resh.h" enum { MULT = 5, SHIFT = 27, TBLSZ = 37, }; struct var { struct var *next; const char *key; char *value; }; struct var *vars[TBLSZ]; static size_t hash(const char *s) { size_t h = 0; assert(s != NULL); for (const char *p = s; *p != '\0'; ++p) h = (h<<MULT) + (((h>>SHIFT)&((1<<MULT) - 1))^*p); return h % TBLSZ; } char * getvar(const char *name) { assert(name != NULL); for (struct var *p = vars[hash(name)]; p != NULL; p = p->next) if (STREQ(name, p->key)) return p->value; return NULL; } void setvar(const char *name, const char *value) { struct var *p; size_t h = hash(name); assert(name != NULL); assert(value != NULL); for (p = vars[h]; p != NULL; p = p->next) { if (STREQ(name, p->key)) { free(p->value); p->value = estrdup(value); return; } } p = calloc(1, sizeof(*p)); if (p == NULL) err(1, "Panic zero. Rebooting.\n"); p->key = estrdup(name); p->value = estrdup(value); p->next = vars[h]; vars[h] = p; } void unsetvar(const char *name) { size_t h; assert(name != NULL); h = hash(name); for (struct var *pp = NULL, *p = vars[h]; p != NULL; pp = p, p = p->next) { if (STREQ(p->key, name)) { if (pp != NULL) pp->next = p->next; else vars[h] = p->next; free((char *)p->key); free(p->value); free(p); return; } } }
#include "messageq.h" #include "../mem/pool.h" #include <string.h> #include <assert.h> void messageq_init(messageq_t* q) { pony_msg_t* stub = POOL_ALLOC(pony_msg_t); stub->size = POOL_INDEX(sizeof(pony_msg_t)); stub->next = NULL; q->head = (pony_msg_t*)((uintptr_t)stub | 1); q->tail = stub; } void messageq_destroy(messageq_t* q) { pony_msg_t* tail = q->tail; assert(((uintptr_t)q->head & ~(uintptr_t)1) == (uintptr_t)tail); pool_free(tail->size, tail); q->head = NULL; q->tail = NULL; } bool messageq_push(messageq_t* q, pony_msg_t* m) { m->next = NULL; pony_msg_t* prev = (pony_msg_t*)_atomic_exch(&q->head, m, __ATOMIC_RELAXED); bool was_empty = ((uintptr_t)prev & 1) != 0; prev = (pony_msg_t*)((uintptr_t)prev & ~(uintptr_t)1); _atomic_store(&prev->next, m, __ATOMIC_RELEASE); return was_empty; } pony_msg_t* messageq_pop(messageq_t* q) { pony_msg_t* tail = q->tail; pony_msg_t* next = _atomic_load(&tail->next, __ATOMIC_ACQUIRE); if(next != NULL) { q->tail = next; pool_free(tail->size, tail); } return next; } bool messageq_markempty(messageq_t* q) { pony_msg_t* tail = q->tail; pony_msg_t* head = _atomic_load(&q->head, __ATOMIC_RELAXED); if(((uintptr_t)head & 1) != 0) return true; if(head != tail) return false; head = (pony_msg_t*)((uintptr_t)head | 1); return _atomic_cas(&q->head, &tail, head, __ATOMIC_RELAXED, __ATOMIC_RELAXED); }
/*Nehme Bilal nehmebilal@gmail.com objectivity June 2011 This reader can import data from an ODBC database. Currently only point sets are supported but this reader was designed in a way that allow adding the ability to import different type of data. The goal is to provide the capacity of having all data related to some project in one database. */ #ifndef _vtkODBCReader_h #define _vtkODBCReader_h #include <vtksys/ios/sstream> #include "vtkPolyDataAlgorithm.h" #include <vtkStdString.h> struct Internal; class VTK_EXPORT vtkODBCReader : public vtkPolyDataAlgorithm { public: static vtkODBCReader* New(); vtkTypeRevisionMacro(vtkODBCReader,vtkPolyDataAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); vtkSetStringMacro(FileName); //vtkSetStringMacro(Headers); //vtkGetStringMacro(Headers); //vtkSetStringMacro(ActiveTable); //vtkGetStringMacro(ActiveTable); //vtkSetStringMacro(ActiveTableType); //vtkGetStringMacro(ActiveTableType); //vtkSetStringMacro(Px); //vtkGetStringMacro(Px); //vtkSetStringMacro(Py); //vtkGetStringMacro(Py); //vtkSetStringMacro(Pz); //vtkGetStringMacro(Pz); int CanReadFile( const char* fname ); // see xml file. // this function is called automatically when the StringVectorProperty // "Properties" is modified void SetProperties(const char*name, const char* type, int status); protected: vtkODBCReader(); ~vtkODBCReader(); virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); private: const char* FileName; char* Headers; char* ActiveTable; char* ActiveTableType; char* Px; char* Py; char* Pz; bool guiLoaded; Internal *internals; vtkStdString dataSourceName; vtkStdString username; vtkStdString password; }; #endif
#include "minunit.h" #include <stdlib.h> #include "AVector.h" static AVector* vector = NULL; char testData[][4] = { "foo", "bar", "baz", "bug" }; const char* testCreate(void) { vector = AStruct->ANew(AVector, 20); massert(vector != NULL, "Failed to create a new vector"); massert(vector->capacity == 20, "Wrong capacity after creation"); return NULL; } const char* testDestroy(void) { massert(vector != NULL, "Invalid vector"); vector->destroy(vector, free); return NULL; } const char* testAppend(void) { size_t i; for (i = 0; i < ARR_SIZE(testData); i++) { char* value; massert(vector->append(vector, AStruct->ADup(testData[i])) != NULL, "Failed to append"); massert((value = vector->get(vector, i)) != NULL, "Failed to get appended value"); massert(!strcmp(value, testData[i]), "Wrong value on append"); } massert(vector->size == ARR_SIZE(testData), "Wrong size after append"); return NULL; } const char* testInsert(void) { size_t i; for (i = 0; i < ARR_SIZE(testData); i++) { char* value; massert(vector->insert(vector, i, AStruct->ADup(testData[i])) != NULL, "Failed to insert"); massert((value = vector->get(vector, i)) != NULL, "Failed to get inserted value"); massert(!strcmp(value, testData[i]), "Wrong value on insert"); } massert(vector->size == 2 * ARR_SIZE(testData), "Wrong size after insert"); return NULL; } const char* testReplace(void) { size_t i; for (i = 0; i < ARR_SIZE(testData); i++) { char* value; massert(vector->replace(vector, i, testData[ARR_SIZE(testData) - i - 1], free), "Failed to replace value"); massert((value = vector->get(vector, i)) != NULL, "Failed to get replaced value"); massert(value == testData[ARR_SIZE(testData) - i - 1], "Wrong value on replace"); } massert(vector->size == 2 * ARR_SIZE(testData), "Wrong size after replace"); return NULL; } const char* testSet(void) { size_t i; for (i = 0; i < ARR_SIZE(testData); i++) { char* value; massert(vector->set(vector, i, AStruct->ADup(testData[i])) != NULL, "Failed to set value"); massert((value = vector->get(vector, i)) != NULL, "Failed to get set value"); massert(!strcmp(value, testData[i]), "Wrong value on set"); } massert(vector->size == 2 * ARR_SIZE(testData), "Wrong size after set"); return NULL; } const char* testGet(void) { size_t i; for (i = 0; i < vector->size; i++) { char* value = vector->get(vector, i); massert(value != NULL, "Failed to get value"); massert(!strcmp(value, testData[i % ARR_SIZE(testData)]), "Wrong value on get"); } return NULL; } const char* testRemove(void) { size_t i; for (i = 0; i < ARR_SIZE(testData); i++) { char* value = vector->remove(vector, 0); massert(value != NULL, "Failed to remove value"); massert(!strcmp(value, testData[i]), "Wrong value on get"); free(value); } massert(vector->size == ARR_SIZE(testData), "Wrong size after remove"); return NULL; } const char* testSubVector(void) { size_t i; AVector* sub = vector->subVector(vector, 1, 2, (AValueFunc)strdup); massert(sub != NULL, "Failed to create sub vector"); massert(sub->size == 2, "Wrong size of sub vector"); for (i = 0; i < sub->size; i++) { char* subValue = sub->get(sub, i); char* vecValue = vector->get(vector, i + 1); massert(subValue != NULL && vecValue != NULL, "Failed to get values"); massert(!strcmp(subValue, vecValue), "Wrong value in sub vector"); } sub->destroy(sub, free); return NULL; } const char* testCopyJoin(void) { size_t i; AVector* copy = vector->copy(vector, (AValueFunc)strdup); massert(copy != NULL, "Failed to create a copy"); massert(copy->size == vector->size, "Wrong size after copy"); for (i = 0; i < copy->size; i++) { char* copyValue = copy->get(copy, i); char* vecValue = vector->get(vector, i); massert(copyValue != NULL && vecValue != NULL, "Failed to get value"); massert(!strcmp(copyValue, vecValue), "Wrong value in copied vector"); } vector->join(vector, copy); massert(vector != NULL, "Failed to join vector"); massert(vector->size == 2 * ARR_SIZE(testData), "Wrong size after join"); return testGet(); } mrun(testCreate, testAppend, testInsert, testReplace, testSet, testGet, testRemove, testSubVector, testCopyJoin, testDestroy );
/* This file is part of the PhantomJS project from Ofi Labs. Copyright (C) 2012 execjosh, http://execjosh.blogspot.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 the <organization> 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 <COPYRIGHT HOLDER> 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. */ #ifndef CHILDPROCESS_H #define CHILDPROCESS_H #include <QObject> #include <QProcess> #ifdef Q_OS_WIN #include <QtCore/qt_windows.h> #endif #include "encoding.h" /** * This class wraps a QProcess and facilitates emulation of node.js's ChildProcess */ class ChildProcessContext : public QObject { Q_OBJECT Q_PROPERTY(qint64 pid READ pid) public: explicit ChildProcessContext(QObject* parent = 0); virtual ~ChildProcessContext(); qint64 pid() const; Q_INVOKABLE void kill(const QString& signal = "SIGTERM"); Q_INVOKABLE void _setEncoding(const QString& encoding); Q_INVOKABLE bool _start(const QString& cmd, const QStringList& args); Q_INVOKABLE qint64 _write(const QString& chunk, const QString& encoding); Q_INVOKABLE void _close(); signals: void exit(const int code) const; /** * For emulating `child.stdout.on("data", function (data) {})` */ void stdoutData(const QString& data) const; /** * For emulating `child.stderr.on("data", function (data) {})` */ void stderrData(const QString& data) const; private slots: void _readyReadStandardOutput(); void _readyReadStandardError(); void _error(const QProcess::ProcessError error); void _finished(const int exitCode, const QProcess::ExitStatus exitStatus); private: QProcess m_proc; Encoding m_encoding; }; /** * Helper class for child_process module */ class ChildProcess : public QObject { Q_OBJECT public: explicit ChildProcess(QObject* parent = 0); virtual ~ChildProcess(); Q_INVOKABLE QObject* _createChildProcessContext(); }; #endif // CHILDPROCESS_H
#ifndef VRCORE_H #define VRCORE_H #include "VRSettings.h" #include "VREvent.h" #include "VRRenderState.h" #include "VRNetInterface.h" /** Application programmers should use this singleton class as the interface to the MinVR library. */ class VRCore { public: // VRCore is a singleton class -- each program should contain exacly one instance of VRCore. Access the // current instance using the instance() function, which will create a new instance the first time it is // called, typically via: VRCore::instance()->initialize(settings); static VRCore* instance(); // THE BIG 4: TO USE MINVR, ADD THE FOLLOWING 4 FUNCTIONS TO YOUR PROGRAM: // 1. The first step is to initialize MinVR. The settings parameter is quite detailed and contains the // information needed to setup the geometry of the VR display devices, the type of stereo rendering to // use, input device drivers to create, plugins/add-ons to load, and more. void initialize(const VRSettings &settings); // BEGIN LOOP: YOUR PROGRAM SHOULD CONTAIN A MAIN LOOP THAT CALLS THE FOLLOWING TWO FUNCTIONS ONCE PER FRAME: // 2. Typically the first call in your program's mainloop. First, MinVR syncs events across all vr nodes. // Then, MinVR processes them to update its own state (e.g., for headtracking). Finally, MinVR calls your // event callback function so that your program can also respond to input events. void synchronizeAndProcessEvents(void (*eventCallbackFunction)(const std::vector<VREvent> &)); // 3. Tell MinVR to apply the appropriate projection matrices, shaders, etc. for each DisplayDevice // setup during initilization and then call your draw function to actually render the scene via // OpenGL or whatever graphics engine you are using. void renderOnAllDisplayDevices(void (*renderCallbackFunction)(const VRRenderState &)); // END LOOP // 4. Call shutdown() to close any network connections and/or other resources created by MinVR void shutdown(); virtual ~VRCore(); private: VRCore(); VRCore *_instance; VRDisplayManager *_displayManager; VRNetInterface *_vrNet; std::vector<VRInputDevice*> _inputDevices; }; #endif
/* $NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $ */ /* $FreeBSD$ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. */ /* * A really poor man's queue. It does only what it has to and gets out of * Dodge. It is used in place of <sys/queue.h> to get a better performance. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/queue.h> #include <stdlib.h> #include <string.h> #include "grep.h" struct qentry { STAILQ_ENTRY(qentry) list; struct str data; }; static STAILQ_HEAD(, qentry) queue = STAILQ_HEAD_INITIALIZER(queue); static unsigned long long count; static struct qentry *dequeue(void); void enqueue(struct str *x) { struct qentry *item; item = grep_malloc(sizeof(struct qentry)); item->data.dat = grep_malloc(sizeof(char) * x->len); item->data.len = x->len; item->data.line_no = x->line_no; item->data.off = x->off; memcpy(item->data.dat, x->dat, x->len); item->data.file = x->file; STAILQ_INSERT_TAIL(&queue, item, list); if (++count > Bflag) free(dequeue()); } static struct qentry * dequeue(void) { struct qentry *item; item = STAILQ_FIRST(&queue); if (item == NULL) return (NULL); STAILQ_REMOVE_HEAD(&queue, list); --count; return (item); } void printqueue(void) { struct qentry *item; while ((item = dequeue()) != NULL) { printline(&item->data, '-', (regmatch_t *)NULL, 0); free(item); } } void clearqueue(void) { struct qentry *item; while ((item = dequeue()) != NULL) free(item); }
/* Copyright Abandoned 1996, 1999, 2001 MySQL AB This file is public domain and comes with NO WARRANTY of any kind */ /* Version numbers for protocol & mysqld */ #ifndef _mysql_version_h #define _mysql_version_h #ifdef _CUSTOMCONFIG_ #include <custom_conf.h> #else #define PROTOCOL_VERSION 10 #define MYSQL_SERVER_VERSION "5.1.55" #define MYSQL_BASE_VERSION "mysqld-5.1" #define MYSQL_SERVER_SUFFIX_DEF "" #define FRM_VER 6 #define MYSQL_VERSION_ID 50155 #define MYSQL_PORT 3306 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" #define MYSQL_CONFIG_NAME "my" #define MYSQL_COMPILATION_COMMENT "Source distribution" /* mysqld compile time options */ #endif /* _CUSTOMCONFIG_ */ #ifndef LICENSE #define LICENSE GPL #endif /* LICENSE */ #endif /* _mysql_version_h */
// Version 1.0 #ifndef _LISTA_PARAMETROW_H_ #define _LISTA_PARAMETROW_H_ #include "list.h" #include "parameter.h" // Nazwa typu wprowadzona, aby zachowac zgodnosc z gramatyka typedef List<Parameter> ParameterList; #endif
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (C) 2007-2013 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC 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. * * RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>. */ /** * @file * * Implementation of the low-level prime field addition and subtraction * functions. * * @version $Id: relic_fp_add_low.c 1535 2013-08-28 04:01:10Z dfaranha $ * @ingroup fp */ #include "relic_fp.h" #include "relic_fp_low.h" #include "relic_core.h" /*============================================================================*/ /* Public definitions */ /*============================================================================*/ dig_t fp_add1_low(dig_t *c, const dig_t *a, dig_t digit) { int i; dig_t carry, r0; carry = digit; for (i = 0; i < FP_DIGS && carry; i++, a++, c++) { r0 = (*a) + carry; carry = (r0 < carry); (*c) = r0; } for (; i < FP_DIGS; i++, a++, c++) { (*c) = (*a); } return carry; } dig_t fp_addn_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < FP_DIGS; i++, a++, b++, c++) { r0 = (*a) + (*b); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; (*c) = r1; } return carry; } void fp_addm_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < FP_DIGS; i++, a++, b++) { r0 = (*a) + (*b); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; c[i] = r1; } if (carry || (fp_cmpn_low(c, fp_prime_get()) != CMP_LT)) { carry = fp_subn_low(c, c, fp_prime_get()); } } dig_t fp_addd_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < 2 * FP_DIGS; i++, a++, b++) { r0 = (*a) + (*b); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; c[i] = r1; } return carry; } void fp_addc_low(dig_t *c, const dig_t *a, const dig_t *b) { dig_t carry = fp_addd_low(c, a, b); if (carry || (fp_cmpn_low(c + FP_DIGS, fp_prime_get()) != CMP_LT)) { carry = fp_subn_low(c + FP_DIGS, c + FP_DIGS, fp_prime_get()); } } dig_t fp_sub1_low(dig_t *c, const dig_t *a, dig_t digit) { int i; dig_t carry, r0; carry = digit; for (i = 0; i < FP_DIGS; i++, c++, a++) { r0 = (*a) - carry; carry = (r0 > (*a)); (*c) = r0; } return carry; } dig_t fp_subn_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, r0, diff; /* Zero the carry. */ carry = 0; for (i = 0; i < FP_DIGS; i++, a++, b++, c++) { diff = (*a) - (*b); r0 = diff - carry; carry = ((*a) < (*b)) || (carry && !diff); (*c) = r0; } return carry; } void fp_subm_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, r0, diff; /* Zero the carry. */ carry = 0; for (i = 0; i < FP_DIGS; i++, a++, b++) { diff = (*a) - (*b); r0 = diff - carry; carry = ((*a) < (*b)) || (carry && !diff); c[i] = r0; } if (carry) { fp_addn_low(c, c, fp_prime_get()); } } void fp_subc_low(dig_t *c, const dig_t *a, const dig_t *b) { dig_t carry = fp_subd_low(c, a, b); if (carry) { fp_addn_low(c + FP_DIGS, c + FP_DIGS, fp_prime_get()); } } dig_t fp_subd_low(dig_t *c, const dig_t *a, const dig_t *b) { int i; dig_t carry, r0, diff; /* Zero the carry. */ carry = 0; for (i = 0; i < 2 * FP_DIGS; i++, a++, b++) { diff = (*a) - (*b); r0 = diff - carry; carry = ((*a) < (*b)) || (carry && !diff); c[i] = r0; } return carry; } void fp_negm_low(dig_t *c, const dig_t *a) { fp_subn_low(c, fp_prime_get(), a); } dig_t fp_dbln_low(dig_t *c, const dig_t *a) { int i; dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < FP_DIGS; i++, a++, c++) { r0 = (*a) + (*a); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; (*c) = r1; } return carry; } void fp_dblm_low(dig_t *c, const dig_t *a) { int i; dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < FP_DIGS; i++, a++) { r0 = (*a) + (*a); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; c[i] = r1; } if (carry || (fp_cmpn_low(c, fp_prime_get()) != CMP_LT)) { carry = fp_subn_low(c, c, fp_prime_get()); } } void fp_hlvm_low(dig_t *c, const dig_t *a) { dig_t carry = 0; if (a[0] & 1) { carry = fp_addn_low(c, a, fp_prime_get()); } else { dv_copy(c, a, FP_DIGS); } fp_rsh1_low(c, c); if (carry) { c[FP_DIGS - 1] ^= ((dig_t)1 << (FP_DIGIT - 1)); } } void fp_hlvd_low(dig_t *c, const dig_t *a) { dig_t carry = 0; if (a[0] & 1) { carry = fp_addn_low(c, a, fp_prime_get()); } else { dv_copy(c, a, FP_DIGS); } fp_add1_low(c + FP_DIGS, a + FP_DIGS, carry); carry = fp_rsh1_low(c + FP_DIGS, c + FP_DIGS); fp_rsh1_low(c, c); if (carry) { c[FP_DIGS - 1] ^= ((dig_t)1 << (FP_DIGIT - 1)); } }
/*========================================================================= Program: Converter Class for Point Language: C++ Copyright (c) Brigham and Women's Hospital. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __RIBConverterPoint_H #define __RIBConverterPoint_H #include "rib_converter.h" // ROS header files #include "ros/ros.h" // ROS message header files #include "ros_igtl_bridge/igtlpoint.h" // OpenIGTLink message files #include "igtlStringMessage.h" class RIBConverterPoint : public RIBConverter<ros_igtl_bridge::igtlpoint> { public: RIBConverterPoint(); RIBConverterPoint(ros::NodeHandle *nh); RIBConverterPoint(const char* topicPublish, const char* topicSubscribe, ros::NodeHandle *nh=NULL); //virtual uint32_t queueSizePublish() { return 10; } //virtual uint32_t queueSizeSubscribe() { return 10; } virtual const char* messageTypeString() { return "POINT"; } public: virtual int onIGTLMessage(igtl::MessageHeader * header); protected: virtual void onROSMessage(const ros_igtl_bridge::igtlpoint::ConstPtr & msg); }; #endif // __RIBConverterPoint_H
#pragma once // CTarget class CTarget { public: CTarget(); virtual ~CTarget(); public: int id; double px; double py; int cnt; public: void SetPosi(double x, double y); };
// Benoit September 2010 #ifndef EU_NIFTI_OCU_I_VISUALIZATION_MANAGER_H_ #define EU_NIFTI_OCU_I_VISUALIZATION_MANAGER_H_ #include <string> #include <OGRE/OgreImage.h> #include "nifti_ocu_msgs/NIFTiViewParams.h" #include "NIFTiViewsUtil.h" class wxIdleEvent; class wxSizeEvent; namespace Ogre { class Viewport; class Vector3; class SceneManager; } namespace rviz { class RenderPanel; class ViewController; } namespace eu { namespace nifti { namespace ocu { namespace view { class IViewController; } class IVisualizationManager { public: virtual ~IVisualizationManager() {}; virtual void initialize() = 0; /** * Gets the coordinate frame to which all fixed data is transformed */ virtual const std::string& getFixedFrame() const = 0; /** * Gets the coordinate frame in which the data is displayed */ virtual const std::string& getTargetFrame() const = 0; virtual void resetTime() = 0; /** * Returns the Ogre viewport, which links a camera and a rendering surface * @return */ virtual Ogre::Viewport* getViewport() const = 0; /** * Returns the object that controls how the scene is viewed * @return */ virtual eu::nifti::ocu::view::IViewController* getViewController() const = 0; /** * Returns the horizontal field of view in radians * @return */ virtual double getFieldOfViewHorizontal() const = 0; /** * Returns the horizontal field of view in radians * @return */ virtual double getFieldOfViewVertical() const = 0; /** * Ensures that Ogre's renderer is called only in a mutex block */ virtual void lockRender() = 0; /** * Ensures that Ogre's renderer is called only in a mutex block */ virtual void unlockRender() = 0; /** * Queues a render request. */ virtual void queueRender() = 0; /** * Forces the display to render at the next call to update (for now, only used for cameras - not 3D scenes) */ virtual void forceReRender() = 0; virtual void update(float wall_dt, float ros_dt) = 0; virtual void onIdle(wxIdleEvent& event) = 0; /** * Makes the view point to a specific location */ virtual void lookAt(const Ogre::Vector3& point) = 0; /** * Updates the info about the OCU that is periodically published */ virtual void updateOCUInfoViewContent() = 0; /** * Updates the info about the OCU that is periodically published */ virtual void updateOCUInfoViewSize() = 0; /** * Handles the resize event created by the render panel * @param evt * @param panelNum */ virtual void handleSizeEvent(wxSizeEvent& evt) = 0; /** * Returns the render panel * @return */ virtual const rviz::RenderPanel* getRenderPanel() const = 0; /** * Returns the x,y,z coordinates associated with a x,y mouse position * within a viewport * @param mouseX * @param mouseY * @return */ virtual Ogre::Vector3 getFixedFramePositionFromViewportPosition(int mouseX, int mouseY) const = 0; /** * Gets the view type (2D Map, 3D first person, etc.) * @return */ virtual ViewType getViewType() const = 0; /** * Sets the view type (2D Map, 3D first person, etc.) * @return */ virtual void setViewType(eu::nifti::ocu::ViewType viewType) = 0; virtual void changeViewParams(nifti_ocu_msgs::NIFTiViewParams* viewParams) = 0; virtual Ogre::Image getCurrentImage() const = 0; virtual std::string getCurrentImageEncoding() const = 0; /** * Returns debugging information * @return */ virtual std::string toString() const = 0; }; } } } #endif /* EU_NIFTI_OCU_I_VISUALIZATION_MANAGER_H_ */
/*========================================================================= Program: Visualization Toolkit Module: vtkFeatureEdges.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkFeatureEdges - extract boundary, non-manifold, and/or sharp edges from polygonal data // .SECTION Description // vtkFeatureEdges is a filter to extract special types of edges from // input polygonal data. These edges are either 1) boundary (used by // one polygon) or a line cell; 2) non-manifold (used by three or more // polygons); 3) feature edges (edges used by two triangles and whose // dihedral angle > FeatureAngle); or 4) manifold edges (edges used by // exactly two polygons). These edges may be extracted in any // combination. Edges may also be "colored" (i.e., scalar values assigned) // based on edge type. The cell coloring is assigned to the cell data of // the extracted edges. // .SECTION Caveats // To see the coloring of the liens you may have to set the ScalarMode // instance variable of the mapper to SetScalarModeToUseCellData(). (This // is only a problem if there are point data scalars.) // .SECTION See Also // vtkExtractEdges #ifndef vtkFeatureEdges_h #define vtkFeatureEdges_h #include "vtkFiltersCoreModule.h" // For export macro #include "vtkPolyDataAlgorithm.h" class vtkIncrementalPointLocator; class VTKFILTERSCORE_EXPORT vtkFeatureEdges : public vtkPolyDataAlgorithm { public: vtkTypeMacro(vtkFeatureEdges,vtkPolyDataAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Construct object with feature angle = 30; all types of edges extracted // and colored. static vtkFeatureEdges *New(); // Description: // Turn on/off the extraction of boundary edges. vtkSetMacro(BoundaryEdges,int); vtkGetMacro(BoundaryEdges,int); vtkBooleanMacro(BoundaryEdges,int); // Description: // Turn on/off the extraction of feature edges. vtkSetMacro(FeatureEdges,int); vtkGetMacro(FeatureEdges,int); vtkBooleanMacro(FeatureEdges,int); // Description: // Specify the feature angle for extracting feature edges. vtkSetClampMacro(FeatureAngle,double,0.0,180.0); vtkGetMacro(FeatureAngle,double); // Description: // Turn on/off the extraction of non-manifold edges. vtkSetMacro(NonManifoldEdges,int); vtkGetMacro(NonManifoldEdges,int); vtkBooleanMacro(NonManifoldEdges,int); // Description: // Turn on/off the extraction of manifold edges. vtkSetMacro(ManifoldEdges,int); vtkGetMacro(ManifoldEdges,int); vtkBooleanMacro(ManifoldEdges,int); // Description: // Turn on/off the coloring of edges by type. vtkSetMacro(Coloring,int); vtkGetMacro(Coloring,int); vtkBooleanMacro(Coloring,int); // Description: // Set / get a spatial locator for merging points. By // default an instance of vtkMergePoints is used. void SetLocator(vtkIncrementalPointLocator *locator); vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); // Description: // Create default locator. Used to create one when none is specified. void CreateDefaultLocator(); // Description: // Return MTime also considering the locator. unsigned long GetMTime(); // Description: // Set/get the desired precision for the output types. See the documentation // for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of // the available precision settings. vtkSetMacro(OutputPointsPrecision,int); vtkGetMacro(OutputPointsPrecision,int); protected: vtkFeatureEdges(); ~vtkFeatureEdges(); // Usual data generation method int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *); double FeatureAngle; int BoundaryEdges; int FeatureEdges; int NonManifoldEdges; int ManifoldEdges; int Coloring; int OutputPointsPrecision; vtkIncrementalPointLocator *Locator; private: vtkFeatureEdges(const vtkFeatureEdges&) VTK_DELETE_FUNCTION; void operator=(const vtkFeatureEdges&) VTK_DELETE_FUNCTION; }; #endif
#pragma once #include "guidedFilter.hpp" class guidedFilter_Naive_Share : public cp::GuidedFilterBase { protected: cp::BoxFilterMethod boxType; int parallelType; cv::Mat mean_I; cv::Mat mean_p; cv::Mat corr_I; cv::Mat corr_Ip; cv::Mat var_I; cv::Mat cov_Ip; cv::Mat a; cv::Mat b; cv::Mat I_b; cv::Mat I_g; cv::Mat I_r; //cv::Mat mean_p; cv::Mat mean_I_b; cv::Mat mean_I_g; cv::Mat mean_I_r; cv::Mat corr_I_bb; cv::Mat corr_I_bg; cv::Mat corr_I_br; cv::Mat corr_I_gg; cv::Mat corr_I_gr; cv::Mat corr_I_rr; cv::Mat corr_Ip_b; cv::Mat corr_Ip_g; cv::Mat corr_Ip_r; cv::Mat var_I_bb; cv::Mat var_I_bg; cv::Mat var_I_br; cv::Mat var_I_gg; cv::Mat var_I_gr; cv::Mat var_I_rr; cv::Mat cov_Ip_b; cv::Mat cov_Ip_g; cv::Mat cov_Ip_r; cv::Mat a_b; cv::Mat a_g; cv::Mat a_r; cv::Mat temp_high; enum { BOX_32F, BOX_64F }; int average_method = BOX_32F; void average(cv::Mat& src, cv::Mat& dest, const int r); void computeVar(cv::Mat& guide); void Ip2ab_Guide1(cv::Mat& input, cv::Mat& guide); void ab2q_Guide1(cv::Mat& guide, cv::Mat& output); void filter_Guide1(cv::Mat& input, cv::Mat& guide, cv::Mat& output); void ab_up_2q_Guide1(cv::Mat& guide, cv::Mat& output); void filterFast_Guide1(cv::Mat& input_low, cv::Mat& guide, cv::Mat& guide_low, cv::Mat& output); void computerCov(std::vector<cv::Mat>& guide); void computeCovariance(const int depth); void Ip2ab_Guide3(cv::Mat& input, std::vector<cv::Mat>& guide); void ab2q_Guide3(std::vector<cv::Mat>& guide, cv::Mat& output); void filter_Guide3(cv::Mat& input, std::vector<cv::Mat>& guide, cv::Mat& output); void ab_up_2q_Guide3(std::vector<cv::Mat>& guide, cv::Mat& output); void filterFast_Guide3(cv::Mat& input_low, std::vector<cv::Mat>& guide, std::vector<cv::Mat>& guide_low, cv::Mat& output); void computeVarCov()override; virtual void filter_Guide1(cv::Mat& input, cv::Mat& output) {}; virtual void filter_Guide3(cv::Mat& input, cv::Mat& output) {}; public: guidedFilter_Naive_Share(cv::Mat& _src, cv::Mat& _guide, cv::Mat& _dest, int _r, float _eps, const cp::BoxFilterMethod _boxType, int _parallelType) : cp::GuidedFilterBase(_src, _guide, _dest, _r, _eps), boxType(_boxType), parallelType(_parallelType) { implementation = cp::GUIDED_NAIVE_SHARE; } void filter(); void filterVector(); void filterGuidePrecomputed() override; void upsample() override; };
/* * Copyright (c) 2008, Autodesk, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Autodesk, Inc. 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 Autodesk, Inc. ``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 Autodesk, Inc. 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. */ /****************************************************************************** ******************************************************************************* ** ** ** Japanese ".PAR" Grid Iterpolation Data File ** ** ** ******************************************************************************* ******************************************************************************/ /* The original Japanese data file is provided in text formm. As a performance enhancement, we convert the ASCII text file to binary form upon the first access. This conversion process uses the dates on the file to determine if a new binary version needs to be built. The following object is used to create, manage, and use a binary version of the Jgd2k data file. We need a binary version to insulate ourselves from ths possibility of a variable length text file. Also, it enables us to sort the data file. There is no reason to believe that the text files will always be properly sorted for rapid access. Note, that unlike all the other grid data files, there is no guarantee that the coverage of any such file is rectangular. Therefore, there is no way that the coverage scheme will work. So, we are therefore limited to handling a single file at a time. The coverage is determined by the coverage of that file. The binary file that we make consists of a number of the following records, with two doubles on the front. The two doubles represent the southwesternmost meshcode in the file. After the rather trivial header, the records appear in ascending order by mesh code. An attempt was made to make this file format generic, i.e. not specifically related to Japanese real estate. Despite these efforts, there are two features of this format that makes the format rather specific to Japan: 1> In generating mesh code, longitude are biased around the 100E meridian. 2> The grid cell size is defined by the mesh encoding as being 45 seconds by 30 seconds. */ struct csJgd2kGridRecord_ { ulong32_t meshCode; long32_t deltaLat; /* seconds * 100,000 */ long32_t deltaLng; /* seconds * 100,000 */ }; struct cs_Japan_ { struct csGridCoverage_ coverage; /* This is the rectangular min/max and does _NOT_ imply that all real estate inside the rectangle is covered. The implication is only that real estate outside the rectangular region is definitely not covered. */ double ewDelta; /* Grid cell size */ double nsDelta; /* Grid cell size */ double errorValue; double cnvrgValue; csFILE* strm; /* file is not opened until required, may be closed if entire contents have been buffered. */ long32_t bufferSize; /* Size of the I/O buffer in use. */ void *dataBuffer; /* not allocated until required, i.e. file is actually opened. */ struct csGridCell_ lngCell; /* Last longitude cell actually used. */ struct csGridCell_ latCell; /* Last latitude cwll actaully used. */ char filePath [MAXPATH]; /* Full path to data source file. */ char fileName [32]; /* File name only, used for error reporting. */ char binaryPath [MAXPATH]; /* Full path to binary shadow file. */ short maxIterations; }; ulong32_t EXP_LVL9 CSjpnLlToMeshCode (const double ll [2]); void EXP_LVL9 CSjpnMeshCodeToLl (double ll [2],ulong32_t meshCode); int EXP_LVL9 CScompareJgd2kGridRecord (const struct csJgd2kGridRecord_ *elem1,const struct csJgd2kGridRecord_ *elem2); struct cs_Japan_* EXP_LVL7 CSnewJgd2kGridFile (Const char *path,long32_t bufferSize,ulong32_t flags,double density); void EXP_LVL7 CSreleaseJgd2kGridFile (struct cs_Japan_ *__This); void EXP_LVL7 CSdeleteJgd2kGridFile (struct cs_Japan_ *__This); int EXP_LVL9 CSextractJgd2kGridFile (struct cs_Japan_ *__This,Const double* sourceLL); int EXP_LVL9 CScalcJgd2kGridFile (struct cs_Japan_* __This,double result [2],Const double* sourceLL); int EXP_LVL9 CSmakeBinaryJgd2kFile (struct cs_Japan_* __This);
// Copyright (c) 2011 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 CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_ #define CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_ #pragma once #include "chrome/browser/ui/find_bar/find_bar_controller.h" #include "chrome/browser/ui/find_bar/find_notification_details.h" #include "content/public/browser/web_contents_observer.h" // Per-tab find manager. Handles dealing with the life cycle of find sessions. class FindTabHelper : public content::WebContentsObserver { public: #if defined(OS_ANDROID) enum BlockingFindType { FIND_NEXT, FIND_ALL }; enum BlockingFindDirection { FORWARD_DIRECTION, BACKWARD_DIRECTION }; #endif explicit FindTabHelper(content::WebContents* web_contents); virtual ~FindTabHelper(); #if defined(OS_ANDROID) // If |find_type| is FIND_ALL finds all the occurrences of the search_string // within the content of the page and returns the number of these // occurrences. The occurrences are highlighted and the first match is // highlighted with a different color. // // If |find_next| is true it moves the different color highlight to the // next match and scrolls to it; |search_string| is ignored. // // This method is synchronous: in violation of the chrome design principles // it will block waiting on the renderer and only return when a reply has // been received from the renderer process. // // This is required for compatibility reasons to implement a // method of the legacy Android Browser's WebView API int BlockingFind(const string16& search_string, BlockingFindType find_type, BlockingFindDirection direction); #endif // Starts the Find operation by calling StartFinding on the Tab. This function // can be called from the outside as a result of hot-keys, so it uses the // last remembered search string as specified with set_find_string(). This // function does not block while a search is in progress. The controller will // receive the results through the notification mechanism. See Observe(...) // for details. void StartFinding(string16 search_string, bool forward_direction, bool case_sensitive); #if defined(OS_ANDROID) // Selects and zooms to the nearest find result to the point (x,y), where // x and y are fractions of the content document's width and height. void ActivateNearestFindResult(float x, float y); #endif // Stops the current Find operation. void StopFinding(FindBarController::SelectionAction selection_action); #if defined(OS_ANDROID) // Asks the renderer to send the bounding boxes of the current find matches. void RequestFindMatchRects(int have_version); #endif // Accessors/Setters for find_ui_active_. bool find_ui_active() const { return find_ui_active_; } void set_find_ui_active(bool find_ui_active) { find_ui_active_ = find_ui_active; } // Setter for find_op_aborted_. void set_find_op_aborted(bool find_op_aborted) { find_op_aborted_ = find_op_aborted; } // Used _only_ by testing to get or set the current request ID. int current_find_request_id() { return current_find_request_id_; } void set_current_find_request_id(int current_find_request_id) { current_find_request_id_ = current_find_request_id; } // Accessor for find_text_. Used to determine if this TabContents has any // active searches. string16 find_text() const { return find_text_; } // Accessor for the previous search we issued. string16 previous_find_text() const { return previous_find_text_; } // Accessor for find_result_. const FindNotificationDetails& find_result() const { return last_search_result_; } void HandleFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update); private: // Notify the UI, automation and any other observers that a find result was // found. void SendFindNotification(int request_id, int match_count, gfx::Rect selection, int ordinal, bool final_update); // Each time a search request comes in we assign it an id before passing it // over the IPC so that when the results come in we can evaluate whether we // still care about the results of the search (in some cases we don't because // the user has issued a new search). static int find_request_id_counter_; // True if the Find UI is active for this Tab. bool find_ui_active_; // True if a Find operation was aborted. This can happen if the Find box is // closed or if the search term inside the Find box is erased while a search // is in progress. This can also be set if a page has been reloaded, and will // on FindNext result in a full Find operation so that the highlighting for // inactive matches can be repainted. bool find_op_aborted_; // This variable keeps track of what the most recent request id is. int current_find_request_id_; // The current string we are/just finished searching for. This is used to // figure out if this is a Find or a FindNext operation (FindNext should not // increase the request id). string16 find_text_; // The string we searched for before |find_text_|. string16 previous_find_text_; // Whether the last search was case sensitive or not. bool last_search_case_sensitive_; // The last find result. This object contains details about the number of // matches, the find selection rectangle, etc. The UI can access this // information to build its presentation. FindNotificationDetails last_search_result_; DISALLOW_COPY_AND_ASSIGN(FindTabHelper); }; #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "air+logios@cs.cmu.edu" /* Define to the full name of this package. */ #define PACKAGE_NAME "cmuclmtk" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "cmuclmtk 0.7" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "cmuclmtk" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.7" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif
#ifndef PRESETS_INCLUDED #define PRESETS_INCLUDED #include "model.h" #define DefaultAminoModel "lg" #define DefaultCodonModel "ECMunrest" RateModel namedModel (const string& name); #endif /* PRESETS_INCLUDED */
/* * Copyright (c) 2012 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 WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_OPUS_H_ #define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_OPUS_H_ #include "acm_generic_codec.h" #include "resampler.h" struct WebRtcOpusEncInst; struct WebRtcOpusDecInst; namespace webrtc { class ACMOpus : public ACMGenericCodec { public: ACMOpus(int16_t codecID); ~ACMOpus(); ACMGenericCodec* CreateInstance(void); int16_t InternalEncode(uint8_t* bitstream, int16_t* bitStreamLenByte); int16_t InternalInitEncoder(WebRtcACMCodecParams *codecParams); int16_t InternalInitDecoder(WebRtcACMCodecParams *codecParams); protected: int16_t DecodeSafe(uint8_t* bitStream, int16_t bitStreamLenByte, int16_t* audio, int16_t* audioSamples, int8_t* speechType); int32_t CodecDef(WebRtcNetEQ_CodecDef& codecDef, const CodecInst& codecInst); void DestructEncoderSafe(); void DestructDecoderSafe(); int16_t InternalCreateEncoder(); int16_t InternalCreateDecoder(); void InternalDestructEncoderInst(void* ptrInst); int16_t SetBitRateSafe(const int32_t rate); bool IsTrueStereoCodec(); void SplitStereoPacket(uint8_t* payload, int32_t* payload_length); WebRtcOpusEncInst* _encoderInstPtr; WebRtcOpusDecInst* _decoderInstPtr; uint16_t _sampleFreq; uint16_t _bitrate; int _channels; }; } // namespace webrtc #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_OPUS_H_
/************************************************************************************ * configs/sama5d3x-ek/src/sam_boot.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX 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. * ************************************************************************************/ /************************************************************************************ * Included Files ************************************************************************************/ #include <nuttx/config.h> #include <debug.h> #include "sama5d3x-ek.h" /************************************************************************************ * Definitions ************************************************************************************/ /************************************************************************************ * Private Functions ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ * Name: sam_boardinitialize * * Description: * All SAMA5 architectures must provide the following entry point. This entry * point is called early in the intitialization -- after all memory has been * configured and mapped but before any devices have been initialized. * ************************************************************************************/ void sam_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is enable, and 2) the weak function * sam_spiinitialize() has been brought into the link. */ #if defined(CONFIG_SAMA5_SPI0) || defined(CONFIG_SAMA5_SPI1) if (sam_spiinitialize) { sam_spiinitialize(); } #endif #if defined(CONFIG_SAMA5_DDRCS) && !defined(CONFIG_SAMA5_BOOT_SDRAM) /* Configure SDRAM if (1) SDRAM has been enalbled in the NuttX configuration and * (2) if we are not currently running out of SDRAM. If we are now running out * of SDRAM then we have to assume that some second level bootloader has properly * configured SDRAM for our use. */ sam_sdram_config(); #endif /* Initialize USB if the 1) the HS host or device controller is in the * configuration and 2) the weak function sam_usbinitialize() has been brought * into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ #if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS) if (sam_usbinitialize) { sam_usbinitialize(); } #endif #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ up_ledinit(); #endif }
// Copyright 2019 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 CHROMEOS_SERVICES_DEVICE_SYNC_FAKE_CRYPTAUTH_FEATURE_STATUS_SETTER_H_ #define CHROMEOS_SERVICES_DEVICE_SYNC_FAKE_CRYPTAUTH_FEATURE_STATUS_SETTER_H_ #include <memory> #include <string> #include <vector> #include "base/callback.h" #include "base/macros.h" #include "base/timer/timer.h" #include "chromeos/components/multidevice/software_feature.h" #include "chromeos/services/device_sync/cryptauth_feature_status_setter.h" #include "chromeos/services/device_sync/cryptauth_feature_status_setter_impl.h" #include "chromeos/services/device_sync/network_request_error.h" namespace chromeos { namespace device_sync { class ClientAppMetadataProvider; class CryptAuthClientFactory; class CryptAuthGCMManager; class FakeCryptAuthFeatureStatusSetter : public CryptAuthFeatureStatusSetter { public: class Delegate { public: virtual ~Delegate() = default; virtual void OnSetFeatureStatusCalled() {} }; struct Request { Request(const std::string& device_id, multidevice::SoftwareFeature feature, FeatureStatusChange status_change, base::OnceClosure success_callback, base::OnceCallback<void(NetworkRequestError)> error_callback); Request(Request&& request); ~Request(); const std::string device_id; const multidevice::SoftwareFeature feature; const FeatureStatusChange status_change; base::OnceClosure success_callback; base::OnceCallback<void(NetworkRequestError)> error_callback; }; FakeCryptAuthFeatureStatusSetter(); ~FakeCryptAuthFeatureStatusSetter() override; void set_delegate(Delegate* delegate) { delegate_ = delegate; } std::vector<Request>& requests() { return requests_; } private: // CryptAuthFeatureStatusSetter: void SetFeatureStatus( const std::string& device_id, multidevice::SoftwareFeature feature, FeatureStatusChange status_change, base::OnceClosure success_callback, base::OnceCallback<void(NetworkRequestError)> error_callback) override; Delegate* delegate_ = nullptr; std::vector<Request> requests_; DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusSetter); }; class FakeCryptAuthFeatureStatusSetterFactory : public CryptAuthFeatureStatusSetterImpl::Factory { public: FakeCryptAuthFeatureStatusSetterFactory(); ~FakeCryptAuthFeatureStatusSetterFactory() override; const std::vector<FakeCryptAuthFeatureStatusSetter*>& instances() const { return instances_; } const ClientAppMetadataProvider* last_client_app_metadata_provider() const { return last_client_app_metadata_provider_; } const CryptAuthClientFactory* last_client_factory() const { return last_client_factory_; } const CryptAuthGCMManager* last_gcm_manager() const { return last_gcm_manager_; } private: // CryptAuthFeatureStatusSetterImpl::Factory: std::unique_ptr<CryptAuthFeatureStatusSetter> CreateInstance( ClientAppMetadataProvider* client_app_metadata_provider, CryptAuthClientFactory* client_factory, CryptAuthGCMManager* gcm_manager, std::unique_ptr<base::OneShotTimer> timer) override; std::vector<FakeCryptAuthFeatureStatusSetter*> instances_; ClientAppMetadataProvider* last_client_app_metadata_provider_ = nullptr; CryptAuthClientFactory* last_client_factory_ = nullptr; CryptAuthGCMManager* last_gcm_manager_ = nullptr; DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusSetterFactory); }; } // namespace device_sync } // namespace chromeos #endif // CHROMEOS_SERVICES_DEVICE_SYNC_FAKE_CRYPTAUTH_FEATURE_STATUS_SETTER_H_
// ***************************************************************************** /*! \file src/NoWarning/charestatecollector.decl.h \copyright 2012-2015 J. Bakosi, 2016-2018 Los Alamos National Security, LLC., 2019-2020 Triad National Security, LLC. All rights reserved. See the LICENSE file for details. \brief Include charestatecollector.decl.h with turning off specific compiler warnings */ // ***************************************************************************** #ifndef nowarning_charestatecollector_decl_h #define nowarning_charestatecollector_decl_h #include "Macro.hpp" #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" #pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wzero-length-array" #pragma clang diagnostic ignored "-Wshorten-64-to-32" #pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wundef" #pragma clang diagnostic ignored "-Wundefined-func-template" #pragma clang diagnostic ignored "-Woverloaded-virtual" #pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wshadow-field" #pragma clang diagnostic ignored "-Wmissing-noreturn" #pragma clang diagnostic ignored "-Wdocumentation" #pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" #pragma clang diagnostic ignored "-Wdeprecated" #pragma clang diagnostic ignored "-Wcovered-switch-default" #pragma clang diagnostic ignored "-Wshadow-field-in-constructor" #pragma clang diagnostic ignored "-Wconversion" #pragma clang diagnostic ignored "-Wcast-qual" #pragma clang diagnostic ignored "-Wdouble-promotion" #pragma clang diagnostic ignored "-Wcast-align" #pragma clang diagnostic ignored "-Wswitch-enum" #pragma clang diagnostic ignored "-Wfloat-equal" #pragma clang diagnostic ignored "-Wsign-compare" #pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wheader-hygiene" #pragma clang diagnostic ignored "-Wnon-virtual-dtor" #elif defined(STRICT_GNUC) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wredundant-decls" #pragma GCC diagnostic ignored "-Wdeprecated-copy" #pragma GCC diagnostic ignored "-Wextra" #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wfloat-equal" #pragma GCC diagnostic ignored "-Wparentheses" #elif defined(__INTEL_COMPILER) #pragma warning( push ) #pragma warning( disable: 181 ) #pragma warning( disable: 1125 ) #pragma warning( disable: 1720 ) #endif #include "../Base/charestatecollector.decl.h" #if defined(__clang__) #pragma clang diagnostic pop #elif defined(STRICT_GNUC) #pragma GCC diagnostic pop #elif defined(__INTEL_COMPILER) #pragma warning( pop ) #endif #endif // nowarning_charestatecollector_decl_h
/* * Copyright (c) 2005, Peter Sommerlad and IFS Institute for Software at HSR Rapperswil, Switzerland * All rights reserved. * * This library/application is free software; you can redistribute and/or modify it under the terms of * the license that is included with this library/application in the file license.txt. */ #ifndef _TimeStampRenderer_H #define _TimeStampRenderer_H #include "Renderer.h" //! Renders a TimeStamp to the stream /*! \par Configuration \code { /UnixTime Rendererspec optional, default current time, unix time to use for timestamp } \endcode or just \code { Rendererspec optional, default current time, unix time to use for timestamp } \endcode This renderer simply creates a TimeStamp object from current system time or given unix time value and puts the human readable String onto the reply stream. The output format is fixed to the format returned from the object. Currently it is (in strftime format): "\%Y\%m\%d\%H\%M\%S" */ class TimeStampRenderer : public Renderer { public: //--- constructors /*! \param name defines the name of the renderer */ TimeStampRenderer(const char *name); virtual ~TimeStampRenderer(); /*! Renders the timestamp to reply \param reply the stream where the rendered output is written on. \param ctx the context the renderer runs within. \param config the configuration of the renderer. */ virtual void RenderAll(std::ostream &reply, Context &ctx, const ROAnything &config); }; #endif
#ifndef __SHAREDMEMORYCLIENT__ #define __SHAREDMEMORYCLIENT__ #include <string> #include <stdlib.h> #include <securityd_client/SharedMemoryCommon.h> #include <security_utilities/threading.h> namespace Security { enum UnavailableReason {kURNone, kURMessageDropped, kURMessagePending, kURNoMessage, kURBufferCorrupt}; class SharedMemoryClient { protected: std::string mSegmentName; size_t mSegmentSize; Mutex mMutex; u_int8_t* mSegment; u_int8_t* mDataArea; u_int8_t* mDataPtr; u_int8_t* mDataMax; SegmentOffsetType GetProducerCount (); void ReadData (void* buffer, SegmentOffsetType bytesToRead); SegmentOffsetType ReadOffset (); public: SharedMemoryClient (const char* segmentName, SegmentOffsetType segmentSize); virtual ~SharedMemoryClient (); bool ReadMessage (void* message, SegmentOffsetType &length, UnavailableReason &ur); const char* GetSegmentName (); size_t GetSegmentSize (); }; }; #endif
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BlockPainter_h #define BlockPainter_h namespace blink { struct PaintInfo; class InlineBox; class LayoutPoint; class LayoutRect; class RenderFlexibleBox; class RenderBlock; class RenderBox; class LayoutObject; class BlockPainter { public: BlockPainter(RenderBlock& block) : m_renderBlock(block) { } void paint(const PaintInfo&, const LayoutPoint& paintOffset); void paintObject(const PaintInfo&, const LayoutPoint&); void paintChildren(const PaintInfo&, const LayoutPoint&); void paintChild(RenderBox&, const PaintInfo&, const LayoutPoint&); void paintChildAsInlineBlock(RenderBox&, const PaintInfo&, const LayoutPoint&); void paintOverflowControlsIfNeeded(const PaintInfo&, const LayoutPoint&); // inline-block elements paint all phases atomically. This function ensures that. Certain other elements // (grid items, flex items) require this behavior as well, and this function exists as a helper for them. // It is expected that the caller will call this function independent of the value of paintInfo.phase. static void paintAsInlineBlock(LayoutObject&, const PaintInfo&, const LayoutPoint&); static void paintChildrenOfFlexibleBox(RenderFlexibleBox&, const PaintInfo&, const LayoutPoint& paintOffset); static void paintInlineBox(InlineBox&, const PaintInfo&, const LayoutPoint& paintOffset); private: LayoutRect overflowRectForPaintRejection() const; bool hasCaret() const; void paintCarets(const PaintInfo&, const LayoutPoint&); void paintContents(const PaintInfo&, const LayoutPoint&); void paintColumnContents(const PaintInfo&, const LayoutPoint&, bool paintFloats = false); void paintColumnRules(const PaintInfo&, const LayoutPoint&); void paintSelection(const PaintInfo&, const LayoutPoint&); void paintContinuationOutlines(const PaintInfo&, const LayoutPoint&); RenderBlock& m_renderBlock; }; } // namespace blink #endif // BlockPainter_h
/* ///////////////////////////////////////////////////////////////////////// * File: src/backends/ber/ber.WindowsMessageBox.c * * Purpose: Implementation of ber.WindowsMessageBox * * Created: 10th March 2008 * Updated: 23rd December 2010 * * Home: http://www.pantheios.org/ * * Copyright (c) 2008-2010, Matthew Wilson and Synesis Software * 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(s) of Matthew Wilson and Synesis Software nor the * names of any 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. * * ////////////////////////////////////////////////////////////////////// */ #include <pantheios/pantheios.h> #include <pantheios/backends/be.lrsplit.h> #include <pantheios/backends/bec.WindowsMessageBox.h> /* ///////////////////////////////////////////////////////////////////////// * API */ PANTHEIOS_BE_DEFINE_BER_FUNCTIONS(WindowsMessageBox) /* ///////////////////////////// end of file //////////////////////////// */
/* This file is a part of sfmt-extstate */ /** * @file sfmt-extstate-misc.c * @brief SFMT table manipulation functions for miscellaneous operations * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (Hiroshima University) * @author Kenji Rikitake * * Copyright (C) 2006,2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. All rights reserved. * * Copyright (C) 2010 Kenji Rikitake. All rights reserved. * * The new BSD License is applied to this software, see LICENSE.txt */ #include <string.h> #include <assert.h> #include "sfmt-extstate.h" /* public functions for the state tables */ void period_certification(w128_t *intstate); const char *get_idstring(void); int get_min_array_size32(void); void init_gen_rand(uint32_t seed, w128_t *intstate); void init_by_array(uint32_t *init_key, int key_length, w128_t *intstate); /* static function prototypes */ inline static uint32_t func1(uint32_t x); inline static uint32_t func2(uint32_t x); /** a parity check vector which certificate the period of 2^{MEXP} */ static uint32_t parity[4] = {PARITY1, PARITY2, PARITY3, PARITY4}; /** * This function certificate the period of 2^{MEXP} * @param intstate internal state array */ void period_certification(w128_t *intstate) { int inner = 0; int i, j; uint32_t work; uint32_t *intstate32; intstate32 = &intstate[0].u[0]; for (i = 0; i < 4; i++) { inner ^= intstate32[i] & parity[i]; } for (i = 16; i > 0; i >>= 1) { inner ^= inner >> i; } inner &= 1; /* check OK */ if (inner == 1) { return; } /* check NG, and modification */ for (i = 0; i < 4; i++) { work = 1; for (j = 0; j < 32; j++) { if ((work & parity[i]) != 0) { intstate32[i] ^= work; return; } work = work << 1; } } } /** * This function returns the identification string. * The string shows the word size, the Mersenne exponent, * and all parameters of this generator. */ const char *get_idstring(void) { return IDSTR; } /** * This function returns the minimum size of array used for \b * fill_array32() function. * @return minimum size of array used for fill_array32() function. */ int get_min_array_size32(void) { return N32; } /** * This function represents a function used in the initialization * by init_by_array * @param x 32-bit integer * @return 32-bit integer */ inline static uint32_t func1(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1664525UL; } /** * This function represents a function used in the initialization * by init_by_array * @param x 32-bit integer * @return 32-bit integer */ inline static uint32_t func2(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1566083941UL; } /** * This function initializes the internal state array with a 32-bit * integer seed. * Execution of this function guarantees that the internal state * array is correctly initialized. * * @param seed a 32-bit integer used as the seed. * @param intstate internal state array */ void init_gen_rand(uint32_t seed, w128_t *intstate) { int i; uint32_t *intstate32; intstate32 = &intstate[0].u[0]; intstate32[0] = seed; for (i = 1; i < N32; i++) { intstate32[i] = 1812433253UL * (intstate32[i - 1] ^ (intstate32[i - 1] >> 30)) + i; } period_certification(&intstate[0]); } /** * This function initializes the internal state array, * with an array of 32-bit integers used as the seeds * * Execution of this function guarantees that the internal state * array is correctly initialized. * * @param init_key the array of 32-bit integers, used as a seed. * @param key_length the length of init_key. * @param intstate internal state array */ void init_by_array(uint32_t *init_key, int key_length, w128_t *intstate) { int i, j, count; uint32_t r; int lag; int mid; int size = N32; uint32_t *intstate32; intstate32 = &intstate[0].u[0]; if (size >= 623) { lag = 11; } else if (size >= 68) { lag = 7; } else if (size >= 39) { lag = 5; } else { lag = 3; } mid = (size - lag) / 2; memset(&intstate[0], 0x8b, (N32 * 4)); if (key_length + 1 > N32) { count = key_length + 1; } else { count = N32; } r = func1(intstate32[0] ^ intstate32[mid] ^ intstate32[N32 - 1]); intstate32[mid] += r; r += key_length; intstate32[mid + lag] += r; intstate32[0] = r; count--; for (i = 1, j = 0; (j < count) && (j < key_length); j++) { r = func1(intstate32[i] ^ intstate32[(i + mid) % N32] ^ intstate32[(i + N32 - 1) % N32]); intstate32[(i + mid) % N32] += r; r += init_key[j] + i; intstate32[(i + mid + lag) % N32] += r; intstate32[i] = r; i = (i + 1) % N32; } for (; j < count; j++) { r = func1(intstate32[i] ^ intstate32[(i + mid) % N32] ^ intstate32[(i + N32 - 1) % N32]); intstate32[(i + mid) % N32] += r; r += i; intstate32[(i + mid + lag) % N32] += r; intstate32[i] = r; i = (i + 1) % N32; } for (j = 0; j < N32; j++) { r = func2(intstate32[i] + intstate32[(i + mid) % N32] + intstate32[(i + N32 - 1) % N32]); intstate32[(i + mid) % N32] ^= r; r -= i; intstate32[(i + mid + lag) % N32] ^= r; intstate32[i] = r; i = (i + 1) % N32; } period_certification(&intstate[0]); }
/* * vim:ts=8:expandtab * * i3 - an improved dynamic tiling window manager * * © 2009-2010 Michael Stapelberg and contributors * * See file LICENSE for license information. * * include/config.h: Contains all structs/variables for the configurable * part of i3 as well as functions handling the configuration file (calling * the parser (src/cfgparse.y) with the correct path, switching key bindings * mode). * */ #ifndef _CONFIG_H #define _CONFIG_H #include <stdbool.h> #include "queue.h" #include "i3.h" typedef struct Config Config; extern char *current_configpath; extern Config config; extern SLIST_HEAD(modes_head, Mode) modes; /** * Used during the config file lexing/parsing to keep the state of the lexer * in order to provide useful error messages in yyerror(). * */ struct context { bool has_errors; int line_number; char *line_copy; const char *filename; char *compact_error; /* These are the same as in YYLTYPE */ int first_column; int last_column; }; /** * Part of the struct Config. It makes sense to group colors for background, * border and text as every element in i3 has them (window decorations, bar). * */ struct Colortriple { uint32_t border; uint32_t background; uint32_t text; }; /** * Holds a user-assigned variable for parsing the configuration file. The key * is replaced by value in every following line of the file. * */ struct Variable { char *key; char *value; char *next_match; SLIST_ENTRY(Variable) variables; }; /** * The configuration file can contain multiple sets of bindings. Apart from the * default set (name == "default"), you can specify other sets and change the * currently active set of bindings by using the "mode <name>" command. * */ struct Mode { char *name; struct bindings_head *bindings; SLIST_ENTRY(Mode) modes; }; /** * Holds part of the configuration (the part which is not already in dedicated * structures in include/data.h). * */ struct Config { const char *terminal; i3Font font; char *ipc_socket_path; const char *restart_state_path; int default_layout; int container_stack_limit; int container_stack_limit_value; /** Default orientation for new containers */ int default_orientation; /** By default, focus follows mouse. If the user explicitly wants to * turn this off (and instead rely only on the keyboard for changing * focus), we allow him to do this with this relatively special option. * It is not planned to add any different focus models. */ bool disable_focus_follows_mouse; /** By default, a workspace bar is drawn at the bottom of the screen. * If you want to have a more fancy bar, it is recommended to replace * the whole bar by dzen2, for example using the i3-wsbar script which * comes with i3. Thus, you can turn it off entirely. */ bool disable_workspace_bar; /** Think of the following layout: Horizontal workspace with a tabbed * con on the left of the screen and a terminal on the right of the * screen. You are in the second container in the tabbed container and * focus to the right. By default, i3 will set focus to the terminal on * the right. If you are in the first container in the tabbed container * however, focusing to the left will wrap. This option forces i3 to * always wrap, which will result in you having to use "focus parent" * more often. */ bool force_focus_wrapping; /** The default border style for new windows. */ border_style_t default_border; /** The modifier which needs to be pressed in combination with your mouse * buttons to do things with floating windows (move, resize) */ uint32_t floating_modifier; /* Color codes are stored here */ struct config_client { uint32_t background; struct Colortriple focused; struct Colortriple focused_inactive; struct Colortriple unfocused; struct Colortriple urgent; } client; struct config_bar { struct Colortriple focused; struct Colortriple unfocused; struct Colortriple urgent; } bar; /** What should happen when a new popup is opened during fullscreen mode */ enum { PDF_LEAVE_FULLSCREEN = 0, PDF_IGNORE = 1 } popup_during_fullscreen; }; /** * Reads the configuration from ~/.i3/config or /etc/i3/config if not found. * * If you specify override_configpath, only this path is used to look for a * configuration file. * */ void load_configuration(xcb_connection_t *conn, const char *override_configfile, bool reload); /** * Translates keysymbols to keycodes for all bindings which use keysyms. * */ void translate_keysyms(); /** * Ungrabs all keys, to be called before re-grabbing the keys because of a * mapping_notify event or a configuration file reload * */ void ungrab_all_keys(xcb_connection_t *conn); /** * Grab the bound keys (tell X to send us keypress events for those keycodes) * */ void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch); /** * Switches the key bindings to the given mode, if the mode exists * */ void switch_mode(const char *new_mode); /** * Returns a pointer to the Binding with the specified modifiers and keycode * or NULL if no such binding exists. * */ Binding *get_binding(uint16_t modifiers, xcb_keycode_t keycode); /** * Kills the configerror i3-nagbar process, if any. * * Called when reloading/restarting. * * If wait_for_it is set (restarting), this function will waitpid(), otherwise, * ev is assumed to handle it (reloading). * */ void kill_configerror_nagbar(bool wait_for_it); /* prototype for src/cfgparse.y */ void parse_file(const char *f); #endif
// // VPLHTTPGenericRequest.h // VPLHTTPClient // // Created by Christian Niles on 5/23/11. // Copyright 2011 Vulpine Labs LLC. All rights reserved. // #import <Foundation/Foundation.h> #import "VPLHTTPRequest.h" @interface VPLHTTPGenericRequest : NSObject <VPLHTTPRequest> { @private NSString * _requestMethod; NSString * _requestURLString; NSMutableDictionary * _requestHeaders; NSData * _requestBody; NSString * _username; NSString * _password; NSTimeInterval _requestTimeout; BOOL _validatesSSLCertificates; } - (id)initWithURLString:(NSString *)URLString; - (id)initWithURLString:(NSString *)URLString method:(NSString *)requestMethod; // ===== REQUEST METHOD ================================================================================================ @property (nonatomic,retain) NSString * requestMethod; // ===== URL STRING ==================================================================================================== @property (nonatomic,retain) NSString * requestURLString; @end
#ifndef _registry_h_ #define _registry_h_ // Authors: Sascha Lange // Modified: Thomas Lampe // Copyright (c) 2004, Neuroinformatics Group, University of Osnabrueck // 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 the University of Osnabrueck 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. #include <vector> #include <string> #include <sstream> #include "modules.h" #include <map> namespace Tapir { /** Central registry of factory classes that are able to construct instances of an unknown class. */ class AbstractRegistry { public: /** this interface declares an abstract factory, that is able to construct instances of one class. Each class needs a different implementation of the abstract factory. */ class Factory { public: virtual ~Factory() {} virtual void* create() const=0; }; virtual ~AbstractRegistry(); /** add a factory for the class "name" */ virtual void add(const char* name, const char* desc, Factory* factory); /** lookup a factory for the requested class "name" */ virtual Factory* lookup(const char* name) const; virtual int listEntries(char* buf, int buf_size) const; virtual void listEntries(std::vector<std::string>* names , std::vector<std::string>* desc) const; protected: AbstractRegistry(); // Abstract class, can not be created struct Entry { // mapping name -> factory std::string name; std::string desc; Factory* factory; }; std::vector< Entry > entries; }; #define ADD_MODULE_DEFINITION(_type_) \ class _type_; \ class _type_##Factory : public AbstractRegistry { \ public: \ static _type_##Factory* get(); \ _type_* create(const char* name) const; \ protected: \ static _type_##Factory* the##_type_##Factory; \ }; FOR_EACH_MODULE(ADD_MODULE_DEFINITION); #define REGISTER(_type_,_name_,_desc_) \ class _##_type_##factory_##_name_ : public Tapir::_type_##Factory::Factory { \ public: \ _##_type_##factory_##_name_() { \ Tapir::_type_##Factory::get()->add(#_name_, _desc_, this); \ } \ void* create () const { return new _name_ (); } \ }; \ static _##_type_##factory_##_name_ *_##_type_##factory_instance_##_name_ = new _##_type_##factory_##_name_ (); /** Central registry of key mappings. **/ class KeyRegistry { public: static KeyRegistry* instance (); bool signup (const long int cmd, TapirModule* module, const char* entry, const char* name, const char* desc, bool print=true); bool delegate (const long int cmd, const char* params); std::stringstream list; const char* fname; protected: KeyRegistry() {}; std::map<long int, TapirModule*> _peres; std::map<long int, long int> _trans; }; #define REGISTER_KEY(_name_,_key_,_desc_) \ Tapir::KeyRegistry::instance()->signup((long int)_key_,this,#_key_,#_name_,_desc_); #define REGISTER_HIDDEN_KEY(_name_,_key_) \ Tapir::KeyRegistry::instance()->signup((long int)_key_,this,#_key_,#_name_,"",false); #define REGISTER_KEY_ALIAS(_name_,_key_,_desc_,_alias_) \ Tapir::KeyRegistry::instance()->signup((long int)_key_,this,_alias_,#_name_,_desc_); #define REGISTER_EXTENDED_KEY(_name_,_alias_,_seq0_,_seq1_,_seq2_,_desc_) \ Tapir::KeyRegistry::instance()->signup((_seq0_+_seq1_*256+_seq2_*65536),this,_alias_,#_name_,_desc_); } #endif
/*========================================================================= Program: Visualization Toolkit Module: vtkImageLuminance.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkImageLuminance - Computes the luminance of the input // .SECTION Description // vtkImageLuminance calculates luminance from an rgb input. #ifndef __vtkImageLuminance_h #define __vtkImageLuminance_h #include "vtkImagingCoreExport.h" // For export macro #include "vtkThreadedImageAlgorithm.h" class VTKIMAGINGCORE_EXPORT vtkImageLuminance : public vtkThreadedImageAlgorithm { public: static vtkImageLuminance *New(); vtkTypeMacro(vtkImageLuminance,vtkThreadedImageAlgorithm); protected: vtkImageLuminance(); ~vtkImageLuminance() {}; virtual int RequestInformation (vtkInformation *, vtkInformationVector**, vtkInformationVector *); void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, int outExt[6], int id); private: vtkImageLuminance(const vtkImageLuminance&); // Not implemented. void operator=(const vtkImageLuminance&); // Not implemented. }; #endif