text
stringlengths
4
6.14k
#ifndef REGION_LAYER_H #define REGION_LAYER_H #include "layer.h" #include "network.h" typedef layer region_layer; region_layer make_region_layer(int batch, int h, int w, int n, int classes, int coords); void forward_region_layer(const region_layer l, network_state state); void backward_region_layer(const region_layer l, network_state state); #ifdef GPU void forward_region_layer_gpu(const region_layer l, network_state state); void backward_region_layer_gpu(region_layer l, network_state state); #endif #endif
#include "image_functions.h" int main( int argc, char** argv ) { FILE* infile; Image pic1, pic2, pic3; if( argc < 6 ) { printf("Please enter all arguments."); exit(0); } infile = open_file( argv[1] ); pic1 = read_in( infile ); infile = open_file( argv[2] ); pic2 = read_in( infile ); fclose( infile ); pic3 = make_one( &pic1, &pic2, atoi(argv[4]), atoi(argv[5]) ); write_file( &pic3, argv[3] ); close_image( &pic1 ); close_image( &pic2 ); close_image( &pic3 ); return 0; }
/* ** svn $Id: npzd_Powell_wrt.h 2328 2014-01-23 20:16:18Z arango $ *************************************************** Hernan G. Arango *** ** Copyright (c) 2002-2014 The ROMS/TOMS Group ** ** Licensed under a MIT/X style license ** ** See License_ROMS.txt ** ************************************************************************ ** ** ** Writes Powell et al. (2006) ecosystem model input parameters into ** ** output NetCDF files. It is included in routine "wrt_info.F". ** ** ** ************************************************************************ */ ! ! Write out NPZD (Powell et al., 2006) biological model parameters. ! CALL netcdf_put_ivar (ng, model, ncname, 'BioIter', & & BioIter(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'AttSW', & & AttSW(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'AttPhy', & & AttPhy(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'PhyIS', & & PhyIS(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'Vm_NO3', & & Vm_NO3(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'PhyMRD', & & PhyMRD(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'PhyMRN', & & PhyMRN(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'K_NO3', & & K_NO3(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'Ivlev', & & Ivlev(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'ZooGR', & & ZooGR(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'ZooEED', & & ZooEED(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'ZooEEN', & & ZooEEN(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'ZooMRD', & & ZooMRD(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'ZooMRN', & & ZooMRN(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'DetRR', & & DetRR(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'wPhy', & & wPhy(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN CALL netcdf_put_fvar (ng, model, ncname, 'wDet', & & wDet(ng), (/0/), (/0/), & & ncid = ncid) IF (exit_flag.ne.NoError) RETURN
#pragma once #include "Assist/Common.h" #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> class WindowManager { public: DECLARE_SINGLETON_HEADER(WindowManager); private: static LRESULT CALLBACK WndProcCallback(HWND, UINT, WPARAM, LPARAM); public: void initWindow(unsigned int screenWidth, unsigned int screenHeight); void shutdownWindow(); // Process window messages. Returns false if the normal execution of the // program should be interrupted (quit, destroy, etc.) bool processMessages(); HWND getMainWindowHandle() const { return mMainWindowHandle; } private: WindowManager(); ~WindowManager(); private: LPCTSTR mApplicationName; HINSTANCE mInstanceHandle; HWND mMainWindowHandle; unsigned int mWindowWidth; unsigned int mWindowHeight; };
#ifndef CELL_H #define CELL_H #include "animal_list.h" #include <iostream> using namespace std; /** * @file cell.h * @author Harum Lokawati * @date March 2017 * @version VZ03 * * @brief the header file containing class declaration cell */ /** * @class Cell * @brief acstract class of Cell as a component of the zoo */ class Cell: public Renderable, public Location{ public: /** * @brief default construstor * construct Renderable and Location */ Cell(); /** * @brief construstor with parameter * construct Cell and set Location(x,y) */ Cell(int x, int y); /** * @brief pure virtual for name getter */ virtual char* GetName()=0; /** * @brief pure virtual for type getter */ virtual char* GetType()=0; }; #endif
// // YouTubeAuth.h // NGYoutubeUpload // // Created by Apple on 13/08/15. // Copyright (c) 2015 Apple. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "NGOauthViewController.h" typedef void (^YouTubeCompletion)(BOOL success, NSString *youTubeToken, NSString *youTubeRefreshToken); @interface NGYoutubeOAuth : NSObject <NSURLConnectionDelegate> @property(copy, nonatomic)YouTubeCompletion completion; @property (nonatomic, weak)NSString *youtubeClientID; @property (nonatomic, strong)NSString *youtubeClientSecret; @property (nonatomic, strong)NSString *youtubepublicAPIKey; @property (nonatomic, strong)NSString *uriCallBack; @property (nonatomic, strong)NSString *state; @property (nonatomic, strong)NSString *scope; @property (nonatomic, strong)NSString *youTubeAccessType; - (id) initWithClientId:(NSString *)clientID clientSecret:(NSString *) clientSecret; - (void) uploadVideo:(NSData *) videoData; @end
/* * ISR_UART.h * * Created on: 20 Aug 2015 * Author: Steve */ #ifndef SOURCES_HAL_ISR_UART_H_ #define SOURCES_HAL_ISR_UART_H_ void UART_ISR_CPP(); #ifdef __cplusplus extern "C" void UART_ISR(); #endif #endif /* SOURCES_HAL_ISR_UART_H_ */
// // FlickrClient.h // FlickrClient // // Created by Chris Schwartz on 5/15/16. // Copyright © 2016 SwiftSmarts. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for FlickrClient. FOUNDATION_EXPORT double FlickrClientVersionNumber; //! Project version string for FlickrClient. FOUNDATION_EXPORT const unsigned char FlickrClientVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <FlickrClient/PublicHeader.h>
#pragma once /* BFS3 Algorithm implementation * * Reference: * Learning is planning: near Bayes-optimal reinforcement learning via Monte-Carlo tree search * John Asmuth, Michael Littman * UAI 2011 * */ class SIMULATOR; class SamplerFactory; class VNODE3; class QNODE3; typedef unsigned int uint; class BFS3 { public: struct PARAMS { PARAMS(); int Verbose; uint D; uint C; uint N; double gamma; double Vmin; double Vmax; }; BFS3(const SIMULATOR& simulator, const PARAMS& params, SamplerFactory& sampFact); ~BFS3(); inline double getReward(uint,uint,uint); uint SelectAction(uint current_state); bool Update(uint state, uint action, uint observation, double reward); void bellmanBackup(VNODE3* vnode, int action, uint s); private: double FSSS(uint prev_state,uint a, uint start_state); void FSSSRollout(VNODE3*& vnode, uint state, uint depth); VNODE3* ExpandNode(uint state); void getQNodeValue(QNODE3& qnode, double& Usa, double& Lsa, uint ss,uint aa); uint* counts; uint* pcounts; //Cached values uint S,A,SA,SAS; PARAMS Params; VNODE3* Root; const SIMULATOR& Simulator; SamplerFactory& SampFact; int TreeDepth, PeakTreeDepth; };
#ifndef _GLFW3EXT_H_ #define _GLFW3EXT_H_ #include "glfw3.h" #ifndef GLFW_EXPOSE_NATIVE_WIN32 #define GLFW_EXPOSE_NATIVE_WIN32 #endif #ifndef GLFW_EXPOSE_NATIVE_WGL #define GLFW_EXPOSE_NATIVE_WGL #endif #include "glfw3native.h" #ifdef __cplusplus extern "C" { #endif #ifndef GLFW_ALPHA_MASK #define GLFW_ALPHA_MASK 0x00021011 #endif /*! @brief The function signature for mouse button callbacks extension. * @Added by xseekerj * * This is the function signature for mouse button callback functions. * * @param[in] window The window that received the event. * @param[in] button The [mouse button](@ref buttons) that was pressed or * released. * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @param[in] cursor X * @param[in] cursor Y * * @sa glfwSetMouseButtonCallback * * @ingroup input */ typedef void(*GLFWXmousebuttonfun)(GLFWwindow*, int, int, int, double, double); typedef GLboolean(*GLFWXloadImagefun)(void** ppvImage); typedef void(*GLFWXunloadImagefun)(void* pvImage); typedef void(*GLFWXdrawImagefun)(HDC hdc, void* pvImage); GLFWAPI int glfwxInit(void); GLFWAPI void glfwxTerminate(void); GLFWAPI void glfwxSetParent(HWND hwndParent); /*! @brief Sets the mouse button callback. * @Added by xseekerj * This function sets the mouse button callback of the specified window, which * is called when a mouse button is pressed or released. * * When a window loses focus, it will generate synthetic mouse button release * events for all pressed mouse buttons. You can tell these events from * user-generated events by the fact that the synthetic ones are generated * after the window has lost focus, i.e. `GLFW_FOCUSED` will be false and the * focus callback will have already been called. * * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or an * error occurred. * * @ingroup input */ GLFWAPI GLFWXmousebuttonfun glfwxSetMouseButtonCallback(GLFWwindow* window, GLFWXmousebuttonfun cbfunEx); GLFWAPI void glfwxSetBackgroundDriver(GLFWXloadImagefun imageLoader, GLFWXdrawImagefun imageDrawer, GLFWXunloadImagefun imageUnloader); // TODO: rename function name #ifdef __cplusplus } #endif #endif
#pragma once #ifndef ENGINE_GRAPHICS_GRAPHICS_GLFW_H_ #define ENGINE_GRAPHICS_GRAPHICS_GLFW_H_ #include "graphics.h" #include <GLFW\glfw3.h> namespace engine { // Graphics subsystem implementation using GLFW. Renders graphics onscreen. class GraphicsGLFW : public Graphics { public: // Camera operations virtual void CameraMove(Point2Df position) override; // Primitive drawing virtual void Draw2DPoint(Point2Df point, float z, cRGBAf color) const override; virtual void Draw2DLine(Line2Df line, float z = 0.0f, cRGBAf color = cRGBAf()) const override; virtual void Draw2DRectangle(Rectangle2Df rectangle, float z = 0.0f, bool filled = false, cRGBAf color = cRGBAf()) const override; virtual void Draw2DCircle(Circle2Df circle, float z = 0.0f, bool filled = false, cRGBAf color = cRGBAf()) const override; static void GLFWErrorCallback(int error, const char* description); private: std::string GetName() const override { return "Graphics(GLFW)"; } virtual EngineSubsystem* Initialize() override; virtual void Terminate() override; virtual void Update() override; virtual void Draw() override; GLFWwindow* window; }; } // namespace #endif // ENGINE_GRAPHICS_GRAPHICS_GLFW_H_
/* $Id: hello.c,v 1.1 2011-03-24 17:25:20-07 - - $ */ int main (void) { printf ("Hello, world\n"); return 0; }
/* * rt_look.c * * Real-Time Workshop code generation for Simulink model "LgV2.mdl". * * Model Version : 1.30 * Real-Time Workshop version : 7.3 (R2009a) 15-Jan-2009 * C source code generated on : Mon Mar 17 14:01:41 2014 * * Target selection: nidll_vxworks.tlc * Note: GRT includes extra infrastructure and instrumentation for prototyping * Embedded hardware selection: 32-bit Generic * Code generation objectives: Unspecified * Validation result: Not run * */ #include "rt_look.h" /* Function: rt_GetLookupIndex ================================================ * Abstract: * Routine to get the index of the input from a table using binary or * interpolation search. * * Inputs: * *x : Pointer to table, x[0] ....x[xlen-1] * xlen : Number of values in xtable * u : input value to look up * * Output: * idx : the index into the table such that: * if u is negative * x[idx] <= u < x[idx+1] * else * x[idx] < u <= x[idx+1] * * Interpolation Search: If the table contains a large number of nearly * uniformly spaced entries, i.e., x[n] vs n is linear then the index * corresponding to the input can be found in one shot using the linear * interpolation formula. Therefore if you have a look-up table block with * many data points, using interpolation search might speed up the code. * Compile the generated code with the following flag: * * make_rtw OPTS=-DDOINTERPSEARCH * * to enable interpolation search. */ int_T rt_GetLookupIndex(const real_T *x, int_T xlen, real_T u) { int_T idx = 0; int_T bottom = 0; int_T top = xlen-1; int_T retValue = 0; boolean_T returnStatus = 0U; #ifdef DOINTERPSEARCH real_T offset = 0; #endif /* * Deal with the extreme cases first: * if u <= x[bottom] then return idx = bottom * if u >= x[top] then return idx = top-1 */ if (u <= x[bottom]) { retValue = bottom; returnStatus = 1U; } else if (u >= x[top]) { retValue = top-1; returnStatus = 1U; } else { /* else required to ensure safe programming, even * * if it's expected that it will never be reached */ } if (returnStatus == 0U) { if (u < 0) { /* For negative input find index such that: x[idx] <= u < x[idx+1] */ for (;;) { #ifdef DOINTERPSEARCH offset = (u-x[bottom])/(x[top]-x[bottom]); idx = bottom + (int_T)((top-bottom)*(offset-DBL_EPSILON)); #else idx = (bottom + top)/2; #endif if (u < x[idx]) { top = idx - 1; } else if (u >= x[idx+1]) { bottom = idx + 1; } else { /* we have x[idx] <= u < x[idx+1], return idx */ retValue = idx; break; } } } else { /* For non-negative input find index such that: x[idx] < u <= x[idx+1] */ for (;;) { #ifdef DOINTERPSEARCH offset = (u-x[bottom])/(x[top]-x[bottom]); idx = bottom + (int_T)((top-bottom)*(offset-DBL_EPSILON)); #else idx = (bottom + top)/2; #endif if (u <= x[idx]) { top = idx - 1; } else if (u > x[idx+1]) { bottom = idx + 1; } else { /* we have x[idx] < u <= x[idx+1], return idx */ retValue = idx; break; } } } } return retValue; }
#ifndef SSF_V5_REPLY_AUTH_H_ #define SSF_V5_REPLY_AUTH_H_ #include <cstdint> #include <array> #include <boost/asio/write.hpp> #include <boost/asio/buffer.hpp> namespace ssf { namespace socks { namespace v5 { //----------------------------------------------------------------------------- class AuthReply { public: AuthReply(uint8_t authMethod); std::array<boost::asio::const_buffer, 2> Buffer() const; private: uint8_t version_; uint8_t authMethod_; }; //----------------------------------------------------------------------------- // S E N D R E P L Y //----------------------------------------------------------------------------- template<class VerifyHandler, class StreamSocket> void AsyncSendAuthReply(StreamSocket& c, const AuthReply& r, VerifyHandler handler) { boost::asio::async_write(c, r.Buffer(), handler); } //----------------------------------------------------------------------------- } // v5 } // socks } // ssf #endif // SSF_V5_REPLY_AUTH_H_
#ifndef __TORRENTSTREAM_H #define __TORRENTSTREAM_H namespace TorrentStream { namespace Bencode { enum class ObjectType { INTEGER = 0, BYTESTRING, LIST, DICTIONARY, }; class Object { public: virtual ObjectType GetType() = 0; virtual std::string ToString() = 0; virtual std::vector<char> Encode() = 0; }; template <typename T> struct TypeToEnum { }; class Integer : public Object { public: Integer(size_t value) : m_Value(value) {} Integer(const std::vector<std::shared_ptr<Token>>& stream); ObjectType GetType() { return ObjectType::INTEGER; } std::string ToString() { std::stringstream s; s << m_Value; return s.str(); } uint64_t GetValue() const { return m_Value; } std::vector<char> Encode() { auto encoded = xs("i%e", m_Value); return std::vector<char>(encoded.begin(), encoded.end()); } private: uint64_t m_Value = 0; }; class ByteString : public Object { public: ByteString(const std::vector<char>& bytes) : m_Bytes(bytes) {} ByteString(const std::vector<std::shared_ptr<Token>>& stream); ObjectType GetType() { return ObjectType::BYTESTRING; } std::string ToString() { if (m_Bytes.size() > 256) { return "ByteString too long"; } std::stringstream s; s << "\""; s << std::string(m_Bytes.data(), m_Bytes.size()); s << "\""; return s.str(); } const std::vector<char>& GetBytes() const { return m_Bytes; } std::vector<char> Encode() { auto len = xs("%:", m_Bytes.size()); std::vector<char> encoded; encoded.reserve(len.size() + m_Bytes.size()); for (auto c : len) { encoded.push_back(c); } for (auto c : m_Bytes) { encoded.push_back(c); } return encoded; } private: std::vector<char> m_Bytes; }; class List : public Object { public: List(const std::vector<std::shared_ptr<Token>>& stream); ObjectType GetType() { return ObjectType::LIST; } std::string ToString() { std::stringstream s; s << "[ "; for (auto i = 0u; i < m_Objects.size() - 1; i++) { s << m_Objects[i]->ToString() << ", "; } if (m_Objects.size() != 0) { s << m_Objects[m_Objects.size() - 1]->ToString(); } s << " ]"; return s.str(); } void Insert(std::shared_ptr<Object> object) { m_Objects.push_back(std::move(object)); } const std::vector<std::shared_ptr<Object>>& GetObjects() const { return m_Objects; } std::vector<char> Encode() { std::vector<char> encoded; encoded.push_back('l'); for (auto& obj : m_Objects) { auto encodedObj = obj->Encode(); for (auto c : encodedObj) { encoded.push_back(c); } } encoded.push_back('e'); return encoded; } private: std::vector<std::shared_ptr<Object>> m_Objects; }; class Dictionary : public Object { public: Dictionary(const std::vector<std::shared_ptr<Token>>& stream); ObjectType GetType() { return ObjectType::DICTIONARY; } std::string ToString(); const std::vector<std::pair<std::string, std::shared_ptr<Object>>>& GetKeys(); std::shared_ptr<Object> GetKey(const std::string& key); template <typename T> T* GetKey(const std::string& key) { for (auto& pair : m_Keys) { if (pair.first == key) { assert(pair.second->GetType() == TypeToEnum<T>::type); return (T*)pair.second.get(); } } return nullptr; } std::vector<char> Encode(); private: void Insert(const std::string& key, std::shared_ptr<Object> object); std::vector<std::pair<std::string, std::shared_ptr<Object>>> m_Keys; }; template <> struct TypeToEnum<Bencode::Integer> { static const Bencode::ObjectType type = Bencode::ObjectType::INTEGER; }; template <> struct TypeToEnum<Bencode::ByteString> { static const Bencode::ObjectType type = Bencode::ObjectType::BYTESTRING; }; template <> struct TypeToEnum<Bencode::List> { static const Bencode::ObjectType type = Bencode::ObjectType::LIST; }; template <> struct TypeToEnum<Bencode::Dictionary> { static const Bencode::ObjectType type = Bencode::ObjectType::DICTIONARY; }; } } #endif
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double RxEurekaVersionNumber; FOUNDATION_EXPORT const unsigned char RxEurekaVersionString[];
// This file was generated based on 'C:\ProgramData\Uno\Packages\Android\0.13.2\Android\Fallbacks\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_ANDROID_FALLBACKS_ANDROID_ANDROID_ANIMATION_ANIMATOR_H__ #define __APP_ANDROID_FALLBACKS_ANDROID_ANDROID_ANIMATION_ANIMATOR_H__ #include <app/Android.android.animation.Animator.h> #include <app/Android.Base.Wrappers.IJWrapper.h> #include <app/Uno.IDisposable.h> #include <Uno.h> namespace app { namespace Android { namespace Fallbacks { struct Android_android_animation_Animator; struct Android_android_animation_Animator__uType : ::app::Android::android::animation::Animator__uType { }; Android_android_animation_Animator__uType* Android_android_animation_Animator__typeof(); struct Android_android_animation_Animator : ::app::Android::android::animation::Animator { }; }}} #endif
// // PolygonSkybox.h // ChicioRayTracing // // Created by Fabrizio Duroni on 09/08/15. // Copyright © 2015 Fabrizio Duroni. All rights reserved. // @import Foundation; #import "Polygon.h" @class Vector3D; @class Point3D; /*! Subclass of polygon used when we render a SIDE of a CUBE WRAPPER for the scene, simulating a closed room (some sort of skybox but with a limit distance). Used to higlight soft shadow in some scenes. @attention We need ONE INSTANCE FOR EACH SIDE. The method that read the texture is common for all direction of ray (simply drop a component based on intersection point) */ @interface PolygonSkybox : Polygon /*! Texture coordinate data type. */ typedef NS_ENUM(NSInteger, PolygonSkyboxSideIdentifier) { Back, Bottom, Front, Left, Right, Top }; /// Side identifier. @property (nonatomic, assign) PolygonSkyboxSideIdentifier sideIdentifier; /*! Init a polygon skybox. @param polygonSkyboxSideIdentifier identifier of the side of the cube wrapper that the polygon represents. @param textureName name of the texture to be used. */ - (instancetype)initWithSideIdentifier:(PolygonSkyboxSideIdentifier)polygonSkyboxSideIdentifier TextureName:(NSString *)textureName; /*! Method used to read the texture data based on the coordinate of the intersection point. The Polygon sides are align with the axes so is easy to do the map: drop the coordinate to 0 and apply a conversion to texture coordinate system as a percentage of height/width. @param intersectionPoint the point of intersection @returns A Vector3D with rgb components of the texture texel. */ - (Vector3D *)readPolygonSkyboxTexture:(Point3D *)intersectionPoint; @end
/* * Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com> * Copyright (c) 2014 Intel Corporation. * * Based on SM130 library developed by Marc Boon <http://www.marcboon.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 <string> #include <mraa/aio.h> #include <mraa/gpio.h> #include <mraa/i2c.h> #include <unistd.h> #include <stdlib.h> #define SIZE_PAYLOAD 18 // maximum payload size of I2C packet #define SIZE_PACKET (SIZE_PAYLOAD + 2) // total I2C packet size, including length uint8_t and checksum #define HIGH 1 #define LOW 0 namespace upm { /** * @brief C++ API for SM130 RFID reader module * * This file defines the C++ interface for sm130 RFID library * * @defgroup sm130 libupm-sm130 * @ingroup sparkfun gpio rfid */ /** * @library sm130 * @sensor sm130 * @comname RFID module * @type rfid * @man sparkfun * @web https://www.sparkfun.com/products/10126 * @con gpio * * @brief C++ API for SM130 RFID reader module * * This file defines the C++ interface for sm130 RFID library * * @snippet sm130.cxx Interesting */ class SM130 { uint8_t m_Data[SIZE_PACKET]; //!< packet data char m_Version[8]; //!< version string uint8_t m_TagNumber[7]; //!< tag number as uint8_t array uint8_t m_TagLength; //!< length of tag number in uint8_ts (4 or 7) char m_TagString[15]; //!< tag number as hex string uint8_t m_TagType; //!< type of tag char errorCode; //!< error code from some commands uint8_t antennaPower; //!< antenna power level uint8_t m_LastCMD; //!< last sent command public: static const uint8_t MIFARE_ULTRALIGHT = 1; static const uint8_t MIFARE_1K = 2; static const uint8_t MIFARE_4K = 3; static const uint8_t CMD_RESET = 0x80; static const uint8_t CMD_VERSION = 0x81; static const uint8_t CMD_SEEK_TAG = 0x82; static const uint8_t CMD_SELECT_TAG = 0x83; static const uint8_t CMD_AUTHENTICATE = 0x85; static const uint8_t CMD_READ16 = 0x86; static const uint8_t CMD_READ_VALUE = 0x87; static const uint8_t CMD_WRITE16 = 0x89; static const uint8_t CMD_WRITE_VALUE = 0x8a; static const uint8_t CMD_WRITE4 = 0x8b; static const uint8_t CMD_WRITE_KEY = 0x8c; static const uint8_t CMD_INC_VALUE = 0x8d; static const uint8_t CMD_DEC_VALUE = 0x8e; static const uint8_t CMD_ANTENNA_POWER = 0x90; static const uint8_t CMD_READ_PORT = 0x91; static const uint8_t CMD_WRITE_PORT = 0x92; static const uint8_t CMD_HALT_TAG = 0x93; static const uint8_t CMD_SET_BAUD = 0x94; static const uint8_t CMD_SLEEP = 0x96; /** * Instanciates a SM130 object * * @param di data pin * @param dcki clock pin */ SM130 (int bus, int devAddr, int rst, int dready); /** * SM130 object destructor */ ~SM130 (); /** * Get the firmware version string. */ const char* getFirmwareVersion (); /** * Checks for availability of a valid response packet. * * This function should always be called and return true prior to using results * of a command. * * @returns true if a valid response packet is available */ uint8_t available (); /** * Returns the packet length, excluding checksum */ uint8_t getPacketLength () { return this->m_Data[0]; }; /** * Returns the last executed command */ uint8_t getCommand () { return this->m_Data[1]; }; /** * Return name of the component */ std::string name() { return m_name; } private: std::string m_name; mraa_gpio_context m_resetPinCtx; mraa_gpio_context m_dataReadyPinCtx; int m_i2cAddr; int m_bus; mraa_i2c_context m_i2Ctx; void arrayToHex (char *s, uint8_t array[], uint8_t len); char toHex (uint8_t b); uint16_t i2cRecievePacket (uint32_t len); mraa_result_t i2cTransmitPacket (uint32_t len); mraa_result_t sendCommand (uint8_t cmd); }; }
#ifndef __SFMLIGHT_H__ #define __SFMLIGHT_H__ #include <sfl/Light.h> #include <sfl/Object.h> #include <sfl/LightScene.h> #endif //__SFMLIGHT_H__
// Copyright (c) 2015 The Bitcredit Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCREDIT_HTTPRPC_H #define BITCREDIT_HTTPRPC_H #include <string> #include <map> class HTTPRequest; /** Start HTTP RPC subsystem. * Precondition; HTTP and RPC has been started. */ bool StartHTTPRPC(); /** Interrupt HTTP RPC subsystem. */ void InterruptHTTPRPC(); /** Stop HTTP RPC subsystem. * Precondition; HTTP and RPC has been stopped. */ void StopHTTPRPC(); /** Start HTTP REST subsystem. * Precondition; HTTP and RPC has been started. */ bool StartREST(); /** Interrupt RPC REST subsystem. */ void InterruptREST(); /** Stop HTTP REST subsystem. * Precondition; HTTP and RPC has been stopped. */ void StopREST(); #endif
/* * Copyright (c) 2012 Sander van der Burg * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include "test.h" int main(int argc, char *argv[]) { int status; IFF_Chunk *chunk = TEST_read("extension.TEST"); /* The given file should be invalid */ if(TEST_check(chunk)) status = 1; else status = 0; TEST_free(chunk); return status; }
#include "shared.h" #include <stdlib.h> tpl_node *msg_node_pack(int msgtype) { tpl_node *tn = tpl_map("i", &msgtype); tpl_pack(tn, 0); return tn; } //------------------------------------------------------------------------- tpl_node *msg_ac_node(struct msg_ac *msg) { tpl_node *tn = tpl_map(MSG_AC_FMT, &msg->buffer, &msg->filename, &msg->line, &msg->col); return tn; } void free_msg_ac(struct msg_ac *msg) { free(msg->buffer.addr); free(msg->filename); } //------------------------------------------------------------------------- void msg_ac_response_send(struct msg_ac_response *msg, int sock) { struct ac_proposal prop; tpl_node *tn; tn = tpl_map(MSG_AC_RESPONSE_FMT, &msg->partial, &prop); tpl_pack(tn, 0); for (size_t i = 0; i < msg->proposals_n; ++i) { prop = msg->proposals[i]; tpl_pack(tn, 1); } tpl_dump(tn, TPL_FD, sock); tpl_free(tn); } void msg_ac_response_recv(struct msg_ac_response *msg, int sock) { struct ac_proposal prop; tpl_node *tn; tn = tpl_map(MSG_AC_RESPONSE_FMT, &msg->partial, &prop); tpl_load(tn, TPL_FD, sock); tpl_unpack(tn, 0); msg->proposals_n = tpl_Alen(tn, 1); msg->proposals = malloc(sizeof(struct ac_proposal) * msg->proposals_n); for (size_t i = 0; i < msg->proposals_n; ++i) { tpl_unpack(tn, 1); msg->proposals[i] = prop; } tpl_free(tn); } void free_msg_ac_response(struct msg_ac_response *msg) { for (size_t i = 0; i < msg->proposals_n; ++i) { struct ac_proposal *p = &msg->proposals[i]; free(p->abbr); free(p->word); } if (msg->proposals) free(msg->proposals); }
#pragma once namespace Mntone { namespace Xamcc { namespace DemoApp { namespace Core { public enum class NotificationType { Favorite, Follow, }; public interface class INotification { property Core::NotificationType NotificationType { Core::NotificationType get(); } property ::Platform::String^ Id { ::Platform::String^ get(); } }; } } } }
#pragma once #include <memory> template <typename T> class Worker { public: virtual bool Init() noexcept { return true; } virtual void ProcessTask(T task) noexcept = 0; protected: ~Worker() {} };
// Created by Sebastian Hunkeler on 19.07.12. // Copyright (c) 2014 Sebastian Hunkeler. All rights reserved. // #import <UIKit/UIKit.h> #import "LFBubbleCollectionViewCell.h" @class LFBubbleCollectionView; #pragma mark - Bubble View Delegate @protocol LFBubbleCollectionViewDelegate <NSObject> @optional -(void)bubbleView:(LFBubbleCollectionView *)bubbleView didHideMenuForBubbleItemAtIndex:(NSInteger)index; -(NSArray *)bubbleView:(LFBubbleCollectionView *)bubbleView menuItemsForBubbleItemAtIndex:(NSInteger)index; @end @interface LFBubbleCollectionView : UICollectionView -(void)showMenuForBubbleItem:(LFBubbleCollectionViewCell *)item; @property (nonatomic, weak) IBOutlet id<LFBubbleCollectionViewDelegate> bubbleViewMenuDelegate; //Pointer to the currently selected bubble when displaying a context menu @property (nonatomic, weak) LFBubbleCollectionViewCell* bubbleThatIsShowingMenu; @end
/**************************************************************************** Copyright (c) 2011 Zynga Inc. Copyright (c) 2012 cocos2d-x.org Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org 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 __CCSHADER_H__ #define __CCSHADER_H__ #include "CCGL.h" #include "base/CCPlatformMacros.h" NS_CC_BEGIN /** * @addtogroup shaders * @{ */ extern CC_DLL const GLchar * ccPosition_uColor_frag; extern CC_DLL const GLchar * ccPosition_uColor_vert; extern CC_DLL const GLchar * ccPositionColor_frag; extern CC_DLL const GLchar * ccPositionColor_vert; extern CC_DLL const GLchar * ccPositionTexture_frag; extern CC_DLL const GLchar * ccPositionTexture_vert; extern CC_DLL const GLchar * ccPositionTextureA8Color_frag; extern CC_DLL const GLchar * ccPositionTextureA8Color_vert; extern CC_DLL const GLchar * ccPositionTextureColor_frag; extern CC_DLL const GLchar * ccPositionTextureColor_vert; extern CC_DLL const GLchar * ccPositionTextureColor_noMVP_frag; extern CC_DLL const GLchar * ccPositionTextureColor_noMVP_vert; extern CC_DLL const GLchar * ccPositionTexture_GrayScale_frag; extern CC_DLL const GLchar * ccPositionTextureColorAlphaTest_frag; extern CC_DLL const GLchar * ccPositionTexture_uColor_frag; extern CC_DLL const GLchar * ccPositionTexture_uColor_vert; extern CC_DLL const GLchar * ccPositionColorLengthTexture_frag; extern CC_DLL const GLchar * ccPositionColorLengthTexture_vert; extern CC_DLL const GLchar * ccLabelDistanceFieldNormal_frag; extern CC_DLL const GLchar * ccLabelDistanceFieldGlow_frag; extern CC_DLL const GLchar * ccLabelNormal_frag; extern CC_DLL const GLchar * ccLabelOutline_frag; extern CC_DLL const GLchar * ccLabel_vert; extern CC_DLL const GLchar * cc3D_PositionTex_vert; extern CC_DLL const GLchar * cc3D_SkinPositionTex_vert; extern CC_DLL const GLchar * cc3D_ColorTex_frag; extern CC_DLL const GLchar * cc3D_Color_frag; // end of shaders group /// @} NS_CC_END #endif /* __CCSHADER_H__ */
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Collections\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_COLLECTIONS_LIST__FUSE_NODE_H__ #define __APP_UNO_COLLECTIONS_LIST__FUSE_NODE_H__ #include <app/Uno.Collections.ICollection__Fuse_Node.h> #include <app/Uno.Collections.IEnumerable__Fuse_Node.h> #include <app/Uno.Collections.IList__Fuse_Node.h> #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Fuse { struct Node; } } namespace app { namespace Uno { namespace Collections { struct List1_Enumerator__Fuse_Node; } } } namespace app { namespace Uno { namespace Collections { struct List__Fuse_Node; struct List__Fuse_Node__uType : ::uClassType { ::app::Uno::Collections::IList__Fuse_Node __interface_0; ::app::Uno::Collections::ICollection__Fuse_Node __interface_1; ::app::Uno::Collections::IEnumerable__Fuse_Node __interface_2; }; List__Fuse_Node__uType* List__Fuse_Node__typeof(); ::uObject* List__Fuse_Node__GetEnumerator_boxed(List__Fuse_Node* __this); void List__Fuse_Node___ObjInit(List__Fuse_Node* __this); void List__Fuse_Node___ObjInit_1(List__Fuse_Node* __this, int capacity); void List__Fuse_Node__Add(List__Fuse_Node* __this, ::app::Fuse::Node* item); void List__Fuse_Node__AddRange(List__Fuse_Node* __this, ::uObject* items); void List__Fuse_Node__BoundsCheck(List__Fuse_Node* __this, int index); void List__Fuse_Node__Clear(List__Fuse_Node* __this); bool List__Fuse_Node__Contains(List__Fuse_Node* __this, ::app::Fuse::Node* item); void List__Fuse_Node__EnsureCapacity(List__Fuse_Node* __this); int List__Fuse_Node__get_Count(List__Fuse_Node* __this); ::app::Fuse::Node* List__Fuse_Node__get_Item(List__Fuse_Node* __this, int index); ::app::Uno::Collections::List1_Enumerator__Fuse_Node List__Fuse_Node__GetEnumerator(List__Fuse_Node* __this); int List__Fuse_Node__IndexOf(List__Fuse_Node* __this, ::app::Fuse::Node* item); void List__Fuse_Node__Insert(List__Fuse_Node* __this, int index, ::app::Fuse::Node* item); List__Fuse_Node* List__Fuse_Node__New_1(::uStatic* __this); List__Fuse_Node* List__Fuse_Node__New_2(::uStatic* __this, int capacity); bool List__Fuse_Node__Remove(List__Fuse_Node* __this, ::app::Fuse::Node* item); void List__Fuse_Node__RemoveAt(List__Fuse_Node* __this, int index); void List__Fuse_Node__set_Item(List__Fuse_Node* __this, int index, ::app::Fuse::Node* value); void List__Fuse_Node__Sort(List__Fuse_Node* __this, ::uDelegate* comparer); ::uArray* List__Fuse_Node__ToArray(List__Fuse_Node* __this); struct List__Fuse_Node : ::uObject { ::uStrong< ::uArray*> _data; int _used; int _version; ::uObject* GetEnumerator_boxed() { return List__Fuse_Node__GetEnumerator_boxed(this); } void _ObjInit() { List__Fuse_Node___ObjInit(this); } void _ObjInit_1(int capacity) { List__Fuse_Node___ObjInit_1(this, capacity); } void Add(::app::Fuse::Node* item) { List__Fuse_Node__Add(this, item); } void AddRange(::uObject* items) { List__Fuse_Node__AddRange(this, items); } void BoundsCheck(int index) { List__Fuse_Node__BoundsCheck(this, index); } void Clear() { List__Fuse_Node__Clear(this); } bool Contains(::app::Fuse::Node* item) { return List__Fuse_Node__Contains(this, item); } void EnsureCapacity() { List__Fuse_Node__EnsureCapacity(this); } int Count() { return List__Fuse_Node__get_Count(this); } ::app::Fuse::Node* Item(int index) { return List__Fuse_Node__get_Item(this, index); } ::app::Uno::Collections::List1_Enumerator__Fuse_Node GetEnumerator(); int IndexOf(::app::Fuse::Node* item) { return List__Fuse_Node__IndexOf(this, item); } void Insert(int index, ::app::Fuse::Node* item) { List__Fuse_Node__Insert(this, index, item); } bool Remove(::app::Fuse::Node* item) { return List__Fuse_Node__Remove(this, item); } void RemoveAt(int index) { List__Fuse_Node__RemoveAt(this, index); } void Item(int index, ::app::Fuse::Node* value) { List__Fuse_Node__set_Item(this, index, value); } void Sort(::uDelegate* comparer) { List__Fuse_Node__Sort(this, comparer); } ::uArray* ToArray() { return List__Fuse_Node__ToArray(this); } }; }}} #include <app/Uno.Collections.List1_Enumerator__Fuse_Node.h> namespace app { namespace Uno { namespace Collections { inline ::app::Uno::Collections::List1_Enumerator__Fuse_Node List__Fuse_Node::GetEnumerator() { return List__Fuse_Node__GetEnumerator(this); } }}} #endif
#ifndef BUZZ_h #define BUZZ_h #include "MKL46Z4.h" #include "globals.h" #include "SW.h" #include "ACC.h" #include "TPM.h" #define BUZZ_PIN 20u //PTE20 #define BUZZ_MASK ( 1u << BUZZ_PIN ) //ustawienia samego piszczenia #define BUZZ_MAX_MOD 2500u //minimalna czestotliwosc #define BUZZ_MIN_MOD 175u //maksymalna czestotliwosc #define BUZZ_MOD_STEP 5 //o ile zmieniac czestotliwosc #define BUZZ_MOD_DELAY 700 //co ile zmieniac czestotliwosc #define BUZZ_MAX_TIME 600u //maksymalny czas piszczenia //ustawienia alarmu #define BUZZ_STEP_FREQ 50u //ile razy na sekunde jest wywolywana FSM (50, bo tak probkuje akcelerometr) #define BUZZ_HIGHLIGHT_TIME 1 //przez ile sekund ma sie palic zielona dioda po za malej sredniej #define BUZZ_MAX_FAILRUES 15 //ile razy pod rzad przyspieszenie moze nie przekroczyc BUZZ_THRESHOLD_ACC #define BUZZ_THRESHOLD_ACC 1536 //1.5g - przez dluzej niz BUZZ_MAX_FAILURES nie wolno machac wolniej niz tak #define BUZZ_MIN_AVG 3072 //3g - srednia machania nie moze byc mniejsza niz to (srednia uwzglednia zerowe 'probki' przy konsekutywnych failurach #define BUZZ_REQUIRED_TIME 8 //przez ile sekund trzeba machac #define BUZZ_HIGHLIGHT_TICKS (BUZZ_STEP_FREQ * BUZZ_HIGHLIGHT_TIME) #define BUZZ_REQUIRED_TICS (BUZZ_STEP_FREQ * BUZZ_REQUIRED_TIME) /** inicjalizacja odpowiednich rejestrow (TPM1 - do generowania fali 2kHz) * * start: * -wylacz drugi alarm, jest jest wlaczony, \ * -wyjdz z menu i ignoruj buttony \ * -wyswietlaj godzine, ale nie spij \ * -wlacz TPM0, TPM1 i ACC \ * * | \ * -------->|<---------------- \ * | v | \ * | clear: | >---| * | -wyczysc dane z ACC | / | * | | | / | * | |<-------- | (GREEN na ~1s) / | * | v | (RED) | / | * | acc: | | (zla suma) / | * |- -zbieraj dane ^ / | * -sprawdz sume --------| / | * v | * | | * (* za duzo odchylek | | * pojedynczego punktu | (dobra suma) | * z rzedu) | | * |<----------------------------- * v * terminate: * -wlacz buttony * -wyswietlaj godzine i spij * -wylacz TPM0, TPM1 i ACC * -wyzeruj dane zwiazane z alarmem * | * v * quiet * */ void initBUZZ(void); //sprawia, ze FSM alarmu wykonuje nastepny krok //TODO: powiazac z jakims timerem albo z przerwaniem z akcelerometru void doAlarmFSM( volatile alarmStruct* alarm ); //wlacza TPM1 (czyli de facto wlacza buzzer) void startTPM1(void); //wylacza TPM1 void stopTPM1(void); //wlacza TPM0 (ktory sprawia, ze FSM zbiera dane z akcelerometru i pracuje) void startTPM0(void); //wylacza TPM0 void stopTPM0(void); #endif
/////////////////////////////////////////////////////// // File: grd_pc.h // Desc: gradient + color plane cost // // Author: rookiepig // Date: 2014/04/03 // /////////////////////////////////////////////////////// #pragma once #include"../commfunc.h" #include"i_plane_cost.h" #define COST_ALPHA 0.1 #define TAU_CLR 10.0 #define TAU_GRD 2.0 // 10 * 3 = 30 means divide color by 3 #define WGT_GAMMA 10.0 // #define USE_BORDER //#define USE_INTER #ifdef USE_INTER #define INTER_SIZE 10.0 #endif // #define INV_DISP_COST_SCALE 10000 // #define USE_LAB_WGT class GrdPC : public IPlaneCost { public: GrdPC(const Mat& l_img, const Mat& r_img, const int& max_disp, const int& wnd_size); //const double& alpha, //const double& tau_clr, const double& tau_grd, //const double& gamma); ~GrdPC(void); virtual double GetPlaneCost( const int& ref_x, const int& ref_y, const Plane& plane, const RefView& view ) const; private: double GetCostWeight(const int& ref_x, const int& ref_y, const int& q_x, const int& q_y, const RefView& view) const; double GetPixelCost(const int& ref_x, const int& ref_y, const double& other_x, const int& other_y, const RefView& view) const; // color image Mat img_[kViewNum]; Mat lab_[kViewNum]; // gradient along x axis Mat grd_x_[kViewNum]; #ifdef USE_INTER Mat inter_img_[kViewNum]; // interpolated image Mat inter_grd_x_[kViewNum]; // interpolated gradient int inter_wid_; #endif // image property int wid_; int hei_; // look up table for fast-exp double* lookup_exp_; // method paramter int max_disp_; int wnd_size_; int half_wnd_; //double alpha_; // balance color and gradient cost //double tau_clr_; // threshold for color cost //double tau_grd_; // threshold for gradient cost //double gamma_; // cost weight parameter };
/* * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ /* $OpenBSD: append.c,v 1.2 1996/06/26 05:31:16 deraadt Exp $ */ /* $NetBSD: append.c,v 1.5 1995/03/26 03:27:37 glass Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Hugh Smith at The University of Guelph. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint #if 0 static char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94"; static char rcsid[] = "$OpenBSD: append.c,v 1.2 1996/06/26 05:31:16 deraadt Exp $"; #endif #endif /* not lint */ #include <sys/param.h> #include <sys/stat.h> #include <err.h> #include <fcntl.h> #include <unistd.h> #include <dirent.h> #include <stdio.h> #include <string.h> #include "archive.h" #include "extern.h" /* * append -- * Append files to the archive - modifies original archive or creates * a new archive if named archive does not exist. */ int append(argv) char **argv; { int afd, fd, eval; char *file; CF cf; struct stat sb; afd = open_archive(O_CREAT|O_RDWR); if (lseek(afd, (off_t)0, SEEK_END) == (off_t)-1) error(archive); /* Read from disk, write to an archive; pad on write. */ SETCF(0, 0, afd, archive, WPAD); for (eval = 0; (file = *argv++);) { if ((fd = open(file, O_RDONLY)) < 0) { warn("%s", file); eval = 1; continue; } if (options & AR_V) (void)printf("q - %s\n", file); cf.rfd = fd; cf.rname = file; put_arobj(&cf, &sb); (void)close(fd); } close_archive(afd); return (eval); }
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <pthread.h> #include <time.h> #include <sys/time.h> #include "wb_gcc.h" #include "wb_pthread_pool.h" #include "wb_object_pool.h" #include "wb_cas_pool.h" static char pad1[CACHE_LINE_ALIGNMENT]; static cell_pool_t* obj_pool = NULL; static char pad2[CACHE_LINE_ALIGNMENT]; static cas_pool_t* cas_pool = NULL; static char pad3[CACHE_LINE_ALIGNMENT]; static mutex_pool_t* mutex_pool = NULL; static char pad4[CACHE_LINE_ALIGNMENT]; #define TMAGIC 0x0395ef09 typedef struct{ int index; uint32_t magic; }tobject_t; int32_t obj_init(void* ptr) { return 0; } void obj_destroy(void* ptr) { } void obj_reset(void* ptr, int32_t flag) { tobject_t* obj = (tobject_t *)ptr; obj->magic = (flag == 1 ? TMAGIC : 0); } int32_t obj_check(void* ptr) { tobject_t* obj = (tobject_t *)ptr; if (obj->magic == TMAGIC) return 0; assert(0); return -1; } #define THREAD_NUM 4 #define POWER 3 #define POOL_SIZE (1 << POWER) static int32_t alloc_count = 0; static void* thread_mutex_func(void* arg) { tobject_t* arr[POOL_SIZE / 2] = { 0 }; int i = 0; int l = 0; while (alloc_count < 1000000){ arr[i] = (tobject_t *)mutex_pool_alloc(mutex_pool); arr[i]->index = arr[i]->index + 1; i++; if (i >= POOL_SIZE / 2){ for (l = 0; l < i; l++){ mutex_pool_free(mutex_pool, arr[l]); } i = 0; } WT_ATOMIC_ADD4(alloc_count, 1); } if (i >= 0) for (l = 0; l < i; l++) mutex_pool_free(mutex_pool, arr[l]); return NULL; } static void* thread_spin_func(void* arg) { tobject_t* arr[POOL_SIZE / 2] = {0}; int i = 0; int l = 0; while (alloc_count < 1000000){ arr[i] = (tobject_t *)pool_alloc(obj_pool); arr[i]->index = arr[i]->index + 1; i++; if (i >= POOL_SIZE / 2){ for (l = 0; l < i; l++){ pool_free(obj_pool, arr[l]); } i = 0; } WT_ATOMIC_ADD4(alloc_count, 1); } if (i > 0) for (l = 0; l < i; l++){ pool_free(obj_pool, arr[l]); } return NULL; } static void* thread_cas_func(void* arg) { tobject_t* obj = NULL; int i = 0; int l = 0; while (alloc_count < 1000000){ obj = (tobject_t *)cas_pool_alloc(cas_pool); obj->index++; cas_pool_free(cas_pool, obj); WT_ATOMIC_ADD4(alloc_count, 1); } return NULL; } void test_mutex_pool() { pthread_t threads[THREAD_NUM]; tobject_t* o = NULL; tobject_t* ar[POOL_SIZE]; int i = 0; struct timeval b, e; mutex_pool = mutex_pool_create("pthread_mutex", sizeof(tobject_t), POOL_SIZE, obj_init, obj_destroy, obj_check, obj_reset); for (i = 0; i < POOL_SIZE; i++){ o = (tobject_t *)mutex_pool_alloc(mutex_pool); printf("alloc obj = 0x%lx\n", (uint64_t)o); ar[i] = o; } for (i = 0; i < POOL_SIZE; i++){ mutex_pool_free(mutex_pool, ar[i]); } o = (tobject_t *)mutex_pool_alloc(mutex_pool); printf("only o = 0x%lx\n", (uint64_t)o); mutex_pool_free(mutex_pool, o); gettimeofday(&b, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_create(&threads[i], NULL, thread_mutex_func, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_join(threads[i], NULL); gettimeofday(&e, NULL); printf("mutex alloc_count = %d, delay = %lu ms\n", alloc_count, ((e.tv_sec - b.tv_sec) * 1000000 + (e.tv_usec - b.tv_usec)) / 1000); mutex_pool_print(mutex_pool); mutex_pool_destroy(mutex_pool); } void test_spin_pool() { pthread_t threads[THREAD_NUM]; tobject_t* o = NULL; tobject_t* ar[POOL_SIZE]; int i = 0; struct timeval b, e; obj_pool = pool_create("spin", sizeof(tobject_t), POOL_SIZE, obj_init, obj_destroy, obj_check, obj_reset); for (i = 0; i < POOL_SIZE; i++){ o = (tobject_t *)pool_alloc(obj_pool); printf("alloc obj = 0x%lx\n", (uint64_t)o); ar[i] = o; } for (i = 0; i < POOL_SIZE; i++){ pool_free(obj_pool, ar[i]); } o = (tobject_t *)pool_alloc(obj_pool); printf("only o = 0x%lx\n", (uint64_t)o); pool_free(obj_pool, o); gettimeofday(&b, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_create(&threads[i], NULL, thread_spin_func, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_join(threads[i], NULL); gettimeofday(&e, NULL); printf("spin alloc_count = %d, delay = %lu ms\n", alloc_count, ((e.tv_sec - b.tv_sec) * 1000000 + (e.tv_usec - b.tv_usec)) / 1000); pool_print(obj_pool); pool_destroy(obj_pool); } void test_cas_pool() { pthread_t threads[THREAD_NUM]; tobject_t* o = NULL; tobject_t* ar[POOL_SIZE]; int i = 0; struct timeval b, e; cas_pool = cas_pool_create("cas", sizeof(tobject_t), obj_init, obj_destroy, obj_check, obj_reset); for (i = 0; i < POOL_SIZE; i++){ o = (tobject_t *)cas_pool_alloc(cas_pool); printf("alloc obj = 0x%lx\n", (uint64_t)o); ar[i] = o; } for (i = 0; i < POOL_SIZE; i++){ cas_pool_free(cas_pool, ar[i]); } o = (tobject_t *)cas_pool_alloc(cas_pool); printf("only o = 0x%lx\n", (uint64_t)o); cas_pool_print(cas_pool); cas_pool_free(cas_pool, o); gettimeofday(&b, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_create(&threads[i], NULL, thread_cas_func, NULL); for (i = 0; i < THREAD_NUM; i++) pthread_join(threads[i], NULL); gettimeofday(&e, NULL); printf("cas alloc_count = %d, delay = %lu ms\n", alloc_count, ((e.tv_sec - b.tv_sec) * 1000000 + (e.tv_usec - b.tv_usec)) / 1000); cas_pool_print(cas_pool); cas_pool_destroy(cas_pool); } int main(int argc, const char* argv[]) { test_mutex_pool(); alloc_count = 0; test_spin_pool(); alloc_count = 0; test_cas_pool(); return 0; }
#ifndef GENOS_dlist_H #define GENOS_dlist_H #include <gxx/datastruct/dlist.h> #include <gxx/util/member.h> #include <gxx/util/memberxx.h> namespace gxx { template<typename type, dlist_head type::* member> class dlist { public: //FIELDS: dlist_head list; //SUBCLASSES: class iterator { public: //using iterator_category = std::bidirectional_iterator_tag; using value_type = type; using difference_type = ptrdiff_t; using pointer = type*; using reference = type&; public: dlist_head* current; public: iterator() : current(nullptr) {}; iterator(dlist_head* head) : current(head) {}; iterator(const iterator& other) : current(other.current) {}; iterator operator++(int) { iterator i = *this; current=current->next; return i; } iterator operator++() { current=current->next; return *this; } iterator operator--(int) { iterator i = *this; current=current->prev; return i; } iterator operator--() { current=current->prev; return *this; } bool operator!= (const iterator& b) {return current != b.current;} bool operator== (const iterator& b) {return current == b.current;} type& operator*() {return *member_container(current,member);} type* operator->() {return member_container(current,member);} }; class reverse_iterator { private: dlist_head* current; public: reverse_iterator(dlist_head* head) : current(head) {} reverse_iterator operator++(int) { reverse_iterator i = *this; current=current->prev; return i; } reverse_iterator operator++() { current=current->prev; return *this; } reverse_iterator operator--(int) { reverse_iterator i = *this; current=current->next; return i; } reverse_iterator operator--() { current=current->next; return *this; } bool operator!= (const reverse_iterator& b) {return current != b.current;} bool operator== (const reverse_iterator& b) {return current == b.current;} type& operator*() {return *member_container(current,member);} type* operator->() {return member_container(current,member);} }; //METHODS: dlist() { dlist_init(&list); } ~dlist() { dlist_del(&list); } bool empty() { return dlist_empty(&list); }; type* first() { return member_container(list.next, member); } //Прилинковать первым в списке. void move_front(type& obj) { dlist_move_next(&(obj.*member), &list); }; //Прилинковать последним в списке. void move_back(type& obj) { dlist_move_prev(&(obj.*member), &list); }; void add_first(type& obj) { dlist_add(&(obj.*member), &list); } void add_last(type& obj) { dlist_add_tail(&(obj.*member), &list); } //Поставить объект перед объектом. void move_next(type& obj, type& head) { dlist_move_next(&(obj.*member), &(head.*member)); }; //Поставить объект перед итерируемым объектом. void move_next(type& obj, iterator head) { dlist_move_next(&(obj.*member), head.current); }; //Поставить объект после объекта. void move_prev(type& obj, type& head) { dlist_move_prev(&(obj.*member), &(head.*member)); }; //Поставить объект после итерируемого объектом. void move_prev(type& obj, iterator head) { dlist_move_prev(&(obj.*member), head.current); }; // iterator insert(iterator it, type & obj) { // dlist_move_prev(&(obj.*member), it.current); // } void pop(type& obj) { //assert(is_linked(obj)); dlist_del(&(obj.*member)); }; static void unbind(type& obj) { dlist_del(&(obj.*member)); }; void del_init(type& obj) { dlist_del_init(&(obj.*member)); }; void pop_if_linked(type& obj) { if (!is_linked(obj)) return; dlist_del(&(obj.*member)); }; void pop_front() { dlist_del(&((*begin()).*member)); }; void pop_back() { dlist_del(&((*rbegin()).*member)); }; void round_left() { move_back(*begin()); }; int size() const { int i = 0; for(auto& v : *this) { i++; } return i; }; iterator begin() {return iterator(list.next);} iterator end() {return iterator(&list);} iterator begin() const {return iterator((dlist_head*)list.next);} iterator end() const {return iterator((dlist_head*)&list);} reverse_iterator rbegin() {return reverse_iterator(list.prev);} reverse_iterator rend() {return reverse_iterator(&list);} //iterator insert_sorted(type & item) { // return insert(std::upper_bound(begin(), end(), item ), item); //} /* gxx::string to_info() const { gxx::string str; str.reserve(128); int i = 0; dlist_head* ptr; dlist_for_each(ptr, &list) { i++; }; str << "count: " << i; return str; }; */ /* gxx::string to_str() const { gxx::string str; str.reserve(128); str << "["; for (auto r : *this) { str << to_str(r) << gxx::string(","); }; str << "]"; return str; }; */ }; } /*namespace std { template<typename T, dlist_head T::* L> class iterator_traits<typename gxx::dlist<T,L>::iterator> { public: using iterator_category = std::bidirectional_iterator_tag; using value_type = T; }; }*/ #endif
@class CatalogDatabase; @class CatalogFilter; @class Checklist; @class Circle; @class CircleCollection; @interface CircleDataProvider : NSObject @property (nonatomic, readonly) NSUInteger comiketNo; @property (nonatomic, readonly) Checklist *checklist; @property (nonatomic, readonly) CatalogDatabase *database; @property (nonatomic, readonly) NSSize cutSize; @property (nonatomic, readonly) NSUInteger numberOfCutsInRow; @property (nonatomic, readonly) NSUInteger numberOfCutsInColumn; @property (nonatomic, readonly) RACSignal *dataDidChangeSignal; @property (nonatomic) CatalogFilter *filter; @property (nonatomic) Circle *selectedCircle; - (instancetype)initWithChecklist:(Checklist *)checklist; - (NSInteger)numberOfRows; - (CircleCollection *)circleCollectionForRow:(NSInteger)row; - (NSString *)stringValueForGroupRow:(NSInteger)row; - (BOOL)isGroupRow:(NSInteger)row; - (NSString *)blockNameForID:(NSInteger)blockID; - (NSImage *)imageForCircle:(Circle *)circle; - (void)filterWithString:(NSString *)string; @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" #import "TSCH3DAnimationInterpolatable-Protocol.h" // Not exported @interface TSCH3DAnimationTimeSlice : NSObject <TSCH3DAnimationInterpolatable> { } + (id)linear; - (float)interpolate:(float)arg1 index:(const tvec2_3b141483 *)arg2; @end
// // Post.h // Weird Retro // // Created by User i7 on 07/02/15. // Copyright (c) 2015 Alex Dougas. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @class Section; @interface Post : NSManagedObject @property (nonatomic, retain) id content; @property (nonatomic, retain) NSDate * dateLastUpdated; @property (nonatomic, retain) NSDate * dateLastView; @property (nonatomic, retain) NSString * info; @property (nonatomic, retain) NSString * keywords; @property (nonatomic, retain) NSString * title; @property (nonatomic, retain) NSString * url; @property (nonatomic, retain) NSString * thumbnailUrl; @property (nonatomic, retain) NSNumber * order; @property (nonatomic, retain) NSNumber * orderInLast; @property (nonatomic, retain) Section *section; @property (nonatomic, readonly) NSSet* comments; @property (nonatomic, readonly) BOOL isBlogPost; @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/KNAnimationEffect.h> #import "KNAnimationPluginArchiving-Protocol.h" #import "KNChunkableBuildAnimator-Protocol.h" #import "KNFrameBuildAnimator-Protocol.h" @class KNAnimParameterGroup, KNMotionBlurAnimationPluginWrapper; // Not exported @interface KNBuildCube : KNAnimationEffect <KNChunkableBuildAnimator, KNFrameBuildAnimator, KNAnimationPluginArchiving> { KNAnimParameterGroup *mParameterGroup; KNMotionBlurAnimationPluginWrapper *_motionBlurWrapper; } + (void)downgradeAttributes:(id *)arg1 animationName:(id *)arg2 warning:(id *)arg3 type:(int)arg4 isToClassic:(_Bool)arg5 version:(unsigned long long)arg6; + (void)upgradeAttributes:(id *)arg1 animationName:(id)arg2 warning:(id *)arg3 type:(int)arg4 isFromClassic:(_Bool)arg5 version:(unsigned long long)arg6; + (id)thumbnailImageNameForType:(int)arg1; + (int)rendererTypeForCapabilities:(id)arg1; + (_Bool)requiresSingleTexturePerStage; + (id)customAttributes; + (id)defaultAttributes; + (void)fillLocalizedDirectionMenu:(id)arg1 forType:(int)arg2; + (unsigned long long)directionType; + (id)localizedMenuString:(int)arg1; + (id)supportedTypes; + (id)animationFilter; + (int)animationCategory; + (id)animationName; - (void)animationDidEndWithContext:(id)arg1; - (void)renderFrameWithContext:(id)arg1; - (void)animationWillBeginWithContext:(id)arg1; - (struct CGRect)frameOfEffectWithFrame:(struct CGRect)arg1 context:(id)arg2; - (id)animationsWithContext:(id)arg1; - (void)dealloc; - (id)initWithAnimationContext:(id)arg1; @end
#pragma once #include "ofMain.h" class ofApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); ofShader shader; ofPlanePrimitive plane; ofImage img; };
// // CCMenuItem+TH.h // frutris // // Created by Benjamin Schüttler on 31.07.12. // Copyright (c) 2012 Rainbow Labs UG. All rights reserved. // #import "CCMenuItem.h" #import "cocos2d.h" @interface CCMenuItemImage (TH) +(id) itemWithNormalFrame:(NSString *)normalF block:(void (^)(id))block; +(id) itemWithNormalFrame:(NSString *)normalF selectedFrame:(NSString *)selectedF block:(void (^)(id))block; +(id) itemWithNormalFrame:(NSString *)normalF selectedFrame:(NSString *)selectedF disabledFrame:(NSString *)disabledF block:(void (^)(id))block; -(id) initWithNormalFrame:(NSString *)normalF selectedFrame:(NSString *)selectedF disabledFrame:(NSString *)disabledF block:(void (^)(id))block; @end
/**************************************** * Author: Ethan Reker * Date Created: June 22, 2016 * Purpose: Create a class to implement a quadratic bezier curve. * This implementation is mostly tailored to generating points for * the soft-knee on a compressor. Usually a bezier curve is treated * as a function of t (parametric curve), but for the soft-knee we * need to calculate the curve as a function of x, so t is aproximated * from x which works fine for this purpose. The only draw back is * this curve has very limited uses. */ #ifndef BEZIER_CURVE_H #define BEZIER_CURVE_H #include <cmath> namespace DSP { class BezierCurve{ public: /*************************************** * Default contructor ***************************************/ BezierCurve(); /*************************************** * Set the X and Y values for the points * used in the curve. P0 is the start * point, P1 is the control point, * and P2 is the end point. ***************************************/ void set(float x0, float y0, float x1, float y1, float x2, float y2); /*************************************** * Approximates t value based on x and * returns Y ***************************************/ float getValueAt(float input); private: float x[3]; float y[3]; }; }//end namespace DSP #endif
// // ThTextView.h // Forest // #import <UIKit/UIKit.h> #import <CoreText/CoreText.h> #import "ThVm.h" @class ThTableViewCell; //drawTypes #define thVmTitle 0 #define thVmSpeed 1 #define thVmCount 2 #define thVmNewCount 3 #define thVmOther 4 #define thVmDate 5 #define thVmAll 6 @interface ThTextView : UIView @property (nonatomic) CGFloat height; @property (nonatomic) CGFloat width; @property (nonatomic) ThVm *thVm; @property (nonatomic) int drawType; @property (nonatomic) BOOL drawMarkWhenRead; @property (weak, nonatomic) ThTableViewCell *thTableViewCell; @property (nonatomic) CTFrameRef ctFrameRef; @end
/* --------------------------------------------------------------------- * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and * Radu Serban @ LLNL * --------------------------------------------------------------------- * SUNDIALS Copyright Start * Copyright (c) 2002-2019, Lawrence Livermore National Security * and Southern Methodist University. * All rights reserved. * * See the top-level LICENSE and NOTICE files for details. * * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * --------------------------------------------------------------------- * This is the header file for the CVODE diagonal linear solver, CVDIAG. * ---------------------------------------------------------------------*/ #ifndef _CVDIAG_H #define _CVDIAG_H #include <sundials/sundials_nvector.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { #endif /* --------------------- * CVDIAG return values * --------------------- */ #define CVDIAG_SUCCESS 0 #define CVDIAG_MEM_NULL -1 #define CVDIAG_LMEM_NULL -2 #define CVDIAG_ILL_INPUT -3 #define CVDIAG_MEM_FAIL -4 /* Additional last_flag values */ #define CVDIAG_INV_FAIL -5 #define CVDIAG_RHSFUNC_UNRECVR -6 #define CVDIAG_RHSFUNC_RECVR -7 /* CVDiag initialization function */ SUNDIALS_EXPORT int CVDiag(void *cvode_mem); /* Optional output functions */ SUNDIALS_EXPORT int CVDiagGetWorkSpace(void *cvode_mem, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int CVDiagGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); SUNDIALS_EXPORT int CVDiagGetLastFlag(void *cvode_mem, long int *flag); SUNDIALS_EXPORT char *CVDiagGetReturnFlagName(long int flag); #ifdef __cplusplus } #endif #endif
// Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle // // See the LICENSE.txt file for license information. Please report all // issues on https://gitlab.onelab.info/gmsh/gmsh/issues. #ifndef BACKGROUND_MESH_TOOLS_H #define BACKGROUND_MESH_TOOLS_H #include "STensor3.h" class GFace; class GVertex; class GEdge; class GEntity; SMetric3 buildMetricTangentToCurve(SVector3 &t, double l_t, double l_n); SMetric3 buildMetricTangentToSurface(SVector3 &t1, SVector3 &t2, double l_t1, double l_t2, double l_n); double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double Z); SMetric3 BGM_MeshMetric(GEntity *ge, double U, double V, double X, double Y, double Z); bool Extend1dMeshIn2dSurfaces(); bool Extend2dMeshIn3dVolumes(); SMetric3 max_edge_curvature_metric(const GVertex *gv); SMetric3 max_edge_curvature_metric(const GEdge *ge, double u, double &l); SMetric3 metric_based_on_surface_curvature(const GFace *gf, double u, double v, bool surface_isotropic = false, double d_normal = 1.e12, double d_tangent_max = 1.e12); #endif
// -*- C++ -*- //============================================================================= /** * @file Log_Persistence_Strategy.h * * $Id: Log_Persistence_Strategy.h 1861 2011-08-31 16:18:08Z mesnierp $ * * @author Matthew Braun <mjb2@cs.wustl.edu> * @author Pradeep Gore <pradeep@cs.wustl.edu> * @author David A. Hanvey <d.hanvey@qub.ac.uk> */ //============================================================================= #ifndef TAO_TLS_PERSISTENCE_STRATEGY_H #define TAO_TLS_PERSISTENCE_STRATEGY_H #include /**/ "ace/pre.h" #include "orbsvcs/Log/log_serv_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Versioned_Namespace.h" #include "ace/Service_Object.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_LogStore; class TAO_LogMgr_i; namespace CORBA { class ORB; typedef ORB* ORB_ptr; } /** * @class TAO_Log_Persistence_Strategy * * @brief Base Strategy for Log / Log Record Storage * */ class TAO_Log_Serv_Export TAO_Log_Persistence_Strategy : public ACE_Service_Object { public: /// @brief Log Store Factory virtual TAO_LogStore* create_log_store (TAO_LogMgr_i* logmgr_i) = 0; private: }; TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* TAO_TLS_PERSISTENCE_STRATEGY_H */
// // AppDelegate.h // WGBCheckUpdateView // // Created by Wangguibin on 2017/2/8. // Copyright © 2017年 王贵彬. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* Copyright (c) 2010-2015 Vanderbilt University * * 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 ATS_HANDLER_H #define ATS_HANDLER_H #include <curl/curl.h> #include "GatewayConnector.h" #include "AtsMessageTypes.h" #include "AtsConfigMgr.h" class AtsHandler : public ammo::gateway::DataPushReceiverListener, public ammo::gateway::PullRequestReceiverListener, public ammo::gateway::PullResponseReceiverListener, public ammo::gateway::GatewayConnectorDelegate { public: AtsHandler(); //GatewayConnectorDelegate methods virtual void onConnect(ammo::gateway::GatewayConnector *sender); virtual void onDisconnect(ammo::gateway::GatewayConnector *sender); // DataPushReceiverListener methods virtual void onPushDataReceived(ammo::gateway::GatewayConnector *sender, ammo::gateway::PushData &pushData); // PullRequestReceiverListener methods virtual void onPullRequestReceived(ammo::gateway::GatewayConnector *sender, ammo::gateway::PullRequest &pullReq); // PullResponseReceiverListener virtual void onPullResponseReceived (ammo::gateway::GatewayConnector *sender, ammo::gateway::PullResponse &response); private: char* baseServerAddr; AtsConfigMgr* config; std::pair<std::string, std::string> credentials; std::string uploadMedia(CURL *curl, std::string mediaType, std::string& payload ); std::string inviteChat(CURL *curl, std::string mediaType, std::string& payload ); std::string listChannels(CURL *curl, std::string dataType, std::string query ); std::string listUnits(CURL *curl, std::string dataType, std::string query ); std::string listMembers(CURL *curl, std::string dataType, std::string query ); std::string listLocations(CURL *curl, std::string dataType, std::string query ); std::string listPeople(CURL *curl, std::string dataType, std::string query ); std::string listPeople(CURL *curl, std::string dataType, std::vector<char>& query ); std::string channelCreate(CURL *curl, std::string dataType, std::string& payload ); std::string centerMap(CURL *curl, std::string dataType, std::string &query ); std::string postLocation(CURL *curl, std::string mediaType, std::string& payload ); std::string postLocations(CURL *curl, std::string mediaType, std::string& payload ); }; #endif // #ifndef ATS_HANDLER_H
/** ****************************************************************************** * @file I2C/I2C_IOExpander/main.c * @author MCD Application Team * @version V1.1.0 * @date 18-January-2013 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #if defined (USE_STM324xG_EVAL) #include "stm324xg_eval.h" #include "stm324xg_eval_lcd.h" #include "stm324xg_eval_ioe.h" #elif defined (USE_STM324x7I_EVAL) #include "stm324x7i_eval.h" #include "stm324x7i_eval_lcd.h" #include "stm324x7i_eval_ioe.h" #else #error "Please select first the Evaluation board used in your application (in Project Options)" #endif /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* #define BUTTON_POLLING_MODE */ #define BUTTON_INTERRUPT_MODE /* #define IOE_POLLING_MODE */ #define IOE_INTERRUPT_MODE #ifdef BUTTON_POLLING_MODE #define BUTTON_MODE BUTTON_MODE_GPIO #else #define BUTTON_MODE BUTTON_MODE_EXTI #endif /* BUTTON_POLLING_MODE */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void TimingDelay_Decrement(void); void Delay(__IO uint32_t nTime); #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// // FWTValidatorProtocol.h // FWTFormManager // // Created by Yevgeniy Prokoshev on 12/03/2015. // // #import <Foundation/Foundation.h> @protocol FWTInputFormatterWithNumberFormatterProtocol <NSObject> @required -(NSNumberFormatter *) numberFormatter; @end
/* * * Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's * prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok. * Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement. * */ #ifndef HK_YAML_TAGFILE_WRITER_H #define HK_YAML_TAGFILE_WRITER_H #include <Common/Serialize/Tagfile/hkTagfileWriter.h> /// Write tagfiles in a TEX format for debugging. /// Note that there is no corresponding reader for this format, it /// is only for human consumption. class HK_EXPORT_COMMON hkTextTagfileWriter : public hkTagfileWriter { public: HK_DECLARE_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE); /// Save the contents to the given stream. virtual hkResult save( const hkDataObject& obj, hkStreamWriter* stream, AddDataObjectListener* userListener, const Options& options = Options() ); }; #endif // HK_YAML_TAGFILE_WRITER_H /* * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907) * * Confidential Information of Havok. (C) Copyright 1999-2014 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok * Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership * rights, and intellectual property rights in the Havok software remain in * Havok and/or its suppliers. * * Use of this software for evaluation purposes is subject to and indicates * acceptance of the End User licence Agreement for this product. A copy of * the license is included with this software and is also available at www.havok.com/tryhavok. * */
// // GHOwnersOrganizationsNewsFeedViewController.h // iGithub // // Created by Oliver Letterer on 06.11.11. // Copyright 2011 Home. All rights reserved. // #import "GHUsersNewsFeedsViewController.h" /** @class GHOwnersOrganizationsNewsFeedViewController @abstract <#abstract comment#> */ @interface GHOwnersOrganizationsNewsFeedViewController : GHUsersNewsFeedsViewController <NSCoding> { @private NSString *_defaultOrganizationName; } @end
// // SocaCoreiOS.h // SocaCoreiOS // // Created by Zhuhao Wang on 4/10/15. // Copyright (c) 2015 Zhuhao Wang. All rights reserved. // //! Project version number for SocaCoreiOS. FOUNDATION_EXPORT double SocaCoreiOSVersionNumber; //! Project version string for SocaCoreiOS. FOUNDATION_EXPORT const unsigned char SocaCoreiOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SocaCoreiOS/PublicHeader.h>
// // CellAdapterTemplate.h // SQTemplate // // Created by 双泉 朱 on 17/5/11. // Copyright © 2017年 Doubles_Z. All rights reserved. // #import <Foundation/Foundation.h> @protocol HYBlockThreeCollectionCellAdapter <NSObject> @end
// // MediaInfo.h // ObjectiveDropbox // // Created by Михаил Мотыженков on 15.03.16. // Copyright © 2016 Михаил Мотыженков. All rights reserved. // #import <Foundation/Foundation.h> #import "DropboxMediaMetadata.h" @interface DropboxMediaInfo : NSObject /** * Indicate the photo/video is still under processing and metadata is not available yet. */ @property (nonatomic) BOOL isPending; /** * The metadata for the photo/video. */ @property (nonatomic, nullable) DropboxMediaMetadata *metadata; @end
// CVcFrame.h : Declaration of ActiveX Control wrapper class(es) created by Microsoft Visual C++ #pragma once ///////////////////////////////////////////////////////////////////////////// // CVcFrame class CVcFrame : public COleDispatchDriver { public: CVcFrame() {} // Calls COleDispatchDriver default constructor CVcFrame(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} CVcFrame(const CVcFrame& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: long get_Style() { long result; InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); return result; } void put_Style(long newValue) { static BYTE parms[] = VTS_I4 ; InvokeHelper(0x1, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); } LPDISPATCH get_FrameColor() { LPDISPATCH result; InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); return result; } LPDISPATCH get_SpaceColor() { LPDISPATCH result; InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); return result; } float get_Width() { float result; InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_R4, (void*)&result, NULL); return result; } void put_Width(float newValue) { static BYTE parms[] = VTS_R4 ; InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); } };
// Copyright 2015 Allen Hsu. #include "test_common.h" #include "intersect.h" #include "vector.h" #include <math.h> TESTING(intersect); // Constants static const Vector ux = VEC(1, 0, 0); static const Vector uy = VEC(0, 1, 0); static const Vector uz = VEC(0, 0, 1); static const Vector uxy = VEC(M_SQRT1_2, M_SQRT1_2, 0); static const Vector uxz = VEC(M_SQRT1_2, 0, M_SQRT1_2); static const Vector w = VEC(2, 4, 3); // Tests static void test_extend(void) { V_EQ("0,i -> 0 = 0", extend(RAY(v_zero, ux), 0), v_zero); V_EQ("0,i -> 1 = i", extend(RAY(v_zero, ux), 1), ux); V_EQ("i,i -> 0 = i", extend(RAY(ux, ux), 0), ux); V_EQ("w,i -> 7 = [9 4 3]", extend(RAY(w, ux), 7), VEC(9, 4, 3)); V_EQ("i,j -> 4 = [1 4 0]", extend(RAY(ux, uy), 4), VEC(1, 4, 0)); V_EQ("w,unit(i+j) -> 0", extend(RAY(w, uxy), 0), w); V_EQ("w,unit(i+j) -> √2", extend(RAY(w, uxy), M_SQRT2), VEC(3, 5, 3)); V_EQ("w,i -> -5 = [-3 4 3]", extend(RAY(w, ux), -5), VEC(-3, 4, 3)); V_EQ("i,j -> 1 != j,i -> 1", extend(RAY(ux, uy), 1), extend(RAY(uy, ux), 1)); V_NEQ("0,j -> 1 != 0,i -> 1", extend(RAY(v_zero, uy), 1), extend(RAY(v_zero, ux), 1)); } static void test_intersect_plane(void) { S_EQ("0,i ∩ k->0 = 0", intersect(RAY(v_zero, ux), PLANE(uz, 0)), 0); S_EQ("i,(-i) ∩ k->0 = 0", intersect(RAY(ux, v_neg(ux)), PLANE(uz, 0)), 0); S_EQ("0,k ∩ k->0 = 0", intersect(RAY(v_zero, uz), PLANE(uz, 0)), 0); S_EQ("j,(-k) ∩ k->0 = 0", intersect(RAY(uy, v_neg(uz)), PLANE(uz, 0)), 0); S_EQ("0,k ∩ k->5 = 5", intersect(RAY(v_zero, uz), PLANE(uz, 5)), 5); S_EQ("k,i ∩ k->0 = -1", intersect(RAY(uz, ux), PLANE(uz, 0)), -1); S_EQ("k,i ∩ -k->0 = -1", intersect(RAY(uz, ux), PLANE(v_neg(uz), 0)), -1); S_EQ("k,-k ∩ k->0 = 1", intersect(RAY(uz, v_neg(uz)), PLANE(uz, 0)), 1); S_EQ("k,-k ∩ -k->0 = 1", intersect(RAY(uz, v_neg(uz)), PLANE(v_neg(uz), 0)), 1); S_EQ("k,k ∩ k->0 = -1", intersect(RAY(uz, uz), PLANE(uz, 0)), -1); S_EQ("k,k ∩ -k->0 = -1", intersect(RAY(uz, uz), PLANE(v_neg(uz), 0)), -1); S_EQ("-3k,4i ∩ k->0 = -1", intersect(RAY(v_mul(uz, -3), v_mul(ux, 4)), PLANE(uz, 0)), -1); S_EQ("0,[1/√2 0 1/√2] ∩ [1/√2 0 1/√2]->10 = 10", intersect(RAY(v_zero, uxz), PLANE(uxz, 10)), 10); } static void test_intersect_sphere(void) { S_EQ("0,i ∩ 0R3 = 3", intersect(RAY(v_zero, ux), SPHERE(v_zero, 3)), 3); S_EQ("i,i ∩ iR2 = 2", intersect(RAY(ux, ux), SPHERE(ux, 2)), 2); S_EQ("-i,i ∩ iR2 = 0", intersect(RAY(v_neg(ux), ux), SPHERE(ux, 2)), 0); S_EQ("k,k ∩ 0R1 = 0", intersect(RAY(uz, uz), SPHERE(v_zero, 1)), 0); S_EQ("k,-k ∩ 0R1 = 0", intersect(RAY(uz, v_neg(uz)), SPHERE(v_zero, 1)), 0); S_EQ("3i,-i ∩ 0R1 = 2", intersect(RAY(v_mul(ux, 3), v_neg(ux)), SPHERE(v_zero, 1)), 2); S_EQ("[5 0 -5],k ∩ 0R5 = 5", intersect(RAY(VEC(5, 0, -5), uz), SPHERE(v_zero, 5)), 5); S_EQ("i,i ∩ 0R0.5 = -1", intersect(RAY(ux, ux), SPHERE(v_zero, 0.5)), -1); S_EQ("0,i ∩ kR0.9 = -1", intersect(RAY(v_zero, ux), SPHERE(uz, 0.9)), -1); S_EQ("5*i,j ∩ 4*iR2 = √3", intersect(RAY(v_mul(ux, 5), uy), SPHERE(v_mul(ux, 4), 2)), sqrt(3)); S_NEQ("k,-j ∩ iR99 != 99", intersect(RAY(uz, v_neg(uy)), SPHERE(ux, 99)), 99); } // Test all TestResult test_all_intersect(void) { BEGIN_TESTS(); test_extend(); test_intersect_plane(); test_intersect_sphere(); END_TESTS(); }
// // HTTPRequest.h // DouYu // // Created by shendong on 16/5/11. // Copyright © 2016年 com.sybercare.enterprise. All rights reserved. // #import <Foundation/Foundation.h> typedef void(^successBlock)(id successObject); typedef void(^failBlock) (id failObject, NSError *error); //暂时这样处理,todo: 将网络请求封装在自己的静态库中 FOUNDATION_EXPORT NSString *const HTTPCheckUpdate; //检查更新 FOUNDATION_EXPORT NSString *const HTTPGetRecommendGameList; /** * 获取颜值列表 */ FOUNDATION_EXPORT NSString *const HTTPGetListDataWhoArebeautiful; //获取 /** * 获取首页广告信息 */ FOUNDATION_EXPORT NSString *const HTTPGetBrandCastInfo; /** * 获取用户的登录信息 */ FOUNDATION_EXPORT NSString *const HTTPGetUserInfomation; /** * 获取斗鱼的等级信息(每一个level信息内含有对应的icon),等级从level1到level 61 */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuLevelInfomation; /** * 获取斗鱼荣誉信息,内含三个荣誉等级的icon */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuHornorInfomation; /** * 获取斗鱼首页中并列展示的title,展示在推荐后面。比如目前是游戏,娱乐,奇葩 */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuColumnTitle; /** * 获取斗鱼首页中最热下面的主播信息 */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuBigHot; /** * 获取斗鱼首页轮播广告信息 */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuHomepageBannerInfomation; /** * 获取首页推荐的所有内容 */ FOUNDATION_EXPORT NSString *const HTTPGetDouYuHomepagelist; /** * 获取首页内游戏内所有的产品详情 */ FOUNDATION_EXPORT NSString *const HTTPGetAllGameInfomaitons; /** * 获取首页内奇葩所有的产品详情 */ FOUNDATION_EXPORT NSString *const HTTPGetAllStrangeInfomaitons; /** * 获取首页内娱乐所有的产品详情 */ FOUNDATION_EXPORT NSString *const HTTPGetAllFunInfomaitons; @interface HTTPRequest : NSObject + (void)requestWithUrl:(NSString *)urlString success:(successBlock)successHander fail:(failBlock)failHander; @end
// // Item.h // ArtAPI // // Created by Doug Diego on 11/18/13. // Copyright (c) 2013 Doug Diego. All rights reserved. // #import <Foundation/Foundation.h> #import "ARTService.h" @interface Item : NSObject @property (nonatomic, copy) NSString * imageUrl; @property (nonatomic, copy) NSString * croppedImageUrl; @property (nonatomic, copy) NSString * thumbImageUrl; @property (nonatomic, copy) NSString * itemId; @property (nonatomic, copy) NSString * title; @property (nonatomic, copy) NSString * artist; @property (nonatomic, retain) NSNumber * pixelWidth; @property (nonatomic, retain) NSNumber * pixelHeight; @property (nonatomic, copy) NSString * type; @property (nonatomic, copy) NSString * itemJSON; @property (nonatomic, retain) NSNumber * price; @property (nonatomic, copy) NSString * priceRange; @property (nonatomic, retain) NSNumber * MSRP; @property (nonatomic, copy) NSString * itemUrl; @property (nonatomic, copy) NSString * lookupType; @property (nonatomic, copy) NSString * sku; @property (nonatomic, copy) NSString * size; @property (nonatomic, copy) NSString * genericImageUrl; @property (nonatomic, retain) ARTService * service; @property (nonatomic, copy) NSString * framedUrl; @property (nonatomic, retain) NSNumber *itemWidth; @property (nonatomic, retain) NSNumber *itemHeight; @property (nonatomic, retain) NSNumber *canFrame; - (Item *)initWithFramedItemDictionary:(NSDictionary *)dictionary; - (Item *)initWithColorResponseDictionary:(NSDictionary *)dictionary; - (Item *)initWithDictionary:(NSDictionary *)dictionary; + (NSArray *) itemWithDictionaryArray: (NSArray*) array; -(NSDictionary*) getItemDict; -(void) setItemDict:(NSDictionary *)itemDict; -(NSString*) genericImageUrlWithSize: (CGSize) size; -(NSString*) genericImageUrlWithSize: (CGSize) size appId:(NSString *) appId; -(NSString*) croppedImageUrlWithSize: (CGSize) size; -(NSString*) formattedPrice; -(NSString*) formattedMSRP; @end
#include <stdio.h> float centymetry; float cale; float wzrostCale; float wzrostCentymetry; int main(void) { printf("Powiedz mi ile masz centymetrow wzrostu, a powiem Ci ile masz wzrostu w calach!\n"); scanf("%f", &centymetry); wzrostCale = centymetry / 2.54; printf("Mmm... Masz %.2f centymetrow wzrostu, a to %.2f cali!\n", centymetry, wzrostCale); printf("O nie... jestes tardem i uzywasz cali? No dobra, ile masz tych cali?\n"); scanf("%f", &cale); wzrostCentymetry = cale * 2.54; printf("Jesli masz %.2f cali, to znaczy ze masz %.2f centymetrow wzrostu... tardzie!\n", cale, wzrostCentymetry); return 0; }
#include <stdio.h> #include "auxiliary.h" void insertion_sort(int *A, int len) { for (int j = 1; j < len; j++) { int r = A[j]; int i = j - 1; while (i >= 0 && A[i] > r) { A[i + 1] = A[i]; i--; } A[i + 1] = r; } } int main(int argc, char **argv) { int array[] = { 23, 54 ,6, 12, 76, 3, 5, 8 }; insertion_sort(array, 8); printIntArray(array, 8); return 0; }
// // MMShotView.h // Dribbble // // Copyright (c) 2012 Mutual Mobile. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <UIKit/UIKit.h> @class DBShot; @interface MMShotView : UIView @property (nonatomic, weak) IBOutlet UIView *contentView; @property (nonatomic, weak) IBOutlet UIImageView *shotImageView; @property (nonatomic, weak) IBOutlet UIImageView *avatarView; @property (nonatomic, weak) IBOutlet UILabel *nameLabel; @property (nonatomic, weak) IBOutlet UILabel *locationLabel; @property (nonatomic, weak) IBOutlet UILabel *usernameLabel; - (void)populateWithShot:(DBShot*)shot; @end
#ifndef _LINK_H_ #define _LINK_H_ #include "MyMath.h" #include "friction.h" #include "rotor.h" class CLink{ private: double m_a; double m_alpha; double m_d; double m_theta; double cos_alpha; //cos(alpha) double sin_alpha; //sin(alpha) double m; //Áú·® CMatrix inertia; //¹«°ÔÁ߽ɿ¡¼­ÀÇ °ü¼º matrix CVector r1_2; CVector r1_com; CVector r2_com; CVector a_com; //link Áú·®Á᫐ °¡¼Óµµ CVector a_end; //link ³¡Á¡ÀÇ °¡¼Óµµ CVector velocity; //frame °¢¼Óµµ CVector accel; //frame °¢°¡¼Óµµ CVector force; //¾Õ ¸µÅ©¿¡ ÀÇÇØ °¡ÇØÁö´Â Èû CVector torque; //¾Õ ¸µÅ©¿¡ ÀÇÇØ °¡ÇØÁö´Â ¸ð¸àÆ® CMatrix R; // 3 X 3 matrix CVector p; // 3 vector CMatrix inverseR; // 3 X 3 matrix friend class CDynamics; public: CFriction fric; CRotor rotor; public: void setLink(double a, double alpha, double d, double theta, double _m, CVector _r2_com, CMatrix _inertia); void forwardKinematics(double theta); double getDH_a(); double getDH_alpha(); double getDH_d(); double getDH_theta(); }; #endif
// Copyright (c) 2012 AlterEgo Studios // // 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 "QGlitter/QGlitterConfig.h" class QByteArray; class QIODevice; class QString; namespace QGlitter { QGLITTER_EXPORTED void cryptoInit(); QGLITTER_EXPORTED const QString &errorMessage(); QGLITTER_EXPORTED bool dsaKeygen(int size, const QString &passphrase); QGLITTER_EXPORTED bool dsaVerify(QIODevice &sourceData, const QByteArray &signature, const QByteArray &publicKey); QGLITTER_EXPORTED QByteArray dsaSign(QIODevice &sourceData, const QByteArray &privateKey, const QString &passphrase); }
/* Copyright (c) 2013 <benemorius@gmail.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. */ #ifndef OBCTEMP_H #define OBCTEMP_H #include <ObcUITask.h> namespace ObcTempState { enum state {TempExt, TempCoolant, TempCoolantWarningSet}; } class ObcTemp : public ObcUITask { public: ObcTemp(OpenOBC& obc); ~ObcTemp(); virtual void runTask(); virtual void buttonHandler(ObcUITaskFocus::type focus, uint32_t buttonMask); virtual void wake(); virtual void sleep(); private: ObcTempState::state state; uint32_t coolantWarningTemp; uint32_t coolantWarningTempSet; }; #endif // OBCTEMP_H
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /* * This file contains the implementation of functions * WebRtcSpl_MaxAbsValueW16C() * WebRtcSpl_MaxAbsValueW32C() * WebRtcSpl_MaxValueW16C() * WebRtcSpl_MaxValueW32C() * WebRtcSpl_MinValueW16C() * WebRtcSpl_MinValueW32C() * WebRtcSpl_MaxAbsIndexW16() * WebRtcSpl_MaxIndexW16() * WebRtcSpl_MaxIndexW32() * WebRtcSpl_MinIndexW16() * WebRtcSpl_MinIndexW32() * */ #include <stdlib.h> #include BOSS_WEBRTC_U_rtc_base__checks_h //original-code:"rtc_base/checks.h" #include "common_audio/signal_processing/include/signal_processing_library.h" // TODO(bjorn/kma): Consolidate function pairs (e.g. combine // WebRtcSpl_MaxAbsValueW16C and WebRtcSpl_MaxAbsIndexW16 into a single one.) // TODO(kma): Move the next six functions into min_max_operations_c.c. // Maximum absolute value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, size_t length) { size_t i = 0; int absolute = 0, maximum = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { absolute = abs((int)vector[i]); if (absolute > maximum) { maximum = absolute; } } // Guard the case for abs(-32768). if (maximum > WEBRTC_SPL_WORD16_MAX) { maximum = WEBRTC_SPL_WORD16_MAX; } return (int16_t)maximum; } // Maximum absolute value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MaxAbsValueW32C(const int32_t* vector, size_t length) { // Use uint32_t for the local variables, to accommodate the return value // of abs(0x80000000), which is 0x80000000. uint32_t absolute = 0, maximum = 0; size_t i = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { absolute = abs((int)vector[i]); if (absolute > maximum) { maximum = absolute; } } maximum = WEBRTC_SPL_MIN(maximum, WEBRTC_SPL_WORD32_MAX); return (int32_t)maximum; } // Maximum value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MaxValueW16C(const int16_t* vector, size_t length) { int16_t maximum = WEBRTC_SPL_WORD16_MIN; size_t i = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] > maximum) maximum = vector[i]; } return maximum; } // Maximum value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MaxValueW32C(const int32_t* vector, size_t length) { int32_t maximum = WEBRTC_SPL_WORD32_MIN; size_t i = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] > maximum) maximum = vector[i]; } return maximum; } // Minimum value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MinValueW16C(const int16_t* vector, size_t length) { int16_t minimum = WEBRTC_SPL_WORD16_MAX; size_t i = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] < minimum) minimum = vector[i]; } return minimum; } // Minimum value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, size_t length) { int32_t minimum = WEBRTC_SPL_WORD32_MAX; size_t i = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] < minimum) minimum = vector[i]; } return minimum; } // Index of maximum absolute value in a word16 vector. size_t WebRtcSpl_MaxAbsIndexW16(const int16_t* vector, size_t length) { // Use type int for local variables, to accomodate the value of abs(-32768). size_t i = 0, index = 0; int absolute = 0, maximum = 0; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { absolute = abs((int)vector[i]); if (absolute > maximum) { maximum = absolute; index = i; } } return index; } // Index of maximum value in a word16 vector. size_t WebRtcSpl_MaxIndexW16(const int16_t* vector, size_t length) { size_t i = 0, index = 0; int16_t maximum = WEBRTC_SPL_WORD16_MIN; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] > maximum) { maximum = vector[i]; index = i; } } return index; } // Index of maximum value in a word32 vector. size_t WebRtcSpl_MaxIndexW32(const int32_t* vector, size_t length) { size_t i = 0, index = 0; int32_t maximum = WEBRTC_SPL_WORD32_MIN; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] > maximum) { maximum = vector[i]; index = i; } } return index; } // Index of minimum value in a word16 vector. size_t WebRtcSpl_MinIndexW16(const int16_t* vector, size_t length) { size_t i = 0, index = 0; int16_t minimum = WEBRTC_SPL_WORD16_MAX; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] < minimum) { minimum = vector[i]; index = i; } } return index; } // Index of minimum value in a word32 vector. size_t WebRtcSpl_MinIndexW32(const int32_t* vector, size_t length) { size_t i = 0, index = 0; int32_t minimum = WEBRTC_SPL_WORD32_MAX; RTC_DCHECK_GT(length, 0); for (i = 0; i < length; i++) { if (vector[i] < minimum) { minimum = vector[i]; index = i; } } return index; }
// // Controller.h // Xbox Live Friends // // i trip blind kids, what's your anti-drug? // // © 2006 mindquirk // #import <Cocoa/Cocoa.h> #import "StayAround.h" @interface Controller : NSObject { //misc IBOutlet NSTextView *sourceLogger; NSTimer *refreshTimer; IBOutlet NSButton *autoRefresh; IBOutlet NSTextField *refreshTime; BOOL isRegistered; NSOperationQueue *queue; IBOutlet NSMenuItem *debugMenu; } + (StayAround *)stayArounds; - (NSOperationQueue *)operationQueue; - (void)timedRefresh; - (void)startRefreshTimer; - (IBAction)toggleRefreshTimer:(id)sender; - (IBAction)changeRefreshTime:(id)sender; @end
// // NNFreezableView.h // NNFreezableViewDemo // // Created by noughts on 2014/11/24. // Copyright (c) 2014年 noughts. All rights reserved. // #import <UIKit/UIKit.h> @interface NNFreezableView : UIView -(void)freeze; -(void)freezeAfterScreenUpdates:(BOOL)afterScreenUpdates; -(void)unfreeze; @end
#ifndef _LIBANIM_SPRITE_H_ #define _LIBANIM_SPRITE_H_ #include <ee/Sprite.h> #include <sprite2/AnimSprite.h> namespace libanim { class Symbol; class Sprite : public s2::AnimSprite, public ee::Sprite { public: Sprite(const Sprite& spr); Sprite& operator = (const Sprite& spr); Sprite(const s2::SymPtr& sym, uint32_t id = -1); /** * @interface * ee::Sprite */ virtual void Load(const Json::Value& val, const std::string& dir = "") override; virtual void Store(Json::Value& val, const std::string& dir = "") const override; virtual void Load(const s2s::NodeSpr* spr) override; virtual ee::PropertySetting* CreatePropertySetting(ee::EditPanelImpl* stage) override; bool IsLoop() const { return m_loop; } float GetInterval() const { return m_interval; } int GetFPS() const { return m_fps; } bool IsStartRandom() const { return m_start_random; } int GetStaticTime() const { return m_static_time; } void SetStaticTime(int static_time); bool IsActive() const; static ee::SprPtr Create(const std::shared_ptr<ee::Symbol>& sym); private: int m_static_time; S2_SPR_CLONE_FUNC(Sprite) }; // Sprite } #endif // _LIBANIM_SPRITE_H_
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_http_auth_h__ #define INCLUDE_http_auth_h__ #include BLIK_LIBGIT2_U_git2_h //original-code:"git2.h" #include BLIK_LIBGIT2_U_netops_h //original-code:"netops.h" typedef enum { GIT_AUTHTYPE_BASIC = 1, GIT_AUTHTYPE_NEGOTIATE = 2, } git_http_authtype_t; typedef struct git_http_auth_context git_http_auth_context; struct git_http_auth_context { /** Type of scheme */ git_http_authtype_t type; /** Supported credentials */ git_credtype_t credtypes; /** Sets the challenge on the authentication context */ int (*set_challenge)(git_http_auth_context *ctx, const char *challenge); /** Gets the next authentication token from the context */ int (*next_token)(git_buf *out, git_http_auth_context *ctx, git_cred *cred); /** Frees the authentication context */ void (*free)(git_http_auth_context *ctx); }; typedef struct { /** Type of scheme */ git_http_authtype_t type; /** Name of the scheme (as used in the Authorization header) */ const char *name; /** Credential types this scheme supports */ git_credtype_t credtypes; /** Function to initialize an authentication context */ int (*init_context)( git_http_auth_context **out, const gitno_connection_data *connection_data); } git_http_auth_scheme; int git_http_auth_dummy( git_http_auth_context **out, const gitno_connection_data *connection_data); int git_http_auth_basic( git_http_auth_context **out, const gitno_connection_data *connection_data); #endif
#include <stdlib.h> #include <assert.h> #include "xdg-surface.h" #include "internal.h" #include "macros.h" #include "compositor/view.h" #include "compositor/output.h" #include "compositor/seat/seat.h" #include "compositor/seat/pointer.h" #include "resources/types/surface.h" static_assert_x(XDG_SHELL_VERSION_CURRENT == 5, generated_protocol_and_implementation_version_are_different); static void xdg_cb_surface_set_parent(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; struct wlc_view *parent = (parent_resource ? convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(parent_resource), "view") : NULL); wlc_view_set_parent_ptr(view, parent); } static void xdg_cb_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) { (void)client; wlc_view_set_title_ptr(convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"), title); } static void xdg_cb_surface_set_app_id(struct wl_client *client, struct wl_resource *resource, const char *app_id) { (void)client; wlc_view_set_app_id_ptr(convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"), app_id); } static void xdg_cb_surface_show_window_menu(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, uint32_t serial, int32_t x, int32_t y) { (void)client, (void)resource, (void)seat, (void)serial, (void)x, (void)y; STUBL(resource); } static void xdg_cb_surface_move(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial) { (void)client, (void)resource, (void)serial; struct wlc_seat *seat; if (!(seat = wl_resource_get_user_data(seat_resource))) return; if (!seat->pointer.focused.view) return; wlc_dlog(WLC_DBG_REQUEST, "(%" PRIuWLC ") requested move", seat->pointer.focused.view); const struct wlc_origin o = { seat->pointer.pos.x, seat->pointer.pos.y }; WLC_INTERFACE_EMIT(view.request.move, seat->pointer.focused.view, &o); } static void xdg_cb_surface_resize(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges) { (void)client, (void)resource, (void)serial; struct wlc_seat *seat; if (!(seat = wl_resource_get_user_data(seat_resource))) return; if (!seat->pointer.focused.view) return; wlc_dlog(WLC_DBG_REQUEST, "(%" PRIuWLC ") requested resize", seat->pointer.focused.view); const struct wlc_origin o = { seat->pointer.pos.x, seat->pointer.pos.y }; WLC_INTERFACE_EMIT(view.request.resize, seat->pointer.focused.view, edges, &o); } static void xdg_cb_surface_ack_configure(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { (void)client, (void)serial, (void)resource; } static void xdg_cb_surface_set_window_geometry(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; view->surface_pending.visible = (struct wlc_geometry){ { x, y }, { width, height } }; wlc_view_update(view); } static void xdg_cb_surface_set_maximized(struct wl_client *client, struct wl_resource *resource) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; wlc_view_request_state(view, WLC_BIT_MAXIMIZED, true); } static void xdg_cb_surface_unset_maximized(struct wl_client *client, struct wl_resource *resource) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; wlc_view_request_state(view, WLC_BIT_MAXIMIZED, false); } static void xdg_cb_surface_set_fullscreen(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; if (!wlc_view_request_state(view, WLC_BIT_FULLSCREEN, true)) return; struct wlc_output *output; if (output_resource && ((output = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(output_resource), "output")))) wlc_view_set_output_ptr(view, output); } static void xdg_cb_surface_unset_fullscreen(struct wl_client *client, struct wl_resource *resource) { (void)client; struct wlc_view *view; if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"))) return; wlc_view_request_state(view, WLC_BIT_FULLSCREEN, false); } static void xdg_cb_surface_set_minimized(struct wl_client *client, struct wl_resource *resource) { (void)client; wlc_view_set_minimized_ptr(convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view"), true); } WLC_CONST const struct xdg_surface_interface* wlc_xdg_surface_implementation(void) { static const struct xdg_surface_interface xdg_surface_implementation = { .destroy = wlc_cb_resource_destructor, .set_parent = xdg_cb_surface_set_parent, .set_title = xdg_cb_surface_set_title, .set_app_id = xdg_cb_surface_set_app_id, .show_window_menu = xdg_cb_surface_show_window_menu, .move = xdg_cb_surface_move, .resize = xdg_cb_surface_resize, .ack_configure = xdg_cb_surface_ack_configure, .set_window_geometry = xdg_cb_surface_set_window_geometry, .set_maximized = xdg_cb_surface_set_maximized, .unset_maximized = xdg_cb_surface_unset_maximized, .set_fullscreen = xdg_cb_surface_set_fullscreen, .unset_fullscreen = xdg_cb_surface_unset_fullscreen, .set_minimized = xdg_cb_surface_set_minimized }; return &xdg_surface_implementation; }
#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 Pods_JoBaseComm_TestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_JoBaseComm_TestsVersionString[];
// // AlertCenter.h // Network Monitor // // Created by HCorbucc on 10/13/14. // Copyright (c) 2014 Hugo Corbucci. All rights reserved. // #ifndef Network_Monitor_AlertCenter_h #define Network_Monitor_AlertCenter_h #import <Foundation/Foundation.h> @protocol AlertCenter <NSObject> - (void) announce:(NSString*) message; @end #endif
// // AppDelegate.h // DemoTableView // // Created by hoang dang trung on 9/24/15. // Copyright © 2015 hoang dang trung. All rights reserved. // #import <UIKit/UIKit.h> #import "TableViewController.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#ifndef _RENDERER_FPS_DISPLAY #define _RENDERER_FPS_DISPLAY #include "TextureText.h" class RendererFPSDisplay : public TextureText { int mLastUpdateTime; int mUpdateIntervalInMillis; public: RendererFPSDisplay(TextureFont* font); RendererFPSDisplay(PersistentData& storageData); void Update(); void Serialize(PersistentData& storageData); void DeSerialize(PersistentData& storageData); virtual std::string GetTypeString() { return "RendererFPSDisplay"; } }; #endif
#ifndef GRIT_ATTRIBUTE_VECTOR_H #define GRIT_ATTRIBUTE_VECTOR_H #include <grit_simplex.h> #include <grit_simplex_set.h> #include <map> #include <vector> #include <algorithm> // Needed for std::min and std::max #include <limits> // Needed for std::numeric_limits namespace grit { template<typename T> class SimplexAttributeVector { }; template<typename T> class Simplex0AttributeVector : public SimplexAttributeVector<T> { protected: std::vector<T> m_data; public: typedef typename std::vector<T>::iterator iterator; typedef typename std::vector<T>::const_iterator const_iterator; iterator begin() { return this->m_data.begin(); } const_iterator begin() const { return this->m_data.begin(); } iterator end() { return this->m_data.end(); } const_iterator end() const { return this->m_data.end(); } public: Simplex0AttributeVector() : m_data() {} virtual ~Simplex0AttributeVector(){} Simplex0AttributeVector( Simplex0AttributeVector const & v) { *this = v; } Simplex0AttributeVector & operator=( Simplex0AttributeVector const & v ) { if(this!=&v) { this->m_data = v.m_data; } return *this; } public: T & operator[](Simplex0 const & s) { this->m_data.resize((s.get_idx0() + 1 > size()) ? s.get_idx0() + 1 : size()); return this->m_data[s.get_idx0()]; } T const & operator[](Simplex0 const & s) const { return this->m_data[s.get_idx0()]; } size_t size() const { return this->m_data.size(); } void insert_from_simplex_set(SimplexSet const & A, Simplex0AttributeVector<T> const & data) { typedef typename SimplexSet::simplex0_const_iterator iterator0; //--- Make sure we have space enough for inserting data using std::min; using std::max; typename Simplex::index_type idx_min = std::numeric_limits<typename Simplex::index_type>::max(); typename Simplex::index_type idx_max = std::numeric_limits<typename Simplex::index_type>::min(); for (iterator0 it = A.begin0(); it != A.end0(); ++it) { Simplex0 const s = *it; idx_min = min( s.get_idx0(), idx_min); idx_max = max( s.get_idx0(), idx_max); } if (this->m_data.size() != idx_max+1u ) { this->m_data.resize( idx_max+1u ); } //--- Now we are sure we got memory allocated to now we can insert stuff for (iterator0 it = A.begin0(); it != A.end0(); ++it) { Simplex0 const s = *it; this->m_data[s.get_idx0()] = data[s]; } } void clear() { this->m_data.clear(); } }; template<typename T1, typename T2> inline void scale(Simplex0AttributeVector<T1> & data, T2 const & value) { typedef typename Simplex0AttributeVector<T1>::iterator iterator; iterator begin = data.begin(); iterator end = data.end(); for(iterator it = begin; it != end; ++it) *it *= value; } template<typename T1, typename T2> inline void scale(Simplex0AttributeVector<T1> & data, T2 const & sx, T2 const & sy) { typedef typename Simplex0AttributeVector<T1>::iterator iterator; iterator begin = data.begin(); iterator end = data.end(); for(iterator it = begin; it != end; ++it) { (*it)[0] *= sx; (*it)[1] *= sy; } } template<typename T> class Simplex1AttributeVector : public SimplexAttributeVector<T> { protected: std::map<Simplex1, T> m_data; public: T & operator[](Simplex1 const & s) { return m_data[s]; } T const & operator[](Simplex1 const & s) const { return m_data.at(s);//C++11 feature } size_t size() const { return m_data.size(); } void erase(Simplex1 const & s) { m_data.erase(s); } void clear() { m_data.clear(); } bool has_value(Simplex1 const & s) const { return (m_data.find(s) != m_data.end()); } }; template<typename T> class Simplex2AttributeVector : public SimplexAttributeVector<T> { protected: std::map<Simplex2, T> m_data; public: T const & operator[](Simplex2 const & s) const { return m_data.at(s);//C++11 feature } T & operator[](Simplex2 const & s) { return m_data[s]; } size_t size() const { return m_data.size(); } void erase(Simplex2 const & s) { m_data.erase(s); } void clear() { m_data.clear(); } bool has_value(Simplex2 const & s) const { return (m_data.find(s) != m_data.end()); } }; }// end namespace grit // GRIT_ATTRIBUTE_VECTOR_H #endif
// // DDAViewController.h // UIMotionEffectSample // // Created by Dulio Denis on 5/20/14. // Copyright (c) 2014 ddApps. All rights reserved. // @interface DDAViewController : UIViewController @end
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <cstdint> #include <limits> namespace facebook { namespace bistro { // TODO: Get rid of this in favor of the Thrift struct as soon as we figure // out our Thrift story? (#3885590) struct LogLine { // Marks LogLines that are not authentic log lines, but which instead store // some kind of error or warning about the log line fetching process. enum { kNotALineID = -1 }; // TODO(agoder): Can haz zero-copy construction? LogLine( std::string job_id, std::string node_id, int32_t time, std::string line, int64_t line_id ) : jobID(job_id), nodeID(node_id), time(time), line(line), lineID(line_id) {} std::string jobID; std::string nodeID; int32_t time; std::string line; int64_t lineID; static int64_t makeLineID(int32_t time, uint32_t count) { return ((int64_t)time << 32) | count; } static int64_t lineIDFromTime(int32_t time, bool is_ascending) { return LogLine::makeLineID( time, is_ascending ? std::numeric_limits<uint32_t>::min() : std::numeric_limits<uint32_t>::max() ); } static int32_t timeFromLineID(int64_t line_id) { return line_id >> 32; } }; struct LogLines { // Can contain "error" lines whose lineID == kNotALineID std::vector<LogLine> lines; int64_t nextLineID; // If no more lines, equals kNotALineID }; }}
// BinaryFunctionSearch.h /* * Copyright (C) 2013-2014 Spencer T. Parkin * * This software has been released under the MIT License. * See the "License.txt" file in the project root directory * for more information about this license. * */ namespace VectorMath { class BinaryFunctionSearch { public: // We assume that this function is continuous on any // compact interval so that we can apply the intermediate // value theorem. class Function { public: virtual double Evaluate( double x ) = 0; }; BinaryFunctionSearch( Function* function ); virtual ~BinaryFunctionSearch( void ); // Return the first found value x, if any, in the given range such that f(x)=y. bool FindValue( double& x, double y, double x0, double x1 ); Function* function; }; } // BinaryFunctionSearch.h
// // TBTableDataSectionInternal.h // TableViewBuddy // // Copyright (c) 2014-2016 Hironori Ichimiya <hiron@hironytic.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. // #import <Foundation/Foundation.h> #import "TBTableDataSection.h" #import "TBUpdateStatus.h" @interface TBTableDataSection () @property(nonatomic, assign) BOOL hidden; @property(nonatomic, copy) NSString *headerTitle; @property(nonatomic, copy) NSString *footerTitle; @property(nonatomic, strong) NSMutableArray *mutableRows; @property(nonatomic, assign) TBUpdateStatus updateStatus; @property(nonatomic, strong) NSMutableArray *insertedRows; @property(nonatomic, strong) NSMutableArray *insertedSections; @end
#include <stdio.h> /* * Purpose * ======= * Returns the time in seconds used by the process. * * Note: the timer function call is machine dependent. Use conditional * compilation to choose the appropriate function. * */ #ifdef _GIVE_UP_THIS_ONE_ /* * It uses the system call gethrtime(3C), which is accurate to * nanoseconds. */ #include <sys/time.h> double sys_timer() { return ( (double)gethrtime() / 1e9 ); } #else #include <sys/types.h> #include <sys/times.h> #include <time.h> #include <sys/time.h> #ifndef CLK_TCK #define CLK_TCK 100 #endif #ifndef CLOCKS_PER_SEC #define CLOCKS_PER_SEC 1000000 #endif double sys_timer_CLOCK() { clock_t tmp; tmp = clock(); return (double) tmp/(CLOCKS_PER_SEC); } double sys_timer() { struct tms use; clock_t tmp; times(&use); tmp = use.tms_utime + use.tms_stime; return (double)(tmp) / CLK_TCK; } #endif
#ifndef __UIOBJ_H_INCLUDED__ #define __UIOBJ_H_INCLUDED__ #include <stdio.h> #include <string> #include <functional> using namespace std; class UIObject { public: UIObject(string uiName, int x1, int y1, int x2, int y2); UIObject(string uiName, int x1, int y1, int x2, int y2, function<void()> clickEvent); // UIObject(string uiName, int x1, int y1, int x2, int y2, function<void()> clickEvent, int clickParam); bool collisionDetection(int x, int y); int x1; int y1; int x2; int y2; string uiName; function<void()> clickEvent; void triggerClickEvent(); // int clickParam; }; #endif
// // DDDHakkenReadLater.h // Hakken // // Created by Sidd Sathyam on 1/31/15. // Copyright (c) 2015 dotdotdot. All rights reserved. // #import <Foundation/Foundation.h> @class DDDHackerNewsItem; @protocol DDDHakkenReadLater <NSObject> @optional + (RACSignal *)addItemToReadLater:(DDDHackerNewsItem *)item; + (RACSignal *)removeItemFromReadLater:(DDDHackerNewsItem *)item; + (RACSignal *)fetchAllItemsToReadLater; + (RACSignal *)fetchUnreadReadLaterItems; + (RACSignal *)fetchReadReadLaterItems; + (RACSignal *)markStoryAsRead:(DDDHackerNewsItem *)item; + (RACSignal *)markStoryAsUnread:(DDDHackerNewsItem *)item; // The completion contains all of the items that were removed from the readlater queue + (RACSignal *)removeAllItemsFromReadLater; @end
#ifndef SCORE_TICK_C #define SCORE_TICK_C #include "print.c" // ------------------ Global Variables ------------------ //unsigned short displayPeriod = 250; //unsigned char score = 0; //input //unsigned char endGame = 0; //input //unsigned char endPoints; // ------------------------------------------------------ // ------------------- Score State SM ------------------- enum scoreStates {Wait, Display}; int scoreTick(int scoreState) { switch(scoreState) { case Wait: if (endGame) { scoreState = Display; printScore(score); } break; case Display: if (GetKeypadKey() == '1') { scoreState = Wait; endPoints = 1; clearDisplay(); } break; default: break; } switch(scoreState) { case Wait: break; case Display: break; default: break; } return scoreState; } // ------------------------------------------------------ #endif
/* Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. obtain a copy of the License at http://www.imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image color methods. */ #ifndef MAGICKCORE_COLOR_H #define MAGICKCORE_COLOR_H #include "magick/pixel.h" #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedCompliance, NoCompliance = 0x0000, CSSCompliance = 0x0001, SVGCompliance = 0x0001, X11Compliance = 0x0002, XPMCompliance = 0x0004, AllCompliance = 0x7fffffff } ComplianceType; typedef struct _ColorInfo { char *path, *name; ComplianceType compliance; MagickPixelPacket color; MagickBooleanType exempt, stealth; struct _ColorInfo *previous, *next; /* deprecated, use GetColorInfoList() */ size_t signature; } ColorInfo; typedef struct _ErrorInfo { double mean_error_per_pixel, normalized_mean_error, normalized_maximum_error; } ErrorInfo; extern MagickExport char **GetColorList(const char *,size_t *,ExceptionInfo *); extern MagickExport const ColorInfo *GetColorInfo(const char *,ExceptionInfo *), **GetColorInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType ColorComponentGenesis(void), IsColorSimilar(const Image *,const PixelPacket *,const PixelPacket *), IsImageSimilar(const Image *,const Image *,ssize_t *x,ssize_t *y, ExceptionInfo *), IsMagickColorSimilar(const MagickPixelPacket *,const MagickPixelPacket *), IsOpacitySimilar(const Image *,const PixelPacket *,const PixelPacket *), ListColorInfo(FILE *,ExceptionInfo *), QueryColorCompliance(const char *,const ComplianceType,PixelPacket *, ExceptionInfo *), QueryColorDatabase(const char *,PixelPacket *,ExceptionInfo *), QueryColorname(const Image *,const PixelPacket *,const ComplianceType,char *, ExceptionInfo *), QueryMagickColorCompliance(const char *,const ComplianceType, MagickPixelPacket *,ExceptionInfo *), QueryMagickColor(const char *,MagickPixelPacket *,ExceptionInfo *), QueryMagickColorname(const Image *,const MagickPixelPacket *, const ComplianceType,char *,ExceptionInfo *); extern MagickExport void ColorComponentTerminus(void), ConcatenateColorComponent(const MagickPixelPacket *,const ChannelType, const ComplianceType,char *), GetColorTuple(const MagickPixelPacket *,const MagickBooleanType,char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif
// // UIDevice+WiFi_yq.h // YQToolsDemo // // Created by WeiXinbing on 2019/6/5. // Copyright © 2019 weixb. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface UIDevice (WiFi_yq) // WiFi 的名称 + (NSString *)WiFiName; // WiFi 的路由器的 Mac 地址 + (NSString *)WiFiBSSID; // 本机地址 + (NSString *)ifa_addr; // 广播地址 + (NSString *)ifa_dstaddr; // 子网掩码地址 + (NSString *)ifa_netmask; // 端口地址 + (NSString *)ifa_name; // 路由器地址 + (NSString *)route_addr; // 获取公网IP信息 + (NSDictionary *)getIpInfo; // IP转经纬度 + (NSDictionary *)getLocationInfo; //格式化方法 + (NSString*)formatNetWork:(long long int)rate; @end NS_ASSUME_NONNULL_END
#pragma once #include <d3d9.h> #include <d3dx9.h> #include "DxUtils.h" #include "PostPRocess.h" #include "PostProcessBloom.h" #include "PostProcessSMAA.h" #include "PostProcessHDR.h" //#define RENDER_TO_BACK_BUFFER // kinda buggy.. namespace PP{ #define MAX_POST_PROCESS_COUNT 5 extern IDirect3DDevice9* m_pDevice; extern UINT g_deviceWidth; extern UINT g_deviceHeight; extern IDirect3DTexture9* g_pSourceRT_Texture; extern IDirect3DSurface9* g_pSourceRT_Surface; extern IDirect3DTexture9* g_pTargetRT_Texture; extern IDirect3DSurface9* g_pTargetRT_Surface; extern PostProcess* g_pPostProcessChain[MAX_POST_PROCESS_COUNT]; extern int g_post_process_count; extern bool g_presented; // // Function Declaration // HRESULT initTemporaryResources(IDirect3DDevice9* pd3dDevice); HRESULT initPermanentResources(IDirect3DDevice9* pd3dDevice); HRESULT releaseTemporaryResources(); HRESULT releasePermanentResources(); void setupScreenDimensions(IDirect3DDevice9* pd3dDevice); void swapTextures(); HRESULT PerformPostProcess(IDirect3DDevice9* pd3dDevice); // // Standard Procedure Functions // void onCreateDevice(IDirect3DDevice9* pd3dDevice); void onLostDevice(); void onResetDevice(IDirect3DDevice9* pd3dDevice); void onDestroy(IDirect3DDevice9* pd3dDevice); }
#include <evcon-glib.h> #include <evcon-allocator.h> #include <evcon-config-private.h> #define UNUSED(x) ((void)(x)) /* GLib slice wrapper */ static void* evcon_glib_alloc_cb(size_t size, void* user_data) { UNUSED(user_data); return g_slice_alloc(size); } static void evcon_glib_free_cb(void *ptr, size_t size, void *user_data) { UNUSED(user_data); g_slice_free1(size, ptr); } evcon_allocator* evcon_glib_allocator(void) { static char static_allocator_buf[EVCON_ALLOCATOR_RECOMMENDED_SIZE]; static volatile evcon_allocator* allocator = NULL; static volatile int lock = 0; if (2 == g_atomic_int_get(&lock)) return (evcon_allocator*) allocator; while (!g_atomic_int_compare_and_exchange(&lock, 0, 1)) { if (2 == g_atomic_int_get(&lock)) return (evcon_allocator*) allocator; } allocator = evcon_allocator_init(static_allocator_buf, sizeof(static_allocator_buf), NULL, evcon_glib_alloc_cb, evcon_glib_free_cb); g_atomic_int_set(&lock, 2); return (evcon_allocator*) allocator; }
// // AppDelegate.h // MySpec // // Created by Кирилл on 30.11.15. // Copyright © 2015 Кирилл. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; @end
#ifndef FONTSCALABLEPUSHBUTTON_H #define FONTSCALABLEPUSHBUTTON_H #include <QWidget> #include <QPushButton> class FontScalablePushButton : public QPushButton { Q_OBJECT protected: bool _fontAdjusted = false; protected: virtual void resizeEvent (QResizeEvent* evt); public: explicit FontScalablePushButton (QWidget *parent = 0); }; #endif // FONTSCALABLEPUSHBUTTON_H
// // GWEN // Copyright (c) 2013-2015 James Lammlein // Copyright (c) 2010 Facepunch Studios // // This file is part of GWEN. // // MIT License // // 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 "Gwen/Controls/Base.h" #include "Gwen/skin/gwen_skin_base.h" namespace Gwen { namespace ControlsInternal { /// \brief This class represents a right arrow for a menu item. class MenuItemRightArrow : public Controls::Base { public: /// \brief Constructor. GWEN_CONTROL(MenuItemRightArrow, Controls::Base); protected: /// \brief Draws the UI element. virtual void Render(Skin::Base* skin) override; }; }; // namespace ControlsInternal }; // namespace Gwen
// // ___FILENAME___ // ___PROJECTNAME___ // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright © ___YEAR___ ___FULLUSERNAME___. All rights reserved. // #import <UIKit/UIKit.h> @interface UIViewController (Swizzling) @end
#ifndef APP_SETTINGS_H #define APP_SETTINGS_H #include <string> #include <vector> #include <boost\program_options.hpp> #include <Logger\Logger.h> #include <boost\filesystem.hpp> #include <boost\algorithm\string.hpp> #include <CGMath.h> enum DISPLAY_TYPE{ POINT_CLOUD, MESH_WIRE_FRAME, MESH_FILLED, UNKNOWN_TYPE }; static const std::string DISPLAY_TYPE_STR[DISPLAY_TYPE::UNKNOWN_TYPE] = { "POINT_CLOUD", "MESH_WIRE_FRAME", "MESH_FILLED" }; static inline DISPLAY_TYPE get_display_type(const std::string &_str){ for (int i = 0; i < DISPLAY_TYPE::UNKNOWN_TYPE; ++i){ if (boost::iequals(DISPLAY_TYPE_STR[i], _str)){ return DISPLAY_TYPE(i); } } return DISPLAY_TYPE::UNKNOWN_TYPE; } struct app_settings{ float p_fov; float p_zNear; float p_zFar; float p_zoom_factor; bool p_auto_rotate; float p_rotate_x; float p_rotate_y; float p_rotate_z; float p_rotate_about_x; float p_rotate_about_y; float p_rotate_about_z; float p_rotate_speed; DISPLAY_TYPE p_display_type; app_settings(){ p_fov = 50.0; p_zNear = 0.01; p_zFar = 1000.0; p_zoom_factor = 5.0; p_auto_rotate = false; p_rotate_x = 0; p_rotate_y = 1; p_rotate_z = 0; p_rotate_about_x = 0; p_rotate_about_y = 1; p_rotate_about_z = 0; p_rotate_speed = 0.5; p_display_type = DISPLAY_TYPE::POINT_CLOUD; }; bool read_settings(const std::string &_settings_file){ try { std::vector<std::string> options; if (!read_file(_settings_file, options)){ AceLogger::Log("Cannot read settings as the settings file not found.", AceLogger::LOG_ERROR); return false; } namespace po = boost::program_options; po::options_description desc("Options"); std::string auto_rotate; std::string display_type; desc.add_options() ("help", "Print help messages") ("zoom_factor", po::value<float>(&p_zoom_factor)->default_value(5), "camera zoom factor") ("fov", po::value<float>(&p_fov)->default_value(0), "camera fov") ("znear", po::value<float>(&p_zNear)->default_value(0), "camera closest z rendered") ("zfar", po::value<float>(&p_zFar)->default_value(0), "camera furthest z rendered") ("auto_rotate", po::value<std::string>(&auto_rotate)->default_value("No"), "auto rotate the view") ("rotate_x", po::value<float>(&p_rotate_x)->default_value(0), "rotate about point x") ("rotate_y", po::value<float>(&p_rotate_y)->default_value(0), "rotate about point y") ("rotate_z", po::value<float>(&p_rotate_z)->default_value(0), "rotate about point z") ("rotate_about_x", po::value<float>(&p_rotate_about_x)->default_value(0), "rotate about x") ("rotate_about_y", po::value<float>(&p_rotate_about_y)->default_value(0), "rotate about y") ("rotate_about_z", po::value<float>(&p_rotate_about_z)->default_value(0), "rotate about z") ("rotate_speed", po::value<float>(&p_rotate_speed)->default_value(0), "rotate speed degrees per second") ("display_type", po::value<std::string>(&display_type)->default_value(DISPLAY_TYPE_STR[DISPLAY_TYPE::POINT_CLOUD].c_str()), "display type(POINT_CLOUD, MESH_WIRE_FRAME or MESH_FILLED)") ; po::variables_map vm; try { po::store(po::command_line_parser(options).options(desc).run(), vm); if (vm.count("help")) { AceLogger::Log("Help not available", AceLogger::LOG_WARNING); return false; } po::notify(vm); p_display_type = get_display_type(display_type); if (p_display_type == DISPLAY_TYPE::UNKNOWN_TYPE){ AceLogger::Log("invalid option for display_type( POINT_CLOUD, MESH_WIRE_FRAME or MESH_FILLED)", AceLogger::LOG_ERROR); return false; } if (!get_bool(auto_rotate, p_auto_rotate)){ AceLogger::Log("invalid option for auto_rotate( choose yes or no)", AceLogger::LOG_ERROR); return false; } return validate_settings(); } catch (po::error& e) { AceLogger::Log(e.what(), AceLogger::LOG_ERROR); return false; } } catch (std::exception& e) { AceLogger::Log("Unhandled Exception", AceLogger::LOG_ERROR); AceLogger::Log(e.what(), AceLogger::LOG_ERROR); return false; } } private: bool read_file(const std::string &_file_path, std::vector<std::string> &_data)const{ if (!boost::filesystem::exists(boost::filesystem::path(_file_path))){ AceLogger::Log("file doesn't exist: " + _file_path, AceLogger::LOG_ERROR); return false; } std::ifstream ifs(_file_path); std::string temp; while (std::getline(ifs, temp)){ _data.push_back(temp); } ifs.close(); return true; }; bool get_bool(std::string _str, bool &_val){ boost::trim(_str); if (boost::iequals(_str, "Yes")){ _val = true; return true; } else if (boost::iequals(_str, "No")){ _val = false; return true; } return false; } bool validate_settings()const { bool returnVal = true; if (returnVal) AceLogger::Log("input data validated"); return returnVal; } }; #endif
/* patchlevel.h * * Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, * 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. * */ #ifndef __PATCHLEVEL_H_INCLUDED__ /* do not adjust the whitespace! Configure expects the numbers to be * exactly on the third column */ #define PERL_REVISION 5 /* age */ #define PERL_VERSION 18 /* epoch */ #define PERL_SUBVERSION 2 /* generation */ /* The following numbers describe the earliest compatible version of Perl ("compatibility" here being defined as sufficient binary/API compatibility to run XS code built with the older version). Normally this should not change across maintenance releases. Note that this only refers to an out-of-the-box build. Many non-default options such as usemultiplicity tend to break binary compatibility more often. This is used by Configure et al to figure out PERL_INC_VERSION_LIST, which lists version libraries to include in @INC. See INSTALL for how this works. Porting/bump-perl-version will automatically set these to the version of perl to be released for blead releases, and to 5.X.0 for maint releases. Manually changing them should not be necessary. */ #define PERL_API_REVISION 5 #define PERL_API_VERSION 18 #define PERL_API_SUBVERSION 0 /* XXX Note: The selection of non-default Configure options, such as -Duselonglong may invalidate these settings. Currently, Configure does not adequately test for this. A.D. Jan 13, 2000 */ #define __PATCHLEVEL_H_INCLUDED__ #endif /* local_patches -- list of locally applied less-than-subversion patches. If you're distributing such a patch, please give it a name and a one-line description, placed just before the last NULL in the array below. If your patch fixes a bug in the perlbug database, please mention the bugid. If your patch *IS* dependent on a prior patch, please place your applied patch line after its dependencies. This will help tracking of patch dependencies. Please either use 'diff --unified=0' if your diff supports that or edit the hunk of the diff output which adds your patch to this list, to remove context lines which would give patch problems. For instance, if the original context diff is *** patchlevel.h.orig <date here> --- patchlevel.h <date here> *** 38,43 *** --- 38,44 --- ,"FOO1235 - some patch" ,"BAR3141 - another patch" ,"BAZ2718 - and another patch" + ,"MINE001 - my new patch" ,NULL }; please change it to *** patchlevel.h.orig <date here> --- patchlevel.h <date here> *** 41,43 *** --- 41,44 --- + ,"MINE001 - my new patch" ,NULL }; (Note changes to line numbers as well as removal of context lines.) This will prevent patch from choking if someone has previously applied different patches than you. History has shown that nobody distributes patches that also modify patchlevel.h. Do it yourself. The following perl program can be used to add a comment to patchlevel.h: #!perl die "Usage: perl -x patchlevel.h comment ..." unless @ARGV; open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; my $seen=0; while (<PLIN>) { if (/\t,NULL/ and $seen) { while (my $c = shift @ARGV){ $c =~ s|\\|\\\\|g; $c =~ s|"|\\"|g; print PLOUT qq{\t,"$c"\n}; } } $seen++ if /local_patches\[\]/; print PLOUT; } close PLOUT or die "Couldn't close filehandle writing to patchlevel.new : $!"; close PLIN or die "Couldn't close filehandle reading from patchlevel.h : $!"; close DATA; # needed to allow unlink to work win32. unlink "patchlevel.bak" or warn "Couldn't unlink patchlevel.bak : $!" if -e "patchlevel.bak"; rename "patchlevel.h", "patchlevel.bak" or die "Couldn't rename patchlevel.h to patchlevel.bak : $!"; rename "patchlevel.new", "patchlevel.h" or die "Couldn't rename patchlevel.new to patchlevel.h : $!"; __END__ Please keep empty lines below so that context diffs of this file do not ever collect the lines belonging to local_patches() into the same hunk. */ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) # if defined(PERL_IS_MINIPERL) # define PERL_PATCHNUM "UNKNOWN-miniperl" # define PERL_GIT_UNPUSHED_COMMITS /*leave-this-comment*/ # elif defined(PERL_MICRO) # define PERL_PATCHNUM "UNKNOWN-microperl" # define PERL_GIT_UNPUSHED_COMMITS /*leave-this-comment*/ # else #include "git_version.h" # endif static const char * const local_patches[] = { NULL #ifdef PERL_GIT_UNCOMMITTED_CHANGES ,"uncommitted-changes" #endif PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ #ifdef DEBIAN #include "patchlevel-debian.h" #endif ,NULL }; /* Initial space prevents this variable from being inserted in config.sh */ # define LOCAL_PATCH_COUNT \ ((int)(sizeof(local_patches)/sizeof(local_patches[0])-2)) /* the old terms of reference, add them only when explicitly included */ #define PATCHLEVEL PERL_VERSION #undef SUBVERSION /* OS/390 has a SUBVERSION in a system header */ #define SUBVERSION PERL_SUBVERSION #endif
// Copyright (c) 2011-2013 The Flirtcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef FLIRTCOIN_QT_TRAFFICGRAPHWIDGET_H #define FLIRTCOIN_QT_TRAFFICGRAPHWIDGET_H #include <QWidget> #include <QQueue> class ClientModel; QT_BEGIN_NAMESPACE class QPaintEvent; class QTimer; QT_END_NAMESPACE class TrafficGraphWidget : public QWidget { Q_OBJECT public: explicit TrafficGraphWidget(QWidget *parent = 0); void setClientModel(ClientModel *model); int getGraphRangeMins() const; protected: void paintEvent(QPaintEvent *); public slots: void updateRates(); void setGraphRangeMins(int mins); void clear(); private: void paintPath(QPainterPath &path, QQueue<float> &samples); QTimer *timer; float fMax; int nMins; QQueue<float> vSamplesIn; QQueue<float> vSamplesOut; quint64 nLastBytesIn; quint64 nLastBytesOut; ClientModel *clientModel; }; #endif // FLIRTCOIN_QT_TRAFFICGRAPHWIDGET_H
#ifndef ALIANALYSISTASKEMCALSAMPLETEST_H #define ALIANALYSISTASKEMCALSAMPLETEST_H // $Id$ class TH1; class TH2; class TH3; class AliParticleContainer; class AliClusterContainer; #include "AliAnalysisTaskEmcal.h" class AliAnalysisTaskEmcalSampleTEST : public AliAnalysisTaskEmcal { public: AliAnalysisTaskEmcalSampleTEST(); AliAnalysisTaskEmcalSampleTEST(const char *name); virtual ~AliAnalysisTaskEmcalSampleTEST(); void UserCreateOutputObjects(); void Terminate(Option_t *option); protected: void ExecOnce(); Bool_t FillHistograms() ; Bool_t Run() ; void CheckClusTrackMatching(); // General histograms TH1 **fHistTracksPt; //!Track pt spectrum TH1 **fHistClustersPt; //!Cluster pt spectrum TH3 *fHistPtDEtaDPhiTrackClus; //!track pt, delta eta, delta phi to matched cluster TH3 *fHistPtDEtaDPhiClusTrack; //!cluster pt, delta eta, delta phi to matched track AliParticleContainer *fTracksCont; //!Tracks AliClusterContainer *fCaloClustersCont; //!Clusters private: AliAnalysisTaskEmcalSampleTEST(const AliAnalysisTaskEmcalSampleTEST&); // not implemented AliAnalysisTaskEmcalSampleTEST &operator=(const AliAnalysisTaskEmcalSampleTEST&); // not implemented ClassDef(AliAnalysisTaskEmcalSampleTEST, 1) // emcal sample analysis task }; #endif
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #if defined __OPENCV_BUILD \ #include "cv_cpu_config.h" #include "cv_cpu_helper.h" #ifdef CV_CPU_DISPATCH_MODE #define CV_CPU_OPTIMIZATION_NAMESPACE __CV_CAT(opt_, CV_CPU_DISPATCH_MODE) #define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace __CV_CAT(opt_, CV_CPU_DISPATCH_MODE) { #define CV_CPU_OPTIMIZATION_NAMESPACE_END } #else #define CV_CPU_OPTIMIZATION_NAMESPACE cpu_baseline #define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace cpu_baseline { #define CV_CPU_OPTIMIZATION_NAMESPACE_END } #endif #define __CV_CPU_DISPATCH_CHAIN_END(fn, args, mode, ...) /* done */ #define __CV_CPU_DISPATCH(fn, args, mode, ...) __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) #define __CV_CPU_DISPATCH_EXPAND(fn, args, ...) __CV_EXPAND(__CV_CPU_DISPATCH(fn, args, __VA_ARGS__)) #define CV_CPU_DISPATCH(fn, args, ...) __CV_CPU_DISPATCH_EXPAND(fn, args, __VA_ARGS__, END) // expand macros #if defined CV_ENABLE_INTRINSICS \ && !defined CV_DISABLE_OPTIMIZATION \ && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */ \ #ifdef CV_CPU_COMPILE_SSE2 # include <emmintrin.h> # define CV_MMX 1 # define CV_SSE 1 # define CV_SSE2 1 #endif #ifdef CV_CPU_COMPILE_SSE3 # include <pmmintrin.h> # define CV_SSE3 1 #endif #ifdef CV_CPU_COMPILE_SSSE3 # include <tmmintrin.h> # define CV_SSSE3 1 #endif #ifdef CV_CPU_COMPILE_SSE4_1 # include <smmintrin.h> # define CV_SSE4_1 1 #endif #ifdef CV_CPU_COMPILE_SSE4_2 # include <nmmintrin.h> # define CV_SSE4_2 1 #endif #ifdef CV_CPU_COMPILE_POPCNT # ifdef _MSC_VER # include <nmmintrin.h> # if defined(_M_X64) # define CV_POPCNT_U64 _mm_popcnt_u64 # endif # define CV_POPCNT_U32 _mm_popcnt_u32 # else # include <popcntintrin.h> # if defined(__x86_64__) # define CV_POPCNT_U64 __builtin_popcountll # endif # define CV_POPCNT_U32 __builtin_popcount # endif # define CV_POPCNT 1 #endif #ifdef CV_CPU_COMPILE_AVX # include <immintrin.h> # define CV_AVX 1 #endif #ifdef CV_CPU_COMPILE_FP16 # if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) # include <arm_neon.h> # else # include <immintrin.h> # endif # define CV_FP16 1 #endif #ifdef CV_CPU_COMPILE_AVX2 # include <immintrin.h> # define CV_AVX2 1 #endif #ifdef CV_CPU_COMPILE_AVX_512F # include <immintrin.h> # define CV_AVX_512F 1 #endif #ifdef CV_CPU_COMPILE_AVX512_SKX # include <immintrin.h> # define CV_AVX512_SKX 1 #endif #ifdef CV_CPU_COMPILE_FMA3 # define CV_FMA3 1 #endif #if defined _WIN32 && defined(_M_ARM) # include <Intrin.h> # include <arm_neon.h> # define CV_NEON 1 #elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) # include <arm_neon.h> # define CV_NEON 1 #endif #if defined(__ARM_NEON__) || defined(__aarch64__) # include <arm_neon.h> #endif #ifdef CV_CPU_COMPILE_VSX # include <altivec.h> # undef vector # undef pixel # undef bool # define CV_VSX 1 #endif #ifdef CV_CPU_COMPILE_VSX3 # define CV_VSX3 1 #endif #endif // CV_ENABLE_INTRINSICS && !CV_DISABLE_OPTIMIZATION && !__CUDACC__ #if defined CV_CPU_COMPILE_AVX && !defined CV_CPU_BASELINE_COMPILE_AVX struct VZeroUpperGuard { #ifdef __GNUC__ __attribute__((always_inline)) #endif inline ~VZeroUpperGuard() { _mm256_zeroupper(); } }; #define __CV_AVX_GUARD VZeroUpperGuard __vzeroupper_guard; CV_UNUSED(__vzeroupper_guard); #endif #ifdef __CV_AVX_GUARD #define CV_AVX_GUARD __CV_AVX_GUARD #else #define CV_AVX_GUARD #endif #endif // __OPENCV_BUILD #if !defined __OPENCV_BUILD /* Compatibility code */ \ && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */ #if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2) # include <emmintrin.h> # define CV_MMX 1 # define CV_SSE 1 # define CV_SSE2 1 #elif defined _WIN32 && defined(_M_ARM) # include <Intrin.h> # include <arm_neon.h> # define CV_NEON 1 #elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) # include <arm_neon.h> # define CV_NEON 1 #elif defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__) # include <altivec.h> # undef vector # undef pixel # undef bool # define CV_VSX 1 #endif #endif // !__OPENCV_BUILD && !__CUDACC (Compatibility code) #ifndef CV_MMX # define CV_MMX 0 #endif #ifndef CV_SSE # define CV_SSE 0 #endif #ifndef CV_SSE2 # define CV_SSE2 0 #endif #ifndef CV_SSE3 # define CV_SSE3 0 #endif #ifndef CV_SSSE3 # define CV_SSSE3 0 #endif #ifndef CV_SSE4_1 # define CV_SSE4_1 0 #endif #ifndef CV_SSE4_2 # define CV_SSE4_2 0 #endif #ifndef CV_POPCNT # define CV_POPCNT 0 #endif #ifndef CV_AVX # define CV_AVX 0 #endif #ifndef CV_FP16 # define CV_FP16 0 #endif #ifndef CV_AVX2 # define CV_AVX2 0 #endif #ifndef CV_FMA3 # define CV_FMA3 0 #endif #ifndef CV_AVX_512F # define CV_AVX_512F 0 #endif #ifndef CV_AVX_512BW # define CV_AVX_512BW 0 #endif #ifndef CV_AVX_512CD # define CV_AVX_512CD 0 #endif #ifndef CV_AVX_512DQ # define CV_AVX_512DQ 0 #endif #ifndef CV_AVX_512ER # define CV_AVX_512ER 0 #endif #ifndef CV_AVX_512IFMA512 # define CV_AVX_512IFMA512 0 #endif #ifndef CV_AVX_512PF # define CV_AVX_512PF 0 #endif #ifndef CV_AVX_512VBMI # define CV_AVX_512VBMI 0 #endif #ifndef CV_AVX_512VL # define CV_AVX_512VL 0 #endif #ifndef CV_AVX512_SKX # define CV_AVX512_SKX 0 #endif #ifndef CV_NEON # define CV_NEON 0 #endif #ifndef CV_VSX # define CV_VSX 0 #endif #ifndef CV_VSX3 # define CV_VSX3 0 #endif
#import "MOBProjection.h" @interface MOBProjectionEPSG3724 : MOBProjection @end
#include <stdio.h> #include <stdlib.h> #define MAX_STACK_SIZE 256 typedef enum { OBJ_INT, OBJ_PAIR } ObjectType; typedef struct StructObject { unsigned char marked; ObjectType type; struct StructObject* next; union { // OBJ_INT int value; // OBJ_PAIR struct { struct StructObject* head; struct StructObject* tail; }; }; } Object; typedef struct { Object* objects[MAX_STACK_SIZE]; int stack_size; int num_of_objects; Object* first_object; } VM; void assert(int predicate, char* message); VM* new_vm(); void push(VM* vm, Object* obj); Object* pop(VM* vm); Object* new_object(ObjectType type); Object* push_int(VM* vm, int value); Object* push_pair(VM* vm); void mark(Object* obj); void mark_all(VM* vm); Object* get_next_marked_object(VM* vm, Object* node); void sweep(VM* vm); void gc(VM* vm); void traverse_objects(VM* vm);
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/ashchauhan/Desktop/SampleApp/OnePoint/Runtime/Common/IOM/ITemplates.java // // Created by ashchauhan on 6/20/14. // //#ifndef _ITemplates_H_ //#define _ITemplates_H_ @protocol ITemplates < NSObject> @end // _ITemplates_H_
// // NSObject+ExecutionTimeLogger.h // PropertySales // // Created by Muddineti, Dhana (NonEmp) on 2/15/14. // Copyright (c) 2014 Shradha iSolutions. All rights reserved. // #import <Foundation/Foundation.h> @interface NSObject (ExecutionTimeLogger) - (void)logExecutionTime:(NSDate *)startTime; @end
// // IRFNavigationKit.h // Confab App // // Created by Fabio Pelosin on 15/11/13. // Copyright (c) 2013 Fabio Pelosin. All rights reserved. // #ifndef Confab_App_IRFNavigationKit_h #define Confab_App_IRFNavigationKit_h // ViewController #import "IRFViewController.h" #import "NSViewController+IRFNavigationKit.h" // NavigationController #import "IRFNavigationController.h" #import "IRFNavigationControllerDelegate.h" // NavigationBar #import "IRFNavigationBar.h" #import "IRFNavigationBarDelegate.h" #import "IRFNavigationItem.h" #import "IRFBarButtonItem.h" // Transitioning #import "IRFViewControllerAnimatedTransitioning.h" #import "IRFViewControllerContextTransitioning.h" #import "IRFFadeAnimator.h" #import "IRFSlideAnimator.h" #endif