text
stringlengths
4
6.14k
/* * CocosBuilder: http://www.CocosBuilder.com * * Copyright (c) 2012 Zynga Inc. * * 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 "cocos2d.h" #import "CCScale9Sprite.h" @interface RulersLayer : CCLayer { CCScale9Sprite* bgHorizontal; CCScale9Sprite* bgVertical; CCNode* marksVertical; CCNode* marksHorizontal; CCSprite* mouseMarkHorizontal; CCSprite* mouseMarkVertical; CGSize winSize; CGPoint stageOrigin; float zoom; CCLabelAtlas* lblX; CCLabelAtlas* lblY; } - (void) updateWithSize:(CGSize)winSize stageOrigin:(CGPoint)stageOrigin zoom:(float)zoom; - (void)mouseEntered:(NSEvent *)event; - (void)mouseExited:(NSEvent *)event; - (void)updateMousePos:(CGPoint)pos; @end
/** * token.h * * Define all token types. */ #ifndef TOKEN_H #define TOKEN_H /* The following enum contains all token names with the names 'TOK_*' */ enum { #define X(x) x, # include "token.include" #undef X __token_dummy__ /* Dummy element for trailing comma */ }; /* These names can be indexed via the above enum and make debugging slightly * easier */ static const char *__token_names[] = { #define X(x) #x, # include "token.include" #undef X "__token_dummy__" }; /* The token type. These tokens are generated within the lexer, but knowledge * of this type is also required in the parser. * * This may be moved into the lexer since it makes more sense there. */ typedef struct { int type; int is_literal; union { int id; char *literal; }; } token_t; #endif
/* Copyright (c) 2012, 2013 Kajetan Swierk <k0zmo@outlook.com> 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. */ #pragma once #include "clw/Prerequisites.h" #include "clw/MemoryObject.h" namespace clw { // !TODO: Add new classes to reflect changes in OpenCL 1.2 enum class EChannelOrder { R = 0x10B0, A = 0x10B1, RG = 0x10B2, RA = 0x10B3, RGB = 0x10B4, RGBA = 0x10B5, BGRA = 0x10B6, ARGB = 0x10B7, Intensity = 0x10B8, Luminance = 0x10B9, Rx = 0x10BA, RGx = 0x10BB, RGBx = 0x10BC }; enum class EChannelType { Normalized_Int8 = 0x10D0, Normalized_Int16 = 0x10D1, Normalized_UInt8 = 0x10D2, Normalized_UInt16 = 0x10D3, Normalized_565 = 0x10D4, Normalized_555 = 0x10D5, Normalized_101010 = 0x10D6, Unnormalized_Int8 = 0x10D7, Unnormalized_Int16 = 0x10D8, Unnormalized_Int32 = 0x10D9, Unnormalized_UInt8 = 0x10DA, Unnormalized_UInt16 = 0x10DB, Unnormalized_UInt32 = 0x10DC, HalfFloat = 0x10DD, Float = 0x10DE }; struct CLW_EXPORT ImageFormat { EChannelOrder order; EChannelType type; ImageFormat() : order(EChannelOrder(0)), type(EChannelType(0)) {} ImageFormat(EChannelOrder order, EChannelType type) : order(order), type(type) {} bool isNull() const { return order == EChannelOrder(0) || type == EChannelType(0); } bool operator==(const ImageFormat& other) const { return order == other.order && type == other.type; } bool operator!=(const ImageFormat& other) const { return !operator==(other); } }; class CLW_EXPORT Image2D : public MemoryObject { public: Image2D() {} Image2D(Context* ctx, cl_mem id) : MemoryObject(ctx, id) {} Image2D(const Image2D& other); Image2D& operator=(const Image2D& other); Image2D(Image2D&& other); Image2D& operator=(Image2D&& other); ImageFormat format() const; int width() const; int height() const; int bytesPerElement() const; int bytesPerLine() const; private: mutable ImageFormat _fmt; }; class CLW_EXPORT Image3D : public MemoryObject { public: Image3D() {} Image3D(Context* ctx, cl_mem id) : MemoryObject(ctx, id) {} Image3D(const Image3D& other); Image3D& operator=(const Image3D& other); Image3D(Image3D&& other); Image3D& operator=(Image3D&& other); ImageFormat format() const; int width() const; int height() const; int depth() const; int bytesPerElement() const; int bytesPerLine() const; int bytesPerSlice() const; private: mutable ImageFormat _fmt; }; #define CASE(X) case X: return string(#X); inline string channelTypeName(EChannelType type) { switch(type) { CASE(EChannelType::Normalized_Int8); CASE(EChannelType::Normalized_Int16); CASE(EChannelType::Normalized_UInt8); CASE(EChannelType::Normalized_UInt16); CASE(EChannelType::Normalized_565); CASE(EChannelType::Normalized_555); CASE(EChannelType::Normalized_101010); CASE(EChannelType::Unnormalized_Int8); CASE(EChannelType::Unnormalized_Int16); CASE(EChannelType::Unnormalized_Int32); CASE(EChannelType::Unnormalized_UInt8); CASE(EChannelType::Unnormalized_UInt16); CASE(EChannelType::Unnormalized_UInt32); CASE(EChannelType::HalfFloat); CASE(EChannelType::Float); default: return "Undefined"; } } inline string channelOrderName(EChannelOrder order) { switch(order) { CASE(EChannelOrder::R); CASE(EChannelOrder::A); CASE(EChannelOrder::RG); CASE(EChannelOrder::RA); CASE(EChannelOrder::RGB); CASE(EChannelOrder::RGBA); CASE(EChannelOrder::BGRA); CASE(EChannelOrder::ARGB); CASE(EChannelOrder::Intensity); CASE(EChannelOrder::Luminance); CASE(EChannelOrder::Rx); CASE(EChannelOrder::RGx); CASE(EChannelOrder::RGBx); default: return "Undefined"; } } #undef CASE }
// // DDAreaPickerView.h // AreaPicker // // Created by SuperDanny on 15/11/10. // Copyright © 2015年 SuperDanny. All rights reserved. // #import <UIKit/UIKit.h> #import "DDLocation.h" typedef enum { DDAreaPickerWithStateAndCity, DDAreaPickerWithStateAndCityAndDistrict } DDAreaPickerStyle; @class DDAreaPickerView; @protocol DDAreaPickerDatasource <NSObject> - (NSArray *)areaPickerData:(DDAreaPickerView *)picker; @end @protocol DDAreaPickerDelegate <NSObject> @optional - (void)pickerDidChaneStatus:(DDAreaPickerView *)picker; @end @interface DDAreaPickerView : UIView <UIPickerViewDelegate, UIPickerViewDataSource> @property (assign, nonatomic) id <DDAreaPickerDelegate> delegate; @property (assign, nonatomic) id <DDAreaPickerDatasource> datasource; @property (strong, nonatomic) IBOutlet UIPickerView *locatePicker; @property (strong, nonatomic) DDLocation *locate; @property (nonatomic) DDAreaPickerStyle pickerStyle; - (id)initWithStyle:(DDAreaPickerStyle)pickerStyle withDelegate:(id <DDAreaPickerDelegate>)delegate andDatasource:(id <DDAreaPickerDatasource>)datasource; - (void)showInView:(UIView *)view; - (void)cancelPicker; @end
/* * The MIT License (MIT) * * Copyright (c) 2014 Egbert Verhage * * 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. * */ #ifndef PLANNINGEDITOR_H #define PLANNINGEDITOR_H #include <cstddef> #include <cursesapp.h> #include <cursesm.h> #include <cursesf.h> class PlanningEditor : public NCursesApplication { protected: int titlesize() const {return 1;} void title(); Soft_Label_Key_Set::Label_Layout useSLKs() const { return Soft_Label_Key_Set::PC_Style_With_Index; } void init_labels(Soft_Label_Key_Set& S) const; public: PlanningEditor() : NCursesApplication(true) { } int run(); }; #endif // PLANNINGEDITOR_H
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double OrangeLabelVersionNumber; FOUNDATION_EXPORT const unsigned char OrangeLabelVersionString[];
#pragma once // ApplicationDialog dialog /*struct buttonSet { CString name; CButton* ctrlCheckButton; CButton* altCheckButton; CComboBox* VKBox; };*///This actually seemed to crash windows????? class ApplicationDialog : public CDialog { DECLARE_DYNAMIC(ApplicationDialog) public: ApplicationDialog(CWnd* pParent = NULL); // standard constructor virtual ~ApplicationDialog(); virtual BOOL OnInitDialog(); // Dialog Data enum { IDD = IDD_APPLICATION_MANAGER }; private: CString VKS[100]; bool InitVKS(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedOk(); };
/**************************************************************************************** Copyright (C) 2014 Autodesk, Inc. All rights reserved. Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form. ****************************************************************************************/ //! \file fbxshape.h #ifndef _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ #define _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ #include <fbxsdk/fbxsdk_def.h> #include <fbxsdk/scene/geometry/fbxgeometrybase.h> #include <fbxsdk/fbxsdk_nsbegin.h> class FbxBlendShapeChannel; class FbxGeometry; /** A shape describes the deformation on a set of control points, which is similar to the cluster deformer in Maya. * For example, we can add a shape to a created geometry. And the shape and the geometry have the same * topological information but different position of the control points. * With varying amounts of influence, the geometry performs a deformation effect. * \nosubgrouping * \see FbxGeometry */ class FBXSDK_DLL FbxShape : public FbxGeometryBase { FBXSDK_OBJECT_DECLARE(FbxShape, FbxGeometryBase); public: /** Set the blend shape channel that contains this target shape. * \param pBlendShapeChannel Pointer to the blend shape channel to set. * \return \c true on success, \c false otherwise. */ bool SetBlendShapeChannel(FbxBlendShapeChannel* pBlendShapeChannel); /** Get the blend shape channel that contains this target shape. * \return a pointer to the blend shape channel if set or NULL. */ FbxBlendShapeChannel* GetBlendShapeChannel() const; /** Get the base geometry of this target shape. * \return a pointer to the base geometry if set or NULL. * \remarks Since target shape can only connected to its base geometry through * blend shape channel and blend shape deformer. * So only when this target shape is connected to a blend shape channel, * and the blend shape channel is connected to a blend shape deformer, * and the blend shape deformer is used on a base geometry, then to get * base geometry will success. */ FbxGeometry* GetBaseGeometry(); /** Get the length of the arrays of control point indices and weights. * \return Length of the arrays of control point indices and weights. * Returns 0 if no control point indices have been added or the arrays have been reset. */ int GetControlPointIndicesCount() const; /** Get the array of control point indices. * \return Pointer to the array of control point indices. * \c NULL if no control point indices have been added or the array has been reset. */ int* GetControlPointIndices() const; /** Set the array size for the control point indices * \param pCount The new count. */ void SetControlPointIndicesCount(int pCount); /** Add a control point index to the control point indices array * \param pIndex The control point index to add. */ void AddControlPointIndex(int pIndex); /** Restore the shape to its initial state. * Calling this function will clear the following: * \li Pointer to blend shape channel. * \li Control point indices. */ void Reset(); /***************************************************************************************************************************** ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** *****************************************************************************************************************************/ #ifndef DOXYGEN_SHOULD_SKIP_THIS virtual FbxObject& Copy(const FbxObject& pObject); virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL, void* pSet = NULL) const; protected: virtual FbxNodeAttribute::EType GetAttributeType() const; virtual FbxStringList GetTypeFlags() const; FbxArray<int> mControlPointIndices; #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ }; #include <fbxsdk/fbxsdk_nsend.h> #endif /* _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ */
#pragma once #include "def.h" class fsm :public boost::enable_shared_from_this<fsm> { std::map<string,ptr_state_unit> m_stateunitmap; void* m_userdata; // room , game_user , user...... ptr_state_unit m_curstateunit; public: fsm(); ~fsm(); void add(string arg_name, ptr_state_unit arg_state_unit) { m_stateunitmap.insert(std::map<string, ptr_state_unit>::value_type(arg_name, arg_state_unit)); } void addrule(int arg_condition ,string arg_prestate, string arg_curstate) // ÀÌÀü ½ºÅ×ÀÌÆ® - > ÀÌÈÄ ½ºÅ×ÀÌÆ®c { } void addevent(string arg_state, boost::function<void(string)> arg_handler) // ½ºÅ×ÀÌÆ® º¯°æ½Ã { } void start(string arg_statename); void transition(string arg_statename); void update(float deltatime); };
#include "learnuv.h" int main() { int err; double uptime; err = uv_uptime(&uptime); CHECK(err, "uv_uptime"); log_info("Uptime: %f", uptime); log_report("Uptime: %f", uptime); size_t resident_set_memory; err = uv_resident_set_memory(&resident_set_memory); CHECK(err, "uv_resident_set_memory"); log_report("RSS: %ld", resident_set_memory); return 0; }
/******************************************************************************* MIT License Copyright (c) 2017 Jeff Kubascik 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. *******************************************************************************/ #ifndef __NIXIE_DRIVER_H #define __NIXIE_DRIVER_H /* Includes *******************************************************************/ /* Definitions ****************************************************************/ #define NUM_CNT 3 /* Public function prototypes ************************************************/ void nixieDriver_init(void); void nixieDriver_set(int* vals); #endif /* __NIXIE_DRIVER_H */
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. #pragma once #include "cpprest/base_uri.h" #include "web_request.h" namespace signalr { class web_request_factory { public: virtual std::unique_ptr<web_request> create_web_request(const web::uri &url); virtual ~web_request_factory(); }; }
/* * */ #include <stdint.h> #include "unix/constant.h" #include "encode.h" #include "invoke.h" #include "poll.h" #define ONCE_PER_SECOND 100 enum { ENABLED = (1 << 0), /* else disabled */ STARTED = (1 << 1), /* else stopped */ }; static uint8_t flag = 0; void poll_init () { flag = 0; } void poll_enable () { return; flag |= ENABLED; } void poll_disable () { return; flag &= ~ENABLED; poll_stop (); } /* static void poll_callback () */ /* { */ /* return; */ /* encode_msg_0 (MSG_ID_POLL, SERIAL_ID_TO_IGNORE); */ /* } */ void poll_start () { return; if ((flag & STARTED) != 0) return; flag |= STARTED; /* invoke_enable (INVOKE_ID_POLL, ONCE_PER_SECOND, poll_callback); */ } void poll_stop () { return; if ((flag & STARTED) == 0) return; flag &= ~STARTED; /* invoke_disable (INVOKE_ID_POLL); */ }
extern int js_add(int, int); int add(int a, int b) { return js_add(a, b); }
#ifndef TECH_UI_WINDOWSYSTEM_H #define TECH_UI_WINDOWSYSTEM_H #include <tech/pimpl.h> #include <tech/string.h> #include <tech/types.h> #include <tech/ui/rect.h> #include <tech/ui/timer.h> #include <tech/ui/widget.h> namespace Tech { class WindowSystemPrivate; class WindowSystem final : public Interface<WindowSystemPrivate> { public: static WindowSystem* instance(); void processEvents(); void stopEventProcessing(); void sync(); Widget::Handle createWindow(Widget* widget, Widget::Handle parent = Widget::kInvalidHandle); void destroyWindow(Widget::Handle handle); Widget* findWindow(Widget::Handle handle) const; void setWindowSizeLimits(Widget::Handle handle, const Size<int>& minSize, const Size<int>& maxSize); void moveWindow(Widget::Handle handle, const Point<int>& pos); void resizeWindow(Widget::Handle handle, const Size<int>& size); void setWindowVisible(Widget::Handle handle, bool visible); void setWindowFrameless(Widget::Handle handle, bool enabled); void setWindowTaskbarButton(Widget::Handle handle, bool enabled); void setWindowTitle(Widget::Handle handle, const String& title); void repaintWindow(Widget::Handle handle, const Rect<int>& rect); void enqueueWidgetRepaint(Widget* widget); void enqueueWidgetDeletion(Widget* widget); Timer::Handle createTimer(Timer* timer); void destroyTimer(Timer::Handle handle); void startTimer(Timer::Handle handle, Duration timeout, bool periodic); void stopTimer(Timer::Handle handle); bool isTimerActive(Timer::Handle handle) const; Duration timerInterval(Timer::Handle handle) const; private: WindowSystem(); }; } // namespace Tech #endif // TECH_UI_WINDOWSYSTEM_H
// // ExampleTableViewController.h // WDIOSLibrary // // Created by Dhanu Saksrisathaporn on 9/13/2559 BE. // Copyright © 2559 Dhanu Saksrisathaporn. All rights reserved. // @import WDIOSLibrary; @interface ExampleTableViewController : WDIOSTableViewController @end
#define SOKOL_IMPL #include "sokol_args.h" void use_args_impl(void) { sargs_setup(&(sargs_desc){0}); }
// *********************************************************************** // Filename : StopWatch.h // Author : LIZHENG // Created : 2014-04-28 // Description : 高精度计时器 // // Copyright (c) lizhenghn@gmail.com. All rights reserved. // *********************************************************************** #ifndef ZL_STOPWTACH_H #define ZL_STOPWTACH_H #include "zlreactor/Define.h" #ifdef OS_WINDOWS #include <Windows.h> #include <time.h> //struct timeval //{ // long tv_sec, tv_usec; //}; #elif defined(OS_LINUX) #include <sys/time.h> #else #error "You must be include OsDefine.h firstly" #endif NAMESPACE_ZL_BASE_START #define GET_TICK_COUNT(a, b) ((a.tv_sec - b.tv_sec)*1000000 + (a.tv_usec - b.tv_usec)) class StopWatch { public: StopWatch() { start(); } public: void reset() { getTimeOfDay(&start_time, NULL); } static struct timeval now() { struct timeval now; getTimeOfDay(&now, NULL); return now; } float elapsedTime() { struct timeval now; getTimeOfDay(&now, NULL); return float(GET_TICK_COUNT(now, start_time) / 1000000.0); } float elapsedTimeInMill() { struct timeval now; getTimeOfDay(&now, NULL); return float(GET_TICK_COUNT(now, start_time) / 1000.0); } int64_t elapsedTimeInMicro() { timeval now; getTimeOfDay(&now, NULL); return GET_TICK_COUNT(now, start_time); } float diffTime(const struct timeval& start) { struct timeval now; getTimeOfDay(&now, NULL); return float(GET_TICK_COUNT(now, start) / 1000000.0); } float diffTime(const struct timeval& start, const struct timeval& end) { return float(GET_TICK_COUNT(end, start) / 1000000.0); } private: void start() { reset(); } static void getTimeOfDay(struct timeval *tv, void *tz) { #ifdef OS_LINUX gettimeofday(tv, NULL); #elif defined(OS_WINDOWS) typedef unsigned __int64 uint64; #define EPOCHFILETIME (116444736000000000ULL) FILETIME ft; LARGE_INTEGER li; uint64 tt; GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; tt = (li.QuadPart - EPOCHFILETIME) / 10; tv->tv_sec = tt / 1000000; tv->tv_usec = tt % 1000000; #endif } private: struct timeval start_time; }; NAMESPACE_ZL_BASE_END #endif /** ZL_STOPWTACH_H */
/** * * Description: Simple Chat Server. * Author: Deric Fagnan * * * */ #include <stdio.h> #include <stdlib.h> #include <string.h> //strlen #include <unistd.h> //write #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> //inet_addr #include <pthread.h> //for threading , link with lpthread typedef unsigned short uint16_t; void *connection_handler(void *socket_desc); int read_client(int sock); #define PORT 3000 #define MAXMSG 256 #define MAX_USER_NAME 20 #define MAX_PASSWORD 10 #define RX_BUFSIZE 4096 //----- Global Vars ----- char RXBuffer[RX_BUFSIZE]; enum bool { false, true }; struct user { int id; char username[MAX_USER_NAME]; char password[MAX_PASSWORD]; }; int make_server_socket(uint16_t port) { int sock_server; struct sockaddr_in server; /* Create the socket. */ sock_server = socket(AF_INET, SOCK_STREAM, 0); if(sock_server < 0) { perror("socket"); exit(EXIT_FAILURE); } /* Give the socket properties. */ server.sin_family = AF_INET; server.sin_port = htons (3000); server.sin_addr.s_addr = htonl (INADDR_ANY); if (bind(sock_server, (struct sockaddr *) &server, sizeof (server)) < 0) { perror("bind"); exit(EXIT_FAILURE); } return sock_server; } int send_message(int sock, char* message) { write(sock , message , strlen(message)); return 1; } int main() { printf("Server is running...\n"); int sock_server = make_server_socket(PORT); struct sockaddr_in client; int new_socket, c; char message[256]; char client_command; if(listen(sock_server, 3) < 0) { printf("Failed to listen"); } printf("Waiting for incoming connections...\n"); c = sizeof(struct sockaddr_in); new_socket = accept(sock_server, (struct sockaddr *)&client, (socklen_t*)&c); while(new_socket > 0) { puts("Connection accepted\n"); // Acknowledge client //send_message(new_socket, "Hello Client , I have received your connection.\n"); enum bool client_connected = true; while(client_connected) { // Read incomming message from client read(new_socket, &client_command, sizeof(client_command)); switch(client_command) { case '0': // Client quit puts("Client has quit"); client_connected = false; break; case '1': // Client Log in request puts("Client requested to log in"); break; case '2': // Client Create user request puts("Client requested to create user"); break; case '3': // Client send message request puts("client requested to send message"); // Read message from client read_client(new_socket); break; } } } shutdown(sock_server, 0); printf("Server is shuting down.\n"); return 0; } /* * This will handle connection for each client * */ void *connection_handler(void *socket_desc) { //Get the socket descriptor int sock = *(int*)socket_desc; char *message; //Send some messages to the client message = "Greetings! I am your connection handler\n"; write(sock , message , strlen(message)); message = "Its my duty to communicate with you"; write(sock , message , strlen(message)); //Free the socket pointer free(socket_desc); unlink(socket_desc); return 0; } int read_client(int sock) { int n = 0; do { n = read( sock, RXBuffer, RX_BUFSIZE - 1 ); RXBuffer[n] = '\0'; printf( "Read %d bytes: %s\n", n, RXBuffer ); } while ( n > 0 ); /* int n = read(sock, RXBuffer, RX_BUFSIZE - 1); RXBuffer[n] = '\0'; printf( "Read %d bytes: %s\n", n, RXBuffer ); //puts(RXBuffer); */ return 0; }
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #define PACKET_SIZE 256 #define THRESHOLD_VAL 10 // Performs thresholding with <THRESHOLD_VAL> and performs zero-length encoding // @data: pointer to the dataset to encode; encodes <PACKET_SIZE> bytes at a time // @output: pointer to the output buffer; assume max size of <PACKET_SIZE> bytes // @return: final size of the encoded packet int encode(float *data, float *output) { int i, j; char zero_length = 0; for (i = 0, j = 0; i < PACKET_SIZE, j < PACKET_SIZE; i++) { if (data[i] < THRESHOLD_VAL) { if (!zero_length) { output[j] = 0; j++; output[j] = 0; zero_length = 1; } output[j]++; } else { if (zero_length) { zero_length = 0; j++; } output[j] = data[i]; j++; } } return j; }
// // MenuViewController.h // MBXMapKit // // Created by Gevorg Ghukasyan on 2/9/15. // Copyright (c) 2015 MapBox. All rights reserved. // #import <UIKit/UIKit.h> @interface MenuViewController : UIViewController @end
// Langevin.h -- The Velocity Verlet molecular dynamics algorithm. // -*- c++ -*- // // Copyright (C) 2001-2011 Jakob Schiotz and Center for Individual // Nanoparticle Functionality, Department of Physics, Technical // University of Denmark. Email: schiotz@fysik.dtu.dk // // This file is part of Asap version 3. // // This program is free software: you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // version 3 as published by the Free Software Foundation. Permission // to use other versions of the GNU Lesser General Public License may // granted by Jakob Schiotz or the head of department of the // Department of Physics, Technical University of Denmark, as // described in section 14 of the GNU General Public License. // // 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 // and the GNU Lesser Public License along with this program. If not, // see <http://www.gnu.org/licenses/>. #ifndef _LANGEVIN_H #define _LANGEVIN_H #include "AsapPython.h" #include "Asap.h" #include "AsapObject.h" #include "Vec.h" #include "MolecularDynamics.h" #include <vector> namespace ASAPSPACE { class Potential; class DynamicAtoms; class AsapRandomThread; class Langevin : public MolecularDynamics { public: Langevin(PyObject *py_atoms, Potential *calc, double timestep, PyObject *sdpos_name, PyObject *sdmom_name, PyObject *c1_name, PyObject *c2_name, bool fixcm, unsigned int seed); virtual ~Langevin(); virtual string GetName() const {return "Langevin";} // Constants are scalars and given here. void SetScalarConstants(double act0, double c3, double c4, double pmcor, double cnst); // Constants are vectors on the atoms. void SetVectorConstants(PyObject *act0_name, PyObject *c3_name, PyObject *c4_name, PyObject *pmcor_name, PyObject *cnst_name); // Get the random numbers void GetRandom(std::vector<Vec> &x1, std::vector<Vec> &x2, bool gaussian=true); protected: // Run the dynamics. nsteps is the number of steps, observers is a Python // list of observers, each observer described by a tuple // (function, interval, args, kwargs) and function(*args, **kwargs) is // called for each interval time steps. //virtual void Run(int nsteps); virtual void Run2(int nsteps, PyObject *observers, PyObject *self); void ClearPyNames(); // Release Python variable names. private: bool fixcm; bool vectorconstants; // Constants are vectors double act0; double c3; double c4; double pmcor; double cnst; PyObject *sdpos_name; PyObject *sdmom_name; PyObject *c1_name; PyObject *c2_name; PyObject *act0_name; PyObject *c3_name; PyObject *c4_name; PyObject *pmcor_name; PyObject *cnst_name; AsapRandomThread *random; }; } // end namespace #endif // _LANGEVIN_H
#include <check.h> #include "check_ace_string.h" #include "../src/ace_string.h" // unit tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ START_TEST (join_two_strings) { char *result = ace_str_join_2 ("hello", " world"); ck_assert_str_eq (result, "hello world"); } END_TEST START_TEST (join_three_strings) { char *result = ace_str_join_3 ("whiskey", " tango", " foxtrot"); ck_assert_str_eq (result, "whiskey tango foxtrot"); } END_TEST START_TEST (string_ending) { ck_assert (ace_str_ends_with ("", "")); ck_assert (ace_str_ends_with ("a", "a")); ck_assert (ace_str_ends_with ("aa", "a")); ck_assert (ace_str_ends_with ("hello world", "world")); ck_assert (!ace_str_ends_with ("a", "b")); ck_assert (!ace_str_ends_with ("a", "aa")); ck_assert (!ace_str_ends_with ("hello world", "hello")); } END_TEST // test case ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TCase *create_ace_string_testcase (void) { TCase *testcase = tcase_create ("String utils"); tcase_add_test (testcase, join_two_strings); tcase_add_test (testcase, join_three_strings); tcase_add_test (testcase, string_ending); return testcase; }
#ifndef QMLTAB_H #define QMLTAB_H #include <QWidget> #include <QLayout> #include <QQuickView> #include <QQmlEngine> #include <QQuickItem> #include <QQmlComponent> #include <QVariantList> #include <QApplication> #include <memory> #include "dbi/dbi.h" class QmlTab : public QWidget { Q_OBJECT public: explicit QmlTab(QString qmlfile, QWidget *parent = 0); ~QmlTab(); std::unique_ptr<QQuickItem> root; std::unique_ptr<QQmlEngine> engine; }; struct AlbumItem { enum AlbumRoles { NameRole = Qt::UserRole +1, CoverRole, TracksRole }; }; #endif // QMLTAB_H
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #define AWS_UTIL_EXPORT __declspec(dllexport) ///#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <algorithm> #include <ctime> #include <iomanip> #include <sstream> #include "hmac_sha2.h" #include "BinaryUtils.h" #include "URIUtils.h" // TODO: reference additional headers your program requires here
/***************************************************************************** The following code is derived, directly or indirectly, from the SystemC source code Copyright (c) 1996-2006 by all Contributors. All Rights reserved. The contents of this file are subject to the restrictions and limitations set forth in the SystemC Open Source License Version 2.4 (the "License"); You may not use this file except in compliance with such restrictions and limitations. You may obtain instructions on how to receive a copy of the License at http://www.systemc.org/. Software distributed by Contributors under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. *****************************************************************************/ /***************************************************************************** simple_bus_request.h : The bus interface request form. Original Author: Ric Hilderink, Synopsys, Inc., 2001-10-11 *****************************************************************************/ /***************************************************************************** MODIFICATION LOG - modifiers, enter your name, affiliation, date and changes you are making here. Name, Affiliation, Date: Description of Modification: *****************************************************************************/ #ifndef __simple_bus_request_h #define __simple_bus_request_h enum simple_bus_lock_status { SIMPLE_BUS_LOCK_NO = 0 , SIMPLE_BUS_LOCK_SET , SIMPLE_BUS_LOCK_GRANTED }; struct simple_bus_request { // parameters unsigned int priority; // request parameters bool do_write; unsigned int address; unsigned int end_address; int *data; simple_bus_lock_status lock; // request status sc_event transfer_done; simple_bus_status status; // default constructor simple_bus_request(); }; inline simple_bus_request::simple_bus_request() : priority(0) , do_write(false) , address(0) , end_address(0) , data((int *)0) , lock(SIMPLE_BUS_LOCK_NO) , status(SIMPLE_BUS_OK) {} #endif
#import "MOBProjection.h" @interface MOBProjectionEPSG4966 : MOBProjection @end
/**\file * * \copyright * Copyright (c) 2008-2014, Kyuba Project Members * \copyright * 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: * \copyright * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * \copyright * 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. * * \see Project Documentation: http://ef.gy/documentation/curie * \see Project Source Code: http://git.becquerel.org/kyuba/curie.git */ #include <curie/main.h> #include <curie/sexpr.h> #include <curie/time.h> int cmain() { int_date date = dt_get_kin (); return date < UNIX_EPOCH; }
/* * Functions used to build the ast */ #pragma once #include "structures.h" /* TreeNode, NodeList and such*/ #include <stdio.h> /*printfs*/ #include <stdlib.h> /*mallocs et all*/ #include <string.h> /*strcmp*/ TreeNode* InitTreeNode(enum NodeType type); NodeList* InitNodeList(TreeNode* node); TreeNode* InsertTerminal(char* terminalValue, enum NodeType terminalType); /*Tree generation*/ TreeNode* InsertClass(TreeNode* name,NodeList* sons); TreeNode* InsertMethod(TreeNode* Type, TreeNode* name, NodeList* paramSons, NodeList* bodySons); TreeNode* InsertVarDecl(TreeNode* type,NodeList* names); NodeList* InsertFormalParams(TreeNode* type,TreeNode* name,NodeList* existing); TreeNode* InsertIfElse(TreeNode* condition, TreeNode* ifBody, TreeNode* elseBody); TreeNode* InsertWhile(TreeNode* condition, TreeNode* body); TreeNode* InsertPrint(TreeNode* expr); TreeNode* InsertStore(TreeNode* varName, TreeNode* expr); TreeNode* InsertStoreArray(TreeNode* arrayName, TreeNode* indexExpr, TreeNode* value); /*TreeNode* insertInitArray(TreeNode* sizeExpr, enum NodeType type);*/ TreeNode* InsertExpression(TreeNode* son1, enum NodeType exprType, TreeNode* son2); TreeNode* InsertParseArgs(TreeNode* name, TreeNode* index); TreeNode* InsertCall(TreeNode* name, NodeList* args); TreeNode* InsertBraces(NodeList* statements); NodeList* InsertTreeNodeIntoList(TreeNode* newTreeNode, NodeList* existing); TreeNode* AddSonsToTreeNode(TreeNode* node, NodeList* sons); NodeList* MergeLists(NodeList* first, NodeList* second); NodeList* InsertMainArgs(TreeNode* argName);
/* * The MIT License (MIT) * Copyright (c) 2015 Peter Vanusanik <admin@en-circle.com> * * 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. * * ny_service.h * Created on: Jan 14, 2016 * Author: Peter Vanusanik * Contents: */ #pragma once #include "ny_stddef.h" #include "ny_commons.h" #include "devsys.h" bool service_exists(const char* service); int register_as_service(const char* service);
// // JWTClaimVerifierBase.h // JWT // // Created by Dmitry Lobanov on 30.05.2021. // Copyright © 2021 JWTIO. All rights reserved. // #import <Foundation/Foundation.h> #import <JWT/JWTClaimsSetsProtocols.h> NS_ASSUME_NONNULL_BEGIN @interface JWTClaimVerifierBase : NSObject <JWTClaimVerifierProtocol> @end NS_ASSUME_NONNULL_END
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @protocol WCCardPkgBackTableViewDelegate <NSObject> - (void)WXCardPkgTableViewHeight:(double)arg1 scrollEnabled:(_Bool)arg2; - (double)WXCardPkgTableViewMaxHeight; @end
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Drawing\0.11.3\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_FUSE_DRAWING_WINDING_RULES_H__ #define __APP_FUSE_DRAWING_WINDING_RULES_H__ #include <Uno.h> namespace app { namespace Fuse { namespace Drawing { struct WindingRules__uType : ::uClassType { }; WindingRules__uType* WindingRules__typeof(); bool WindingRules__AbsoluteGreaterOrEqualsTwo(::uStatic* __this, int n); bool WindingRules__Negative(::uStatic* __this, int n); bool WindingRules__NonZero(::uStatic* __this, int n); bool WindingRules__Odd(::uStatic* __this, int n); bool WindingRules__Positive(::uStatic* __this, int n); }}} #endif
/********************************************************************* ** Copyright (C) 2003 Terabit Pty Ltd. All rights reserved. ** ** This file is part of the POSIX-Proactor module. ** ** @file SslChannel.h ** ** ** @author Alexander Libman <libman@terabit.com.au> ** ** ** **********************************************************************/ #ifndef TERABIT_SSLCHANNEL_H #define TERABIT_SSLCHANNEL_H #include "IOTerabit/SSL/IOTERABIT_SSL_Export.h" #include "IOTerabit/AsynchChannel.h" #include "TProactor/Monitor_T.h" #include "TProactor/SSL/SSL_Asynch_Stream.h" namespace Terabit { // ************************************************************* // SslChannel // ************************************************************* class IOTERABIT_SSL_Export SslChannel : public AsynchChannel { public: SslChannel (int id); virtual ~SslChannel (void); private: virtual void handle_wakeup (); virtual int open_impl (ACE_HANDLE handle, bool flg_server); virtual int close_impl (); virtual int start_read_impl (ACE_Message_Block& mb, size_t nbytes); virtual int start_write_impl (ACE_Message_Block& mb, size_t nbytes); virtual bool has_specific_events (); virtual int reset_impl (); TRB_SSL_Asynch_Stream *ssl_stream_; }; // ************************************************************* // SslChannelFactory // ************************************************************* class IOTERABIT_SSL_Export SslChannelFactory : public AsynchChannelFactory { public: typedef ACE_SYNCH_MUTEX Mutex; typedef ACE_SYNCH_CONDITION Condition; typedef Monitor_T<Mutex,Condition> Monitor; typedef Guard_Monitor_T<Monitor> Guard_Monitor; typedef Guard_Monitor::Save_Guard Save_Guard; SslChannelFactory (unsigned int min_cache_size = 0, unsigned int max_cache_size = (size_t) -1); virtual ~SslChannelFactory (); virtual AsynchChannel* create_channel(); virtual void destroy_channel (AsynchChannel *channel); void set_pool_size (unsigned int min_cache_size, unsigned int max_cache_size); private: void add_channels (unsigned int count); void del_channels (unsigned int count); Monitor monitor_; AsynchChannelList free_list_; // pool of free channel for reuse unsigned int min_free_channels_; // min number of channels in the pool unsigned int max_free_channels_; // max number of channels in the pool unsigned int num_channels_; // current number active and free channels unsigned int next_id_; // next channel id to assign }; } //namespace Terabit #endif // TERABIT_SSLCHANNEL_H
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSDBezierPath.h> @interface TSDBezierPath (LivarotPrivate) + (id)p_booleanWithBezierPaths:(id)arg1 operation:(int)arg2; + (struct CGRect)p_pathToBounds:(Path_1b135553 *)arg1; + (id)p_pathToBezier:(Path_1b135553 *)arg1; + (Path_1b135553 *)p_bezierToPath:(id)arg1; @end
// // c_language_demo.c // swift4demo // // Created by hzyuxiaohua on 2017/6/29. // Copyright © 2017年 XY Network Co., Ltd. All rights reserved. // #include "c_language_demo.h" #include "stdlib.h" int uninitialized_value_demo() { int a; return a + 42; } int dereference_demo(int *value) { int tmp = *value; if (value == NULL) { return 0; } return tmp; } int use_after_scope_demo() { int *pointer = NULL; if (1 > 0) { int tmp = 2017; pointer = &tmp; tmp = 2018; } printf("use_after_scope_result: %d\n", *pointer); *pointer = 2016; return 0; } uint32_t *pointer_to_random_integer_value() { uint32_t random = arc4random_uniform(10000); // unsafe pointer never store local variable return &random; } int use_after_return_demo() { uint32_t *pointer = pointer_to_random_integer_value(); printf("use_after_return_demo_result: %d\n", *pointer); return 0; }
#ifdef __cplusplus extern "C" { #endif typedef struct mData { int chan; int note; int vel; } mData; extern void __stdcall mPlay(void *); extern void __stdcall mStop(); extern void __stdcall mGetData(mData *,int,int); //first int is a channel number, second int is 'fake velocity' fadeout (from max to 0 in ms) //returns last played note number, together with it's 'fake velocity' #ifdef __cplusplus } #endif
#ifndef __ACTOR_H__ #define __ACTOR_H__ /* // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // -- // -- File Name: FOUR.Actor.h // -- // -- Author(s): Paul Nispel // -- // -- Creation Date: 4/17/2013 // -- // ---------------------------------------------------------------------------- // -- // -- Copyright Paul Nispel 2013 // -- // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- */ class Vector3; class Component; // ------------------------------------ // #include "../core/Group.h" // -------------------------------------------------------------------- // *** A C T O R // -------------------------------------------------------------------- class Actor { public: // *** P U B L I C V A R I A B L E S Actor * parent; Vector3 * position; Group< Actor * > children; public: // *** P U B L I C M E T H O D S Actor() {} Actor * createChild () { return this;} Actor * addChild () { return this;} protected: private: }; #endif //__ACTOR_H__
//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by Text.rc // #define IDS_STRING1 1 #define IDS_STRING2 2 #define IDS_STRING3 3 #define IDS_STRING4 4 #define IDS_STRING5 5 #define IDS_STRING6 6 #define IDS_STRING7 7 #define IDS_STRING8 8 #define IDS_STRING9 9 #define IDS_STRING10 10 #define IDS_STRING11 11 #define IDS_STRING12 12 #define IDS_STRING13 13 #define IDS_STRING14 14 #define IDS_STRING15 15 #define IDS_STRING16 16 #define IDS_STRING17 17 #define IDS_STRING18 18 #define IDS_STRING19 19 #define IDS_STRING20 20 #define IDS_STRING21 21 #define IDS_STRING22 22 #define IDS_STRING23 23 #define IDS_STRING24 24 #define IDS_STRING25 25 #define IDS_STRING26 26 #define IDS_STRING27 27 #define IDS_STRING28 28 #define IDS_STRING29 29 #define IDS_STRING30 30 #define IDS_STRING31 31 #define IDS_STRING32 32 #define IDS_STRING33 33 #define IDS_STRING34 34 #define IDS_STRING35 35 #define IDS_STRING36 36 #define IDS_STRING37 37 #define IDS_STRING38 38 #define IDS_STRING39 39 #define IDS_STRING40 40 #define IDS_STRING41 41 #define IDS_STRING42 42 #define IDS_STRING43 43 #define IDS_STRING44 44 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
// // OCLogService.h // OCLogService // // Created by Dmitry Fantastik on 11/16/13. // Copyright (c) 2013 fantastik. All rights reserved. // #import <OCLogService/OCLogServiceConfigurator.h> #import <OCLogService/OCLogObject.h> #import <OCLogService/OCLogNestedObject.h> #import <OCLogService/OCApiBatchObject.h> #import <OCLogService/OCLogObjectFilePrinter.h> #import <OCLogService/OCLogObjectConsolePrinter.h> #import <OCLogService/OCLogger.h> #import <OCLogService/OCDefines.h>
#pragma once #include "StockTypeMacro.h" #include "BigNumber/BigNumberAPI.h" #include <vector> #include <memory> #include "IntDateTime/IntDateTimeAPI.h" enum FilterType { FILTER_INIT, ALL_STOCK, RISE_UP, FALL_DOWN, }; enum StrategyType { STRATEGY_INIT, SAR_RISE_BACK_COUNT, SAR_RISE_BACK, CATCH_UP, SAR_RISE_BACK_THIRTY_LINE, LINE_BACK, STRATEGY_TYPE_SIZE, RECONSTRUCTION, UPWARD, T_ADD_0 }; enum SolutionType { SOLUTION_INIT, AVG_FUND_HIGH_SCORE, STRATEGY_SET, DISPOSABLE_STRATEGY, INTEGRATED_STRATEGY, OBSERVE_STRATEGY }; struct StockTypeAPI StockLoadInfo { //ÊÇ·ñÊÇ×Ô¶¨Òå bool m_isCustomize; #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4251) #endif //ËùÓÐgupiao£¬ÔÚ×Ô¶¨ÒåÏÂÓÐЧ std::vector<std::string> m_allStock; #ifdef _MSC_VER #pragma warning(pop) #endif //ÊÇ·ñyejizengzhang FilterType m_filterType; //ÊÇ·ñÈ¥³ýjiejin bool m_isDislodgeLiftBan; //ÊÇ·ñÊÇkechuangban bool m_isDislodge688; /** ¹¹Ô캯Êý */ StockLoadInfo() { m_isCustomize = false; m_filterType = FILTER_INIT; m_isDislodgeLiftBan = false; m_isDislodge688 = false; } }; struct StockTypeAPI StockInfo { //¼Û¸ñ BigNumber m_price; //°Ù·Ö±È 0-100 BigNumber m_percent; //·ÖÊý BigNumber m_score; //±ÈÀý 0-1 BigNumber m_rate; }; struct StockTypeAPI ChooseParam { //ʹÓõÄÀàÐÍ StrategyType m_useType; //ʹÓõļÆÊýÀàÐÍ StrategyType m_useCountType; //ÊÇ·ñÊǹ۲ìÀàÐÍ bool m_isObserve; //½â¾ö·½°¸ÀàÐÍ£¬Èç¹ûÊÇobserverÔòÊÇÄÚ²¿ÀàÐÍ£¬²»ÊÇÔòÖ±½ÓʹÓà SolutionType m_solutionType; /** ¹¹Ô캯Êý */ ChooseParam(); /** ÊÇ·ñµÈÓÚ @param [in] chooseParam Ñ¡Ôñ²ÎÊý @return ·µ»ØÊÇ·ñµÈÓÚ */ bool operator==(const ChooseParam& chooseParam); /** ÊÇ·ñ²»µÈÓÚ @param [in] chooseParam Ñ¡Ôñ²ÎÊý @return ·µ»ØÊÇ·ñµÈÓÚ */ bool operator!=(const ChooseParam& chooseParam); /** ÊÇ·ñ²»µÈÓÚ @param [in] chooseParam1 Ñ¡Ôñ²ÎÊý1 @param [in] chooseParam2 Ñ¡Ôñ²ÎÊý2 @return ·µ»ØÊÇ·ñµÈÓÚ */ friend bool operator< (const ChooseParam& chooseParam1, const ChooseParam& chooseParam2) { if (chooseParam1.m_solutionType < chooseParam2.m_solutionType) { return true; } if (chooseParam1.m_solutionType > chooseParam2.m_solutionType) { return false; } if (chooseParam1.m_useType < chooseParam2.m_useType) { return true; } if (chooseParam1.m_useType > chooseParam2.m_useType) { return false; } if (chooseParam1.m_useCountType < chooseParam2.m_useCountType) { return true; } if (chooseParam1.m_useCountType > chooseParam2.m_useCountType) { return false; } if (chooseParam1.m_isObserve < chooseParam2.m_isObserve) { return true; } if (chooseParam1.m_isObserve > chooseParam2.m_isObserve) { return false; } return false; } }; class Solution; class Strategy; struct SolutionInfo; struct StrategyInfo; class StockMarket; class StockTypeAPI StockStorageBase { public: virtual std::vector<std::string>* filterStock(StrategyType strategyType, const IntDateTime& date) = 0; virtual std::shared_ptr<Solution> solution(SolutionType solutionType) = 0; virtual std::shared_ptr<Strategy> strategy(StrategyType strategyType) = 0; virtual std::shared_ptr<SolutionInfo> solutionInfo(SolutionType solutionType) = 0; virtual std::shared_ptr<StrategyInfo> strategyInfo(StrategyType solutionType, const std::string& stock) = 0; virtual std::shared_ptr<StockMarket> market(const std::string& stock) = 0; virtual IntDateTime moveDay(const IntDateTime& date, int32_t day, const std::shared_ptr<StockMarket>& runMarket = nullptr) = 0; };
// // SimpleAuthGooglePlusLoginViewController.h // SimpleAuth // // Created by Martin Pilch on 16/5/15. // Copyright (c) 2015 Martin Pilch, All rights reserved. // #import "SimpleAuthWebViewController.h" @interface SimpleAuthGooglePlusLoginViewController : SimpleAuthWebViewController @end
#ifndef _LINUX_AUXVEC_H #define _LINUX_AUXVEC_H //lux 辅助信息常量定义,在加载可执行文件时用到,see binfmt_elf.c #include <asm/auxvec.h> /* Symbolic values for the entries in the auxiliary table put on the initial stack */ #define AT_NULL 0 /* end of vector */ #define AT_IGNORE 1 /* entry should be ignored */ #define AT_EXECFD 2 /* file descriptor of program */ #define AT_PHDR 3 /* program headers for program */ #define AT_PHENT 4 /* size of program header entry */ #define AT_PHNUM 5 /* number of program headers */ #define AT_PAGESZ 6 /* system page size */ #define AT_BASE 7 /* base address of interpreter */ #define AT_FLAGS 8 /* flags */ #define AT_ENTRY 9 /* entry point of program */ #define AT_NOTELF 10 /* program is not ELF */ #define AT_UID 11 /* real uid */ #define AT_EUID 12 /* effective uid */ #define AT_GID 13 /* real gid */ #define AT_EGID 14 /* effective gid */ #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ #define AT_CLKTCK 17 /* frequency at which times() increments */ /* AT_* values 18 through 22 are reserved */ #define AT_SECURE 23 /* secure mode boolean */ #define AT_BASE_PLATFORM 24 /* string identifying real platform, may * differ from AT_PLATFORM. */ #define AT_RANDOM 25 /* address of 16 random bytes */ #define AT_EXECFN 31 /* filename of program */ #ifdef __KERNEL__ #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ #endif #endif /* _LINUX_AUXVEC_H */
/* * Generated by class-dump 3.3.3 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard. */ #import "MTMMessage.h" @class NSDictionary; @interface MTMFakeMessage : MTMMessage { NSDictionary *_messageDescription; } - (id)initWithDescription:(id)arg1; - (void)dealloc; - (id)valueForKey:(id)arg1; - (unsigned long long)messageFlags; - (unsigned long long)readFlags; @end
/*** * Inferno Engine v4 2015-2017 * Written by Tomasz "Rex Dex" Jonarski * * [# filter: actions #] ***/ #pragma once #include "sceneEditorStructure.h" #include "sceneEditorStructureNode.h" #include "sceneEditorStructureLayer.h" #include "sceneEditorStructureGroup.h" #include "sceneEditorStructureWorldRoot.h" #include "sceneEditorStructurePrefabRoot.h" namespace ed { namespace world { /// context for selection class SelectionContext : public base::SharedFromThis<SelectionContext> { RTTI_DECLARE_VIRTUAL_ROOT_CLASS(SelectionContext); public: SelectionContext(ContentStructure& content, const base::Array<ContentElementPtr>& selection); SelectionContext(ContentStructure& content, const ContentElementPtr& selectionOverride); ~SelectionContext(); //-- // is the selection empty FORCEINLINE const Bool empty() const { return m_selection.empty(); } // is the a single object selection FORCEINLINE const Bool single() const { return m_selection.size() == 1; } // get number of objects in the selection FORCEINLINE const Uint32 size() const { return m_selection.size(); } // get content we operate on FORCEINLINE ContentStructure& getContent() const { return m_content; } // all selected objects FORCEINLINE const base::Array<ContentElementPtr>& getAllSelected() const { return m_selection; } // get unique selection FORCEINLINE ContentElementType getUnifiedSelectionType() const { return m_unifiedSelectionType; } // get list of unified elements FORCEINLINE const base::Array<ContentElementPtr>& getUnifiedSelection() const { return m_unifiedSelection; } // get typed list of unified elements template< typename T > FORCEINLINE const base::Array<T>& getUnifiedSelection() const { return (const base::Array<base::SharedPtr<T>>&) m_selection; } // get "or" mask (at least one node has it) of all "features" of selection - unified selection only FORCEINLINE const ContentElementMask getUnifiedOrMask() const { return m_unifiedOrMask; } // get "and" mask (all nodes have it) of all "features" of selection - unified selection only FORCEINLINE const ContentElementMask& getUnifiedAndMask() const { return m_unifiedAndMask; } private: // content ContentStructure& m_content; // all selected objects base::Array<ContentElementPtr> m_selection; // unique selection - best ContentElementType m_unifiedSelectionType; // type of the unique selection base::Array<ContentElementPtr> m_unifiedSelection; // part of selection that has unified type ContentElementMask m_unifiedOrMask; ContentElementMask m_unifiedAndMask; //-- void filterSelection(); }; } // world } // ed
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2020 Scientific Computing and Imaging Institute, University of Utah. 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. */ #ifndef CORE_ALGORITHMS_MATH_ResizeMatrixALGO_H #define CORE_ALGORITHMS_MATH_ResizeMatrixALGO_H #include<Core/Algorithms/Base/AlgorithmBase.h> #include<Core/Algorithms/Math/share.h> namespace SCIRun { namespace Core { namespace Algorithms { namespace Math { ALGORITHM_PARAMETER_DECL(NoOfRows); ALGORITHM_PARAMETER_DECL(NoOfColumns); ALGORITHM_PARAMETER_DECL(Major); class SCISHARE ResizeMatrixAlgo : public AlgorithmBase { public: ResizeMatrixAlgo(); AlgorithmOutput run(const AlgorithmInput& input) const; }; } } } } #endif
#include "skynet.h" #include "skynet_monitor.h" #include "skynet_server.h" #include "skynet.h" #include "atomic.h" #include <stdlib.h> #include <string.h> struct skynet_monitor { int version; int check_version; uint32_t source; uint32_t destination; }; struct skynet_monitor *skynet_monitor_new() { struct skynet_monitor *ret = skynet_malloc(sizeof(*ret)); memset(ret, 0, sizeof(*ret)); return ret; } void skynet_monitor_delete(struct skynet_monitor *sm) { skynet_free(sm); } void skynet_monitor_trigger(struct skynet_monitor *sm, uint32_t source, uint32_t destination) { sm->source = source; sm->destination = destination; ATOM_INC(&sm->version); } void skynet_monitor_check(struct skynet_monitor *sm) { if(sm->version == sm->check_version) { if(sm->destination) { skynet_context_endless(sm->destination); skynet_error(NULL, "A message from [ :%08x ] to [ :%08x ] maybe in an endless loop (version = %d)", sm->source , sm->destination, sm->version); } } else { sm->check_version = sm->version; } }
// // DemoCell.h // SwpCateGoryDemo // // Created by swp_song on 2017/6/20. // Copyright © 2017年 swp-song. All rights reserved. // #import <UIKit/UIKit.h> @class DemoModel; NS_ASSUME_NONNULL_BEGIN @interface DemoCell : UITableViewCell /**! * @author swp_song * * @brief demoCellWihtTableView:forCellReuseIdentifier: ( 快速初始化一个 Cell ) * * @param tableView tableView * * @param identifier identifier * * @return UITableViewCell */ + (instancetype)demoCellWihtTableView:(UITableView *)tableView forCellReuseIdentifier:(NSString *)identifier; /**! * @author swp_song * * @brief demoCellInit ( 快速初始化一个 Cell ) */ + (__kindof DemoCell * _Nonnull (^)(UITableView * _Nonnull, NSString * _Nonnull))demoCellInit; /**! * @author swp_song * * @brief demo ( 设置数据 ) */ - (DemoCell * _Nonnull (^)(DemoModel * _Nonnull))demo; @end NS_ASSUME_NONNULL_END
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSArray, NSDate, NSMutableDictionary, NSString; @interface XCSnapshot : NSObject { NSArray *_sourceDirs; NSArray *_archiveDirs; long long _multiRootIndex; NSString *_userComment; NSDate *_date; NSMutableDictionary *_userDictionary; BOOL _archiveInProgress; BOOL _archiveValid; NSString *_errorMessage; } + (id)snapshotRepositoryRootDirectory; + (id)_dateFormatter; + (id)standardizedDirectoriesFrom:(id)arg1; + (id)predictiveSnapshotsIncludingSourceDir:(id)arg1; + (void)cleanRepository; + (void)stopAllPredictiveSnapshots; + (void)stopPredictiveSnapshotsOfDirectories:(id)arg1; + (void)enablePredictiveSnapshotsOfDirectories:(id)arg1; + (BOOL)predictiveSnapshotsEnabledForDirectories:(id)arg1; + (id)archivePathsForSourceDirectories:(id)arg1 date:(id)arg2; + (id)repositoryDirectoriesForDirectories:(id)arg1; + (id)archiveDirectoryName; + (id)snapshotFromArchiveDictionary:(id)arg1; + (id)newSnapshotForSourceDirectories:(id)arg1; + (id)sourceDirsKeyForDirectories:(id)arg1; + (Class)snapshotClass; + (id)keyPathsForValuesAffectingUserCommentAsAttributedString; @property(nonatomic) long long multiRootIndex; // @synthesize multiRootIndex=_multiRootIndex; - (id)repositoryDirForPath:(id)arg1; - (id)sourceDirForPath:(id)arg1; - (id)projectPath; - (void)setProjectPath:(id)arg1; - (id)projectName; - (void)setProjectName:(id)arg1; - (id)userName; - (void)setUserName:(id)arg1; - (id)name; - (void)setName:(id)arg1; - (void)_displayRefreshForName:(id)arg1; - (id)changeSet; - (long long)compareDates:(id)arg1; - (id)objectForKey:(id)arg1; - (void)setString:(id)arg1 forKey:(id)arg2; - (id)errorMessage; - (BOOL)archiveValid; - (void)setArchiveInProgress:(BOOL)arg1; - (BOOL)archiveInProgress; - (id)archiveDirs; - (void)removeSnapshotArchive; - (void)restoreFiles:(id)arg1; - (void)restore; - (void)startTakingSnapshot; - (id)archiveStrategy; - (void)postCopyCompleteNoticeWithErrorMessage:(id)arg1; - (id)snapshotRepositoryDirectories; - (id)formattedDateString; - (id)snapshotDate; - (void)setUserCommentAsAttributedString:(id)arg1; - (id)userCommentAsAttributedString; - (void)setUserComment:(id)arg1; - (id)userComment; - (id)sourceDirs; - (void)_didChange; - (id)dictionaryRepresentation; - (id)sourceDirsKey; - (void)dealloc; - (id)initWithDictionary:(id)arg1; - (id)initWithSourceDirs:(id)arg1 archiveDirs:(id)arg2 comment:(id)arg3 date:(id)arg4; - (id)initNewSnapshotWithSourceDirectories:(id)arg1; @end
// // UserCell.h // searchDemo // // Created by GuanFeng on 2017/4/27. // Copyright © 2017年 GuanFeng. All rights reserved. // #import <UIKit/UIKit.h> @class UserInfo; @interface UserCell : UITableViewCell @property (nonatomic, strong) UserInfo *info; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSDStyledInfoSetStyleCommand.h> @class NSObject<TSSPreset>; // Not exported @interface TSDMediaApplyPresetCommand : TSDStyledInfoSetStyleCommand { NSObject<TSSPreset> *mPreset; } @property(readonly, nonatomic) NSObject<TSSPreset> *preset; // @synthesize preset=mPreset; - (void)saveToArchiver:(id)arg1; - (id)initFromUnarchiver:(id)arg1; - (void)computeStyle; - (void)dealloc; - (id)initWithMediaInfo:(id)arg1 presetKind:(id)arg2 index:(unsigned long long)arg3; - (id)initWithMediaInfo:(id)arg1 preset:(id)arg2; @end
// Copyright (c) 2014 rokob. All rights reserved. #import <Foundation/Foundation.h> #import "RKAuthClientServices.h" @class FirebaseSimpleLogin; @interface RKAuthClientFirebaseFacebookHandler : NSObject <RKAuthClientFacebook> - (instancetype)initWithSimpleLogin:(FirebaseSimpleLogin *)simpleLogin; @end
// // CommunityDetailsTableView.h // MierMilitaryNews // // Created by 李响 on 2016/10/28. // Copyright © 2016年 miercn. All rights reserved. // #import <UIKit/UIKit.h> #import "CommunityDetailsModel.h" @class CommunityCommentModel; typedef void(^OpenUserHomeVCBlock)(NSString *uid , NSString *userName); typedef void(^OpenReplyBlock)(CommunityCommentModel *commentModel , NSString *placeholder); @interface CommunityDetailsTableView : UITableView @property (nonatomic , copy ) OpenReplyBlock openReplyBlock;//打开回复Block @property (nonatomic , copy ) OpenUserHomeVCBlock openUserHomeBlock; //打开用户主页Block @property (nonatomic , strong ) CommunityDetailsModel *model; //社区详情数据模型 @property (nonatomic , copy ) void (^scrollBlock)(CGPoint contentOffset); //列表滑动Block /** 发送评论 @param comment 评论内容 @param rootComment 所属评论 @param resultBlock 结果回调Block */ - (void)sendComment:(NSString *)comment RootComment:(CommunityCommentModel *)rootComment ResultBlock:(void (^)(BOOL))resultBlock; @end
// // SearchAdvanceOpportunityViewController.h // OfficeOneMB // // Created by Dao Xuan Luong on 12/15/14. // // #import "BaseViewController.h" @protocol SearchAdvanceDelegate <NSObject> -(void) actionSearchAdvance :(NSString*)keyword addStartDate:(NSDate*)startDate addEndDate:(NSDate*)endDate userType:(int)type; -(void) dismissPopoverView; @end @interface SearchAdvanceOpportunityViewController : UIViewController @property (weak,nonatomic) id <SearchAdvanceDelegate> advanceSearchDelegate; @property (weak, nonatomic) IBOutlet UITextField *txtName; @property (weak, nonatomic) IBOutlet UITextField *txtStartDate; @property (weak, nonatomic) IBOutlet UIButton *btnStartDate; @property (weak, nonatomic) IBOutlet UIButton *btnEndDate; @property (weak, nonatomic) IBOutlet UITextField *txtEndDate; @property (weak, nonatomic) IBOutlet UITextField *txtAccountType; @property (weak, nonatomic) IBOutlet UIButton *btnChoiceAccountType; @property (weak, nonatomic) IBOutlet UILabel *lblTitle; @property (weak, nonatomic) IBOutlet UILabel *lblStartDate; @property (weak, nonatomic) IBOutlet UILabel *lblEndDate; @property (weak, nonatomic) IBOutlet UILabel *lblCustomerType; @property (weak, nonatomic) IBOutlet UIButton *btnSearch; @property (weak, nonatomic) IBOutlet UIButton *btnCance; ////////////// KHAI BAO BIEN CHUNG////////// @property (nonatomic, retain) UIPopoverController *listPopover; ////////////// KHAI BAO BIEN CHUNG////////// @end
/* * Generated by util/mkerr.pl DO NOT EDIT * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <stdio.h> #include BOSS_OPENSSL_V_openssl__err_h //original-code:<openssl/err.h> #include BOSS_OPENSSL_U_internal__dso_h //original-code:"internal/dso.h" /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR # define ERR_FUNC(func) ERR_PACK(ERR_LIB_DSO,func,0) # define ERR_REASON(reason) ERR_PACK(ERR_LIB_DSO,0,reason) static ERR_STRING_DATA DSO_str_functs[] = { {ERR_FUNC(DSO_F_DLFCN_BIND_FUNC), "dlfcn_bind_func"}, {ERR_FUNC(DSO_F_DLFCN_LOAD), "dlfcn_load"}, {ERR_FUNC(DSO_F_DLFCN_MERGER), "dlfcn_merger"}, {ERR_FUNC(DSO_F_DLFCN_NAME_CONVERTER), "dlfcn_name_converter"}, {ERR_FUNC(DSO_F_DLFCN_UNLOAD), "dlfcn_unload"}, {ERR_FUNC(DSO_F_DL_BIND_FUNC), "dl_bind_func"}, {ERR_FUNC(DSO_F_DL_LOAD), "dl_load"}, {ERR_FUNC(DSO_F_DL_MERGER), "dl_merger"}, {ERR_FUNC(DSO_F_DL_NAME_CONVERTER), "dl_name_converter"}, {ERR_FUNC(DSO_F_DL_UNLOAD), "dl_unload"}, {ERR_FUNC(DSO_F_DSO_BIND_FUNC), "DSO_bind_func"}, {ERR_FUNC(DSO_F_DSO_CONVERT_FILENAME), "DSO_convert_filename"}, {ERR_FUNC(DSO_F_DSO_CTRL), "DSO_ctrl"}, {ERR_FUNC(DSO_F_DSO_FREE), "DSO_free"}, {ERR_FUNC(DSO_F_DSO_GET_FILENAME), "DSO_get_filename"}, {ERR_FUNC(DSO_F_DSO_GLOBAL_LOOKUP), "DSO_global_lookup"}, {ERR_FUNC(DSO_F_DSO_LOAD), "DSO_load"}, {ERR_FUNC(DSO_F_DSO_MERGE), "DSO_merge"}, {ERR_FUNC(DSO_F_DSO_NEW_METHOD), "DSO_new_method"}, {ERR_FUNC(DSO_F_DSO_PATHBYADDR), "DSO_pathbyaddr"}, {ERR_FUNC(DSO_F_DSO_SET_FILENAME), "DSO_set_filename"}, {ERR_FUNC(DSO_F_DSO_UP_REF), "DSO_up_ref"}, {ERR_FUNC(DSO_F_VMS_BIND_SYM), "vms_bind_sym"}, {ERR_FUNC(DSO_F_VMS_LOAD), "vms_load"}, {ERR_FUNC(DSO_F_VMS_MERGER), "vms_merger"}, {ERR_FUNC(DSO_F_VMS_UNLOAD), "vms_unload"}, {ERR_FUNC(DSO_F_WIN32_BIND_FUNC), "win32_bind_func"}, {ERR_FUNC(DSO_F_WIN32_GLOBALLOOKUP), "win32_globallookup"}, {ERR_FUNC(DSO_F_WIN32_JOINER), "win32_joiner"}, {ERR_FUNC(DSO_F_WIN32_LOAD), "win32_load"}, {ERR_FUNC(DSO_F_WIN32_MERGER), "win32_merger"}, {ERR_FUNC(DSO_F_WIN32_NAME_CONVERTER), "win32_name_converter"}, {ERR_FUNC(DSO_F_WIN32_PATHBYADDR), "win32_pathbyaddr"}, {ERR_FUNC(DSO_F_WIN32_SPLITTER), "win32_splitter"}, {ERR_FUNC(DSO_F_WIN32_UNLOAD), "win32_unload"}, {0, NULL} }; static ERR_STRING_DATA DSO_str_reasons[] = { {ERR_REASON(DSO_R_CTRL_FAILED), "control command failed"}, {ERR_REASON(DSO_R_DSO_ALREADY_LOADED), "dso already loaded"}, {ERR_REASON(DSO_R_EMPTY_FILE_STRUCTURE), "empty file structure"}, {ERR_REASON(DSO_R_FAILURE), "failure"}, {ERR_REASON(DSO_R_FILENAME_TOO_BIG), "filename too big"}, {ERR_REASON(DSO_R_FINISH_FAILED), "cleanup method function failed"}, {ERR_REASON(DSO_R_INCORRECT_FILE_SYNTAX), "incorrect file syntax"}, {ERR_REASON(DSO_R_LOAD_FAILED), "could not load the shared library"}, {ERR_REASON(DSO_R_NAME_TRANSLATION_FAILED), "name translation failed"}, {ERR_REASON(DSO_R_NO_FILENAME), "no filename"}, {ERR_REASON(DSO_R_NULL_HANDLE), "a null shared library handle was used"}, {ERR_REASON(DSO_R_SET_FILENAME_FAILED), "set filename failed"}, {ERR_REASON(DSO_R_STACK_ERROR), "the meth_data stack is corrupt"}, {ERR_REASON(DSO_R_SYM_FAILURE), "could not bind to the requested symbol name"}, {ERR_REASON(DSO_R_UNLOAD_FAILED), "could not unload the shared library"}, {ERR_REASON(DSO_R_UNSUPPORTED), "functionality not supported"}, {0, NULL} }; #endif int ERR_load_DSO_strings(void) { #ifndef OPENSSL_NO_ERR if (ERR_func_error_string(DSO_str_functs[0].error) == NULL) { ERR_load_strings(0, DSO_str_functs); ERR_load_strings(0, DSO_str_reasons); } #endif return 1; }
/*********************************************************************/ /* */ /* Equilibrate matrix A using LAPACK subroutine SGEEQU */ /* */ /* -- Created by the Lighthouse Development Team */ /* */ /*********************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <complex.h> #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) /**************************** BEGIN CONSTANT SET UP ****************************/ /*--- input matrix properties ---*/ #define ROW_A #define COL_A /*--- enter file location for matrix A ---*/ #define fileA "path_to_file A" /**************************** END CONSTANT SET UP ****************************/ /*--- global variables ---*/ int m = ROW_A; int n = COL_A; int lda = ROW_A; int info, i, j; char CMACH = 's'; float SMLNUM, BIGNUM; float amax, rowcnd, colcnd, R[ROW_A], C[COL_A], AT[ROW_A*COL_A]; FILE *fptA; /*--- external function prototype declaration ---*/ extern void OPEN_FILE(); extern void GET_DATA(); extern void PRINT_SOLUTION(); extern void SCALED_MATRIX(); extern double SLAMCH(); int main(){ /*--- message ---*/ printf("******************************************\n"); printf("*** Use SGEEQU to equilibrate matrix A ***\n"); printf("******************************************\n"); printf("\n"); /*--- open files that store data ---*/ OPEN_FILE(); /*--- read data ---*/ GET_DATA(); /*--- compute smallest/largest safe numbers ---*/ SMLNUM = SLAMCH(&CMACH); BIGNUM = 1.0/SMLNUM; printf("SMLNUM = %e\n", SMLNUM); printf("BIGNUM = %e\n\n", BIGNUM); /*--- call lapack subroutine SGEEQU, note: ---*/ /*--- (1) all the arguments must be pointers ---*/ /*--- (2) add an underscore to the routine name ---*/ /*--- (3) matrices must be transformed into Fortran vector format ---*/ SGEEQU_(&m, &n, AT, &lda, R, C, &rowcnd, &colcnd, &amax, &info); /*--- print the solution ---*/ PRINT_SOLUTION(); /*--- write scaled matrix if there is one ---*/ SCALED_MATRIX(); /*--- close files ---*/ fclose(fptA); return 0; } void OPEN_FILE(){ fptA = fopen(fileA,"r"); if(fptA == NULL){ printf("Cannot open %s.\n", fileA); puts(strerror(errno)); exit(EXIT_FAILURE); } } void GET_DATA(){ /*--- to call a Fortran routine from C, matrices must be transformed into their Fortran vector formats ---*/ /*--- read A and transform it to AT ---*/ for(i=0; i<lda; i++){ for(j=0; j<n; j++){ fscanf(fptA, "%f",&AT[i+lda*j]); } } } void PRINT_SOLUTION(){ printf("Solution: \n"); printf("AMAX = %6.3e\n", amax); printf("ROWCND = %6.3e\n", rowcnd); printf("COLCND = %6.3e\n\n", colcnd); printf("Row scale factors:\n"); for (i=0; i<m; i++){ printf(" % 6.3e\t", R[i]); } printf("\n\n"); printf("Column scale factors:\n"); for (i=0; i<m; i++){ printf(" % 6.3e\t", C[i]); } /*---print info ---*/ printf("\n\ninfo = %d\n\n", info); } void SCALED_MATRIX(){ if (rowcnd>=0.1 && SMLNUM<amax && amax<BIGNUM){ if (colcnd<0.1){ printf("Row scaling is not needed. Column Scaled Matrix A =\n"); for (j=0; j<n; j++){ for (i=0; i<m; i++){ AT[i+m*j] = AT[i+m*j]*C[j]; } } } else printf("Matrix is not worth scaling.\n"); exit(EXIT_SUCCESS); } else{ if (colcnd>=0.1){ printf("Column scaling is not needed. Row Scaled Matrix A =\n"); for (j=0; j<n; j++){ for (i=0; i<m; i++){ AT[i+m*j] = R[i]* AT[i+m*j]; } } } else { printf("Row-and-column Scaled Matrix A =\n"); for (j=0; j<n; j++){ for (i=0; i<m; i++){ AT[i+m*j] = R[i]* AT[i+m*j]*C[j]; } } } } /*--- print scaled matrix A ---*/ for (i=0; i<m; i++){ for (j=0; j<n; j++){ printf(" %6.3f", AT[i+m*j]); } printf("\n"); } }
// // NSDictionary+StolpersteinParsing.h // Stolpersteine // // Copyright (C) 2013 Option-U Software // // 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> @class Stolperstein; @interface NSDictionary (StolpersteinParsing) - (Stolperstein *)newStolperstein; @end
// LAF Base Library // Copyright (c) 2001-2016 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_MEMORY_DUMP_H_INCLUDED #define BASE_MEMORY_DUMP_H_INCLUDED #pragma once #include <string> namespace base { class MemoryDump { public: MemoryDump(); ~MemoryDump(); void setFileName(const std::string& fileName); private: class MemoryDumpImpl; MemoryDumpImpl* m_impl; }; } // namespace base #endif // BASE_MEMORY_DUMP_H_INCLUDED
typedef enum {false,true} bool; extern int __VERIFIER_nondet_int(void); int main() { int i; i = __VERIFIER_nondet_int(); while (i > 5) { if (i != 10) { i = i-1; } } return 0; }
#include <assert.h> #include "cm_err.h" #include "cm_object.h" #include "cm_manager.h" #include "cm_manager_obj.h" struct cm_manager * cm_manager_new(cm_err_t *err) { return cm_manager_obj_new(NULL, err); } void cm_manager_new_async(cm_manager_new_done done, void *userdata) { cm_manager_obj_new_async(NULL, done, userdata); } struct cm_manager * cm_manager_ref(struct cm_manager *self) { assert(self && self->get); return self->get(self); } void cm_manager_unref(struct cm_manager *self) { assert(self && self->put); self->put(self); } char * cm_manager_get_path(struct cm_manager *self) { assert(self && self->get_path); return self->get_path(self); } void cm_manager_start(struct cm_manager *self, cm_err_t *err) { assert(self && self->start); return self->start(self, err); } void cm_manager_start_async(struct cm_manager *self, cm_manager_start_done done, void *userdata) { assert(self && self->start_async); return self->start_async(self, done, userdata); } void cm_manager_stop(struct cm_manager *self, cm_err_t *err) { assert(self && self->stop); return self->stop(self, err); } void cm_manager_stop_async(struct cm_manager *self, cm_manager_stop_done done, void *userdata) { assert(self && self->stop_async); return self->stop_async(self, done, userdata); } void cm_manager_list_modems(struct cm_manager *self, cm_manager_list_modems_for_each for_each, void *userdata, cm_err_t *err) { assert(self && self->list_modems); return self->list_modems(self, for_each, userdata, err); } void cm_manager_list_modems_async(struct cm_manager *self, cm_manager_list_modems_for_each for_each, cm_manager_list_modems_done done, void *userdata) { assert(self && self->list_modems_async); return self->list_modems_async(self, for_each, done, userdata); } void cm_manager_subscribe_modem_added(struct cm_manager *self, cm_manager_modem_added added, void *userdata, cm_err_t *err) { assert(self && self->subscribe_modem_added); return self->subscribe_modem_added(self, added, userdata, err); } void cm_manager_unsubscribe_modem_added(struct cm_manager *self, cm_err_t *err) { assert(self && self->unsubscribe_modem_added); return self->unsubscribe_modem_added(self, err); } void cm_manager_subscribe_modem_removed(struct cm_manager *self, cm_manager_modem_removed removed, void *userdata, cm_err_t *err) { assert(self && self->subscribe_modem_removed); return self->subscribe_modem_removed(self, removed, userdata, err); } void cm_manager_unsubscribe_modem_removed(struct cm_manager *self, cm_err_t *err) { assert(self && self->unsubscribe_modem_removed); return self->unsubscribe_modem_removed(self, err); }
#pragma once #include <Windows.h> #include <exception> #include "OSGFInputElement.h" class InputSystem { public: InputSystem(); InputSystem(RAWINPUTDEVICE* devs,UINT count); void SetKeyboard(OSGFInputElement* keyboard) { mInputElements[RIM_TYPEKEYBOARD] = keyboard; } void SetMouse(OSGFInputElement* mouse) { mInputElements[RIM_TYPEMOUSE] = mouse; } void HandleInput(WPARAM wParam,LPARAM lParam); ~InputSystem(void); private: OSGFInputElement* mInputElements[3]; void RegisterAndCheckForErrors(RAWINPUTDEVICE* devs,UINT count) { if(!RegisterRawInputDevices(devs,count,sizeof(devs[0]))) { throw std::exception("Error in registering input devices.Error code"+ HRESULT_FROM_WIN32(GetLastError())); } } };
// // EtherJsonController.h // etherpad-lite-objc // // Copyright (c) 2012 Alexander Zautke. // This code is released under the MIT License (MIT). // For conditions of distribution and use, see the disclaimer and license in EtherpadController.h // #import <Foundation/Foundation.h> @interface EtherJsonController : NSObject + (id)objectWithData:(NSData*)jsonData; // returns a Foundation object (like NSDictionary or NSArray) from given JSON data. + (id)objectWithData:(NSData *)jsonData error:(NSError**)error; + (NSData*)dataWithObject:(id)jsonObject; // returns JSON data from a Foundation object. + (NSData*)dataWithObject:(id)jsonObject error:(NSError**)error; @end
// // AppRouterAutoPanUp.h // objcTempDemo // // Created by Deng on 16/7/8. // Copyright © Deng. All rights reserved. // #import "AppRouter.h" @class AppRouterAutoPanUp; @interface AppRouterAutoPanUp : AppRouter #pragma mark Public Method #pragma mark Properties @end
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* card_to_rom.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: htindon <htindon@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2014/02/05 16:13:05 by htindon #+# #+# */ /* Updated: 2014/02/28 01:05:40 by htindon ### ########.fr */ /* */ /* ************************************************************************** */ #include <stdio.h> #include <stdlib.h> #include <string.h> int match_and_replace(int number) { int value[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; char *numeral[13] = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}; int i; char *result; i = 0; while (i < 13) { while (number >= value[i]) { number -= value[i]; result = strcat(result, numeral[i]); } i++; } return (0); } /* int process(char *line) { return (0); } int readfile(char *filename) { char *line; FILE *file = NULL; file = fopen(filename, "r"); if (file != NULL) { line = (char *)malloc(1024); while (42) { if (fgets(line, 1024, file)) process(line); else break ; } fclose(file); } return (0); } */ int main(int argc, char **argv) { // readfile(argv[1]); match_and_replace(5000); return (0); }
// // PromotionAudienceViewController.h // ShnergleApp // // Created by Adam Hani Schakaki on 25/07/2013. // Copyright (c) 2013 Shnergle. All rights reserved. // #import "CustomBackViewController.h" @interface PromotionAudienceViewController : CustomBackViewController <UITableViewDataSource, UITableViewDelegate> @end
/* * * Servo.c * * Created: April 30 2016 * Authors: Yuqi (Mark) Zhao and Claire Chen */ #include "Servo.h" /* * Configure ports PTD0 and PTD2 as the GPIO output pins for both servos. */ void servo_init(void){ //Enable power to port D SIM->SCGC5 |= SIM_SCGC5_PORTD_MASK; //Set up each pin as GPIO output PORTD->PCR[SERVO1] |= PORT_PCR_MUX(001); PTD->PDDR |= (1 << SERVO1); PTD->PDOR &= ~(1 << SERVO1); //Initialize pin to 0 PORTD->PCR[SERVO1] &= ~(1 << PORT_PCR_SRE_SHIFT); //Configure fast slew rate PORTD->PCR[SERVO2] |= PORT_PCR_MUX(001); PTD->PDDR |= (1 << SERVO2); PTD->PDOR &= ~(1 << SERVO2); //Initialize pin to 0 PORTD->PCR[SERVO2] &= ~(1 << PORT_PCR_SRE_SHIFT); //Configure fast slew rate } /* * This function sets up PIT0 and PIT1, which will be used for setting the * Correct periods to control the servo positions! */ void servo_setup_timers(void){ int default_position1; int default_position2; servo1_angle = SERVO1_NEUTRAL; //Initialize the start angle to 90 servo2_angle = SERVO2_NEUTRAL; SIM->SCGC6 |= SIM_SCGC6_PIT_MASK; // Enable Clock to PIT PIT->MCR = 0x0; // Enables PIT timer, allows running in debug mode default_position1 = servo_get_high(servo1_angle); // Sets both servos to 90 degrees default_position2 = servo_get_high(servo2_angle); // Set up PIT0 and PIT1 PIT->CHANNEL[0].LDVAL = default_position1; PIT->CHANNEL[0].TCTRL = 3; PIT->CHANNEL[1].LDVAL = default_position2; PIT->CHANNEL[1].TCTRL = 3; //Enable interrupts on PIT0 and PIT1 NVIC_EnableIRQ(PIT0_IRQn); NVIC_EnableIRQ(PIT1_IRQn); } /* * Takes in angle between 0 and 180 degrees * Returns integer corresponding to appropriate high load value between 1ms and 2ms */ int servo_get_high(int angle){ float angle_range = (float)(MAX_ANGLE - MIN_ANGLE); float angle_distance = angle/angle_range; int load_val = (int) (MILLISECOND + MILLISECOND * (angle_distance)); return load_val; } /* * Takes in load value of high pulse * Returns integer corresponding to appropriate low load value */ int servo_get_low(int angle){ int high_load_val = servo_get_high(angle); int low_load_val = PERIOD - high_load_val; return low_load_val; } /* * Signals servo to hit, depending on the servo_num */ void servo_hit(int servo_num){ if(servo_num == 1){ tap_dat_1 = 1; //Set servo angle to hit servo1_angle = SERVO1_HIT; /* if(intflag == 0){ intflag = 1; LEDGrn_On(); } else{ intflag = 0; LEDGrn_Off(); } */ } else if(servo_num == 2){ tap_dat_2 = 1; servo2_angle = SERVO2_HIT; /* if(intflag2 == 0){ intflag2 = 1; LEDRed_On(); } else{ intflag2 = 0; LEDRed_Off(); } */ } }
#ifndef GUYGRAPHICSCOMPONENT_H #define GUYGRAPHICSCOMPONENT_H #include <string> #include "zombie_walk.h" #include "graphics_component.h" #include "graphics.h" #include "Entity.h" #include "AnimatedSprite.h" class GuyGraphicsComponent : public GraphicsComponent { public: GuyGraphicsComponent(Graphics &graphics); ~GuyGraphicsComponent(); void update(int deltaInMS, Entity &object, Graphics &graphics); private: StaticSprite *guySprite; AnimatedSprite *walkLeft; AnimatedSprite *walkRight; }; #endif
// // BMArchive // Bitmessage // // Created by Steve Dekorte on 4/8/14. // Copyright (c) 2014 voluntary.net. All rights reserved. // #import <Foundation/Foundation.h> @interface BMArchive : NSObject - (void)archiveFromPath:(NSString *)inPath toPath:(NSString *)outPath; - (void)unarchiveFromPath:(NSString *)inPath toPath:(NSString *)outPath; @end
#pragma once #include <SDL.h> #include <vector> // class LuckyComponent; // class LuckyWindow; // class LuckyContent; // class LuckyText; //GENERIC COMPONENT CLASS class LuckyComponent { protected: SDL_Rect bounds; public: SDL_Rect* parent_bounds; LuckyComponent(int x, int y, int w = 0, int h = 0) : bounds{x, y, w, h} { } virtual void update() = 0; virtual void draw() = 0; }; class LuckyWindow; class LuckyPane : public LuckyComponent { public: SDL_Texture* pane_tex; LuckyWindow* parent; std::vector<LuckyComponent*> components; LuckyPane(LuckyWindow* p); void addComponent(LuckyComponent* component); void update(); void draw(); }; class LuckyWindow { private: SDL_Rect shadow; SDL_Rect frame; SDL_Rect handle; bool locked = false; int grabbedx, grabbedy; SDL_Texture* shadow_tex; SDL_Texture* frame_tex; public: const char* title; SDL_Rect window; LuckyPane* pane; LuckyWindow(const char* t, int x, int y, int w = 240, int h = 180); void updateWindow(); bool trygrab(); void update(); void draw(); }; class LuckyText : public LuckyComponent { public: const char* text; LuckyText(const char* t, int x, int y); void update(); void draw(); }; class LuckyButton : public LuckyComponent { private: bool hover, pressed; int padding; SDL_Texture* btex; SDL_Texture* btex_hover; SDL_Texture* btex_press; public: const char* text; SDL_Rect actual; LuckyButton(const char* t, int x, int y); void (*onClick)(void*) = NULL; void update(); void draw(); };
// // DZVideoPlayerUiProtocol.h // #ifndef DZVideoPlayerUiProtocol_h #define DZVideoPlayerUiProtocol_h #import "DZPlayerView.h" #import "DZProgressIndicatorSlider.h" @protocol DZVideoPlayerUiProtocol -(DZPlayerView *)playerView; -(UIActivityIndicatorView *)activityIndicatorView; -(UIView *)topToolbarView; -(UIView *)bottomToolbarView; -(UIButton *)doneButton; -(UIButton *)playButton; -(UIButton *)pauseButton; -(DZProgressIndicatorSlider *)progressIndicator; -(UILabel *)currentTimeLabel; -(UILabel *)remainingTimeLabel; -(UIButton *)fullscreenExpandButton; -(UIButton *)fullscreenShrinkButton; @end #endif /* DZVideoPlayerUiProtocol_h */
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/times.h> #include "clock.h" /* Routines for using cycle counter */ /* Detect whether running on Alpha */ #ifdef __alpha #define IS_ALPHA 1 #else #define IS_ALPHA 0 #endif /* Detect whether running on x86 */ #ifdef __i386__ #define IS_x86 1 #else #define IS_x86 0 #endif /* Keep track of most recent reading of cycle counter */ static unsigned cyc_hi = 0; static unsigned cyc_lo = 0; #if IS_ALPHA /* Use Alpha cycle timer to compute cycles. Then use measured clock speed to compute seconds */ /* * counterRoutine is an array of Alpha instructions to access * the Alpha's processor cycle counter. It uses the rpcc * instruction to access the counter. This 64 bit register is * divided into two parts. The lower 32 bits are the cycles * used by the current process. The upper 32 bits are wall * clock cycles. These instructions read the counter, and * convert the lower 32 bits into an unsigned int - this is the * user space counter value. * NOTE: The counter has a very limited time span. With a * 450MhZ clock the counter can time things for about 9 * seconds. */ static unsigned int counterRoutine[] = { 0x601fc000u, 0x401f0000u, 0x6bfa8001u }; /* Cast the above instructions into a function. */ static unsigned int (*counter)(void)= (void *)counterRoutine; void start_counter() { /* Get cycle counter */ cyc_hi = 0; cyc_lo = counter(); } double get_counter() { unsigned ncyc_hi, ncyc_lo; unsigned hi, lo, borrow; double result; ncyc_lo = counter(); ncyc_hi = 0; lo = ncyc_lo - cyc_lo; borrow = lo > ncyc_lo; hi = ncyc_hi - cyc_hi - borrow; result = (double) hi * (1 << 30) * 4 + lo; if (result < 0) { fprintf(stderr, "Error: Cycle counter returning negative value: %.0f\n", result); } return result; } #endif /* Alpha */ #if IS_x86 void access_counter(unsigned *hi, unsigned *lo) { /* Get cycle counter */ asm("rdtsc; movl %%edx,%0; movl %%eax,%1" : "=r" (*hi), "=r" (*lo) : /* No input */ : "%edx", "%eax"); } void start_counter() { access_counter(&cyc_hi, &cyc_lo); } double get_counter() { unsigned ncyc_hi, ncyc_lo; unsigned hi, lo, borrow; double result; /* Get cycle counter */ access_counter(&ncyc_hi, &ncyc_lo); /* Do double precision subtraction */ lo = ncyc_lo - cyc_lo; borrow = lo > ncyc_lo; hi = ncyc_hi - cyc_hi - borrow; result = (double) hi * (1 << 30) * 4 + lo; if (result < 0) { fprintf(stderr, "Error: Cycle counter returning negative value: %.0f\n", result); } return result; } #endif /* x86 */ double ovhd() { /* Do it twice to eliminate cache effects */ int i; double result; for (i = 0; i < 2; i++) { start_counter(); result = get_counter(); } return result; } /* Determine clock rate by measuring cycles elapsed while sleeping for sleeptime seconds */ double mhz_full(int verbose, int sleeptime) { double rate; start_counter(); sleep(sleeptime); rate = get_counter()/(1e6*sleeptime); if (verbose) printf("Processor Clock Rate ~= %.1f MHz\n", rate); return rate; } /* Version using a default sleeptime */ double mhz(int verbose) { return mhz_full(verbose, 2); } /** Special counters that compensate for timer interrupt overhead */ static double cyc_per_tick = 0.0; #define NEVENT 100 #define THRESHOLD 1000 #define RECORDTHRESH 3000 /* Attempt to see how much time is used by timer interrupt */ static void callibrate(int verbose) { double oldt; struct tms t; clock_t oldc; int e = 0; times(&t); oldc = t.tms_utime; start_counter(); oldt = get_counter(); while (e <NEVENT) { double newt = get_counter(); if (newt-oldt >= THRESHOLD) { clock_t newc; times(&t); newc = t.tms_utime; if (newc > oldc) { double cpt = (newt-oldt)/(newc-oldc); if ((cyc_per_tick == 0.0 || cyc_per_tick > cpt) && cpt > RECORDTHRESH) cyc_per_tick = cpt; /* if (verbose) printf("Saw event lasting %.0f cycles and %d ticks. Ratio = %f\n", newt-oldt, (int) (newc-oldc), cpt); */ e++; oldc = newc; } oldt = newt; } } if (verbose) printf("Setting cyc_per_tick to %f\n", cyc_per_tick); } static clock_t start_tick = 0; void start_comp_counter() { struct tms t; if (cyc_per_tick == 0.0) callibrate(0); times(&t); start_tick = t.tms_utime; start_counter(); } double get_comp_counter() { double time = get_counter(); double ctime; struct tms t; clock_t ticks; times(&t); ticks = t.tms_utime - start_tick; ctime = time - ticks*cyc_per_tick; /* printf("Measured %.0f cycles. Ticks = %d. Corrected %.0f cycles\n", time, (int) ticks, ctime); */ return ctime; }
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #ifdef _OPENACC #include <openacc.h> #endif // Utility routine for allocating a two dimensional array float **malloc_2d(int nx, int ny) { float **array; int i; array = (float **) malloc(nx * sizeof(float *)); array[0] = (float *) malloc(nx * ny * sizeof(float)); for (i = 1; i < nx; i++) { array[i] = array[0] + i * ny; } return array; } // Utility routine for deallocating a two dimensional array void free_2d(float **array) { free(array[0]); free(array); } void init(float **arr, int nx, int ny) { int i, j; /* TODO: Implement data initialization with OpenACC on device */ for (i = 0; i < nx + 2; i++) { for (j = 0; j < ny + 2; j++) { arr[i][j] = 0e0; } } /* TODO: Implement data initialization with OpenACC on device */ for (i = 0; i < nx + 2; i++) { arr[i][ny + 1] = 1e0; } /* TODO: Implement data initialization with OpenACC on device */ for (i = 0; i < ny + 2; i++) { arr[nx + 1][i] = 1e0; } } void update(float **newarr, float **oldarr, float *norm, int nx, int ny) { int i, j; const float factor = 0.25; float lnorm; if (norm != NULL) { lnorm = 0; /* TODO: Implement computation with OpenACC on device */ for (i = 1; i < nx + 1; i++) { for (j = 1; j < ny + 1; j++) { newarr[i][j] = factor * (oldarr[i - 1][j] + oldarr[i + 1][j] + oldarr[i][j - 1] + oldarr[i][j + 1]); lnorm = fmaxf(lnorm, fabsf(newarr[i][j] - oldarr[i][j])); } } *norm = lnorm; } else { /* TODO: Implement computation with OpenACC on device */ for (i = 1; i < nx + 1; i++) { for (j = 1; j < ny + 1; j++) { newarr[i][j] = factor * (oldarr[i - 1][j] + oldarr[i + 1][j] + oldarr[i][j - 1] + oldarr[i][j + 1]); } } } } void usage(pname) { printf("Usage: %s [nx] [ny]", pname); } int main(int argc, char **argv) { float eps; float **u, ** unew; float norm = 0e0, mlups = 0e0; int maxiter, nx, ny, iter, ndef = 2400; clock_t t_start, t_end; float dt; eps = 0.5e-3; maxiter = (int)(1e0 / eps); switch (argc) { case 1: nx = ndef; ny = nx; break; case 2: nx = atoi(argv[1]); ny = nx; break; case 3: nx = atoi(argv[1]); ny = atoi(argv[2]); break; default: usage(argv[0]); return -1; } printf("Stencil: nx,ny,maxiter,eps=%d %d %d %18.16f\n", nx, ny, maxiter, eps); u = malloc_2d(nx + 2, ny + 2); unew = malloc_2d(nx + 2, ny + 2); /* TODO: Initialize data region on device */ init(u, nx, ny); init(unew, nx, ny); t_start = clock(); norm = eps + 1; iter = 0; while (iter <= maxiter && norm >= eps) { update(unew, u, NULL, nx, ny); update(u, unew, &norm, nx, ny); iter = iter + 2; if (iter % 100 == 0 || norm < eps) { printf(": norm, eps= %18.16f %18.16f\n", norm, eps); } } free_2d(u); free_2d(unew); mlups = 1.0e-6 * iter * nx * ny; t_end = clock(); dt = ((float)(t_end - t_start)) / CLOCKS_PER_SEC; printf("'Stencil: norm =%18.16f with iter = %d\n", norm, iter); printf("'Stencil: Time =%18.16f sec, MLups/s=%18.16f\n", dt, (float) mlups / dt); return 0; }
// // SimpleNetwork.h // SimpleNetwork // // Created by hanbing on 15/3/3. // Copyright (c) 2015年 fly. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for SimpleNetwork. FOUNDATION_EXPORT double SimpleNetworkVersionNumber; //! Project version string for SimpleNetwork. FOUNDATION_EXPORT const unsigned char SimpleNetworkVersionString[];
/*@self.public()*/ /** @file Compatibility header for `aligned_alloc`. */ #if !defined CAL_ALIGNED_ALLOC_DEFINED # error "must not include end header without matching begin" #elif CAL_ALIGNED_ALLOC_DEFINED # undef aligned_alloc #endif #undef CAL_ALIGNAS_DEFINED
#ifndef __BINARY_JSON__ #define __BINARY_JSON__ #include <XeCore/Common/Buffer.h> #include <json/json.h> namespace BinaryJson { typedef XeCore::Common::ByteBuffer Buffer; bool jsonToBinary( Json::Value& root, Buffer* buff, dword keyhash = 0, bool dontClearBuffer = false ); bool binaryToJson( Buffer* buff, Json::Value& root, dword keyhash = 0 ); } #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class MPVolumeView, NSMutableDictionary, NSNumberFormatter, NSString, NSTimer, QLArchiveViewer, QLPreviewItemsSource, UIBarButtonItem, UIDocumentInteractionController, UILabel, UINavigationController, UIView, UIViewController<QLPreviewContentControllerProtocol>, _UIAsyncInvocation; // Not exported @interface QLPreviewControllerReserved : NSObject { id <QLPreviewItem> previewItem; id delegate; _Bool blockRemoteImages; _Bool useCustomActionButton; _Bool showActionAsDefaultButton; NSString *loadingTextForMissingFiles; int mode; QLPreviewItemsSource *itemsSource; UIViewController<QLPreviewContentControllerProtocol> *previewContentController; _UIAsyncInvocation *cancelViewServiceRequest; NSTimer *timeoutTimer; id readyBlock; long long previousToolbarStyle; _Bool previousToolbarWasTranslucent; _Bool previousNavBarWasTranslucent; long long previousStatusBarStyle; UINavigationController *navigationController; int overlayState; UIBarButtonItem *archiveItem; UIBarButtonItem *listItem; UIBarButtonItem *titleItem; UIBarButtonItem *actionItem; _Bool scrubbing; UIBarButtonItem *indexItem; UILabel *indexLabel; UIBarButtonItem *playPauseButton; UIBarButtonItem *routeButton; MPVolumeView *volumeView; MPVolumeView *volumeViewHidden; _Bool internalViewsLoaded; UIView *mainView; unsigned int statusBarWasHidden:1; unsigned int toolbarWasHidden:1; unsigned int isInUIDICPopover:1; NSNumberFormatter *indexFormatter; QLArchiveViewer *archiveViewer; UIDocumentInteractionController *interactionController; NSMutableDictionary *pdfPreviewDataCache; NSMutableDictionary *avStateForPreviewItems; _Bool sourceIsManaged; } - (void)dealloc; - (id)init; @end
#pragma once #include <cctype> #include <cstddef> namespace mlfe{ namespace cuda_kernel{ template <typename T> void broadcast( const T *x, T *y, int Nx, int Cx, int Hx, int Wx, int Ny, int Cy, int Hy, int Wy); template <typename T> void broadcast_gradient( const T *dy, T *dx, int Ny, int Cy, int Hy, int Wy, int Nx, int Cx, int Hx, int Wx); } // namespace cuda_kernel } // namespace mlfe
#pragma once #include "Assist/Common.h" #include "BL/DisplayCamera.h" class SceneObject; class Scene : public PropertyOwner { public: Scene(); DISABLE_COPY(Scene); ~Scene(); private: DisplayCamera* mDisplayCamera; Array<SceneObject*> mSceneObjects; };
// // AnnotatedImage+Create.h // DetectMe // // Created by Josep Marc Mingot Hidalgo on 11/10/13. // Copyright (c) 2013 Josep Marc Mingot Hidalgo. All rights reserved. // #import <CoreLocation/CoreLocation.h> #import <coreMotion/CoreMotion.h> #import "AnnotatedImage.h" #import "Detector.h" #import "Box.h" @interface AnnotatedImage (Create) + (AnnotatedImage *) annotatedImageWithImage:(UIImage *)image box:(Box *)box forLocation:(CLLocation *) location forMotion:(CMDeviceMotion *) motion forUser:(User *)currentUser inManagedObjectContext:(NSManagedObjectContext *)context; + (AnnotatedImage *) annotatedImageWithDictionaryInfo:(NSDictionary *)annotatedImageInfo inManagedObjectContext:(NSManagedObjectContext *)context forDetector:(Detector *)detector; - (Box *) boxForAnnotatedImage; - (void) setBox:(Box *) box; @end
#ifndef PIGEON_H_ #define PIGEON_H_ #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif #define PIGEON_ALIGNSIZE 4 #define PIGEON_LINESIZE 80 // Typedefs {{{ typedef void (*PortalEntryHandler)(void * target, char * message, char * response); typedef char * (*PigeonIn)(char * buffer, int maxSize); // getline typedef void (*PigeonOut)(const char * message); // puts typedef unsigned long (*PigeonMillis)(); // millis struct Pigeon; typedef struct Pigeon Pigeon; struct Portal; typedef struct Portal Portal; typedef struct PortalEntrySetup { char * key; PortalEntryHandler handler; void * handle; bool stream; bool onchange; bool manual; } PortalEntrySetup; // }}} // Methods {{{ void portalAdd(Portal*, PortalEntrySetup); void portalAddBatch(Portal*, PortalEntrySetup*); void portalSet( Portal*, const char * key, const char * message ); void portalGetStreamKeys(Portal*, char * destination); bool portalSetStreamKeys(Portal*, char * sequence); void portalUpdate(Portal*, const char * key); void portalFlush(Portal*); void portalReady(Portal*); void portalEnable(Portal*); void portalDisable(Portal*); Pigeon * pigeonInit(PigeonIn, PigeonOut, PigeonMillis); Portal * pigeonCreatePortal(Pigeon*, const char * id); void pigeonReady(Pigeon*); void portalFloatHandler(void * handle, char * message, char * response); void portalUintHandler(void * handle, char * message, char * response); void portalIntHandler(void * handle, char * message, char * response); void portalUlongHandler(void * handle, char * message, char * response); void portalBoolHandler(void * handle, char * message, char * response); void portalStreamKeyHandler(void * handle, char * message, char * response); // }}} // End C++ export structure #ifdef __cplusplus } #endif // End include guard #endif
#include "pi_SharedTypes_0.h" #include "GenericSharedDeclarations.h" #include "queue_SharedTypes_0.h" void pi_SharedTypes_0_mutexDestroy_3(pi_SharedTypes_0_FlaggedQueue_t* var) { pthread_mutex_destroy(&var->itemCount.mutex); queue_SharedTypes_0_mutexDestroy_2(&var->queue); pthread_mutex_destroy(&var->isFull.mutex); pthread_mutex_destroy(&var->isFinished.mutex); } void pi_SharedTypes_0_mutexInit_6(pi_SharedTypes_0_SharedOf_ArrayOf_SharedOf_FlaggedQueue_0_0_t* var) { pthread_mutex_init(&var->mutex,&GenericSharedDeclarations_mutexAttribute_0); pi_SharedTypes_0_mutexInit_5(((pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t*)(var->value)), 20); } void pi_SharedTypes_0_mutexInit_4(pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t* var) { pthread_mutex_init(&var->mutex,&GenericSharedDeclarations_mutexAttribute_0); pi_SharedTypes_0_mutexInit_3(&var->value); } void pi_SharedTypes_0_mutexInit_5(pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t* var, int32_t size_0) { for ( int32_t __i_1 = 0; __i_1 < size_0; __i_1++ ) { pi_SharedTypes_0_mutexInit_4(&var[__i_1]); } } void pi_SharedTypes_0_mutexDestroy_6(pi_SharedTypes_0_SharedOf_ArrayOf_SharedOf_FlaggedQueue_0_0_t* var) { pthread_mutex_destroy(&var->mutex); pi_SharedTypes_0_mutexDestroy_5(((pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t*)(var->value)), 20); } void pi_SharedTypes_0_mutexInit_3(pi_SharedTypes_0_FlaggedQueue_t* var) { pthread_mutex_init(&var->itemCount.mutex,&GenericSharedDeclarations_mutexAttribute_0); queue_SharedTypes_0_mutexInit_2(&var->queue); pthread_mutex_init(&var->isFull.mutex,&GenericSharedDeclarations_mutexAttribute_0); pthread_mutex_init(&var->isFinished.mutex,&GenericSharedDeclarations_mutexAttribute_0); } void pi_SharedTypes_0_mutexDestroy_5(pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t* var, int32_t size_0) { for ( int32_t __i_1 = 0; __i_1 < size_0; __i_1++ ) { pi_SharedTypes_0_mutexDestroy_4(&var[__i_1]); } } void pi_SharedTypes_0_mutexDestroy_4(pi_SharedTypes_0_SharedOf_FlaggedQueue_0_t* var) { pthread_mutex_destroy(&var->mutex); pi_SharedTypes_0_mutexDestroy_3(&var->value); }
// // RootViewController.h // NavigationControllerTransitions // // Created by Kirby Turner on 4/14/11. // Copyright 2011 White Peak Software Inc. All rights reserved. // #import <UIKit/UIKit.h> @interface RootViewController : UITableViewController { } @end
#pragma once #include "sprite.h" #include "timer.h" class Medal : public Sprite { public: static Texture image_; Medal(float x, float y); static void loadContent(Graphics &graphics); void update(std::chrono::milliseconds delta); void draw(Graphics &graphics); bool obtainable() { return !delay_time_.active(); } private: Timer delay_time_{std::chrono::milliseconds(300)}; };
/* Quinta questão da prova */ #include <stdio.h> #include <stdio.h> int main() { unsigned char entrada; printf("Entrada: "); scanf("%c", &entrada); printf("Dado: %X\n", entrada); // Limpar 3 algarismos menos significativos entrada = entrada & 0xF8; // 1111 1000 // Inverter o mais significativo entrada = entrada ^ 0x8F; // 0111 1111 printf("Saída: 0x%X\n", saida); return 0; }
#include "mex.h" #include <math.h> #include "float.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[]) { // // Usage // ----- // flag = same_diff(data,tolerance_multiplier) // // - data is assumed to be 1d (this could be verified ...) // // Computes whether or not all differences are the same // as the first difference // // all(diff(diffs) < 0.00001*diffs(1)) // // This function was written to verify evenly sampled time data. // // Improvements // ------------ // 1) parallel // 2) simd // // See Also // -------- // sl.array.similiarity.sameDiff double tolerance_multiplier = 0.00001; if (nrhs == 2){ if (!mxIsClass(prhs[1],"double")){ mexErrMsgIdAndTxt("SL:same_diff:call_error","The 2nd input must be a double"); } tolerance_multiplier = mxGetScalar(prhs[1]); }else if (nrhs != 1){ mexErrMsgIdAndTxt("SL:same_diff:call_error","Invalid # of inputs, 1 or 2 expected"); } if (!mxIsClass(prhs[0],"double")){ mexErrMsgIdAndTxt("SL:same_diff:call_error","The input array must be of type double"); } if (!(nlhs == 1)){ mexErrMsgIdAndTxt("SL:same_diff:n_inputs","Invalid # of outputs, 1 expected"); } mwSize n_samples_data = mxGetNumberOfElements(prhs[0]); plhs[0] = mxCreateLogicalMatrix(1,1); mxLogical *pl = mxGetLogicals(plhs[0]); *pl = true; if (n_samples_data < 3){ return; } double *data = mxGetData(prhs[0]); double *p_start = data; double last_sample = *data; double current_sample = *(++data); double first_diff = current_sample - last_sample; //This needs to be initialized to enter the while loop double current_diff = first_diff; double MAX_DIFF_OF_DIFFS = tolerance_multiplier*fabs(first_diff); //sentinel block - don't need to worry about running past the end //since the last value will always be false double end_array_value = *(p_start+n_samples_data-1); *(p_start+n_samples_data-1) = mxGetNaN(); while (fabs(current_diff - first_diff) < MAX_DIFF_OF_DIFFS){ last_sample = current_sample; current_sample = *(++data); current_diff = current_sample - last_sample; } //Alternative approach, this allows for slow drifts over time // while (fabs(current_diff - last_diff) < MAX_DIFF){ // last_diff = current_diff; // last_sample = current_sample; // current_sample = *(++data); // current_diff = current_sample - last_sample; // } //Reset terminal value *(p_start+n_samples_data-1) = end_array_value; if (data == p_start+n_samples_data-1){ current_diff = end_array_value - last_sample; *pl = (fabs(current_diff - first_diff) < MAX_DIFF_OF_DIFFS); }else{ *pl = false; } }
/* * NodeTest.h * * Created on: Aug 11, 2008 * Author: yamokosk */ #ifndef NODETEST_H_ #define NODETEST_H_ // Logging #include <log4cxx/logger.h> // CppUnit #include <cppunit/extensions/HelperMacros.h> // Class to test #include "SceneNode.h" class NodeTest : public CppUnit::TestFixture { static log4cxx::LoggerPtr logger; CPPUNIT_TEST_SUITE( NodeTest ); CPPUNIT_TEST( testNumChildren ); CPPUNIT_TEST( testGetChildByIndex ); CPPUNIT_TEST( testGetChildByName ); CPPUNIT_TEST( testRemoveChildByIndex ); CPPUNIT_TEST( testRemoveChildByName ); CPPUNIT_TEST( testRemoveAllChildren ); CPPUNIT_TEST( testTranslateRelativeToLocal ); CPPUNIT_TEST( testTranslateRelativeToParent ); CPPUNIT_TEST( testTranslateRelativeToWorld ); CPPUNIT_TEST( testRotateRelativeToLocal ); CPPUNIT_TEST( testRotateRelativeToParent ); CPPUNIT_TEST( testRotateRelativeToWorld ); CPPUNIT_TEST( testProcessUpdates ); CPPUNIT_TEST_EXCEPTION( testAddChildWithParent, TinySG::InvalidParametersException ); CPPUNIT_TEST_EXCEPTION( testAddChildWithSameName, TinySG::ItemIdentityException ); CPPUNIT_TEST_EXCEPTION( testGetChildByBadIndex, TinySG::InvalidParametersException ); CPPUNIT_TEST_EXCEPTION( testGetChildByBadName, TinySG::ItemIdentityException ); CPPUNIT_TEST_EXCEPTION( testRemoveChildByBadIndex, TinySG::InvalidParametersException ); CPPUNIT_TEST_EXCEPTION( testRemoveChildByBadName, TinySG::ItemIdentityException ); CPPUNIT_TEST_SUITE_END(); protected: TinySG::SceneNode *n1, *n2, *n3, *n4, *n2_copy; //TinySG::NodeFactory fact; public: void setUp(); void tearDown(); protected: // Level 1 test cases void testNumChildren(); void testGetChildByIndex(); void testGetChildByName(); void testRemoveChildByIndex(); void testRemoveChildByName(); void testRemoveAllChildren(); void testTranslateRelativeToLocal(); void testTranslateRelativeToParent(); void testTranslateRelativeToWorld(); void testRotateRelativeToLocal(); void testRotateRelativeToParent(); void testRotateRelativeToWorld(); // Level 2 test cases void testProcessUpdates(); //void testChangeParentPose(); // Exception test cases void testAddChildWithParent(); void testAddChildWithSameName(); void testGetChildByBadIndex(); void testGetChildByBadName(); void testRemoveChildByBadIndex(); void testRemoveChildByBadName(); }; #endif /* NODETEST_H_ */
#ifndef RECTANGLE_H #define RECTANGLE_H #include "Polygon.h" class Rectangle : public Polygon { public: Rectangle(int width, int height); int getArea(); protected: private: }; #endif // RECTANGLE_H
#ifndef CtreCanNode_H_ #define CtreCanNode_H_ #include "ctre.h" //BIT Defines + Typedefs #include <pthread.h> #include <map> #include <string.h> // memcpy #include <sys/time.h> class CtreCanNode { public: CtreCanNode(UINT8 deviceNumber); ~CtreCanNode(); UINT8 GetDeviceNumber() { return _deviceNumber; } protected: template <typename T> class txTask{ public: uint32_t arbId; T * toSend; T * operator -> () { return toSend; } T & operator*() { return *toSend; } bool IsEmpty() { if(toSend == 0) return true; return false; } }; template <typename T> class recMsg{ public: uint32_t arbId; uint8_t bytes[8]; CTR_Code err; T * operator -> () { return (T *)bytes; } T & operator*() { return *(T *)bytes; } }; UINT8 _deviceNumber; void RegisterRx(uint32_t arbId); void RegisterTx(uint32_t arbId, uint32_t periodMs); CTR_Code GetRx(uint32_t arbId,uint8_t * dataBytes,uint32_t timeoutMs); void FlushTx(uint32_t arbId); template<typename T> txTask<T> GetTx(uint32_t arbId) { txTask<T> retval = {0}; txJobs_t::iterator i = _txJobs.find(arbId); if(i != _txJobs.end()){ retval.arbId = i->second.arbId; retval.toSend = (T*)i->second.toSend; } return retval; } template<class T> void FlushTx(T & par) { FlushTx(par.arbId); } template<class T> recMsg<T> GetRx(uint32_t arbId, uint32_t timeoutMs) { recMsg<T> retval; retval.err = GetRx(arbId,retval.bytes, timeoutMs); return retval; } private: class txJob_t { public: uint32_t arbId; uint8_t toSend[8]; uint32_t periodMs; }; class rxEvent_t{ public: uint8_t bytes[8]; struct timespec time; rxEvent_t() { bytes[0] = 0; bytes[1] = 0; bytes[2] = 0; bytes[3] = 0; bytes[4] = 0; bytes[5] = 0; bytes[6] = 0; bytes[7] = 0; } }; typedef std::map<uint32_t,txJob_t> txJobs_t; txJobs_t _txJobs; typedef std::map<uint32_t,rxEvent_t> rxRxEvents_t; rxRxEvents_t _rxRxEvents; }; #endif
/* FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS tutorial books are available in pdf and paperback. * * Complete, revised, and edited pdf reference manuals are also * * available. * * * * Purchasing FreeRTOS documentation will not only help you, by * * ensuring you get running as quickly as possible and with an * * in-depth knowledge of how to use FreeRTOS, it will also help * * the FreeRTOS project to continue with its mission of providing * * professional grade, cross platform, de facto standard solutions * * for microcontrollers - completely free of charge! * * * * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * * * * Thank you for using FreeRTOS, and thank you for your support! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation AND MODIFIED BY the FreeRTOS exception. >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to distribute a combined work that includes FreeRTOS without being obliged to provide the source code for proprietary components outside of the FreeRTOS kernel. FreeRTOS 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 and the FreeRTOS license exception along with FreeRTOS; if not itcan be viewed here: http://www.freertos.org/a00114.html and also obtained by writing to Real Time Engineers Ltd., contact details for whom are available on the FreeRTOS WEB site. 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, and our new fully thread aware and reentrant UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell the code with commercial support, indemnification and middleware, under the OpenRTOS brand. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. */ #include "FreeRTOS.h" /*-----------------------------------------------------------*/ /* Called by the startup code to initialise the run time system. */ unsigned portCHAR __low_level_init(void); /*-----------------------------------------------------------*/ unsigned portCHAR __low_level_init(void) { unsigned portCHAR resetflag = RESF; unsigned portCHAR psval = 0; unsigned portBASE_TYPE i = 0; /* Setup provided by NEC. */ portDISABLE_INTERRUPTS(); /* disable global interrupts */ PRCMD = 0x00; /* On-chip debug mode */ OCDM = 0x00; VSWC = 0x00; /* set system wait control register */ WDTM2 = 0x00; /* WDT2 setting */ PLLON = 0; /* PLL stop mode */ psval = 0x0A | 0x00; PRCMD = psval; /* set Command Register */ CKC = psval; /* set Clock Control Register */ PLLS = 0x03; psval = 0x80; /* Set fXX and fCPU */ PRCMD = psval; PCC = psval; PLLON = 1; /* activate PLL */ for( i = 0; i <= 2000; i++ ) /* Wait for stabilisation */ { portNOP(); } while( LOCK ) /* Wait for PLL frequency stabiliasation */ { ; } SELPLL = 1; /* Set PLL mode active */ RSTOP = 0; /* Set fR (enable) */ BGCE0 = 0; /* Set fBRG(disable) */ psval = 0x00; /* Stand-by setting */ PRCMD = psval; /* set Command Register */ PSC = psval; /* set Power Save Control Register */ return pdTRUE; } /*-----------------------------------------------------------*/
#ifndef ossimPlanetStandardTextureLayerFactory_HEADER #define ossimPlanetStandardTextureLayerFactory_HEADER #include <ossimPlanet/ossimPlanetTextureLayerFactory.h> #include <ossim/base/ossimFilename.h> #include <ossim/base/ossimKeywordlist.h> #include <ossimPlanet/ossimPlanetExport.h> #include <mutex> class OSSIMPLANET_DLL ossimPlanetStandardTextureLayerFactory : public ossimPlanetTextureLayerFactory { public: ossimPlanetStandardTextureLayerFactory(); static ossimPlanetStandardTextureLayerFactory* instance(); virtual osg::ref_ptr<ossimPlanetTextureLayer> createLayer(const ossimString& name, bool openAllEntriesFlag)const; protected: ossimPlanetStandardTextureLayerFactory(const ossimPlanetStandardTextureLayerFactory& src):ossimPlanetTextureLayerFactory(src) { } const ossimPlanetStandardTextureLayerFactory& operator =(const ossimPlanetStandardTextureLayerFactory& ) { return *this;} osg::ref_ptr<ossimPlanetTextureLayer> createLayerFromFilename(const ossimFilename& name, bool openAllEntriesFlag)const; osg::ref_ptr<ossimPlanetTextureLayer> createLayerFromKwl(const ossimKeywordlist& kwl, const ossimString& prefix=ossimString())const; osg::ref_ptr<ossimPlanetTextureLayer> createLayerFromOldKwl(const ossimKeywordlist& kwl, const ossimString& prefix=ossimString())const; static ossimPlanetStandardTextureLayerFactory* theInstance; mutable std::recursive_mutex theMutex; }; #endif
// // Created by erik on 10/2/16. // #ifndef SOI_DIMENSIONS_H_H #define SOI_DIMENSIONS_H_H #include <ratio> #include <iosfwd> namespace std { template<class O, intmax_t N, intmax_t D> basic_ostream<O>& operator<<( basic_ostream<O>& stream, ratio<N, D> ratio ); } namespace spatacs { namespace physics { namespace dimensions { template<class T> struct DimBase { }; template<class LengthDim, class TimeDim, class MassDim> struct Dimension_t : public DimBase<Dimension_t<LengthDim, TimeDim, MassDim>> { using length = LengthDim; using time = TimeDim; using mass = MassDim; }; using Zero = std::ratio<0, 1>; using One = std::ratio<1, 1>; // calculation with dimensions template<class D1, class D2, template<class, class> class OP> struct OperationDim { using new_len = OP<typename D1::length, typename D2::length>; using new_time = OP<typename D1::time, typename D2::time>; using new_mass = OP<typename D1::mass, typename D2::mass>; using type = Dimension_t<new_len, new_time, new_mass>; }; template<class A, class B> using mul_t = typename OperationDim<A, B, std::ratio_add>::type; template<class A, class B> using div_t = typename OperationDim<A, B, std::ratio_subtract>::type; template<class A, int P, int Q> using pow_t = typename OperationDim<A, Dimension_t<std::ratio<P, Q>, std::ratio<P, Q>, std::ratio<P, Q>>, std::ratio_multiply>::type; template<class T, class U> constexpr bool dimensions_equal() { return std::ratio_equal<typename T::length, typename U::length>::value && std::ratio_equal<typename T::time, typename U::time>::value && std::ratio_equal<typename T::mass, typename U::mass>::value; } // pre defined useful dimensions using dimless_t = Dimension_t<Zero, Zero, Zero>; using length_t = Dimension_t<One, Zero, Zero>; using time_t = Dimension_t<Zero, One, Zero>; using mass_t = Dimension_t<Zero, Zero, One>; template<class T> using rate_dim_t = div_t<T, time_t>; template<class T> using inverse_dim_t = div_t<dimless_t, T>; using velocity_t = rate_dim_t<length_t>; using impulse_t = mul_t<velocity_t, mass_t>; using acceleration_t = rate_dim_t<velocity_t>; using force_t = mul_t<acceleration_t, mass_t>; using area_t = mul_t<length_t, length_t>; using energy_t = mul_t<force_t, length_t>; using power_t = rate_dim_t<energy_t>; template<class O> struct unit_symbols; template<> struct unit_symbols<char> { constexpr static const char* m = "m"; constexpr static const char* kg = "kg"; constexpr static const char* sec = "s"; constexpr static const char* exp = "^"; constexpr static const char* div = "/"; constexpr static const char* sqr = "²"; }; template<> struct unit_symbols<wchar_t> { constexpr static const wchar_t* m = L"m"; constexpr static const wchar_t* kg = L"kg"; constexpr static const wchar_t* sec = L"s"; constexpr static const wchar_t* exp = L"^"; constexpr static const wchar_t* div = L"/"; constexpr static const wchar_t* sqr = L"²"; }; template<class O, class R> void output_dimension(std::basic_ostream<O>& stream, const O* symbol, R&& r) { if(std::ratio_equal<R, Zero>::value) { return; } stream << symbol; if (std::ratio_equal<R, One>::value) { return; } /* if (std::ratio_equal<R, std::ratio<2, 1>>::value) { stream << unit_symbols<O>::sqr; return; } */ stream << unit_symbols<O>::exp << r; } template<class O, class T> std::basic_ostream<O>& operator<<( std::basic_ostream<O>& stream, DimBase<T> d ) { using len_t = typename T::length; using mass_t = typename T::mass; using time_t = typename T::time; output_dimension(stream, unit_symbols<O>::kg, mass_t{}); output_dimension(stream, unit_symbols<O>::m, len_t{}); output_dimension(stream, unit_symbols<O>::sec, time_t{}); return stream; } } } } template<class O, intmax_t N, intmax_t D> std::basic_ostream<O>& std::operator<<( std::basic_ostream<O>& stream, std::ratio<N, D> ratio ) { using ratio_t = std::ratio<N, D>; if( ratio_t::den != 1 ) { return stream << ratio_t::num << spatacs::physics::dimensions::unit_symbols<O>::div << ratio_t::den; }else { return stream << ratio_t::num; } }; #endif //SOI_DIMENSIONS_H_H
#ifndef REVOLC_GLOBAL_MODULE_H #define REVOLC_GLOBAL_MODULE_H #include "build.h" #include "core/dll.h" #include "core/cson.h" #include "global/cfg.h" #include "resources/resource.h" struct World; typedef void (*InitModuleImpl)(); typedef void (*DeinitModuleImpl)(); typedef void (*WorldGenModuleImpl)(struct World*); typedef void (*UpdModuleImpl)(); typedef struct Module { Resource res; char extless_file[MAX_PATH_SIZE]; char rel_extless_file[MAX_PATH_SIZE]; char tmp_file[MAX_PATH_SIZE]; bool is_main_prog_module; // If true, dll == g_main_program_dll DllHandle dll; char worldgen_func_name[MAX_FUNC_NAME_SIZE]; char init_func_name[MAX_FUNC_NAME_SIZE]; char deinit_func_name[MAX_FUNC_NAME_SIZE]; char upd_func_name[MAX_FUNC_NAME_SIZE]; InitModuleImpl init; // Called during resource load DeinitModuleImpl deinit; WorldGenModuleImpl worldgen; UpdModuleImpl upd; } PACKED Module; // Call module init/deinit for all modules. // Must be separated from res init because module init is after // subsystem init, which is after resource init. REVOLC_API void init_for_modules(); REVOLC_API void deinit_for_modules(); REVOLC_API void worldgen_for_modules(World *w); REVOLC_API void upd_for_modules(); // Module _resource_ init/deinit REVOLC_API void init_module(Module *mod); REVOLC_API void deinit_module(Module *mod); REVOLC_API WARN_UNUSED Module *blobify_module(struct WArchive *ar, Cson c, bool *err); REVOLC_API void deblobify_module(WCson *c, struct RArchive *ar); #endif // REVOLC_GLOBAL_MODULE_H
#ifndef MEMBERSHIP_MANAGEMENT_H_INCLUDED #define MEMBERSHIP_MANAGEMENT_H_INCLUDED #include "buses_management.h" #include "depots_management.h" #include "messages.h" #include "extracting.h" void assign_to(char*, int); void assign_structs_to(Depot*, Bus*); void remove_assignment_from(char*, int); void remove_assignment_structs_from(Depot*, Bus*); void move_to(char*, int, char*); #endif /* MEMBERSHIP_MANAGEMENT_H_INCLUDED */
//****************************************************************************************** // Anubis Editor 1.0 - A 3D Adventure Game Engine. // Copyright (C) 2006-2007 Gorka Suárez García // // 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //****************************************************************************************** #ifndef _ANUBIS_COLOR_H_ #define _ANUBIS_COLOR_H_ //****************************************************************************************** // Includes. //****************************************************************************************** #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <gl/gl.h> //****************************************************************************************** // Funciones auxiliares para la conversión de los colores. //****************************************************************************************** inline GLfloat ColorIntToFloat (int value) { return ((float) value) / 255.0f; } //------------------------------------------------------------------------------------------ inline int ColorFloatToInt (GLfloat value) { return (int) (value * 255.0f); } //****************************************************************************************** #endif //****************************************************************************************** // color.h //******************************************************************************************
/* * $QNXLicenseC: * Copyright 2008, QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software 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 OF ANY KIND, either express or implied. * * This file may contain contributions from others, either as * contributors under the License or as licensors under other terms. * Please review this entire file for other proprietary rights or license * notices, as well as the QNX Development Suite License Guide at * http://licensing.qnx.com/license-guide/ for other information. * $ */ #include "startup.h" #include <arm/sa1100.h> unsigned long rtc_time_sa1100(unsigned rttr) { unsigned tmp; hwi_add_device(HWI_ITEM_BUS_UNKNOWN, HWI_ITEM_DEVCLASS_RTC, "sa1100", 0); /* * FIXME: disable the RTC and 1HZ interrupts? * According to the manual, these are undefined on reset */ out32(SA1100_RTC_BASE + SA1100_RTSR, 0); /* * Check if the IPL has set the RTTR. */ tmp = in32(SA1100_RTC_BASE + SA1100_RTTR); if (tmp == 0) { /* * RTTR is not set - the RTC has been clocked at 32.768KHz since * the reset, so the time read below is going to very wrong... */ if (rttr == 0) { /* * Set default value for perfect 32.768KHz crystal */ rttr = 0x7fff; } out32(SA1100_RTC_BASE + SA1100_RTTR, rttr); } /* * Read counter register */ return in32(SA1100_RTC_BASE + SA1100_RCNR); } __SRCVERSION( "$URL: http://svn/product/tags/restricted/bsp/nto650/ti-omap4430-panda/latest/src/hardware/startup/lib/arm/hw_rtc_sa1100.c $ $Rev: 655042 $" );
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "WXPBGeneratedMessage.h" @interface DelFavItemRsp : WXPBGeneratedMessage { } + (void)initialize; // Remaining properties @property(nonatomic) unsigned int favId; // @dynamic favId; @property(nonatomic) int ret; // @dynamic ret; @end
/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2009-2012, Willow Garage, Inc. * Copyright (c) 2012-, Open Perception, 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 copyright holder(s) 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 PCL_IO_OPENNI2_FRAME_LISTENER_H_ #define PCL_IO_OPENNI2_FRAME_LISTENER_H_ #include <boost/function.hpp> #include <openni2/OpenNI.h> namespace pcl { namespace io { namespace openni2 { typedef boost::function<void(openni::VideoStream& stream)> StreamCallbackFunction; /* Each NewFrameListener may only listen to one VideoStream at a time. **/ class OpenNI2FrameListener : public openni::VideoStream::NewFrameListener { public: OpenNI2FrameListener () : callback_(0) {} OpenNI2FrameListener (StreamCallbackFunction cb) : callback_(cb) {} virtual ~OpenNI2FrameListener () { }; inline void onNewFrame (openni::VideoStream& stream) { if (callback_) callback_(stream); } void setCallback (StreamCallbackFunction cb) { callback_ = cb; } private: StreamCallbackFunction callback_; }; } // namespace } } #endif // PCL_IO_OPENNI2_FRAME_LISTENER_H_
/* ---------------------------------------------------------------------------- ** Copyright (c) 2016 Austin Brunkhorst, All Rights Reserved. ** ** Destructor.h ** --------------------------------------------------------------------------*/ #pragma once #include "Invokable.h" #include "DestructorInvoker.h" namespace ursine { namespace meta { class Destructor : public Invokable { public: Destructor(void); Destructor(Type classType, DestructorInvokerBase *invoker); static const Destructor &Invalid(void); Type GetClassType(void) const; bool IsValid(void) const; void Invoke(Variant &instance) const; private: Type m_classType; std::shared_ptr<DestructorInvokerBase> m_invoker; }; } }
/*MIT License Copyright (c) 2018 MTA SZTAKI 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.*/ #ifndef APE_OGREPOINTCLOUD_H #define APE_OGREPOINTCLOUD_H #include <iostream> #include "Ogre.h" #include "apeINode.h" namespace ape { class OgrePointCloud { public: OgrePointCloud(const std::string& name, const std::string& resourcegroup, const int numpoints, float *parray, float *carray, float boundigSphereRadius, ape::NodeWeakPtr headNode, ape::NodeWeakPtr pointCloudNode, float pointSize, bool pointScale, float pointScaleOffset, float unitScaleDistance, float scaleFactor); void updateVertexPositions(int size, float *points); void updateVertexColours(int size, float *colours); virtual ~OgrePointCloud(); private: int mSize; Ogre::MeshPtr mMesh; Ogre::SubMesh* mSubMesh; Ogre::MaterialPtr mMaterial; ape::NodeWeakPtr mHeadNode; ape::NodeWeakPtr mPointCloudNode; float mPointSize; bool mPointScale; float mPointScaleOffset; float mUnitScaleDistance; float mScaleFactor; Ogre::HardwareVertexBufferSharedPtr mVbuf; Ogre::HardwareVertexBufferSharedPtr mCbuf; Ogre::RenderSystem* mRenderSystemForVertex; }; } #endif
#ifndef TYPETOSTR_H #define TYPETOSTR_H #include <string> #include <typeinfo> #include <stdio.h> #include <sstream> // just for testing purposes template<typename F> std::string typetostr() { //cout << (string("echo ")+typeid(F).name()+"c++filt -t").c_str() << endl; FILE *pipe = popen((std::string("echo ")+typeid(F).name()+" | c++filt -t").c_str(),"r"); char buf[200]; std::ostringstream ss; while(!feof(pipe)) { if (fgets(buf,199,pipe)!=NULL) { int i; for(i=0;i<199 && buf[i] && buf[i]!='\n' && buf[i]!='\r';i++) ; if (i<199) buf[i] = 0; ss << buf; } } pclose(pipe); return ss.str(); } #endif