text stringlengths 4 6.14k |
|---|
/*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2019-2021 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*********************************************************************************/
#pragma once
#include <modules/basegl/baseglmoduledefine.h>
#include <modules/basegl/shadercomponents/shadercomponent.h>
#include <inviwo/core/datastructures/image/layer.h>
#include <inviwo/core/properties/isotfproperty.h>
#include <inviwo/core/util/stdextensions.h>
#include <inviwo/core/util/zip.h>
#include <modules/opengl/image/layergl.h>
#include <modules/opengl/texture/texture.h>
#include <modules/opengl/shader/shader.h>
#include <fmt/format.h>
#include <array>
namespace inviwo {
/**
* Adds a set of `N` IsoTFProperties, and binds them to uniforms in the shader.
*/
template <size_t N>
class IsoTFComponent : public ShaderComponent {
public:
IsoTFComponent(VolumeInport& volumeInport)
: ShaderComponent(), isotfs{util::make_array<N>([&](size_t i) {
if constexpr (N > 1) {
auto prop =
IsoTFProperty{fmt::format("isotf{}", i), fmt::format("TF & Iso Values #{}", i),
&volumeInport, InvalidationLevel::InvalidResources};
prop.isovalues_.setIdentifier(fmt::format("isovalues{}", i))
.setDisplayName(fmt::format("Iso Values #{}", i));
prop.tf_.setIdentifier(fmt::format("transferFunction{}", i))
.setDisplayName(fmt::format("Transfer Function #{}", i));
return prop;
} else {
return IsoTFProperty{"isotf", "TF & Iso Values", &volumeInport,
InvalidationLevel::InvalidResources};
}
})} {
static_assert(N > 0, "there has to be at least one isotf");
}
virtual std::string_view getName() const override { return isotfs[0].getIdentifier(); }
virtual void process(Shader& shader, TextureUnitContainer& cont) override {
for (auto&& isotf : isotfs) {
if (auto tfLayer = isotf.tf_.get().getData()) {
TextureUnit& unit = cont.emplace_back();
auto transferFunctionGL = tfLayer->template getRepresentation<LayerGL>();
transferFunctionGL->bindTexture(unit.getEnum());
shader.setUniform(isotf.tf_.getIdentifier(), unit);
}
{
const auto positions = isotf.isovalues_.get().getPositionsf();
const auto colors = isotf.isovalues_.get().getColors();
const auto name = isotf.isovalues_.getIdentifier();
StrBuffer buff;
shader.setUniform(buff.replace("{}.values", name), positions.size(),
positions.data());
shader.setUniform(buff.replace("{}.colors", name), colors.size(), colors.data());
shader.setUniform(buff.replace("{}.size", name), static_cast<int>(colors.size()));
}
}
}
virtual void initializeResources(Shader& shader) override {
// need to ensure there is always at least one isovalue due to the use of the macro
// as array size in IsovalueParameters
size_t isoCount = 1;
for (auto&& isotf : isotfs) {
isoCount = std::max(isoCount, isotf.isovalues_.get().size());
}
shader.getFragmentShaderObject()->addShaderDefine("MAX_ISOVALUE_COUNT",
fmt::format("{}", isoCount));
}
virtual std::vector<Property*> getProperties() override {
std::vector<Property*> props;
for (auto&& isotf : isotfs) {
props.push_back(&isotf);
}
return props;
}
virtual std::vector<Segment> getSegments() override {
std::vector<Segment> segments;
for (auto&& [i, isotf] : util::enumerate(isotfs)) {
segments.push_back(Segment{
fmt::format("uniform IsovalueParameters {};", isotf.isovalues_.getIdentifier()),
placeholder::uniform, 1000 + 1});
segments.push_back(
Segment{fmt::format("uniform sampler2D {};", isotf.tf_.getIdentifier()),
placeholder::uniform, 1050 + 1});
}
return segments;
}
std::array<IsoTFProperty, N> isotfs;
};
} // namespace inviwo
|
#ifndef _LUMINA_DESKTOP_TASK_MANAGER_PLUGIN_H
#define _LUMINA_DESKTOP_TASK_MANAGER_PLUGIN_H
// Qt includes
#include <QWidget>
#include <QList>
#include <QString>
#include <QDebug>
#include <QTimer>
#include <QEvent>
// libLumina includes
#include <LuminaX11.h>
// Local includes
#include "LTaskButton.h"
#include "LWinInfo.h"
#include "../LPPlugin.h"
#include "../../LSession.h" //keep this last
class LTaskManagerPlugin : public LPPlugin{
Q_OBJECT
public:
LTaskManagerPlugin(QWidget *parent=0);
~LTaskManagerPlugin();
private:
QList<LTaskButton*> BUTTONS; //to keep track of the current buttons
QTimer *timer;
bool updating; //quick flag for if it is currently working
private slots:
void UpdateButtons();
void checkWindows();
public slots:
void LocaleChange(){
UpdateButtons();
}
void ThemeChange(){
UpdateButtons();
}
};
#endif |
/*
* This source file is part of libRocket, the HTML/CSS Interface Middleware
*
* For the latest information, see http://www.librocket.com
*
* Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
*
* 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 ROCKETCOREFONTPROVIDER_H
#define ROCKETCOREFONTPROVIDER_H
#include <Rocket/Core/Font.h>
#include <Rocket/Core/StringUtilities.h>
namespace Rocket {
namespace Core {
class FontFaceHandle;
class FontFamily;
/**
The font database contains all font families currently in use by Rocket.
@author Peter Curry
*/
class FontProvider {
public:
/// Returns a handle to a font face that can be used to position and render
/// text. This will return the closest match
/// it can find, but in the event a font family is requested that does not
/// exist, NULL will be returned instead of a
/// valid handle.
/// @param[in] family The family of the desired font handle.
/// @param[in] charset The set of characters required in the font face, as a
/// comma-separated list of unicode ranges.
/// @param[in] style The style of the desired font handle.
/// @param[in] weight The weight of the desired font handle.
/// @param[in] size The size of desired handle, in points.
/// @return A valid handle if a matching (or closely matching) font face was
/// found, NULL otherwise.
FontFaceHandle* GetFontFaceHandle(const String& family, const String& charset,
Font::Style style, Font::Weight weight, int size);
protected:
typedef std::map<String, FontFamily*, StringUtilities::StringComparei>
FontFamilyMap;
FontFamilyMap font_families;
};
} // namespace Core
} // namespace Rocket
#endif
|
// Copyright (C) 2020-2020 European Spallation Source, ERIC. See LICENSE file
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief macro RelAssertMsg() provides an assert with a message.
///
/// It's always on in Release builds, however it has only small perf
/// impact, as the condition expression is always expected to be true.
/// It's made to ensure correct failure modes in Google Test (compiled in
/// Debug) and when running large datasets, while cannot run well in
/// Debug builds.
///
/// \brief macro TestEnvAssertMsg() provides an assert when running in unit test
/// environment or in DEBUG builds. It should only be used to find invariant
/// breaking errors during testing, NOT as an error mechanism during production.
///
//===----------------------------------------------------------------------===//
#pragma once
#include <common/debug/Expect.h>
#include <stdio.h>
#include <stdlib.h>
#define HandleAssertFail(exp, file, line, msg) \
((void)fprintf(stderr, "%s:%u: failed assertion `%s': \"%s\"\n", file, line, \
exp, msg), \
abort())
// for now the asserts are always on!
/// \todo make the asserts primarity for DEBUG and google test.
#define RelAssertMsg(exp, msg) \
(UNLIKELY(!(exp)) ? HandleAssertFail(#exp, __FILE__, __LINE__, msg) : (void)0)
#if defined(BUILD_IS_TEST_ENVIRONMENT) || !defined(NDEBUG)
#define TestEnvAssertMsg(exp, msg) RelAssertMsg(exp, msg)
#else
#define TestEnvAssertMsg(exp, msg) /**/
#endif
|
#ifndef UTIL_H
#define UTIL_H
#include <vector>
#include <sstream>
typedef unsigned char Byte; // TODO: maybe move this to "Types.h" or something like that
typedef std::vector<Byte> ByteArray;
/* Converts a string into any desired type, providing that the standard
* library's stringstream class can perform the conversion.
* NOTE: T must also have a default constructor, that way if the
* conversion fails the return value is some default value. */
// TODO: make this throw exception
template<typename T>
T FromString(const std::string& str)
{
T result;
// Checks if the string is empty before trying to convert
if (!str.empty())
{
std::stringstream iss(str);
iss >> result;
}
return result;
} /* defined in header because it's a templated function */
/* Reads the file with the given filename as a binary file, returning
* an array of bytes. */
ByteArray ReadBinaryFile(const std::string& filename);
/* Returns how many numbers of bytes are in the given file.
* NOTE: 'file' must be a valid, open stream. */
size_t GetFilesize(std::ifstream& file);
#endif
|
/* cryptoki.h include file for PKCS #11. */
/* $Revision: 1.4 $ */
/* License to copy and use this software is granted provided that it is
* identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
* (Cryptoki)" in all material mentioning or referencing this software.
* License is also granted to make and use derivative works provided that
* such works are identified as "derived from the RSA Security Inc. PKCS #11
* Cryptographic Token Interface (Cryptoki)" in all material mentioning or
* referencing the derived work.
* RSA Security Inc. makes no representations concerning either the
* merchantability of this software or the suitability of this software for
* any particular purpose. It is provided "as is" without express or implied
* warranty of any kind.
*/
#ifndef ___CRYPTOKI_H
#define ___CRYPTOKI_H
#define CK_PTR *
#define CK_DEFINE_FUNCTION(returnType, name) \
returnType name
#define CK_DECLARE_FUNCTION(returnType, name) \
returnType name
#define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
returnType (* name)
#define CK_CALLBACK_FUNCTION(returnType, name) \
returnType (* name)
#ifndef NULL_PTR
#define NULL_PTR 0
#endif
#include "pkcs11.h"
CK_FUNCTION_LIST *pkcs11_get_function_list( const char *param );
CK_RV pkcs11_initialize(CK_FUNCTION_LIST_PTR funcs);
CK_RV pkcs11_initialize_nss(CK_FUNCTION_LIST_PTR funcs, const char *path);
#endif /* ___CRYPTOKI_H */
|
#ifndef INCLUDES_TARANTOOL_BOX_SCHEMA_H
#define INCLUDES_TARANTOOL_BOX_SCHEMA_H
/*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "error.h"
#include <stdio.h> /* snprintf */
enum schema_id {
/** Start of the reserved range of system spaces. */
SC_SYSTEM_ID_MIN = 256,
/** Space id of _schema. */
SC_SCHEMA_ID = 272,
/** Space id of _space. */
SC_SPACE_ID = 280,
/** Space id of _index. */
SC_INDEX_ID = 288,
/** Space id of _func. */
SC_FUNC_ID = 296,
/** Space id of _user. */
SC_USER_ID = 304,
/** Space id of _priv. */
SC_PRIV_ID = 312,
/** Space id of _cluster. */
SC_CLUSTER_ID = 320,
/** End of the reserved range of system spaces. */
SC_SYSTEM_ID_MAX = 511,
SC_ID_NIL = 2147483647
};
extern int sc_version;
struct space;
/** Call a visitor function on every space in the space cache. */
void
space_foreach(void (*func)(struct space *sp, void *udata), void *udata);
/**
* Try to look up a space by space number in the space cache.
* FFI-friendly no-exception-thrown space lookup function.
*
* @return NULL if space not found, otherwise space object.
*/
extern "C" struct space *
space_by_id(uint32_t id);
/** No-throw conversion of space id to space name */
extern "C" const char *
space_name_by_id(uint32_t id);
static inline struct space *
space_cache_find(uint32_t id)
{
struct space *space = space_by_id(id);
if (space)
return space;
tnt_raise(ClientError, ER_NO_SUCH_SPACE, int2str(id));
}
/**
* Update contents of the space cache. Typically the new space is
* an altered version of the original space.
* Returns the old space, if any.
*/
struct space *
space_cache_replace(struct space *space);
/** Delete a space from the space cache. */
struct space *
space_cache_delete(uint32_t id);
bool
space_is_system(struct space *space);
void
schema_init();
void
schema_free();
struct space *schema_space(uint32_t id);
/*
* Find object id by object name.
*/
uint32_t
schema_find_id(uint32_t system_space_id, uint32_t index_id,
const char *name, uint32_t len);
void
func_cache_replace(struct func_def *func);
void
func_cache_delete(uint32_t fid);
struct func_def *
func_by_id(uint32_t fid);
static inline struct func_def *
func_cache_find(uint32_t fid)
{
struct func_def *func = func_by_id(fid);
if (func == NULL)
tnt_raise(ClientError, ER_NO_SUCH_FUNCTION, int2str(fid));
return func;
}
static inline struct func_def *
func_by_name(const char *name, uint32_t name_len)
{
uint32_t fid = schema_find_id(SC_FUNC_ID, 2, name, name_len);
return func_by_id(fid);
}
/**
* Check whether or not an object has grants on it (restrict
* constraint in drop object).
* _priv space to look up by space id
* @retval true object has grants
* @retval false object has no grants
*/
bool
schema_find_grants(const char *type, uint32_t id);
#endif /* INCLUDES_TARANTOOL_BOX_SCHEMA_H */
|
/*********************************************************************/
/* Copyright (c) 2013, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
/* AUSTIN ``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 UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/
#ifndef MOVIETHUMBNAILGENERATOR_H
#define MOVIETHUMBNAILGENERATOR_H
#include "ThumbnailGenerator.h"
class MovieThumbnailGenerator : public ThumbnailGenerator
{
public:
MovieThumbnailGenerator(const QSize &size);
virtual QImage generate(const QString& filename) const;
};
#endif // MOVIETHUMBNAILGENERATOR_H
|
/*
For license details see ../../LICENSE
*/
/**
* \file log.h
* \date Aug 11, 2017
*/
#ifndef _AX_LOG_H_
#define _AX_LOG_H_
#include "ax/types.h"
#include <stdio.h>
#define AX_LOG_INFO 0
#define AX_LOG_DBUG 1
#define AX_LOG_WARN 2
#define AX_LOG_FAIL 3
#define AX_LOG_NONE 100
#ifndef AX_MIN_LOG_LEVEL
# ifndef NDEBUG
# define AX_MIN_LOG_LEVEL AX_LOG_DBG
# else
# define AX_MIN_LOG_LEVEL AX_LOG_WARN
# endif
#endif
#define __AX_STR_X(x) #x
#define __AX_STR(x) __AX_STR_X(x)
#define AX_LOG(lvl, fmt, ...) \
if (AX_LOG_##lvl >= AX_MIN_LOG_LEVEL) { \
char buf[] = "["#lvl"] (" __FILE__ ":" __AX_STR(__LINE__) ") " fmt; \
_ax_print_log(buf, ## __VA_ARGS__); \
} \
do { } while (0)
AX_API
void ax_set_log_file(FILE* f);
AX_API
FILE* ax_get_log_file();
AX_API
void _ax_print_log(ax_str fmt, ...);
#endif/*_AX_LOG_H_*/
|
#ifndef _Layout_map_file_
#define _Layout_map_file_
//#include "pair_mem.h"
#include "limits.h"
#ifdef WIN32
#include <windows.h>
#endif
#define NO_TEST
extern __int64 NULL_FILE_SIZE;
template <class T>
class CMemoryMappedFile
{
public :
//int m_MaxNodeLowerInt; // the maximum number of node within 4GB
//unsigned long m_MaxIncrement; // increment when we have maximum nodes
int m_Idx; // just index to see which model use which map.
long m_MappingSize, m_MaxMappingSize; // mapping size
__int64 m_StartLoc, m_EndLoc; // current mapping area
__int64 m_FileSize; // input file size
long m_MemoryAllGra;
char m_FileName [255];
char * m_pFileData;
// handles for memory-mapped file
#ifdef WIN32
HANDLE m_hFile, m_hMapping;
#else
int m_FD;
#endif
char m_MappingMode [20];
unsigned int m_CurrentPointer; // used for GetNextElement
CMemoryMappedFile (void);
#ifdef WIN32
CMemoryMappedFile (HANDLE hFile, HANDLE hMapping);
#else
CMemoryMappedFile<T>::CMemoryMappedFile (int FD);
#endif
CMemoryMappedFile (const char * pFileName, char * pMappingMode, int MappingSize = 0,
__int64 & FileSize = NULL_FILE_SIZE);
~CMemoryMappedFile (void);
void Init (const char * pFileName, char * pMappingMode, int MappingSize = 0,
__int64 & FileSize = NULL_FILE_SIZE);
inline void RemapFileBase (__int64 & FileOffset);
long ComputeMappingSize (__int64 & BaseAddress);
long ComputeOffset (__int64 & FileOffset);
const T & operator [] (int i);
T & GetReference (int i);
bool ReserveMemorySpace (int Start, int End);
char * LoadPage (__int64 & StartPos, int MappingSize, __int64 & FileSize, char * pMappingMode);
void Unload (void);
void UnloadMapPage (char * pFileData );
bool Flush (void);
bool FlushPage (char * pFileData);
// sequential access
bool SetCurrentPointer (int Pointer) { m_CurrentPointer = Pointer; return true;}
const T & GetNextElement (void);
T & RefNextElement (void);
};
#endif
|
//
// BBKeyValueObserving.h
// BBFrameworks
//
// Created by William Towe on 9/23/15.
// Copyright © 2015 Bion Bilateral, LLC. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __BB_FRAMEWORKS_KEY_VALUE_OBSERVING__
#define __BB_FRAMEWORKS_KEY_VALUE_OBSERVING__
#import "NSObject+BBKeyValueObservingExtensions.h"
#endif
|
#ifndef VIEWMENU_H
#define VIEWMENU_H
#include <QMenu>
class ViewMenu : public QMenu
{
Q_OBJECT
public:
explicit ViewMenu(QWidget * parent=0);
signals:
void pageSelected(QString);
public slots:
void addPage(const QString & label,
const QIcon & icon=QIcon());
void pageTriggered(void);
private:
QMenu * cmpPageMenu;
QMap<QString, QAction *> mLabelActionMap;
QMap<QAction *, QString> mActionLabelMap;
};
#endif // VIEWMENU_H
|
/**************************************************************************/
/*!
@file accelerometers.h
@author Nguyen Quang Huy, Nguyen Thien Tin
@ingroup Sensors
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, K. Townsend
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 _ACCELEROMETERS_H_
#define _ACCELEROMETERS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "projectconfig.h"
#include "drivers/sensors/sensors.h"
#define SENSORS_CAL_ACCEL_DATA_PRESENT (1 << 0)
typedef struct
{
float32_t scale; /**< scale factor */
float32_t offset; /**< offset error */
} accel_calib_params_t;
typedef struct
{
uint16_t config;
uint16_t sensorID;
accel_calib_params_t x;
accel_calib_params_t y;
accel_calib_params_t z;
} accel_calib_data_t;
error_t accelGetOrientation ( sensors_event_t *event, sensors_vec_t *orientation );
error_t accelLoadCalData ( accel_calib_data_t *calib_data );
error_t accelCalibrateEventData ( sensors_event_t *event, accel_calib_data_t *calib_data );
#ifdef __cplusplus
}
#endif
#endif // _ACCELEROMETERS_H_
|
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
#include <gtk/gtk.h>
#include <string>
#include "chrome/common/edit_command.h"
#include "chrome/common/owned_widget_gtk.h"
class NativeWebKeyboardEvent;
// This class is a convenience class for handling editor key bindings defined
// in gtk keyboard theme.
// In gtk, only GtkEntry and GtkTextView support customizing editor key bindings
// through keyboard theme. And in gtk keyboard theme definition file, each key
// binding must be bound to a specific class or object. So existing keyboard
// themes only define editor key bindings exactly for GtkEntry and GtkTextView.
// Then, the only way for us to intercept editor key bindings defined in
// keyboard theme, is to create a GtkEntry or GtkTextView object and call
// gtk_bindings_activate_event() against it for the key events. If a key event
// matches a predefined key binding, corresponding signal will be emitted.
// GtkTextView is used here because it supports more key bindings than GtkEntry,
// but in order to minimize the side effect of using a GtkTextView object, a new
// class derived from GtkTextView is used, which overrides all signals related
// to key bindings, to make sure GtkTextView won't receive them.
//
// See third_party/WebKit/WebCore/editing/EditorCommand.cpp for detailed
// definition of webkit edit commands.
// See webkit/glue/editor_client_impl.cc for key bindings predefined in our
// webkit glue.
class GtkKeyBindingsHandler {
public:
explicit GtkKeyBindingsHandler(GtkWidget* parent_widget);
~GtkKeyBindingsHandler();
// Key bindings handler will be disabled when IME is disabled by webkit.
void set_enabled(bool enabled) {
enabled_ = enabled;
}
// Matches a key event against predefined gtk key bindings, false will be
// returned if the key event doesn't correspond to a predefined key binding.
// Edit commands matched with |wke| will be stored in |edit_commands|.
bool Match(const NativeWebKeyboardEvent& wke, EditCommands* edit_commands);
private:
// Object structure of Handler class, which is derived from GtkTextView.
struct Handler {
GtkTextView parent_object;
GtkKeyBindingsHandler *owner;
};
// Class structure of Handler class.
struct HandlerClass {
GtkTextViewClass parent_class;
};
// Creates a new instance of Handler class.
GtkWidget* CreateNewHandler();
// Adds an edit command to the key event.
void EditCommandMatched(const std::string& name, const std::string& value);
// Initializes Handler structure.
static void HandlerInit(Handler *self);
// Initializes HandlerClass structure.
static void HandlerClassInit(HandlerClass *klass);
// Registeres Handler class to GObject type system and return its type id.
static GType HandlerGetType();
// Gets the GtkKeyBindingsHandler object which owns the Handler object.
static GtkKeyBindingsHandler* GetHandlerOwner(GtkTextView* text_view);
// Handler of "backspace" signal.
static void BackSpace(GtkTextView* text_view);
// Handler of "copy-clipboard" signal.
static void CopyClipboard(GtkTextView* text_view);
// Handler of "cut-clipboard" signal.
static void CutClipboard(GtkTextView* text_view);
// Handler of "delete-from-cursor" signal.
static void DeleteFromCursor(GtkTextView* text_view, GtkDeleteType type,
gint count);
// Handler of "insert-at-cursor" signal.
static void InsertAtCursor(GtkTextView* text_view, const gchar* str);
// Handler of "move-cursor" signal.
static void MoveCursor(GtkTextView* text_view, GtkMovementStep step,
gint count, gboolean extend_selection);
// Handler of "move-viewport" signal.
static void MoveViewport(GtkTextView* text_view, GtkScrollStep step,
gint count);
// Handler of "paste-clipboard" signal.
static void PasteClipboard(GtkTextView* text_view);
// Handler of "select-all" signal.
static void SelectAll(GtkTextView* text_view, gboolean select);
// Handler of "set-anchor" signal.
static void SetAnchor(GtkTextView* text_view);
// Handler of "toggle-cursor-visible" signal.
static void ToggleCursorVisible(GtkTextView* text_view);
// Handler of "toggle-overwrite" signal.
static void ToggleOverwrite(GtkTextView* text_view);
// Handler of "show-help" signal.
static gboolean ShowHelp(GtkWidget* widget, GtkWidgetHelpType arg1);
// Handler of "move-focus" signal.
static void MoveFocus(GtkWidget* widget, GtkDirectionType arg1);
OwnedWidgetGtk handler_;
// Buffer to store the match results.
EditCommands edit_commands_;
// Indicates if key bindings handler is enabled or not.
// It'll only be enabled if IME is enabled by webkit.
bool enabled_;
};
#endif // CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
|
/*****************************************************************************/
/**
* @file Context.h
* @author Naohisa Sakamoto
*/
/*****************************************************************************/
#pragma once
#include "../EGL.h"
#include "Config.h"
#include "Surface.h"
#include "Display.h"
namespace kvs
{
namespace egl
{
class Context
{
private:
EGLContext m_handle; ///< EGL rendering context
kvs::egl::Display& m_display; ///< EGL display
public:
Context( kvs::egl::Display& display );
~Context();
void* handle() { return m_handle; }
bool isValid() const { return m_handle != NULL; }
bool create( kvs::egl::Config& config );
void destroy();
bool makeCurrent( kvs::egl::Surface& surface );
void releaseCurrent();
bool swapBuffers( kvs::egl::Surface& surface );
bool swapInterval( EGLint interval );
};
} // end of namespace egl
} // end of namespace kvs
|
/*
This file is a part of NNTL project (https://github.com/Arech/nntl)
Copyright (c) 2015-2021, Arech (aradvert@gmail.com; https://github.com/Arech)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of NNTL nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "_i_activation.h"
namespace nntl {
namespace activation {
//activation types should not be templated (probably besides real_t), because they are intended to be used
//as means to recognize activation function type
struct type_relu {};
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//ReLU
template<typename RealT, typename WeightsInitScheme = weights_init::He_Zhang<>>
class relu
: public _i_activation<RealT, WeightsInitScheme, true>
, public type_relu
{
public:
//apply f to each srcdest matrix element. The biases (if any) must be left untouched!
template <typename iMath>
static void f(realmtx_t& srcdest, iMath& m) noexcept {
static_assert(::std::is_base_of<math::_i_math<real_t>, iMath>::value, "iMath should implement math::_i_math");
m.relu(srcdest);
};
template <typename iMath>
static void df(realmtx_t& f_df, iMath& m) noexcept {
static_assert(::std::is_base_of<math::_i_math<real_t>, iMath>::value, "iMath should implement math::_i_math");
NNTL_ASSERT(!f_df.emulatesBiases());
m.drelu(f_df);
}
};
//activation types should not be templated (probably besides real_t), because they are intended to be used
//as means to recognize activation function type
struct type_leakyrelu {};
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Leaky Relu
template<typename RealT, unsigned int LeakKInv100 = 10000
, typename WeightsInitScheme = weights_init::He_Zhang<>>
class leaky_relu
: public _i_activation<RealT, WeightsInitScheme, true>
, public type_leakyrelu
{
public:
static constexpr real_t LeakK = real_t(100.0) / real_t(LeakKInv100);
public:
//apply f to each srcdest matrix element. The biases (if any) must be left untouched!
template <typename iMath>
static void f(realmtx_t& srcdest, iMath& m) noexcept {
static_assert(::std::is_base_of<math::_i_math<real_t>, iMath>::value, "iMath should implement math::_i_math");
m.leakyrelu(srcdest, LeakK);
};
template <typename iMath>
static void df(realmtx_t& f_df, iMath& m) noexcept {
static_assert(::std::is_base_of<math::_i_math<real_t>, iMath>::value, "iMath should implement math::_i_math");
NNTL_ASSERT(!f_df.emulatesBiases());
m.dleakyrelu(f_df, LeakK);
}
};
template<typename RealT, typename WeightsInitScheme = weights_init::He_Zhang<>>
using leaky_relu_1000 = leaky_relu<RealT, 100000, WeightsInitScheme>;
template<typename RealT, typename WeightsInitScheme = weights_init::He_Zhang<>>
using leaky_relu_100 = leaky_relu<RealT, 10000, WeightsInitScheme>;
template<typename RealT, typename WeightsInitScheme = weights_init::He_Zhang<>>
using very_leaky_relu_5p5 = leaky_relu<RealT, 550, WeightsInitScheme>;
}
}
|
/*-
* Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/sys/sparc64/include/upa.h,v 1.4 2002/04/02 17:38:52 tmm Exp $
*/
#ifndef _MACHINE_UPA_H_
#define _MACHINE_UPA_H_
#define UPA_MEMSTART 0x1c000000000UL
#define UPA_MEMEND 0x1ffffffffffUL
#define UPA_CR_MID_SHIFT (17)
#define UPA_CR_MID_SIZE (5)
#define UPA_CR_MID_MASK \
(((1 << UPA_CR_MID_SIZE) - 1) << UPA_CR_MID_SHIFT)
#define UPA_CR_GET_MID(cr) ((cr & UPA_CR_MID_MASK) >> UPA_CR_MID_SHIFT)
#ifdef LOCORE
#define UPA_GET_MID(r1) \
ldxa [%g0] ASI_UPA_CONFIG_REG, r1 ; \
srlx r1, UPA_CR_MID_SHIFT, r1 ; \
and r1, (1 << UPA_CR_MID_SIZE) - 1, r1
#endif
#endif /* _MACHINE_UPA_H_ */
|
// Copyright 2018-present 650 Industries. All rights reserved.
#import <UIKit/UIKit.h>
@protocol ABI41_0_0UMFontScalerInterface
- (UIFont *)scaledFont:(UIFont *)font toSize:(CGFloat)fontSize;
@end
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
@protocol ABI40_0_0RCTInvalidating <NSObject>
- (void)invalidate;
@end
|
/*
* Bindle Binaries Objective-C Kit
* Copyright (c) 2012 Bindle Binaries
*
* @BINDLE_BINARIES_BSD_LICENSE_START@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Bindle Binaries nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BINDLE BINARIES 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.
*
* @BINDLE_BINARIES_BSD_LICENSE_END@
*/
/*
* BKListController.h - Generic UItableView for displaying data
*/
#import <UIKit/UIKit.h>
@class BKListController;
@protocol BKListControllerDelegate <NSObject>
@optional
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
- (void) listController:(BKListController *)listController
tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end
@interface BKListController : UITableViewController
{
// delegates
id <BKListControllerDelegate> __weak delegate;
id <UITableViewDataSource> __weak tableDataSource;
id <UITableViewDelegate> __weak tableDelegate;
// identity
NSInteger tag;
// data source selectors
NSArray * data;
SEL cellTextLabelSelector;
SEL cellDetailTextLabelSelector;
SEL cellAccessoryViewSelector;
SEL cellImageSelector;
// cell appearance
UITableViewCellStyle cellStyle;
UITableViewCellAccessoryType cellAccessoryType;
UITableViewCellSelectionStyle cellSelectionStyle;
}
// delegates
@property (nonatomic, weak) id <BKListControllerDelegate> delegate;
@property (nonatomic, weak) id <UITableViewDataSource> tableDataSource;
@property (nonatomic, weak) id <UITableViewDelegate> tableDelegate;
// identity
@property (nonatomic, assign) NSInteger tag;
// data source selectors
@property (nonatomic, strong) NSArray * data;
@property (nonatomic, assign) SEL cellTextLabelSelector;
@property (nonatomic, assign) SEL cellDetailTextLabelSelector;
@property (nonatomic, assign) SEL cellAccessoryViewSelector;
@property (nonatomic, assign) SEL cellImageSelector;
// cell appearance
@property (nonatomic, assign) UITableViewCellStyle cellStyle;
@property (nonatomic, assign) UITableViewCellAccessoryType cellAccessoryType;
@property (nonatomic, assign) UITableViewCellSelectionStyle cellSelectionStyle;
@end
|
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef ALLOY_BACKEND_X64_X64_FUNCTION_H_
#define ALLOY_BACKEND_X64_X64_FUNCTION_H_
#include "alloy/runtime/function.h"
#include "alloy/runtime/symbol_info.h"
namespace alloy {
namespace backend {
namespace x64 {
class X64Function : public runtime::Function {
public:
X64Function(runtime::FunctionInfo* symbol_info);
virtual ~X64Function();
void* machine_code() const { return machine_code_; }
size_t code_size() const { return code_size_; }
void Setup(void* machine_code, size_t code_size);
protected:
virtual int AddBreakpointImpl(runtime::Breakpoint* breakpoint);
virtual int RemoveBreakpointImpl(runtime::Breakpoint* breakpoint);
virtual int CallImpl(runtime::ThreadState* thread_state,
uint64_t return_address);
private:
void* machine_code_;
size_t code_size_;
};
} // namespace x64
} // namespace backend
} // namespace alloy
#endif // ALLOY_BACKEND_X64_X64_FUNCTION_H_
|
#include <stdlib.h>
extern unsigned int keylookup[];
extern char *toASCIILut[];
int
comparator (const void *key, const void *member)
{
unsigned int keyU = (*((unsigned int *) key));
unsigned int memberU = (*((unsigned int *) member));
if (keyU < memberU) {
return -1;
} else if (keyU > memberU) {
return 1;
}
return 0;
}
char *
findString (unsigned int index)
{
unsigned int *out_index =
bsearch (&index, &keylookup, 8922, sizeof (unsigned int), &comparator);
if (out_index == NULL) {
// not found
return "";
} else {
return toASCIILut[out_index - keylookup];
}
}
|
//
// Created by Leland Richardson on 12/27/15.
// Copyright (c) 2015 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface ABI43_0_0AIRMapCoordinate : NSObject
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@end |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVolumeReader.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkVolumeReader - read image files
// .SECTION Description
// vtkVolumeReader is a source object that reads image files.
//
// VolumeReader creates structured point datasets. The dimension of the
// dataset depends upon the number of files read. Reading a single file
// results in a 2D image, while reading more than one file results in a
// 3D volume.
//
// File names are created using FilePattern and FilePrefix as follows:
// sprintf (filename, FilePattern, FilePrefix, number);
// where number is in the range ImageRange[0] to ImageRange[1]. If
// ImageRange[1] <= ImageRange[0], then slice number ImageRange[0] is
// read. Thus to read an image set ImageRange[0] = ImageRange[1] = slice
// number. The default behavior is to read a single file (i.e., image slice 1).
//
// The DataMask instance variable is used to read data files with imbedded
// connectivity or segmentation information. For example, some data has
// the high order bit set to indicate connected surface. The DataMask allows
// you to select this data. Other important ivars include HeaderSize, which
// allows you to skip over initial info, and SwapBytes, which turns on/off
// byte swapping. Consider using vtkImageReader as a replacement.
// .SECTION See Also
// vtkSliceCubes vtkMarchingCubes vtkPNMReader vtkVolume16Reader
// vtkImageReader
#ifndef __vtkVolumeReader_h
#define __vtkVolumeReader_h
#include "vtkImageAlgorithm.h"
class VTK_IO_EXPORT vtkVolumeReader : public vtkImageAlgorithm
{
public:
vtkTypeRevisionMacro(vtkVolumeReader,vtkImageAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Specify file prefix for the image file(s).
vtkSetStringMacro(FilePrefix);
vtkGetStringMacro(FilePrefix);
// Description:
// The sprintf format used to build filename from FilePrefix and number.
vtkSetStringMacro(FilePattern);
vtkGetStringMacro(FilePattern);
// Description:
// Set the range of files to read.
vtkSetVector2Macro(ImageRange,int);
vtkGetVectorMacro(ImageRange,int,2);
// Description:
// Specify the spacing for the data.
vtkSetVector3Macro(DataSpacing,double);
vtkGetVectorMacro(DataSpacing,double,3);
// Description:
// Specify the origin for the data.
vtkSetVector3Macro(DataOrigin,double);
vtkGetVectorMacro(DataOrigin,double,3);
// Description:
// Other objects make use of this method.
virtual vtkImageData *GetImage(int ImageNumber) = 0;
protected:
vtkVolumeReader();
~vtkVolumeReader();
char *FilePrefix;
char *FilePattern;
int ImageRange[2];
double DataSpacing[3];
double DataOrigin[3];
private:
vtkVolumeReader(const vtkVolumeReader&); // Not implemented.
void operator=(const vtkVolumeReader&); // Not implemented.
};
#endif
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOptiXViewNodeFactory.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkOptiXViewNodeFactory - matches vtk rendering classes to
// specific ospray ViewNode classes
// .SECTION Description
// Ensures that vtkOptiXPass makes ospray specific translator instances
// for every VTK rendering pipeline class instance it encounters.
#ifndef vtkOptiXViewNodeFactory_h
#define vtkOptiXViewNodeFactory_h
#include "vtkRenderingOptiXModule.h" // For export macro
#include "vtkViewNodeFactory.h"
class VTKRENDERINGOPTIX_EXPORT vtkOptiXViewNodeFactory :
public vtkViewNodeFactory
{
public:
static vtkOptiXViewNodeFactory* New();
vtkTypeMacro(vtkOptiXViewNodeFactory, vtkViewNodeFactory);
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkOptiXViewNodeFactory();
~vtkOptiXViewNodeFactory();
private:
vtkOptiXViewNodeFactory(const vtkOptiXViewNodeFactory&) VTK_DELETE_FUNCTION;
void operator=(const vtkOptiXViewNodeFactory&) VTK_DELETE_FUNCTION;
};
#endif
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_EXAMPLES_MULTILINE_EXAMPLE_H_
#define UI_VIEWS_EXAMPLES_MULTILINE_EXAMPLE_H_
#include "base/macros.h"
#include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/examples/example_base.h"
namespace views {
class Checkbox;
class Label;
namespace examples {
// An example that compares the multiline rendering of different controls.
class VIEWS_EXAMPLES_EXPORT MultilineExample : public ExampleBase,
public TextfieldController {
public:
MultilineExample();
MultilineExample(const MultilineExample&) = delete;
MultilineExample& operator=(const MultilineExample&) = delete;
~MultilineExample() override;
// ExampleBase:
void CreateExampleView(View* container) override;
private:
class RenderTextView;
// TextfieldController:
void ContentsChanged(Textfield* sender,
const std::u16string& new_contents) override;
RenderTextView* render_text_view_ = nullptr;
Label* label_ = nullptr;
Textfield* textfield_ = nullptr;
// Checkbox to enable and disable text rendering in |label_|.
Checkbox* label_checkbox_ = nullptr;
// Checkbox to toggle text elision in |render_text_view_|.
Checkbox* elision_checkbox_ = nullptr;
};
} // namespace examples
} // namespace views
#endif // UI_VIEWS_EXAMPLES_MULTILINE_EXAMPLE_H_
|
/*
* Copyright (c) 2010 The WebM 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.
*/
#include "vpx_ports/config.h"
#include "vp8/encoder/variance.h"
#include "vp8/encoder/onyx_int.h"
void vp8_arch_x86_encoder_init(VP8_COMP *cpi);
void vp8_arch_arm_encoder_init(VP8_COMP *cpi);
void (*vp8_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
extern void vp8_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
void vp8_cmachine_specific_config(VP8_COMP *cpi)
{
#if CONFIG_RUNTIME_CPU_DETECT
cpi->rtcd.common = &cpi->common.rtcd;
cpi->rtcd.variance.sad16x16 = vp8_sad16x16_c;
cpi->rtcd.variance.sad16x8 = vp8_sad16x8_c;
cpi->rtcd.variance.sad8x16 = vp8_sad8x16_c;
cpi->rtcd.variance.sad8x8 = vp8_sad8x8_c;
cpi->rtcd.variance.sad4x4 = vp8_sad4x4_c;
cpi->rtcd.variance.sad16x16x3 = vp8_sad16x16x3_c;
cpi->rtcd.variance.sad16x8x3 = vp8_sad16x8x3_c;
cpi->rtcd.variance.sad8x16x3 = vp8_sad8x16x3_c;
cpi->rtcd.variance.sad8x8x3 = vp8_sad8x8x3_c;
cpi->rtcd.variance.sad4x4x3 = vp8_sad4x4x3_c;
cpi->rtcd.variance.sad16x16x8 = vp8_sad16x16x8_c;
cpi->rtcd.variance.sad16x8x8 = vp8_sad16x8x8_c;
cpi->rtcd.variance.sad8x16x8 = vp8_sad8x16x8_c;
cpi->rtcd.variance.sad8x8x8 = vp8_sad8x8x8_c;
cpi->rtcd.variance.sad4x4x8 = vp8_sad4x4x8_c;
cpi->rtcd.variance.sad16x16x4d = vp8_sad16x16x4d_c;
cpi->rtcd.variance.sad16x8x4d = vp8_sad16x8x4d_c;
cpi->rtcd.variance.sad8x16x4d = vp8_sad8x16x4d_c;
cpi->rtcd.variance.sad8x8x4d = vp8_sad8x8x4d_c;
cpi->rtcd.variance.sad4x4x4d = vp8_sad4x4x4d_c;
cpi->rtcd.variance.var4x4 = vp8_variance4x4_c;
cpi->rtcd.variance.var8x8 = vp8_variance8x8_c;
cpi->rtcd.variance.var8x16 = vp8_variance8x16_c;
cpi->rtcd.variance.var16x8 = vp8_variance16x8_c;
cpi->rtcd.variance.var16x16 = vp8_variance16x16_c;
cpi->rtcd.variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;
cpi->rtcd.variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_c;
cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;
cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_c;
cpi->rtcd.variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_c;
cpi->rtcd.variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_c;
cpi->rtcd.variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_c;
cpi->rtcd.variance.subpixmse16x16 = vp8_sub_pixel_mse16x16_c;
cpi->rtcd.variance.mse16x16 = vp8_mse16x16_c;
cpi->rtcd.variance.getmbss = vp8_get_mb_ss_c;
cpi->rtcd.variance.get4x4sse_cs = vp8_get4x4sse_cs_c;
cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_c;
cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_c;
cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c;
cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c;
cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c;
cpi->rtcd.encodemb.berr = vp8_block_error_c;
cpi->rtcd.encodemb.mberr = vp8_mbblock_error_c;
cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_c;
cpi->rtcd.encodemb.subb = vp8_subtract_b_c;
cpi->rtcd.encodemb.submby = vp8_subtract_mby_c;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_c;
cpi->rtcd.quantize.quantb = vp8_regular_quantize_b;
cpi->rtcd.quantize.quantb_pair = vp8_regular_quantize_b_pair;
cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_c;
cpi->rtcd.quantize.fastquantb_pair = vp8_fast_quantize_b_pair_c;
cpi->rtcd.search.full_search = vp8_full_search_sad;
cpi->rtcd.search.refining_search = vp8_refining_search_sad;
cpi->rtcd.search.diamond_search = vp8_diamond_search_sad;
#if !(CONFIG_REALTIME_ONLY)
cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_c;
#endif
#endif
// Pure C:
vp8_yv12_copy_partial_frame_ptr = vp8_yv12_copy_partial_frame;
#if CONFIG_INTERNAL_STATS
cpi->rtcd.variance.ssimpf_8x8 = ssim_parms_8x8_c;
cpi->rtcd.variance.ssimpf = ssim_parms_c;
#endif
#if ARCH_X86 || ARCH_X86_64
vp8_arch_x86_encoder_init(cpi);
#endif
#if ARCH_ARM
vp8_arch_arm_encoder_init(cpi);
#endif
}
|
void backspace();
void enter();
void insertKey(char key);
void upArrow();
void downArrow();
void clearScreen();
void incTick();
void resetTick();
void copyBuffer(char * buff);
void printBuffer(char * buff);
void timePrint(int hora, int min, int sec);
void changeInterval(int);
void printProcesses();
void printIpcs(); |
#include "xvmaininc.h"
#include "defines.h"
#include "declares.h"
#include "externs.h"
/* Read a number of blocks from the file */
v2_read_blocks(devstate, buf, block, nblocks, async_flag)
struct devstate *devstate;
char *buf;
V2_OFFSET block, nblocks;
int async_flag;
{
int status;
/* Note: The buffer must be declared bufstate->buf_extra larger than */
/* needed to handle idiosyncracies in ansi tapes (see v2_read_ansi or */
/* v2_write_ansi). This also means that the area after the read data */
/* may be modified, so you cannot read a little bit into the beginning */
/* of a buffer and expect the rest of the buffer to remain unchanged. */
switch (devstate->device_type) {
case DEV_DISK:
status = v2_read_disk(&devstate->dev.disk, buf, block, nblocks,
async_flag, &devstate->transfer_count);
if (async_flag)
devstate->async_pending = TRUE;
break;
#if RTL_USE_TAPE
case DEV_TAPE:
status = v2_read_tape(&devstate->dev.tape, buf, block, nblocks,
async_flag, &devstate->transfer_count);
if (async_flag)
devstate->async_pending = TRUE;
break;
#endif
case DEV_ANSI:
status = v2_read_ansi(&devstate->dev.ansi, buf, block, nblocks,
async_flag, &devstate->transfer_count);
if (async_flag)
devstate->async_pending = TRUE;
break;
case DEV_MEMORY: /* same as array */
case DEV_ARRAY:
status = read_nop();
break;
default:
return NOT_IMPLEMENTED;
}
return status;
}
|
#ifndef _MAP_TRANSFORMATION_H_
#define _MAP_TRANSFORMATION_H_
#include "../util/vector2.h"
#include <stdlib.h>
#include <math.h>
class MapTransformation {
public:
void transform(Vector2** transformation_matrix, float turn_x, float turn_y, double rotation, size_t height, size_t width, size_t cell_size);
private:
bool check_boundaries(int x, int y, int boundary_x, int boundary_y);
double last_gyro_value_;
double transform_x(float turn_x, float turn_y, int value_x, int value_y, double rotation);
double transform_y(float turn_x, float turn_y, int value_x, int value_y, double rotation);
};
#endif //_MAP_TRANSFORMATION_H_
|
/*
* Direct3D 11 compute shader header
*
* This file is part of the "ForkENGINE" (Copyright (c) 2014 by Lukas Hermanns)
* See "LICENSE.txt" for license information.
*/
#ifndef __FORK_D3D11_COMPUTE_SHADER_H__
#define __FORK_D3D11_COMPUTE_SHADER_H__
#include "Video/RenderSystem/Shader/ComputeShader.h"
#include "D3D11ShaderBase.h"
namespace Fork
{
namespace Video
{
DECL_SHR_PTR(D3D11ComputeShader);
//! Direct3D 11 compute shader implementation.
class D3D11ComputeShader : public ComputeShader, public D3D11ShaderBase
{
public:
D3D11ComputeShader() = default;
~D3D11ComputeShader();
D3D11ComputeShader(const D3D11ComputeShader&) = delete;
D3D11ComputeShader& operator = (const D3D11ComputeShader&) = delete;
const char* ShaderTypeName() const;
const char* TargetVersionPrefix() const;
void BindShaderAndConstantBuffers(ID3D11DeviceContext* context, UINT startSlot = 0);
inline ID3D11ComputeShader* GetShader() const
{
return shader_;
}
private:
HRESULT CreateShader(ID3D11Device* device, ID3DBlob* buffer);
ID3D11ComputeShader* shader_ = nullptr;
};
} // /namespace Video
} // /namespace Fork
#endif
// ======================== |
/**Header file for the f77-wrapper functions of the LCCollectionVec class.
*
* @author F. Gaede
* @version Oct 10, 2003
*/
#include "cfortran.h"
#include "cpointer.h"
#include "deprecation.h"
// Warning: dont use "_" in function names as this causes two many
// trailing underscores on Linux
// the collection interface
LCIO_DEPRECATED_CAPI PTRTYPE lccolcreate( const char* colname ) ;
LCIO_DEPRECATED_CAPI int lccoldelete( PTRTYPE collection ) ;
LCIO_DEPRECATED_CAPI int lccolgetnumberofelements( PTRTYPE collection ) ;
LCIO_DEPRECATED_CAPI char* lccolgettypename( PTRTYPE collection ) ;
LCIO_DEPRECATED_CAPI PTRTYPE lccolgetelementat( PTRTYPE collection, int index ) ;
LCIO_DEPRECATED_CAPI int lccolgetflag(PTRTYPE collection) ;
LCIO_DEPRECATED_CAPI bool lccolistransient(PTRTYPE collection) ;
LCIO_DEPRECATED_CAPI int lccolsettransient(PTRTYPE collection, bool value) ;
LCIO_DEPRECATED_CAPI bool lccolisdefault(PTRTYPE collection) ;
LCIO_DEPRECATED_CAPI int lccolsetdefault(PTRTYPE collection, bool value) ;
LCIO_DEPRECATED_CAPI int lccolsetflag(PTRTYPE collection, int flag) ;
LCIO_DEPRECATED_CAPI int lccoladdelement(PTRTYPE collection, PTRTYPE object) ;
LCIO_DEPRECATED_CAPI int lccolremoveelementat(PTRTYPE collection, int i) ;
// now the fortran wrappers from cfortran.h
extern "C"{
FCALLSCFUN1(CFORTRANPNTR, lccolcreate, LCCOLCREATE, lccolcreate, STRING )
FCALLSCFUN1(INT, lccoldelete, LCCOLDELETE, lccoldelete, CFORTRANPNTR )
FCALLSCFUN1(INT, lccolgetnumberofelements,LCCOLGETNUMBEROFELEMENTS,lccolgetnumberofelements,CFORTRANPNTR)
FCALLSCFUN1(STRING, lccolgettypename, LCCOLGETTYPENAME, lccolgettypename, CFORTRANPNTR )
FCALLSCFUN2(CFORTRANPNTR, lccolgetelementat, LCCOLGETELEMENTAT, lccolgetelementat, CFORTRANPNTR, INT )
FCALLSCFUN1(INT, lccolgetflag, LCCOLGETFLAG, lccolgetflag, CFORTRANPNTR )
FCALLSCFUN1(LOGICAL, lccolistransient, LCCOLISTRANSIENT, lccolistransient, CFORTRANPNTR )
FCALLSCFUN2(INT, lccolsettransient, LCCOLSETTRANSIENT, lccolsettransient, CFORTRANPNTR, LOGICAL )
FCALLSCFUN1(LOGICAL, lccolisdefault, LCCOLISDEFAULT, lccolisdefault, CFORTRANPNTR )
FCALLSCFUN2(INT, lccolsetdefault, LCCOLSETDEFAULT, lccolsetdefault, CFORTRANPNTR, LOGICAL )
FCALLSCFUN2(INT, lccolsetflag, LCCOLSETFLAG, lccolsetflag, CFORTRANPNTR, INT )
FCALLSCFUN2(INT, lccoladdelement, LCCOLADDELEMENT, lccoladdelement, CFORTRANPNTR, CFORTRANPNTR )
FCALLSCFUN2(INT, lccolremoveelementat, LCCOLREMOVEELEMENTAT, lccolremoveelementat, CFORTRANPNTR, INT )
}
|
/*-
* Copyright (c) 2015 Nokia Solutions and Networks
* Copyright (c) 2015 ENEA Software AB
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ofpi_log.h"
#include "ofpi_cli.h"
#include "ofpi_route.h"
#include "ofpi_arp.h"
#include "ofpi_util.h"
#include "ofpi_sysctl.h"
void f_sysctl_dump(struct cli_conn *conn, const char *s)
{
(void)s;
ofp_sysctl_write_tree(conn->fd);
sendcrlf(conn);
}
void f_sysctl_read(struct cli_conn *conn, const char *s)
{
int oid[OFP_CTL_MAXNAME];
size_t oidlen;
uint64_t old[32];
size_t oldlen;
size_t retval, plen;
int error;
int slen;
char str[128], *p;
struct ofp_sysctl_oid *noid;
int nindx;
struct ofp_sysctl_oid_list *l;
strncpy(str, s, sizeof(str));
str[sizeof(str)-1] = 0;
p = strchr(str, ' ');
if (p)
*p = 0;
slen = strlen(str);
if (slen == 0) {
l = &sysctl__children;
goto err;
}
if (!strncmp(s, "-a", 2)) {
ofp_sysctl_write_tree(conn->fd);
return;
}
oid[0] = 0; /* sysctl internal magic */
oid[1] = 3; /* name2oid */
oidlen = sizeof(oid);
error = ofp_kernel_sysctl(NULL, oid, 2, oid, &oidlen,
(const void *)str, slen, &plen, 0);
if (error) {
ofp_sendf(conn->fd, "Not valid string: '%s'\r\n", str);
str[0] = 0;
l = &sysctl__children;
goto err;
}
plen /= sizeof(int);
error = ofp_sysctl_find_oid(oid, plen, &noid, &nindx, NULL);
if (error)
return;
if ((noid->oid_kind & OFP_CTLTYPE) == OFP_CTLTYPE_NODE) {
ofp_sendf(conn->fd, "Not a variable.\r\n");
l = noid->oid_arg1;
goto err;
}
oldlen = sizeof(old) - 1;
error = ofp_kernel_sysctl(NULL, oid, plen, old, &oldlen,
NULL, 0, &retval, 0);
if (error) {
ofp_sendf(conn->fd, "Cannot access: '%s'", str);
sendcrlf(conn);
return;
}
ofp_sendf(conn->fd, "%s = ", str);
switch (noid->oid_kind & OFP_CTLTYPE) {
case OFP_CTLTYPE_INT: {
int *r = (int *)old;
ofp_sendf(conn->fd, "%d\r\n", *r);
break;
}
case OFP_CTLTYPE_UINT: {
unsigned int *r = (unsigned int *)old;
ofp_sendf(conn->fd, "%u\r\n", *r);
break;
}
case OFP_CTLTYPE_LONG: {
long int *r = (long int *)old;
ofp_sendf(conn->fd, "%ld\r\n", *r);
break;
}
case OFP_CTLTYPE_ULONG: {
unsigned long *r = (unsigned long *)old;
ofp_sendf(conn->fd, "%lu\r\n", *r);
break;
}
case OFP_CTLTYPE_STRING: {
char *r = (char *)old;
r[oldlen] = 0;
ofp_sendf(conn->fd, "%s\r\n", r);
break;
}
case OFP_CTLTYPE_U64: {
uint64_t *r = (uint64_t *)old;
ofp_sendf(conn->fd, "%lu\r\n", *r);
break;
}
case OFP_CTLTYPE_S64: {
int64_t *r = (int64_t *)old;
ofp_sendf(conn->fd, "%ld\r\n", *r);
break;
}
case OFP_CTLTYPE_OPAQUE: {
unsigned int i;
unsigned char *r = (unsigned char *)old;
for (i = 0; i < oldlen; i++)
ofp_sendf(conn->fd, " %02x", r[i]);
ofp_sendf(conn->fd, "\r\n");
break;
}
default: ofp_sendf(conn->fd, "unknown type\r\n");
}
sendcrlf(conn);
return;
err:
ofp_sendf(conn->fd, "Alternatives:\r\n");
struct ofp_sysctl_oid *oidp;
OFP_SLIST_FOREACH(oidp, l, oid_link) {
ofp_sendf(conn->fd, " %s%s%s (%s)\r\n",
str, str[0] ? "." : "",
oidp->oid_name, oidp->oid_descr);
}
sendcrlf(conn);
}
void f_sysctl_write(struct cli_conn *conn, const char *s)
{
int oid[OFP_CTL_MAXNAME];
size_t oidlen;
uint64_t new[32];
size_t newlen;
size_t retval, plen;
int error;
int slen;
char str[128], *p, *p1;
struct ofp_sysctl_oid *noid;
int nindx;
struct ofp_sysctl_oid_list *l = &sysctl__children;
strncpy(str, s, sizeof(str));
str[sizeof(str)-1] = 0;
p = strchr(str, ' ');
if (p) {
*p = 0;
p++;
p1 = strchr(p, ' ');
if (p1)
*p1 = 0;
}
slen = strlen(str);
if (slen == 0) {
l = &sysctl__children;
goto err;
}
oid[0] = 0; /* sysctl internal magic */
oid[1] = 3; /* name2oid */
oidlen = sizeof(oid);
error = ofp_kernel_sysctl(NULL, oid, 2, oid, &oidlen,
(const void *)str, slen, &plen, 0);
if (error) {
ofp_sendf(conn->fd, "Not valid string: '%s'\r\n", str);
str[0] = 0;
goto err;
}
plen /= sizeof(int);
error = ofp_sysctl_find_oid(oid, plen, &noid, &nindx, NULL);
if (error)
return;
if ((noid->oid_kind & OFP_CTLTYPE) == OFP_CTLTYPE_NODE) {
ofp_sendf(conn->fd, "Not a variable.\r\n");
l = noid->oid_arg1;
goto err;
}
switch (noid->oid_kind & OFP_CTLTYPE) {
case OFP_CTLTYPE_UINT:
case OFP_CTLTYPE_INT: {
int *r = (int *)new;
*r = atoi(p);
newlen = sizeof(int);
break;
}
case OFP_CTLTYPE_ULONG:
case OFP_CTLTYPE_LONG: {
long int *r = (long int *)new;
*r = atol(p);
newlen = sizeof(long int);
break;
}
case OFP_CTLTYPE_STRING: {
newlen = strlen(p);
if (newlen > sizeof(new) - 1)
newlen = sizeof(new) - 1;
p[newlen] = 0;
memcpy(new, p, newlen+1);
break;
}
case OFP_CTLTYPE_S64:
case OFP_CTLTYPE_U64: {
int64_t *r = (int64_t *)new;
*r = atoll(p);
newlen = sizeof(int64_t);
break;
}
default: ofp_sendf(conn->fd, "unsupported type for writing\r\n");
goto err;
}
error = ofp_kernel_sysctl(NULL, oid, plen, NULL, NULL,
new, newlen, &retval, 0);
if (error) {
ofp_sendf(conn->fd, "Cannot write: '%s'", str);
sendcrlf(conn);
return;
}
sendcrlf(conn);
return;
err:
ofp_sendf(conn->fd, "Alternatives:\r\n");
struct ofp_sysctl_oid *oidp;
OFP_SLIST_FOREACH(oidp, l, oid_link) {
ofp_sendf(conn->fd, " %s%s%s\r\n",
str, str[0] ? "." : "", oidp->oid_name);
}
sendcrlf(conn);
}
|
// Copyright (c) 2015 University of Szeged.
// Copyright (c) 2015 The Chromium Authors.
// All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPROCKET_BROWSER_UI_AUTHENTICATION_DIALOG_H_
#define SPROCKET_BROWSER_UI_AUTHENTICATION_DIALOG_H_
#include <string>
#include "base/strings/string16.h"
#include "build/build_config.h"
#if defined(USE_AURA)
#include "ui/views/window/dialog_delegate.h"
namespace views {
class Label;
class Textfield;
}
#elif defined(OS_ANDROID)
#include "base/android/scoped_java_ref.h"
#endif
class SprocketResourceDispatcherHostLoginDelegate;
class SprocketAuthenticationDialog
#if defined(USE_AURA)
: public views::DialogDelegateView
#endif
{
public:
SprocketAuthenticationDialog(
SprocketResourceDispatcherHostLoginDelegate* delegate,
std::string& realm,
std::string& host);
#if defined(USE_AURA)
~SprocketAuthenticationDialog() override;
#else
~SprocketAuthenticationDialog();
#endif
#if defined(USE_AURA)
// Overridden from views::DialogDelegate:
base::string16 GetWindowTitle() const override;
bool Cancel() override;
bool Accept() override;
// Overridden from ui::DialogModel:
int GetDialogButtons() const override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
gfx::Size GetPreferredSize() const override;
#elif defined(OS_ANDROID)
void Cancel();
void Accept(const base::string16& username, const base::string16& password);
void CreateJavaObject();
base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
static bool Register(JNIEnv* env);
#endif
private:
#if defined(USE_AURA)
views::Label* label_;
views::Textfield* username_prompt_;
views::Textfield* password_prompt_;
#elif defined(OS_ANDROID)
base::android::ScopedJavaGlobalRef<jobject> java_object_;
#endif
SprocketResourceDispatcherHostLoginDelegate* delegate_;
base::string16 message_;
DISALLOW_COPY_AND_ASSIGN(SprocketAuthenticationDialog);
};
#endif // SPROCKET_BROWSER_UI_AUTHENTICATION_DIALOG_H_
|
#ifndef __DAVAENGINE_GAME_OBJECT_ANIMATIONS_H__
#define __DAVAENGINE_GAME_OBJECT_ANIMATIONS_H__
#include "Base/BaseMath.h"
#include "Render/2D/Sprite.h"
#include "Animation/AnimatedObject.h"
#include "Animation/Interpolation.h"
namespace DAVA
{
class RemoveFromManagerGameObjectAnimation : public Animation
{
protected:
~RemoveFromManagerGameObjectAnimation();
public:
RemoveFromManagerGameObjectAnimation(GameObject* object);
virtual void Update(float32 timeElapsed);
virtual void OnStart();
private:
GameObject* object;
};
};
#endif |
// Copyright (c) 2015 Vijos Dev Team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WINC_CORE_UTIL_H_
#define WINC_CORE_UTIL_H_
#include <Windows.h>
#include <memory>
#include <type_traits>
#include <winc_types.h>
namespace winc {
struct CloseHandleDeleter {
void operator()(HANDLE object) const {
::CloseHandle(object);
}
};
typedef std::unique_ptr<std::remove_pointer<HANDLE>::type,
CloseHandleDeleter> unique_handle;
class ProcThreadAttributeList {
public:
ProcThreadAttributeList()
: data_(nullptr)
{}
~ProcThreadAttributeList();
ResultCode Init(DWORD attribute_count, DWORD flags);
ResultCode Update(DWORD flags, DWORD_PTR attribute,
PVOID value, SIZE_T size);
LPPROC_THREAD_ATTRIBUTE_LIST data() const {
return data_;
}
private:
LPPROC_THREAD_ATTRIBUTE_LIST data_;
private:
ProcThreadAttributeList(const ProcThreadAttributeList &) = delete;
void operator=(const ProcThreadAttributeList &) = delete;
};
}
#endif
|
#ifndef ALIPP13CLUSTERCUTS_H
#define ALIPP13CLUSTERCUTS_H
// --- AliRoot header files ---
#include <AliVCluster.h>
// NB: There is no need to derive it from TObject
// as it should be a lightweight class
struct AliPP13ClusterCuts
{
enum PredefinedSet{kStandardPHOS};
Bool_t AcceptCluster(AliVCluster * clus) const;
static AliPP13ClusterCuts GetClusterCuts(Int_t ctype = kStandardPHOS);
Float_t fClusterMinE;
Float_t fAsymmetryCut;
Float_t fTimingCut;
Int_t fNCellsCut;
Int_t fNContributors;
};
#endif |
//
// NewLeadViewController.h
// Celery
//
// Created by Peter Shih on 4/17/13.
//
//
#import "PSTableViewController.h"
@interface NewLeadViewController : PSTableViewController
- (id)initWithProductId:(NSString *)productId;
@end
|
/*
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <glog/logging.h>
#include <proxygen/lib/http/HTTPConstants.h>
#include <proxygen/lib/http/codec/HTTPCodec.h>
namespace proxygen {
/**
* Helper class that holds some event in the lifecycle
* of an HTTP request or response.
*
* The main use for this class is to queue up events in
* situations where the code handling events isn't able
* to process them and the thing generating events isn't
* able to stop.
*/
class HTTPEvent {
public:
enum class Type: uint8_t {
// Ingress events
MESSAGE_BEGIN,
HEADERS_COMPLETE,
BODY,
CHUNK_HEADER,
CHUNK_COMPLETE,
TRAILERS_COMPLETE,
MESSAGE_COMPLETE,
UPGRADE
};
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, bool upgrade = false):
streamID_(streamID), length_(0), event_(event),
upgrade_(upgrade) {}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, size_t length):
streamID_(streamID), length_(length), event_(event),
upgrade_(false) {
// This constructor should only be used for CHUNK_HEADER.
// (Ideally we would take the event type as a template parameter
// so we could enforce this check at compile time. Unfortunately,
// that would prevent us from using this constructor with
// deferredCallbacks_.emplace().)
CHECK(event == Type::CHUNK_HEADER);
}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, std::unique_ptr<HTTPMessage> headers):
headers_(std::move(headers)), streamID_(streamID), length_(0),
event_(event), upgrade_(false) {}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, std::unique_ptr<folly::IOBuf> body):
body_(std::move(body)), streamID_(streamID), length_(0),
event_(event), upgrade_(false) {}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, std::unique_ptr<HTTPHeaders> trailers):
trailers_(std::move(trailers)), streamID_(streamID), length_(0),
event_(event), upgrade_(false) {}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, std::unique_ptr<HTTPException> error):
error_(std::move(error)), streamID_(streamID), length_(0),
event_(event), upgrade_(false) {}
HTTPEvent(HTTPCodec::StreamID streamID,
Type event, UpgradeProtocol protocol):
streamID_(streamID), length_(0), event_(event),
upgrade_(false), protocol_(protocol) {}
Type getEvent() const { return event_; }
HTTPCodec::StreamID getStreamID() const { return streamID_; }
std::unique_ptr<HTTPMessage> getHeaders() { return std::move(headers_); }
std::unique_ptr<folly::IOBuf> getBody() { return std::move(body_); }
std::unique_ptr<HTTPException> getError() { return std::move(error_); }
bool isUpgrade() const {
CHECK(event_ == Type::MESSAGE_COMPLETE);
return upgrade_;
}
size_t getChunkLength() const {
CHECK(event_ == Type::CHUNK_HEADER);
return length_;
}
std::unique_ptr<HTTPHeaders> getTrailers() {
return std::move(trailers_);
}
UpgradeProtocol getUpgradeProtocol() {
return protocol_;
}
private:
std::unique_ptr<HTTPMessage> headers_;
std::unique_ptr<folly::IOBuf> body_;
std::unique_ptr<HTTPHeaders> trailers_;
std::unique_ptr<HTTPException> error_;
HTTPCodec::StreamID streamID_;
size_t length_; // Only valid when event_ == CHUNK_HEADER
Type event_;
bool upgrade_; // Only valid when event_ == MESSAGE_COMPLETE
UpgradeProtocol protocol_;
};
std::ostream& operator<<(std::ostream& os, HTTPEvent::Type e);
}
|
/**
* @file Transformation.h
* @brief abstract class for representing 3D affine transformations
* @author Ralph Gauges
*
*/
/* Copyright 2010 Ralph Gauges
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation. A copy of the license agreement is
* provided in the file named "LICENSE.txt" included with this software
* distribution. It is also available online at
* http://sbml.org/software/libsbml/license.html
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* The original code contained here was initially developed by:
*
* Ralph Gauges
* Group for the modeling of biological processes
* University of Heidelberg
* Im Neuenheimer Feld 267
* 69120 Heidelberg
* Germany
*
* mailto:ralph.gauges@bioquant.uni-heidelberg.de
*
* Contributor(s):
*
* @class Transformation
* @brief implementation of a 3D transformation matrix.
*
* The Transformation class represents a 3D transformation which normally is a 4x4 matrix.
* Since the last row is always 0 0 0 1 for affine transformations, we leave out those values
* and store the matrix as an array of 4x3 columns
*/
#ifndef Transformation_H__
#define Transformation_H__
#include <sbml/common/sbmlfwd.h>
#include <sbml/packages/render/extension/RenderExtension.h>
#include <sbml/SBase.h>
#include <sbml/xml/XMLNode.h>
#ifdef __cplusplus
LIBSBML_CPP_NAMESPACE_BEGIN
class LIBSBML_EXTERN Transformation : public SBase
{
protected:
/** @cond doxygenLibsbmlInternal */
double mMatrix[12];
static const double IDENTITY3D[12];
/** @endcond */
protected:
/**
* Creates a new Transformation object from the given XMLNode object.
* The XMLNode object has to contain a valid XML representation of a
* Transformation object as defined in the render extension specification.
* This method is normally called when render information is read from a file and
* should normally not have to be called explicitely.
*
* @param node the XMLNode object reference that describes the Transformation
* object to be instantiated.
*/
Transformation(const XMLNode& node, unsigned int l2version=4);
public:
/**
* Returns a 3D identity matrix.
* The matrix contains 12 double values.
*/
static const double* getIdentityMatrix();
/**
* Creates a new Transformation object with the given SBML level
* and SBML version.
*
* @param level SBML level of the new object
* @param level SBML version of the new object
*/
Transformation (unsigned int level = RenderExtension::getDefaultLevel(),
unsigned int version = RenderExtension::getDefaultVersion(),
unsigned int pkgVersion = RenderExtension::getDefaultPackageVersion());
/**
* Creates a new Transformation object with the given SBMLNamespaces.
*
* @param sbmlns The SBML namespace for the object.
*/
Transformation (RenderPkgNamespaces* renderns);
/**
* Copy constructor.
*/
Transformation(const Transformation& other);
/**
* Destroy this Transformation object.
*/
virtual ~Transformation ();
/**
* Sets the matrix to the values given in the array.
*
* @param m array with new values to be set for this Transformation object.
*/
void setMatrix(const double m[12]);
/**
* Returns the matrix which is an array of double values of length 12.
*
* @return a pointer to the array of numbers for the transformation.
*/
const double* getMatrix() const;
/**
* Returns true if the matrix has been set or false otherwise.
* The matrix is considered as set if none of the values in the matrix is NaN.
*
* @return true or false depending on whether a NaN was found.
*/
bool isSetMatrix() const;
};
LIBSBML_CPP_NAMESPACE_END
#endif /* __cplusplus */
#endif /* Transformation_H__ */
|
/** @file cscan.h
*
* This file defines the interface to the numscanner.
*/
struct scanstate;
/** These are the tokens that the numscan scanner recognizes. */
enum commentscan_tokens {
EOFTOK, ///< re2c scanners always return 0 when they hit the EOF.
LABEL, ///< a number is a consecutive string of digits.
DATA, ///< a string is anything that isn't a number or a newline.
CPCOMMENT, ///< A C++ comment: //(.*)$
COMBEG, ///< the start of a comment, "/*"
COMMENT, ///< data inside a comment
COMEND, ///< the ending clause of a comment
NEWLINE, ///< a single newline, returned in either state
};
/** This prepares the given scanstate to be a numscanner */
scanstate* commentscan_attach(scanstate *ss);
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_REPEAT_CONTROLLER_H_
#define UI_VIEWS_REPEAT_CONTROLLER_H_
#include "base/callback.h"
#include "base/macros.h"
#include "base/timer/timer.h"
namespace views {
///////////////////////////////////////////////////////////////////////////////
//
// RepeatController
//
// An object that handles auto-repeating UI actions. There is a longer initial
// delay after which point repeats become constant. Users provide a callback
// that is notified when each repeat occurs so that they can perform the
// associated action.
//
///////////////////////////////////////////////////////////////////////////////
class RepeatController {
public:
explicit RepeatController(base::RepeatingClosure callback);
virtual ~RepeatController();
// Start repeating.
void Start();
// Stop repeating.
void Stop();
const base::OneShotTimer& timer_for_testing() const { return timer_; }
private:
// Called when the timer expires.
void Run();
// The current timer.
base::OneShotTimer timer_;
base::RepeatingClosure callback_;
DISALLOW_COPY_AND_ASSIGN(RepeatController);
};
} // namespace views
#endif // UI_VIEWS_REPEAT_CONTROLLER_H_
|
//
// FLYConfiguration.h
// InAppTest
//
// Created by Ivan Kozlov on 30/05/16.
// Copyright © 2016 Ivan Kozlov. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FLYInterstitialModel;
typedef void (^FLYConfigurationSuccessBlock)(FLYInterstitialModel *interstitialModel);
typedef void (^FLYConfigurationFailureBlock)(NSError *error);
@interface FLYConfiguration : NSObject
@property(nonatomic) BOOL coppa;
@property(nonatomic) BOOL dnt;
@property(nonatomic) BOOL testing;
+(instancetype)sharedInstance;
-(NSDictionary *)dictionaryRepresentation:(NSUInteger)zoneID;
@end |
//
// Copyright (c) 2010 The ANGLE 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.
//
#include "compiler/translator/intermediate.h"
#include "compiler/translator/LoopInfo.h"
class TInfoSinkBase;
// Traverses intermediate tree to ensure that the shader does not exceed the
// minimum functionality mandated in GLSL 1.0 spec, Appendix A.
class ValidateLimitations : public TIntermTraverser
{
public:
ValidateLimitations(sh::GLenum shaderType, TInfoSinkBase &sink);
int numErrors() const { return mNumErrors; }
virtual bool visitBinary(Visit, TIntermBinary *);
virtual bool visitUnary(Visit, TIntermUnary *);
virtual bool visitAggregate(Visit, TIntermAggregate *);
virtual bool visitLoop(Visit, TIntermLoop *);
private:
void error(TSourceLoc loc, const char *reason, const char *token);
bool withinLoopBody() const;
bool isLoopIndex(TIntermSymbol *symbol);
bool validateLoopType(TIntermLoop *node);
bool validateForLoopHeader(TIntermLoop *node);
// If valid, return the index symbol id; Otherwise, return -1.
int validateForLoopInit(TIntermLoop *node);
bool validateForLoopCond(TIntermLoop *node, int indexSymbolId);
bool validateForLoopExpr(TIntermLoop *node, int indexSymbolId);
// Returns true if none of the loop indices is used as the argument to
// the given function out or inout parameter.
bool validateFunctionCall(TIntermAggregate *node);
bool validateOperation(TIntermOperator *node, TIntermNode *operand);
// Returns true if indexing does not exceed the minimum functionality
// mandated in GLSL 1.0 spec, Appendix A, Section 5.
bool isConstExpr(TIntermNode *node);
bool isConstIndexExpr(TIntermNode *node);
bool validateIndexing(TIntermBinary *node);
sh::GLenum mShaderType;
TInfoSinkBase &mSink;
int mNumErrors;
TLoopStack mLoopStack;
};
|
#pragma once
#include <Transformation.h>
#include <EventID.h>
#include <utility>
using EventTypeResult = std::pair<EventType, bool>;
EventTypeResult findGoalEventType(EventID goal, const Transformation::EventTypes& types);
/** \brief extract comaptible EventIds from published EventIds
* \param goal the goal EventID
* \param ids all published EventIds
**/
Transformation::EventIDs extractCompatibleIDs(EventID goal, const Transformation::EventIDs& ids);
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#ifdef WIN32
#include <tchar.h>
#include <Windows.h>
#include "CyAPI.h"
#include "cyioctl.h"
#else
#include <string.h>
typedef unsigned char BYTE;
typedef unsigned int DWORD;
#endif
#include "HexFileParser.h"
|
/*
* Copyright (c) 2016, Uppsala University, Sweden.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Kasun Hewage
*
*/
#ifndef __LWB_SCHED_COMPRESSOR_H__
#define __LWB_SCHED_COMPRESSOR_H__
#include "lwb-common.h"
uint8_t lwb_sched_compress(lwb_schedule_t *sched, uint8_t* buf, uint8_t buf_len);
uint8_t lwb_sched_decompress(lwb_schedule_t *sched, uint8_t* buf, uint8_t buf_len);
#endif /* __LWB_SHED_COMPRESSOR_H__ */
|
/*
* Distortion.h
* ------------
* Purpose: Implementation of the DMO Distortion DSP (for non-Windows platforms)
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#if !defined(NO_PLUGINS) && defined(NO_DMO)
#include "../PlugInterface.h"
OPENMPT_NAMESPACE_BEGIN
namespace DMO
{
//==================================
class Distortion : public IMixPlugin
//==================================
{
public:
enum Parameters
{
kDistGain = 0,
kDistEdge,
kDistPreLowpassCutoff,
kDistPostEQCenterFrequency,
kDistPostEQBandwidth,
kDistNumParameters
};
protected:
float m_param[kDistNumParameters];
// Pre-EQ coefficients
float m_preEQz1[2], m_preEQb1, m_preEQa0;
// Post-EQ coefficients
float m_postEQz1[2], m_postEQz2[2], m_postEQa0, m_postEQb0, m_postEQb1;
uint8 m_edge, m_shift;
public:
static IMixPlugin* Create(VSTPluginLib &factory, CSoundFile &sndFile, SNDMIXPLUGIN *mixStruct);
Distortion(VSTPluginLib &factory, CSoundFile &sndFile, SNDMIXPLUGIN *mixStruct);
virtual void Release() { delete this; }
virtual int32 GetUID() const { return 0xEF114C90; }
virtual int32 GetVersion() const { return 0; }
virtual void Idle() { }
virtual uint32 GetLatency() const { return 0; }
virtual void Process(float *pOutL, float *pOutR, uint32 numFrames);
virtual float RenderSilence(uint32) { return 0.0f; }
virtual bool MidiSend(uint32) { return true; }
virtual bool MidiSysexSend(const void *, uint32) { return true; }
virtual void MidiCC(uint8, MIDIEvents::MidiCC, uint8, CHANNELINDEX) { }
virtual void MidiPitchBend(uint8, int32, int8) { }
virtual void MidiVibrato(uint8, int32, int8) { }
virtual void MidiCommand(uint8, uint8, uint16, uint16, uint16, CHANNELINDEX) { }
virtual void HardAllNotesOff() { }
virtual bool IsNotePlaying(uint32, uint32, uint32) { return false; }
virtual int32 GetNumPrograms() const { return 0; }
virtual int32 GetCurrentProgram() { return 0; }
virtual void SetCurrentProgram(int32) { }
virtual PlugParamIndex GetNumParameters() const { return kDistNumParameters; }
virtual PlugParamValue GetParameter(PlugParamIndex index);
virtual void SetParameter(PlugParamIndex index, PlugParamValue value);
virtual void Resume();
virtual void Suspend() { m_isResumed = false; }
virtual void PositionChanged() { }
virtual bool IsInstrument() const { return false; }
virtual bool CanRecieveMidiEvents() { return false; }
virtual bool ShouldProcessSilence() { return true; }
#ifdef MODPLUG_TRACKER
virtual CString GetDefaultEffectName() { return _T("Distortion"); }
virtual void CacheProgramNames(int32, int32) { }
virtual void CacheParameterNames(int32, int32) { }
virtual CString GetParamName(PlugParamIndex param);
virtual CString GetParamLabel(PlugParamIndex);
virtual CString GetParamDisplay(PlugParamIndex param);
virtual CString GetCurrentProgramName() { return CString(); }
virtual void SetCurrentProgramName(const CString &) { }
virtual CString GetProgramName(int32) { return CString(); }
virtual bool HasEditor() const { return false; }
#endif
virtual void BeginSetProgram(int32) { }
virtual void EndSetProgram() { }
virtual int GetNumInputChannels() const { return 2; }
virtual int GetNumOutputChannels() const { return 2; }
virtual bool ProgramsAreChunks() const { return false; }
virtual size_t GetChunk(char *(&), bool) { return 0; }
virtual void SetChunk(size_t, char *, bool) { }
protected:
static float FreqInHertz(float param) { return 100.0f + param * 7900.0f; }
float GainInDecibel() const { return -60.0f + m_param[kDistGain] * 60.0f; }
void RecalculateDistortionParams();
};
} // namespace DMO
OPENMPT_NAMESPACE_END
#endif // !NO_PLUGINS && NO_DMO
|
/********************************************************************************/
/* */
/* TPM PhysicalSetDeactivated */
/* Written by S. Berger */
/* IBM Thomas J. Watson Research Center */
/* $Id: physicalsetdeactivated.c 4702 2013-01-03 21:26:29Z kgoldman $ */
/* */
/* (c) Copyright IBM Corporation 2006, 2010. */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* */
/* Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* Neither the names of the IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef TPM_POSIX
#include <netinet/in.h>
#endif
#ifdef TPM_WINDOWS
#include <winsock2.h>
#endif
#include "tpm.h"
#include "tpmutil.h"
#include <tpmfunc.h>
void print_usage(void);
int main(int argc, char *argv[])
{
int ret = 0;
int i; /* argc iterator */
TPM_BOOL state = TRUE;
TPM_setlog(0); /* turn off verbose output */
for (i=1 ; (i<argc) && (ret == 0) ; i++) {
if (strcmp(argv[i],"-c") == 0) {
state = FALSE;
}
else if (strcmp(argv[i],"-s") == 0) {
state = TRUE;
}
else if (strcmp(argv[i],"-h") == 0) {
ret = ERR_BAD_ARG;
print_usage();
}
else if (strcmp(argv[i],"-v") == 0) {
TPM_setlog(1);
}
else {
printf("\n%s is not a valid option\n", argv[i]);
ret = ERR_BAD_ARG;
print_usage();
}
}
if (ret == 0) {
ret = TPM_PhysicalSetDeactivated(state);
if (ret != 0) {
printf("TPM_PhysicalSetDeactivated returned '%s' (%d).\n",
TPM_GetErrMsg(ret),
ret);
}
}
return ret;
}
void print_usage(void)
{
printf("\n");
printf("physicalsetdeactivated\n");
printf("\n");
printf("Runs TPM_PhysicalSetDeactivated\n");
printf("\n");
printf("\t-c clear deactivated to FALSE\n");
printf("\t-s set deactivated to TRUE (default)\n");
printf("\t-h this help message\n");
return;
}
|
#ifndef COAX_GUI_HANDLER_H
#define COAX_GUI_HANDLER_H
#include <QObject>
#include <QDesktopWidget>
#include <QApplication>
#include <QtGui>
#include <QtGui/QMainWindow>
#include <boost/thread.hpp>
#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <cv_bridge/cv_bridge.h>
#include <image_transport/image_transport.h>
#include "coax_msgs/CoaxState.h"
#include "ui_CoaxGUI.h"
class CoaxGUIHandler : public QMainWindow {
Q_OBJECT
protected:
Ui_CoaxGUI gui;
QImage video;
QTimer controlTimer, guiTimer;
ros::AsyncSpinner spinner;
coax_msgs::CoaxState state,cfgstate;
ros::Subscriber state_sub;
ros::Publisher control_pub;
ros::ServiceClient cfgControlClt;
ros::ServiceClient cfgCommClt;
ros::ServiceClient cfgOAClt;
ros::ServiceClient reachNavStateClt;
ros::ServiceClient setTimeoutClt;
image_transport::Subscriber camera_sub;
boost::mutex image_mutex;
bool configureCoaX;
bool manualControl;
float desiredRoll, desiredPitch, desiredYaw, desiredAlt;
public:
CoaxGUIHandler(ros::NodeHandle & n);
~CoaxGUIHandler();
void stateCallback(const coax_msgs::CoaxState::ConstPtr& msg) {
// printf("Got State\n");
state = *msg;
}
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
boost::lock_guard<boost::mutex> guard(image_mutex);
// Convert image from ROS msg to OpenCV
cv_bridge::CvImagePtr cv_ptr;
try
{
// Conversion
cv_ptr = cv_bridge::toCvCopy(msg, "mono8");
// Show image (debug)
//cv::namedWindow("CoaX Video", CV_WINDOW_AUTOSIZE);
//cv::startWindowThread();
//cv::imshow("CoaX Video", cv_ptr->image);
//cv::waitKey(3);
video = QImage((const uchar*)(cv_ptr->image.data), cv_ptr->image.cols, cv_ptr->image.rows, QImage::Format_Indexed8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("Unable to convert %s image to mono8! cv_bridge exception: %s", msg->encoding.c_str(), e.what());
return;
}
}
/**
* Examine the key pressed and move the disc accordingly.
**/
void keyPressEvent (QKeyEvent *);
public slots:
void updateGui();
void updateControl();
void prepareConfiguration();
void cancelConfiguration();
void applyConfiguration();
void toggleKeyControl(bool state);
};
#endif // COAX_GUI_HANDLER_H
|
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004-2020 musikcube team
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <functional>
#include <musikcore/sdk/IPlugin.h>
#include <musikcore/support/Preferences.h>
#include <cursespp/Checkbox.h>
#include <cursespp/TextInput.h>
#include <cursespp/TextLabel.h>
#include <cursespp/OverlayBase.h>
#include <cursespp/ShortcutsWindow.h>
namespace musik {
namespace cube {
class ServerOverlay:
public cursespp::OverlayBase,
public sigslot::has_slots<>
{
public:
using Callback = std::function<void()>;
using Plugin = std::shared_ptr<musik::core::sdk::IPlugin>;
using Prefs = std::shared_ptr<musik::core::Preferences>;
static void Show(Callback callback);
static std::shared_ptr<musik::core::sdk::IPlugin> FindServerPlugin();
virtual void Layout();
virtual bool KeyPress(const std::string& key);
private:
ServerOverlay(Callback callback, Plugin plugin);
void RecalculateSize();
void InitViews();
bool Save();
void Load();
Callback callback;
Plugin plugin;
Prefs prefs;
int width, height, x, y;
std::shared_ptr<cursespp::TextLabel> titleLabel;
std::shared_ptr<cursespp::Checkbox> enableWssCb, enableHttpCb, enableSyncTransCb;
std::shared_ptr<cursespp::Checkbox> ipv6Cb;
std::shared_ptr<cursespp::TextLabel> wssPortLabel, httpPortLabel, pwLabel, transCacheLabel, maxTransLabel;
std::shared_ptr<cursespp::TextInput> wssPortInput, httpPortInput, pwInput, transCacheInput, maxTransInput;
std::shared_ptr<cursespp::ShortcutsWindow> shortcuts;
};
}
}
|
//
// SCFieldLinkData.h
// SCFieldLinkData
//
// Created on 2/29/2012.
// Copyright 2012. Sitecore. All rights reserved.
//
#include <SitecoreMobileSDK/SCAsyncOpDefinitions.h>
#import <Foundation/Foundation.h>
@class SCItem;
/**
The SCFieldLinkData object contains attributes of link xml of "General Link" field raw value.
*/
@interface SCFieldLinkData : NSObject
@property(nonatomic,readonly) NSString *linkDescription;
@property(nonatomic,readonly) NSString *linkType;
@property(nonatomic,readonly) NSString *url;
@property(nonatomic,readonly) NSString *alternateText;
@end
/**
The SCInternalFieldLinkData object represents the Sitecore internal link.
*/
@interface SCInternalFieldLinkData : SCFieldLinkData
@property(nonatomic,readonly) NSString *anchor;
@property(nonatomic,readonly) NSString *queryString;
@property(nonatomic,readonly) NSString *itemId;
/**
Used for loading the linked item.
@return SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler's result is SCItem object or nil if error happens.
*/
-(SCAsyncOp)itemReader;
@end
/**
The SCMediaFieldLinkData object represents the Sitecore media link.
*/
@interface SCMediaFieldLinkData : SCFieldLinkData
/**
Linked media item id.
*/
@property(nonatomic,readonly) NSString *itemId;
/**
Used to load linked image.
@return SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler's result is UIImage object or nil if error happens.
*/
-(SCAsyncOp)imageReader;
-(SCExtendedAsyncOp)extendedImageReader;
@end
/**
The SCExternalFieldLinkData object represents the Sitecore external link.
*/
@interface SCExternalFieldLinkData : SCFieldLinkData
@end
/**
The SCAnchorFieldLinkData object represents the Sitecore anchor link.
*/
@interface SCAnchorFieldLinkData : SCFieldLinkData
@property(nonatomic,readonly) NSString *anchor;
@end
/**
The SCEmailFieldLinkData object represents the Sitecore email link.
*/
@interface SCEmailFieldLinkData : SCFieldLinkData
@end
/**
The SCEmailFieldLinkData object represents the Sitecore javascript link.
*/
@interface SCJavascriptFieldLinkData : SCFieldLinkData
@end
|
/* sqlstmts.c
*
* SQL statement definitions (used by parser)
*
* Created by Oliver Sharma on 2009-05-03.
* Copyright (c) 2009. All rights reserved.
*/
#include "sqlstmts.h"
#include "util.h"
#include "timestamp.h"
#include "gram.h"
#include <stdlib.h>
#include <string.h>
#include "logdefs.h"
const int sql_colattrib_types[6] = {0,1,2,3,4,5};
const char *colattrib_name[6] = {"none", "count", "min", "max", "avg", "sum"};
sqlwindow *sqlstmt_new_stubwindow() {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_NONE;
win->num = -1;
win->unit = -1;
return win;
}
sqlwindow *sqlstmt_new_timewindow(int num, int unit) {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_TIME;
win->num = num;
win->unit = unit;
return win;
}
sqlwindow *sqlstmt_new_timewindow_since(char *value) {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_SINCE;
win->tstampv = string_to_timestamp(value);
return win;
}
sqlwindow *sqlstmt_new_timewindow_interval(sqlinterval *val) {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_INTERVAL;
(win->intv).leftOp = val->leftOp;
(win->intv).rightOp = val->rightOp;
(win->intv).leftTs = val->leftTs;
(win->intv).rightTs = val->rightTs;
return win;
}
sqlwindow *sqlstmt_new_timewindow_now() {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_TIME;
win->num = -1;
win->unit = SQL_WINTYPE_TIME_NOW;
return win;
}
sqlwindow *sqlstmt_new_tuplewindow(int num) {
sqlwindow *win;
win = malloc(sizeof(sqlwindow));
win->type = SQL_WINTYPE_TPL;
win->num = num;
win->unit = -1;
return win;
}
sqlfilter *sqlstmt_new_filter(int ctype, char *name, int dtype, char *value) {
sqlfilter *filter;
filter = malloc(sizeof(sqlfilter));
filter->IS_STR = 0;
filter->varname = name;
switch(ctype) {
case EQUALS:
filter->sign = SQL_FILTER_EQUAL;
break;
case LESS:
filter->sign = SQL_FILTER_LESS;
break;
case GREATER:
filter->sign = SQL_FILTER_GREATER;
break;
case LESSEQ:
filter->sign = SQL_FILTER_LESSEQ;
break;
case GREATEREQ:
filter->sign = SQL_FILTER_GREATEREQ;
break;
case CONTAINS:
filter->sign = SQL_FILTER_CONTAINS;
break;
case NOTCONTAINS:
filter->sign = SQL_FILTER_NOTCONTAINS;
break;
}
switch(dtype) {
case INTEGER:
filter->value.intv = strtoll(value, NULL, 10);
break;
case REAL:
filter->value.realv = strtod(value, NULL);
break;
case CHARACTER:
filter->value.charv = value[0];
break;
case TINYINT:
filter->value.tinyv = atoi(value) & 0xff;
break;
case SMALLINT:
filter->value.smallv = atoi(value) & 0xffff;
break;
case TSTAMP:
filter->value.tstampv = string_to_timestamp(value);
break;
case VARCHAR:
filter->value.stringv = strdup(value);
filter->IS_STR = 1;
debugvf("VALUE IS :%s\n",filter->value.stringv);
}
return filter;
}
sqlpair *sqlstmt_new_pair(int ctype, char *name, int dtype, char *value) {
sqlpair *pair;
pair = malloc(sizeof(sqlpair));
pair->IS_STR = 0;
pair->varname = name;
switch(ctype) {
case EQUALS:
pair->sign = SQL_PAIR_EQUAL;
break;
case ADD:
pair->sign = SQL_PAIR_ADDEQ;
break;
case SUB:
pair->sign = SQL_PAIR_SUBEQ;
break;
}
switch(dtype) {
case INTEGER:
pair->value.intv = strtoll(value, NULL, 10);
break;
case REAL:
pair->value.realv = strtod(value, NULL);
break;
case CHARACTER:
pair->value.charv = value[0];
break;
case TINYINT:
pair->value.tinyv = atoi(value) & 0xff;
break;
case SMALLINT:
pair->value.smallv = atoi(value) & 0xffff;
break;
case TSTAMP:
pair->value.tstampv = string_to_timestamp(value);
break;
case VARCHAR:
pair->value.stringv = strdup(value);
pair->IS_STR = 0;
debugvf("VALUE IS :%s\n",pair->value.stringv);
}
return pair;
}
int sqlstmt_calc_len(sqlinsert *insert) {
int total;
int i;
total = strlen(insert->tablename) + 1;
total += insert->ncols * sizeof(char*);
for (i=0; i < insert->ncols; i++) {
total += strlen(insert->colval[i]) + 1;
}
debugvf("Calculated insert length to be %d\n", total);
return total;
}
int sqlstmt_valid_groupby(sqlselect *select) {
int i, j;
char *groupbycolname;
char *selectcolname;
int found;
/* if there are none group-by operators, it is correct */
if (select->groupby_ncols == 0)
return 1;
/* if none aggregate operators are specified, then it is incorrect */
if (!select->containsMinMaxAvgSum && !select->isCountStar) {
errorf("No aggregate operator specified to group by.\n");
return 0;
}
/* finally, each group-by column must be a selected column */
for (i = 0; i < select->groupby_ncols; i++) {
groupbycolname = select->groupby_cols[i];
found = 0;
for (j = 0; j < select->ncols; j++) {
selectcolname = select->cols[j];
if (strcmp(groupbycolname, selectcolname) == 0)
found = 1;
}
if (!found) {
errorf("Column %s not selected.\n", groupbycolname);
return 0;
}
}
return 1;
}
|
/* $NetBSD: initarmvar.h,v 1.1 2003/04/18 12:01:32 scw Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Steve C. Woodford for Wasabi Systems, Inc.
*
* 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 for the NetBSD Project by
* Wasabi Systems, Inc.
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __EVBARM_INITARMVAR_H
#define __EVBARM_INITARMVAR_H
struct initarm_iospace {
vaddr_t ii_kva; /* KVA at which to map this io space */
paddr_t ii_pa; /* PA of start of region to map */
psize_t ii_size; /* Size of region, in bytes */
vm_prot_t ii_prot; /* VM_PROT_READ/VM_PROT_WRITE */
int ii_cache; /* PTE_{NO,}CACHE */
};
struct initarm_config {
const BootConfig *ic_bootconf; /* Boot configuration */
paddr_t ic_kernel_base_pa; /* Physical address of KERNEL_BASE */
vaddr_t ic_vecbase; /* ARM_VECTORS_{LOW,HIGH} */
vaddr_t ic_iobase; /* KVA of start of fixed io space */
vsize_t ic_iosize; /* Size of fixed io space (bytes) */
int ic_nio; /* # of fixed io mappings in ic_io */
const struct initarm_iospace *ic_io; /* List of fixed io mappings */
};
extern vaddr_t initarm_common(const struct initarm_config *);
#endif /* __EVBARM_INITARMVAR_H */
|
#ifndef __SECCOLLECTTRANSFORM_H__
#define __SECCOLLECTTRANSFORM_H__
/*
* Copyright (c) 2010-2011 Apple 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@
*/
#include "SecTransform.h"
#ifdef __cplusplus
extern "C" {
#endif
/*!
@function SecCreateCollectTransform
@abstract Creates a collection object.
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform will collect all
of the data given to it and output a single data
item
*/
SecTransformRef SecCreateCollectTransform(CFErrorRef* error)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
#ifdef __cplusplus
}
#endif
#endif // __SECCOLLECTTRANSFORM_H__
|
#include <check.h>
#include <stdlib.h>
#include <stdbool.h>
#include "xspf.h"
#define XML_DECL "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
START_TEST(build_xspf)
{
xspf *x = xspf_new();
char *actual = NULL;
const char *expected = XML_DECL
"<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n"
"</playlist>\n";
x = xspf_begin_playlist(x);
x = xspf_end_playlist(x);
actual = xspf_free(x, false);
ck_assert_str_eq(expected, actual);
free(actual);
expected = XML_DECL
"<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n"
"<trackList>\n"
"</trackList>\n"
"</playlist>\n";
x = xspf_new();
x = xspf_begin_playlist(x);
x = xspf_begin_tracklist(x);
x = xspf_end_tracklist(x);
x = xspf_end_playlist(x);
actual = xspf_free(x, false);
ck_assert_str_eq(expected, actual);
free(actual);
expected = XML_DECL
"<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n"
"<trackList>\n"
"<track>\n"
"</track>\n"
"<track>\n"
"</track>\n"
"</trackList>\n"
"</playlist>\n";
x = xspf_new();
x = xspf_begin_playlist(x);
x = xspf_begin_tracklist(x);
x = xspf_begin_track(x);
x = xspf_end_track(x);
x = xspf_begin_track(x);
x = xspf_end_track(x);
x = xspf_end_tracklist(x);
x = xspf_end_playlist(x);
actual = xspf_free(x, false);
ck_assert_str_eq(expected, actual);
free(actual);
}
END_TEST
Suite *
xspf_suite(void)
{
Suite *s = suite_create("XSPF test suite");
TCase *tc_xspf = tcase_create("XSPF Building");
tcase_add_test(tc_xspf, build_xspf);
suite_add_tcase(s, tc_xspf);
return s;
}
int
main(void)
{
int num_failed = 0;
Suite *s = xspf_suite();
SRunner *sr = srunner_create(s);
srunner_run_all(sr, CK_ENV);
num_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (num_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
// Copyright Paul Dardeau, SwampBits LLC 2014
// BSD License
#ifndef CHAUDIERE_CONDITIONVARIABLE_H
#define CHAUDIERE_CONDITIONVARIABLE_H
#include <memory>
namespace chaudiere
{
class Mutex;
/**
* ConditionVariable is an interface (abstract base class) for condition variables
*/
class ConditionVariable
{
public:
virtual ~ConditionVariable() {}
/**
* Wait for the condition to occur
* @param mutex the mutex lock that the caller currently has locked
* @return boolean
* @see Mutex()
*/
virtual bool wait(Mutex* mutex) = 0;
/**
* Notify (wake up) a single waiting thread that the condition has occurred
*/
virtual void notifyOne() = 0;
/**
* Notify (wake up) all threads waiting that the condition has occurred
*/
virtual void notifyAll() = 0;
};
}
#endif
|
/**
******************************************************************************
* @file UART/UART_Printf/Inc/main.h
* @author MCD Application Team
* @version V1.2.4
* @date 29-January-2016
* @brief Header for main.c module
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "stm32f4xx_nucleo.h"
#include "stdio.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* User can use this section to tailor USARTx/UARTx instance used and associated
resources */
/* Definition for USARTx clock resources */
#define USARTx USART2
#define USARTx_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE();
#define USARTx_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define USARTx_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define USARTx_FORCE_RESET() __HAL_RCC_USART2_FORCE_RESET()
#define USARTx_RELEASE_RESET() __HAL_RCC_USART2_RELEASE_RESET()
/* Definition for USARTx Pins */
#define USARTx_TX_PIN GPIO_PIN_2
#define USARTx_TX_GPIO_PORT GPIOA
#define USARTx_TX_AF GPIO_AF7_USART2
#define USARTx_RX_PIN GPIO_PIN_3
#define USARTx_RX_GPIO_PORT GPIOA
#define USARTx_RX_AF GPIO_AF7_USART2
extern uint16_t USART_RX_STA; //½ÓÊÕ״̬±ê¼Ç
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/* apt-spy (c) Steven Holmes, 2003.
* This software is licensed as detailed in the COPYRIGHT file.
*/
#ifndef __PROTOCOLS_H
#define __PROTOCOLS_H
#include "parse.h" /* enum protocol */
int get_file(server_t *current, CURL *curl, char *file, enum protocol protocol, int *total_bytes);
#endif
|
//
// DOMNavigationBar.h
// DOMATI
//
// Created by Jad Osseiran on 28/10/2013.
// Copyright (c) 2013 Jad. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer. Redistributions in binary
// form must reproduce the above copyright notice, this list of conditions and
// the following disclaimer in the documentation and/or other materials
// provided with the distribution. Neither the name of the nor the names of
// its contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#import <UIKit/UIKit.h>
@interface DOMNavigationBar : UINavigationBar
@end
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_
#define UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <vector>
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/views/views_export.h"
namespace base {
class TickClock;
}
namespace views {
class PrefixDelegate;
class View;
// PrefixSelector is used to change the selection in a view as the user
// types characters.
class VIEWS_EXPORT PrefixSelector : public ui::TextInputClient {
public:
PrefixSelector(PrefixDelegate* delegate, View* host_view);
PrefixSelector(const PrefixSelector&) = delete;
PrefixSelector& operator=(const PrefixSelector&) = delete;
~PrefixSelector() override;
// Invoked from the view when it loses focus.
void OnViewBlur();
// Returns whether a key typed now would continue the existing search or start
// a new search.
bool ShouldContinueSelection() const;
// ui::TextInputClient:
void SetCompositionText(const ui::CompositionText& composition) override;
uint32_t ConfirmCompositionText(bool keep_selection) override;
void ClearCompositionText() override;
void InsertText(const std::u16string& text,
InsertTextCursorBehavior cursor_behavior) override;
void InsertChar(const ui::KeyEvent& event) override;
ui::TextInputType GetTextInputType() const override;
ui::TextInputMode GetTextInputMode() const override;
base::i18n::TextDirection GetTextDirection() const override;
int GetTextInputFlags() const override;
bool CanComposeInline() const override;
gfx::Rect GetCaretBounds() const override;
gfx::Rect GetSelectionBoundingBox() const override;
bool GetCompositionCharacterBounds(uint32_t index,
gfx::Rect* rect) const override;
bool HasCompositionText() const override;
FocusReason GetFocusReason() const override;
bool GetTextRange(gfx::Range* range) const override;
bool GetCompositionTextRange(gfx::Range* range) const override;
bool GetEditableSelectionRange(gfx::Range* range) const override;
bool SetEditableSelectionRange(const gfx::Range& range) override;
bool DeleteRange(const gfx::Range& range) override;
bool GetTextFromRange(const gfx::Range& range,
std::u16string* text) const override;
void OnInputMethodChanged() override;
bool ChangeTextDirectionAndLayoutAlignment(
base::i18n::TextDirection direction) override;
void ExtendSelectionAndDelete(size_t before, size_t after) override;
void EnsureCaretNotInRect(const gfx::Rect& rect) override;
bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override;
void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override;
ukm::SourceId GetClientSourceForMetrics() const override;
bool ShouldDoLearning() override;
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
bool SetCompositionFromExistingText(
const gfx::Range& range,
const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
gfx::Range GetAutocorrectRange() const override;
gfx::Rect GetAutocorrectCharacterBounds() const override;
bool SetAutocorrectRange(const gfx::Range& range) override;
#endif
#if defined(OS_WIN) || defined(OS_CHROMEOS)
void GetActiveTextInputControlLayoutBounds(
absl::optional<gfx::Rect>* control_bounds,
absl::optional<gfx::Rect>* selection_bounds) override;
#endif
#if defined(OS_WIN)
void SetActiveCompositionForAccessibility(
const gfx::Range& range,
const std::u16string& active_composition_text,
bool is_composition_committed) override;
#endif
void set_tick_clock_for_testing(const base::TickClock* clock) {
tick_clock_ = clock;
}
private:
// Invoked when text is typed. Tries to change the selection appropriately.
void OnTextInput(const std::u16string& text);
// Returns true if the text of the node at |row| starts with |lower_text|.
bool TextAtRowMatchesText(int row, const std::u16string& lower_text);
// Clears |current_text_| and resets |time_of_last_key_|.
void ClearText();
PrefixDelegate* prefix_delegate_;
View* host_view_;
// Time OnTextInput() was last invoked.
base::TimeTicks time_of_last_key_;
std::u16string current_text_;
// TickClock used for getting the time of the current keystroke, used for
// continuing or restarting selections.
const base::TickClock* tick_clock_;
};
} // namespace views
#endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_
#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_
#include <string>
class ProfileSyncServiceHarness;
// Interface for a helper class that can be used to check if a desired change in
// the state of the sync engine has taken place. Used by the desktop sync
// integration tests.
//
// Usage: Tests that want to use this class to wait for an arbitrary sync state
// must implement a concrete StatusChangeChecker object and pass it to
// ProfileSyncServiceHarness::AwaitStatusChange().
class StatusChangeChecker {
public:
explicit StatusChangeChecker();
// Called every time ProfileSyncServiceHarness is notified of a change in the
// state of the sync engine. Returns true if the desired change has occurred.
virtual bool IsExitConditionSatisfied() = 0;
// Returns a string representing this current StatusChangeChecker, and
// possibly some small part of its state. For example: "AwaitPassphraseError"
// or "AwaitMigrationDone(BOOKMARKS)".
virtual std::string GetDebugMessage() const = 0;
virtual void InitObserver(ProfileSyncServiceHarness*) = 0;
virtual void UninitObserver(ProfileSyncServiceHarness*) = 0;
protected:
virtual ~StatusChangeChecker();
};
#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_AUDIO_AUDIO_RENDERER_SINK_CACHE_H_
#define CONTENT_RENDERER_MEDIA_AUDIO_AUDIO_RENDERER_SINK_CACHE_H_
#include <memory>
#include <string>
#include "base/memory/scoped_refptr.h"
#include "base/unguessable_token.h"
#include "content/common/content_export.h"
#include "media/base/output_device_info.h"
namespace media {
class AudioRendererSink;
}
namespace content {
class RenderFrame;
// Caches AudioRendererSink instances, provides them to the clients for usage,
// tracks their used/unused state, reuses them to obtain output device
// information, garbage-collects unused sinks.
// Must live on the main render thread. Thread safe.
class CONTENT_EXPORT AudioRendererSinkCache {
public:
virtual ~AudioRendererSinkCache() {}
// If called, the cache will drop sinks belonging to the specified frame on
// navigation.
static void ObserveFrame(RenderFrame* frame);
// Returns output device information for a specified sink.
virtual media::OutputDeviceInfo GetSinkInfo(
int source_render_frame_id,
const base::UnguessableToken& session_id,
const std::string& device_id) = 0;
// Provides a sink for usage. The sink must be returned to the cache by
// calling ReleaseSink(). The sink must be stopped by the user before
// deletion, but after releasing it from the cache.
virtual scoped_refptr<media::AudioRendererSink> GetSink(
int source_render_frame_id,
const std::string& device_id) = 0;
// Notifies the cache that the sink is not in use any more. Must be
// called by the client, so that the cache can garbage-collect the sink
// reference.
virtual void ReleaseSink(const media::AudioRendererSink* sink_ptr) = 0;
protected:
AudioRendererSinkCache() {}
private:
DISALLOW_COPY_AND_ASSIGN(AudioRendererSinkCache);
};
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_AUDIO_AUDIO_RENDERER_SINK_CACHE_H_
|
/*
Copyright (c) 1999 - 2010, Vodafone Group Services Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the Vodafone Group Services Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RECURSIVE_MUTEX_IMPL_H
#define RECURSIVE_MUTEX_IMPL_H
#include "Mutex.h"
#include "ThreadID.h"
namespace isab {
class Thread;
class RecursiveMutexImpl {
RecursiveMutexImpl();
~RecursiveMutexImpl();
void lockI(int count);
void unlockI();
void lock(int count) const;
void lock() const;
void unlock() const;
ThreadID getOwner() const;
/// Symbian critical section.
RMutex m_crit;
// Internal mutex.
Mutex m_internal;
// Number of times the mutex has been aquired.
int m_count;
// Current owner of the mutex.
ThreadID m_owner;
friend class RecursiveMutex;
friend class ConditionalImpl;
friend class Monitor;
};
}
#endif
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_URL_LOADING_URL_LOADING_PARAMS_H_
#define IOS_CHROME_BROWSER_URL_LOADING_URL_LOADING_PARAMS_H_
#import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
#import "ios/web/public/navigation/navigation_manager.h"
#include "ui/base/window_open_disposition.h"
// Enum of ways of changing loading behavior, that can be passed around
// opaquely, and set by using |UrlLoadParams::LoadStrategy|.
enum class UrlLoadStrategy {
NORMAL = 0,
ALWAYS_NEW_FOREGROUND_TAB = 1 << 0,
ALWAYS_IN_INCOGNITO = 1 << 1,
};
// UrlLoadingService wrapper around web::NavigationManager::WebLoadParams,
// WindowOpenDisposition and parameters from OpenNewTabCommand.
// This is used when a URL is opened.
struct UrlLoadParams {
public:
// Initializes a UrlLoadParams intended to open in current page.
static UrlLoadParams InCurrentTab(
const web::NavigationManager::WebLoadParams& web_params);
static UrlLoadParams InCurrentTab(const GURL& url);
static UrlLoadParams InCurrentTab(const GURL& url, const GURL& virtual_url);
// Initializes a UrlLoadParams intended to open in a new page.
static UrlLoadParams InNewTab(
const web::NavigationManager::WebLoadParams& web_params);
static UrlLoadParams InNewTab(const GURL& url);
static UrlLoadParams InNewTab(const GURL& url, const GURL& virtual_url);
// Initializes a UrlLoadParams intended to switch to tab.
static UrlLoadParams SwitchToTab(
const web::NavigationManager::WebLoadParams& web_params);
// Set appropriate parameters for background tab mode.
void SetInBackground(bool in_background);
// Allow copying UrlLoadParams.
UrlLoadParams(const UrlLoadParams& other);
UrlLoadParams& operator=(const UrlLoadParams& other);
// The wrapped params.
web::NavigationManager::WebLoadParams web_params;
// The disposition of the URL being opened. Defaults to
// |WindowOpenDisposition::NEW_FOREGROUND_TAB|.
WindowOpenDisposition disposition;
// Whether this requests opening in incognito or not. Defaults to |false|.
bool in_incognito;
// Location where the new tab should be opened. Defaults to |kLastTab|.
OpenPosition append_to;
// Origin point of the action triggering this command, in main window
// coordinates. Defaults to |CGPointZero|.
CGPoint origin_point;
// Whether or not this URL command comes from a chrome context (e.g.,
// settings), as opposed to a web page context. Defaults to |false|.
bool from_chrome;
// Whether the new tab command was initiated by the user (e.g. by tapping the
// new tab button in the tools menu) or not (e.g. opening a new tab via a
// Javascript action). Defaults to |true|. Only used when the |web_params.url|
// isn't valid.
bool user_initiated;
// Whether the new tab command should also trigger the omnibox to be focused.
// Only used when the |web_params.url| isn't valid. Defaults to |false|.
bool should_focus_omnibox;
// Opaque way of changing loading behavior.
UrlLoadStrategy load_strategy;
bool in_background() const {
return disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB;
}
// Public for testing only.
UrlLoadParams();
};
#endif // IOS_CHROME_BROWSER_URL_LOADING_URL_LOADING_PARAMS_H_
|
#ifndef ACL_H
#define ACL_H
#include <pthread.h>
#include "jid.h"
#define ACL_NORMAL 0
#define ACL_MUC_CREATE 1
#define ACL_MUC_PERSIST 2
#define ACL_MUC_ADMIN 3
#define ACL_COMPONENT_ADMIN 4
typedef struct ACLEntry {
Jid jid;
int role;
struct ACLEntry *next;
} ACLEntry;
typedef struct {
int default_role;
ACLEntry *first;
pthread_rwlock_t sync;
} ACLConfig;
void acl_init(ACLConfig *);
void acl_destroy(ACLConfig *);
int acl_role(ACLConfig *, Jid *);
BOOL acl_serialize(ACLConfig *, FILE *);
BOOL acl_deserialize(ACLConfig *, FILE *, int);
#endif
|
#ifndef __PARSER_H__
#define __PARSER_H__
#include <iostream>
#include <list>
#include <fstream>
#include <stdlib.h>
#include <vector>
#include "traversalUnion.h"
string getIndentation(int level);
class Token{
public:
string value;
int level;
};
class ASTNode{
public:
string getType(){
return type;
}
list<ASTNode*> getChildren(){
return children;
}
void printNode(int level){
cout << getIndentation(level);
cout << "-----------------" << endl;
cout << getIndentation(level);
cout << "- " << getType() << ": " << endl;
cout << getIndentation(level);
cout << "-----------------" << endl;
}
void printNodeAsJSON(int level){
cout << getIndentation(level);
cout << "\"type\": \"node\"," << endl;
cout << getIndentation(level);
cout << "\"tags\":[" << endl;
cout << getIndentation(level+1);
cout << "\"" << getType() << "\"\n";
cout << getIndentation(level);
cout << "]" << endl;
}
void accept(CounterVisitor& v){
v.visit(this);
}
string type;
list<ASTNode*> children;
};
class IfBlock: public ASTNode{
public:
string getType(){
return "IfBlock";
}
};
class If: public ASTNode{
public:
string getType(){
return "If";
}
};
class Function : public ASTNode{
public:
string getType(){
return "Function";
}
};
#endif
|
/* Copyright 2014. The Regents of the University of California.
* Copyright 2015. Martin Uecker.
* All rights reserved. Use of this source code is governed by
* a BSD-style license which can be found in the LICENSE file.
*
* Authors:
* 2014-2015 Martin Uecker <martin.uecker@med.uni-goettingen.de>
*/
#include <stdlib.h>
#include <complex.h>
#include "num/multind.h"
#include "num/conv.h"
#include "num/init.h"
#include "misc/mmio.h"
#include "misc/opts.h"
#ifndef DIMS
#define DIMS 16
#endif
static const char usage_str[] = "bitmask <input> <kernel> <output>";
static const char help_str[] = "Performs a convolution along selected dimensions.";
int main_conv(int argc, char* argv[])
{
cmdline(&argc, argv, 4, 4, usage_str, help_str, 0, NULL);
num_init();
unsigned int flags = atoi(argv[1]);
unsigned int N = DIMS;
long dims[N];
const complex float* in = load_cfl(argv[2], N, dims);
long krn_dims[N];
const complex float* krn = load_cfl(argv[3], N, krn_dims);
complex float* out = create_cfl(argv[4], N, dims);
struct conv_plan* plan = conv_plan(N, flags, CONV_CYCLIC, CONV_SYMMETRIC, dims, dims, krn_dims, krn);
conv_exec(plan, out, in);
conv_free(plan);
unmap_cfl(N, dims, out);
unmap_cfl(N, krn_dims, krn);
unmap_cfl(N, dims, in);
exit(0);
}
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef org_mitk_gui_qt_remeshing_Activator_h
#define org_mitk_gui_qt_remeshing_Activator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class org_mitk_gui_qt_remeshing_Activator : public QObject, public ctkPluginActivator
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_remeshing")
#endif
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context);
void stop(ctkPluginContext* context);
};
}
#endif
|
#ifndef __TCP_IN_H_
#define __TCP_IN_H_
#include <linux/if_ether.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <netinet/ip.h>
#include "mtcp.h"
#include "fhash.h"
#define TCP_FLAG_FIN 0x01 // 0000 0001
#define TCP_FLAG_SYN 0x02 // 0000 0010
#define TCP_FLAG_RST 0x04 // 0000 0100
#define TCP_FLAG_PSH 0x08 // 0000 1000
#define TCP_FLAG_ACK 0x10 // 0001 0000
#define TCP_FLAG_URG 0x20 // 0010 0000
#define TCP_FLAG_SACK 0x40 // 0100 0000
#define TCP_FLAG_WACK 0x80 // 1000 0000
#define TCP_OPT_FLAG_MSS 0x02 // 0000 0010
#define TCP_OPT_FLAG_WSCALE 0x04 // 0000 0100
#define TCP_OPT_FLAG_SACK_PERMIT 0x08 // 0000 1000
#define TCP_OPT_FLAG_SACK 0x10 // 0001 0000
#define TCP_OPT_FLAG_TIMESTAMP 0x20 // 0010 0000
#define TCP_OPT_MSS_LEN 4
#define TCP_OPT_WSCALE_LEN 3
#define TCP_OPT_SACK_PERMIT_LEN 2
#define TCP_OPT_SACK_LEN 10
#define TCP_OPT_TIMESTAMP_LEN 10
#define TCP_DEFAULT_MSS 1460
#define TCP_DEFAULT_IPV6_MSS 1440
#define TCP_DEFAULT_WSCALE 7
#define TCP_INITIAL_WINDOW 14600 // initial window size
#define TCP_SEQ_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define TCP_SEQ_LEQ(a,b) ((int32_t)((a)-(b)) <= 0)
#define TCP_SEQ_GT(a,b) ((int32_t)((a)-(b)) > 0)
#define TCP_SEQ_GEQ(a,b) ((int32_t)((a)-(b)) >= 0)
#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))
/* convert timeval to timestamp (precision: 1 ms) */
#define HZ 1000
#define TIME_TICK (1000000/HZ) // in us
#define TIMEVAL_TO_TS(t) (uint32_t)((t)->tv_sec * HZ + \
((t)->tv_usec / TIME_TICK))
#define TS_TO_USEC(t) ((t) * TIME_TICK)
#define TS_TO_MSEC(t) (TS_TO_USEC(t) / 1000)
#define USEC_TO_TS(t) ((t) / TIME_TICK)
#define MSEC_TO_TS(t) (USEC_TO_TS((t) * 1000))
#define SEC_TO_TS(t) (t * HZ)
#define SEC_TO_USEC(t) ((t) * 1000000)
#define SEC_TO_MSEC(t) ((t) * 1000)
#define MSEC_TO_USEC(t) ((t) * 1000)
#define USEC_TO_SEC(t) ((t) / 1000000)
//#define TCP_TIMEWAIT (MSEC_TO_USEC(5000) / TIME_TICK) // 5s
#define TCP_TIMEWAIT 0
#define TCP_INITIAL_RTO (MSEC_TO_USEC(500) / TIME_TICK) // 500ms
#define TCP_FIN_RTO (MSEC_TO_USEC(500) / TIME_TICK) // 500ms
#define TCP_TIMEOUT (MSEC_TO_USEC(30000) / TIME_TICK) // 30s
#define TCP_MAX_RTX 16
#define TCP_MAX_SYN_RETRY 7
#define TCP_MAX_BACKOFF 7
enum tcp_state
{
TCP_ST_CLOSED = 0,
TCP_ST_LISTEN = 1,
TCP_ST_SYN_SENT = 2,
TCP_ST_SYN_RCVD = 3,
TCP_ST_ESTABLISHED = 4,
TCP_ST_FIN_WAIT_1 = 5,
TCP_ST_FIN_WAIT_2 = 6,
TCP_ST_CLOSE_WAIT = 7,
TCP_ST_CLOSING = 8,
TCP_ST_LAST_ACK = 9,
TCP_ST_TIME_WAIT = 10
};
enum tcp_option
{
TCP_OPT_END = 0,
TCP_OPT_NOP = 1,
TCP_OPT_MSS = 2,
TCP_OPT_WSCALE = 3,
TCP_OPT_SACK_PERMIT = 4,
TCP_OPT_SACK = 5,
TCP_OPT_TIMESTAMP = 8
};
enum tcp_close_reason
{
TCP_NOT_CLOSED = 0,
TCP_ACTIVE_CLOSE = 1,
TCP_PASSIVE_CLOSE = 2,
TCP_CONN_FAIL = 3,
TCP_CONN_LOST = 4,
TCP_RESET = 5,
TCP_NO_MEM = 6,
TCP_NOT_ACCEPTED = 7,
TCP_TIMEDOUT = 8
};
void
ParseTCPOptions(tcp_stream *cur_stream,
uint32_t cur_ts, uint8_t *tcpopt, int len);
inline int
ProcessTCPUplink(mtcp_manager_t mtcp, uint32_t cur_ts, tcp_stream *cur_stream,
const struct tcphdr *tcph, uint32_t seq, uint32_t ack_seq,
uint8_t *payload, int payloadlen, uint32_t window);
int
ProcessTCPPacket(mtcp_manager_t mtcp, uint32_t cur_ts, struct tcphdr* tcph,
int tcplen, const struct sockaddr* saddr, const struct sockaddr* daddr);
uint16_t
TCPCalcChecksum(uint16_t *buf, uint16_t len, const struct sockaddr* saddr, const struct sockaddr* daddr);
#endif /* __TCP_IN_H_ */
|
#ifndef XSANALOGINDATA_H
#define XSANALOGINDATA_H
#include "pstdint.h"
/*! \brief Data from analog inputs from sensors. */
struct XsAnalogInData {
uint16_t m_data; /*!< \brief The data */
#ifdef __cplusplus
/*! \brief Construct a nulled analog data item */
inline XsAnalogInData() : m_data(0)
{}
/*! \brief Construct analog-data with value \a data */
inline XsAnalogInData(uint16_t data) : m_data(data)
{}
#endif
};
typedef struct XsAnalogInData XsAnalogInData;
#endif // file guard
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_cpuinfo.h
*
* CPU feature detection for SDL.
*/
#ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h
#include "SDL_stdinc.h"
/* Need to do this here because intrin.h has C++ code in it */
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
#include <intrin.h>
#ifndef _WIN64
#define __MMX__
#define __3dNOW__
#endif
#define __SSE__
#define __SSE2__
#elif defined(__MINGW64_VERSION_MAJOR)
#include <intrin.h>
#else
#ifdef __ALTIVEC__
#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
#include <altivec.h>
#undef pixel
#endif
#endif
#ifdef __MMX__
#include <mmintrin.h>
#endif
#ifdef __3dNOW__
#include <mm3dnow.h>
#endif
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE2__
#include <emmintrin.h>
#endif
#endif
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* This is a guess for the cacheline size used for padding.
* Most x86 processors have a 64 byte cache line.
* The 64-bit PowerPC processors have a 128 byte cache line.
* We'll use the larger value to be generally safe.
*/
#define SDL_CACHELINE_SIZE 128
/**
* This function returns the number of CPU cores available.
*/
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
/**
* This function returns the L1 cache line size of the CPU
*
* This is useful for determining multi-threaded structure padding
* or SIMD prefetch sizes.
*/
extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
/**
* This function returns true if the CPU has the RDTSC instruction.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
/**
* This function returns true if the CPU has AltiVec features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
/**
* This function returns true if the CPU has MMX features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
/**
* This function returns true if the CPU has 3DNow! features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
/**
* This function returns true if the CPU has SSE features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
/**
* This function returns true if the CPU has SSE2 features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
/**
* This function returns true if the CPU has SSE3 features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
/**
* This function returns true if the CPU has SSE4.1 features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
/**
* This function returns true if the CPU has SSE4.2 features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
/**
* This function returns true if the CPU has AVX features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
/**
* This function returns the amount of RAM configured in the system, in MB.
*/
extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_cpuinfo_h */
/* vi: set ts=4 sw=4 expandtab: */
|
/*
This file is part of the Princeton FCMA Toolbox
Copyright (c) 2013 the authors (see AUTHORS file)
For license terms, please see the LICENSE file.
*/
#include <cstring>
#include "common.h"
RawMatrix** ReadGzDirectory(const char* filepath, const char* filetype,
int& nSubs);
RawMatrix* ReadGzData(std::string fileStr, int sid);
RawMatrix* ReadNiiGzData(std::string fileStr, int sid);
RawMatrix** GetMaskedMatrices(RawMatrix** r_matrices, int nSubs,
const char* maskFile, bool deleteData);
RawMatrix* GetMaskedMatrix(RawMatrix* r_matrix, const char* maskFile);
void GenerateMaskedMatrices(int nSubs, RawMatrix** r_matrices1, RawMatrix** r_matrices2,
const char* mask_file1, const char* mask_file2,
RawMatrix*** p_masked_matrices1, RawMatrix*** p_masked_matrices2);
VoxelXYZ* GetMaskedPts(VoxelXYZ* pts, int nMaskedVoxels, const char* maskFile);
Trial* GenRegularTrials(int nSubs, int nShift, int& nTrials, const char* file);
Trial* GenBlocksFromDir(int nSubs, int nShift, int& nTrials,
RawMatrix** r_matrices, const char* dir);
VoxelXYZ* ReadLocInfo(const char* file);
VoxelXYZ* ReadLocInfoFromNii(RawMatrix* r_matrix);
double** ReadRTMatrices(const char* file, int& nSubs);
void WriteNiiGzData(const char* outputFile, const char* refFile, void* data,
int dataType);
void Write4DNiiGzData(const char* outputFile, const char* refFile, void* data,
int dataType, int nt);
void* GenerateNiiDataFromMask(const char* maskFile, VoxelScore* scores,
int length, int dataType);
inline int getSizeByDataType(int datatype);
const char* GetFilenameExtension(const char* filename);
int ReadConfigFile(const char* fcma_file, const int& length,
char** keys_and_values);
void WriteCorrMatToHDF5(int row1, int row2, float* corrMat, const char* outputfile);
|
/*
Copyright (c) 2014, OpenEmu Team
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the OpenEmu Team 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 OpenEmu Team ''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 OpenEmu Team 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.
*/
typedef struct OEIntPoint {
int x;
int y;
} OEIntPoint;
typedef struct OEIntSize {
int width;
int height;
} OEIntSize;
typedef struct OEIntRect {
OEIntPoint origin;
OEIntSize size;
} OEIntRect;
static inline OEIntPoint OEIntPointMake(int x, int y)
{
return (OEIntPoint){ x, y };
}
static inline OEIntSize OEIntSizeMake(int width, int height)
{
return (OEIntSize){ width, height };
}
static inline OEIntRect OEIntRectMake(int x, int y, int width, int height)
{
return (OEIntRect){ (OEIntPoint){ x, y }, (OEIntSize){ width, height } };
}
static inline BOOL OEIntPointEqualToPoint(OEIntPoint point1, OEIntPoint point2)
{
return point1.x == point2.x && point1.y == point2.y;
}
static inline BOOL OEIntSizeEqualToSize(OEIntSize size1, OEIntSize size2)
{
return size1.width == size2.width && size1.height == size2.height;
}
static inline BOOL OEIntRectEqualToRect(OEIntRect rect1, OEIntRect rect2)
{
return OEIntPointEqualToPoint(rect1.origin, rect2.origin) && OEIntSizeEqualToSize(rect1.size, rect2.size);
}
static inline BOOL OEIntSizeIsEmpty(OEIntSize size)
{
return size.width == 0 || size.height == 0;
}
static inline BOOL OEIntRectIsEmpty(OEIntRect rect)
{
return OEIntSizeIsEmpty(rect.size);
}
static inline NSSize NSSizeFromOEIntSize(OEIntSize size)
{
return NSMakeSize(size.width, size.height);
}
static inline NSString *NSStringFromOEIntPoint(OEIntPoint p)
{
return [NSString stringWithFormat:@"{ %d, %d }", p.x, p.y];
}
static inline NSString *NSStringFromOEIntSize(OEIntSize s)
{
return [NSString stringWithFormat:@"{ %d, %d }", s.width, s.height];
}
static inline NSString *NSStringFromOEIntRect(OEIntRect r)
{
return [NSString stringWithFormat:@"{ %@, %@ }", NSStringFromOEIntPoint(r.origin), NSStringFromOEIntSize(r.size)];
}
static inline NSSize OEScaleSize(NSSize size, CGFloat factor)
{
return (NSSize){size.width*factor, size.height*factor};
}
static inline NSSize OERoundSize(NSSize size)
{
return (NSSize){roundf(size.width), roundf(size.height)};
}
static inline BOOL NSPointInTriangle(NSPoint p, NSPoint A, NSPoint B, NSPoint C)
{
CGFloat d = (B.y-C.y) * (A.x-C.x) + (C.x - B.x) * (A.y - C.y);
CGFloat a = ((B.y - C.y)*(p.x - C.x) + (C.x - B.x)*(p.y - C.y)) / d;
CGFloat b = ((C.y - A.y)*(p.x - C.x) + (A.x - C.x)*(p.y - C.y)) / d;
CGFloat c = 1 - a - b;
return 0 <= a && a <= 1 && 0 <= b && b <= 1 && 0 <= c && c <= 1;
} |
/*
Copyright (c) 2003 Perry Rapp
"The 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.
*/
/*======================================================================
* object.c -- routines to manipulate objects via vtable
*====================================================================*/
#include "llstdlib.h"
#include "vtable.h"
#include "object.h"
/*=================================================
* delete_obj -- release or delete object as appropriate
* obj may be null
*===============================================*/
void
delete_obj (OBJECT obj)
{
VTABLE vtable;
if (!obj) return; /* Like C++ delete, may be called on NULL */
vtable = (*obj);
ASSERT(vtable->vtable_magic == VTABLE_MAGIC);
if ((*vtable->isref_fnc)(obj)) {
/* refcounted */
(*vtable->release_fnc)(obj);
} else {
/* non-refcounted */
(*vtable->destroy_fnc)(obj);
}
}
/*=================================================
* copy_or_addref_obj -- addref or copy object (if possible)
* obj may be null
* returns null if object neither refcountable nor copyable
*===============================================*/
OBJECT
copy_or_addref_obj (OBJECT obj, int deep)
{
VTABLE vtable;
if (!obj) return NULL;
vtable = (*obj);
ASSERT(vtable->vtable_magic == VTABLE_MAGIC);
if ((*vtable->isref_fnc)(obj)) {
/* refcounted */
(*vtable->addref_fnc)(obj);
return obj;
} else if (vtable->copy_fnc) {
/* not refcounted, but copyable */
return (*vtable->copy_fnc)(obj, deep);
} else {
/* not refcounted or copyable */
return NULL;
}
}
/*=================================================
* addref_object -- addref object
* Must be valid object with addref method
*===============================================*/
int
addref_object (OBJECT obj)
{
VTABLE vtable;
ASSERT(obj);
vtable = (*obj);
ASSERT(vtable->vtable_magic == VTABLE_MAGIC);
ASSERT(vtable->isref_fnc);
ASSERT(vtable->addref_fnc);
return (*vtable->addref_fnc)(obj);
}
/*=================================================
* release_object -- release a reference on an object
* Must be valid object with release method
*===============================================*/
int
release_object (OBJECT obj)
{
VTABLE vtable;
ASSERT(obj);
vtable = (*obj);
ASSERT(vtable->vtable_magic == VTABLE_MAGIC);
ASSERT(vtable->isref_fnc);
ASSERT(vtable->release_fnc);
return (*vtable->release_fnc)(obj);
}
|
/*
* Copyright © 2012 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Alan Griffiths <alan@octopull.co.uk>
* Alexandros Frantzis <alexandros.frantzis@canonical.com>
*/
#ifndef MIR_GEOMETRY_RECTANGLE_H_
#define MIR_GEOMETRY_RECTANGLE_H_
#include "mir/geometry/point.h"
#include "size.h"
#include <iosfwd>
namespace mir
{
namespace geometry
{
struct Rectangle
{
Rectangle() = default;
Rectangle(Point const& top_left, Size const& size)
: top_left{top_left}, size{size}
{
}
Point top_left;
Size size;
/**
* The bottom right boundary point of the rectangle.
*
* Note that the returned point is *not* included in the rectangle
* area, that is, the rectangle is represented as [top_left,bottom_right).
*/
Point bottom_right() const;
Point top_right() const;
Point bottom_left() const;
bool contains(Point const& p) const;
/**
* Test if the rectangle contains another.
*
* Note that an empty rectangle can still contain other empty rectangles,
* which are treated as points or lines of thickness zero.
*/
bool contains(Rectangle const& r) const;
bool overlaps(Rectangle const& r) const;
Rectangle intersection_with(Rectangle const& r) const;
};
inline bool operator == (Rectangle const& lhs, Rectangle const& rhs)
{
return lhs.top_left == rhs.top_left && lhs.size == rhs.size;
}
inline bool operator != (Rectangle const& lhs, Rectangle const& rhs)
{
return lhs.top_left != rhs.top_left || lhs.size != rhs.size;
}
std::ostream& operator<<(std::ostream& out, Rectangle const& value);
}
}
#endif /* MIR_GEOMETRY_RECTANGLE_H_ */
|
//Copyright (c) 2016 Artem A. Mavrin and other contributors
#pragma once
#include "AssetTypeActions_Base.h"
class FQuestBookAssetTypeActions : public FAssetTypeActions_Base
{
public:
FQuestBookAssetTypeActions(EAssetTypeCategories::Type InAssetCategory);
// IAssetTypeActions interface
virtual FText GetName() const override;
virtual FColor GetTypeColor() const override;
virtual UClass* GetSupportedClass() const override;
virtual void OpenAssetEditor(const TArray<UObject*>& InObjects, TSharedPtr<class IToolkitHost> EditWithinLevelEditor = TSharedPtr<IToolkitHost>()) override;
virtual uint32 GetCategories() override;
// End of IAssetTypeActions interface
private:
EAssetTypeCategories::Type MyAssetCategory;
}; |
//
// NSScanner+SPLAdditions.h
// Mudrammer
//
// Created by Jonathan Hersh on 2/8/15.
// Copyright (c) 2015 Jonathan Hersh. All rights reserved.
//
@import Foundation;
@interface NSScanner (SPLAdditions)
/**
* Scan a single character from the provided set.
*
* @param set character set to scan
* @param result the character scanned
*
* @return YES if any characters were scanned
*/
- (BOOL) SPLScanCharacterFromSet:(NSCharacterSet *)set
intoString:(NSString *__autoreleasing *)result;
@end
|
/**
* NNNetworkSystem.h
* ÀÛ¼ºÀÚ: À̼±Çù
* ÀÛ¼ºÀÏ: 2013. 11. 08
* ¸¶Áö¸·À¸·Î ¼öÁ¤ÇÑ »ç¶÷: À̼±Çù
* ¼öÁ¤ÀÏ: 2013. 12. 04
*/
#pragma once
#include "NNConfig.h"
#include "NNPacketHeader.h"
#include "NNCircularBuffer.h"
#include "NNBaseHandler.h"
#include <map>
class NNNetworkSystem
{
public:
friend class NNApplication;
static NNNetworkSystem* GetInstance();
static void ReleaseInstance();
bool Init();
void Destroy();
bool Connect( const char* serverIP, int port );
void SetPacketHandler( short packetType, NNBaseHandler* handler );
void Write( const char* data, size_t size );
void Read();
private:
void ProcessPacket();
private:
SOCKET mSocket;
SOCKADDR_IN mServerAddr;
char* mServerIP;
int mPort;
NNCircularBuffer mRecvBuffer;
NNCircularBuffer mSendBuffer;
std::map<short,NNBaseHandler*> mPacketHandler;
private:
static NNNetworkSystem* mpInstance;
NNNetworkSystem();
~NNNetworkSystem();
}; |
/* OpenCL runtime library: clGetExtensionFunctionAddressForPlatform()
Copyright (c) 2017 Michal Babej / Tampere University of Technology
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 "pocl_cl.h"
#include <string.h>
CL_API_ENTRY void * CL_API_CALL
POname (clGetExtensionFunctionAddressForPlatform) (cl_platform_id platform,
const char *func_name)
CL_EXT_SUFFIX__VERSION_1_2
{
cl_platform_id pocl_platform;
cl_uint actual_num = 0;
POname (clGetPlatformIDs) (1, &pocl_platform, &actual_num);
if (actual_num != 1)
{
POCL_MSG_WARN ("Couldn't get the platform ID of Pocl platform\n");
return NULL;
}
if (platform != pocl_platform)
{
POCL_MSG_PRINT_INFO ("Requested Function Address not "
"for Pocl platform, ignoring\n");
return NULL;
}
#ifdef BUILD_ICD
if (strcmp (func_name, "clIcdGetPlatformIDsKHR") == 0)
return (void *)&POname(clIcdGetPlatformIDsKHR);
#endif
if (strcmp (func_name, "clGetPlatformInfo") == 0)
return (void *)&POname(clGetPlatformInfo);
return NULL;
}
POsymAlways (clGetExtensionFunctionAddressForPlatform)
|
/*
* Copyright (c) 2009, 2010, 2011, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <stdint.h>
#include <omp.h>
#define GANG_SCHEDULING
#define MEASURE_BARRIER
#define PERIOD 2500000000UL
#define ITERATIONS 10
#define STACK_SIZE (64 * 1024)
static inline uint64_t rdtsc(void)
{
uint64_t eax, edx;
__asm volatile ("rdtsc" : "=a" (eax), "=d" (edx));
return (edx << 32) | eax;
}
int main(int argc, char *argv[])
{
int nthreads;
if(argc == 2) {
nthreads = atoi(argv[1]);
backend_span_domain(14, STACK_SIZE);
bomp_custom_init(NULL);
omp_set_num_threads(nthreads);
} else {
assert(!"Specify number of threads");
}
volatile uint64_t workcnt[32] = { 0 };
uint64_t last = rdtsc();
#ifndef CPU_BOUND
volatile uint64_t exittime[ITERATIONS] = { 0 };
#endif
for(int iter = 0;; iter = (iter + 1) % ITERATIONS) {
#ifdef CPU_BOUND
volatile bool exitnow = false;
#else
#ifdef MEASURE_BARRIER
# define MAXTHREADS 16
# define WORKMAX 5000000
static uint64_t starta[MAXTHREADS][WORKMAX];
#endif
#endif
#ifdef GANG_SCHEDULING
#pragma omp parallel
{
bomp_synchronize();
}
#endif
// Do some work
#pragma omp parallel
for(uint64_t i = 0;; i++) {
#ifndef CPU_BOUND
# ifdef MEASURE_BARRIER
uint64_t lasta = rdtsc();
# endif
# pragma omp barrier
# ifdef MEASURE_BARRIER
if(i < WORKMAX) {
starta[omp_get_thread_num()][i] = rdtsc() - lasta;
}
# endif
#endif
workcnt[omp_get_thread_num()]++;
#pragma omp master
if(rdtsc() >= last + PERIOD) {
printf("%lu: threads %d (%s), progress ", rdtsc(), nthreads, "static");
for(int n = 0; n < 32; n++) {
printf("%lu ", workcnt[n]);
}
printf("\n");
last += PERIOD;
#ifndef CPU_BOUND
if(exittime[iter] == 0) {
exittime[iter] = i + 3;
exittime[(iter + ITERATIONS - 2) % ITERATIONS] = 0;
}
}
if(exittime[iter] != 0 && exittime[iter] == i) {
break;
}
#else
exitnow = true;
}
if(exitnow) {
break;
}
#endif
}
#ifndef CPU_BOUND
static uint64_t hgram[15] = { 0 };
printf("exittime = %lu\n", exittime[iter]);
assert(exittime[iter] <= WORKMAX);
uint64_t endtime = exittime[iter] < WORKMAX ? exittime[iter] : WORKMAX;
for(int i = 0; i < endtime; i++) {
for(int n = 0; n < nthreads; n++) {
uint64_t val = starta[n][i];
for(int j = 0; j < 15; j++) {
val /= 10;
if(val == 0) {
hgram[j]++;
break;
}
}
}
}
uint64_t val = 1;
for(int i = 0; i < 15; i++) {
val *= 10;
printf("%lu\t%lu\n", val, hgram[i]);
}
#endif
}
}
|
/*
* Author: Chen Su <ghosind@gmail.com>
* Date: Nov 3, 2015
* File: ftoc.c
*
* Exercise 1-15
* Rewrite the temperature conversion program of Section 1.2 to use a function
* for conversion.
*/
#include <stdio.h>
float ftoc(int fahr);
int main() {
float fahr, celsius;
int lower, upper, step;
lower = 0;
upper = 300;
step = 20;
fahr = lower;
while (fahr <= upper) {
celsius = ftoc(fahr);
printf("%3.0f %6.1f\n", fahr, celsius);
fahr = fahr + step;
}
}
float ftoc(int fahr) {
float celsius;
celsius = (5.0 / 9.0) * (fahr - 32.0);
return celsius;
}
|
#import <Cocoa/Cocoa.h>
@protocol MKDragFileWellProtocol
- (void)droppedInWell:sender;
- (BOOL)acceptsDrop:sender;
@end
@interface MKDragFileWell : NSImageView <NSDraggingSource, NSDraggingDestination>
@property (strong, nonatomic) NSArray *filePaths;
@property (assign, nonatomic) id delegate;
@property (assign, nonatomic) BOOL canDrag;
@property (assign, nonatomic) BOOL canDrop;
@property (assign, nonatomic) NSUInteger resizeImageUntilLessThanKb;
- (void)filePaths:(NSArray *)array;
- (NSArray *)filePaths;
- (void)setImage:(NSImage *)image;
//- (NSImage *)image;
// -- dragging destination
- (NSDragOperation)draggingSession:(NSDraggingSession *)session
sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender;
- (BOOL)draggingUpdated:(id <NSDraggingInfo>)sender;
- (void)draggingExited:(id <NSDraggingInfo>)sender;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
// delegate methods -- dragging source
- (void)copy:sender;
@end
|
//
// TCProgressHUD.h
// timecoco
//
// Created by Xie Hong on 7/11/15.
// Copyright (c) 2015 timecoco. All rights reserved.
//
#import "SVProgressHUD.h"
@interface TCProgressHUD : SVProgressHUD
@end
|
/**
* SIM Header
*
* Processor: PIC32MZ2048ECM064
* Compiler: Microchip XC32
* Author: Andrew Mass
* Created: 2018-2019
*/
#pragma once
#include "../FSAE.X/FSAE_config.h"
#include <sys/types.h>
void main(void);
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3Support module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef Q3FTP_H
#define Q3FTP_H
#include <QtCore/qstring.h> // char*->QString conversion
#include <QtNetwork/qurlinfo.h>
#include <Qt3Support/q3networkprotocol.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Qt3Support)
#ifndef QT_NO_NETWORKPROTOCOL_FTP
class Q3Socket;
class Q3FtpCommand;
class Q_COMPAT_EXPORT Q3Ftp : public Q3NetworkProtocol
{
Q_OBJECT
public:
Q3Ftp(); // ### Qt 4.0: get rid of this overload
Q3Ftp( QObject *parent, const char *name=0 );
virtual ~Q3Ftp();
int supportedOperations() const;
// non-Q3NetworkProtocol functions:
enum State {
Unconnected,
HostLookup,
Connecting,
Connected,
LoggedIn,
Closing
};
enum Error {
NoError,
UnknownError,
HostNotFound,
ConnectionRefused,
NotConnected
};
enum Command {
None,
ConnectToHost,
Login,
Close,
List,
Cd,
Get,
Put,
Remove,
Mkdir,
Rmdir,
Rename,
RawCommand
};
int connectToHost( const QString &host, Q_UINT16 port=21 );
int login( const QString &user=QString(), const QString &password=QString() );
int close();
int list( const QString &dir=QString() );
int cd( const QString &dir );
int get( const QString &file, QIODevice *dev=0 );
int put( const QByteArray &data, const QString &file );
int put( QIODevice *dev, const QString &file );
int remove( const QString &file );
int mkdir( const QString &dir );
int rmdir( const QString &dir );
int rename( const QString &oldname, const QString &newname );
int rawCommand( const QString &command );
Q_ULONG bytesAvailable() const;
Q_LONG readBlock( char *data, Q_ULONG maxlen );
QByteArray readAll();
int currentId() const;
QIODevice* currentDevice() const;
Command currentCommand() const;
bool hasPendingCommands() const;
void clearPendingCommands();
State state() const;
Error error() const;
QString errorString() const;
public Q_SLOTS:
void abort();
Q_SIGNALS:
void stateChanged( int );
void listInfo( const QUrlInfo& );
void readyRead();
void dataTransferProgress( int, int );
void rawCommandReply( int, const QString& );
void commandStarted( int );
void commandFinished( int, bool );
void done( bool );
protected:
void parseDir( const QString &buffer, QUrlInfo &info ); // ### Qt 4.0: delete this? (not public API)
void operationListChildren( Q3NetworkOperation *op );
void operationMkDir( Q3NetworkOperation *op );
void operationRemove( Q3NetworkOperation *op );
void operationRename( Q3NetworkOperation *op );
void operationGet( Q3NetworkOperation *op );
void operationPut( Q3NetworkOperation *op );
// ### Qt 4.0: delete these
// unused variables:
Q3Socket *commandSocket, *dataSocket;
bool connectionReady, passiveMode;
int getTotalSize, getDoneSize;
bool startGetOnFail;
int putToWrite, putWritten;
bool errorInListChildren;
private:
void init();
int addCommand( Q3FtpCommand * );
bool checkConnection( Q3NetworkOperation *op );
private Q_SLOTS:
void startNextCommand();
void piFinished( const QString& );
void piError( int, const QString& );
void piConnectState( int );
void piFtpReply( int, const QString& );
private Q_SLOTS:
void npListInfo( const QUrlInfo & );
void npDone( bool );
void npStateChanged( int );
void npDataTransferProgress( int, int );
void npReadyRead();
protected Q_SLOTS:
// ### Qt 4.0: delete these
void hostFound();
void connected();
void closed();
void dataHostFound();
void dataConnected();
void dataClosed();
void dataReadyRead();
void dataBytesWritten( int nbytes );
void error( int );
};
#endif // QT_NO_NETWORKPROTOCOL_FTP
QT_END_NAMESPACE
QT_END_HEADER
#endif // Q3FTP_H
|
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2008 Renato Araujo Oliveira Filho <renatox@gmail.com>
Copyright (c) 2000-2012 Torus Knot Software Ltd
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 __EGLWindow_H__
#define __EGLWindow_H__
#include "OgreRenderWindow.h"
#include "OgreEGLSupport.h"
#include "OgreEGLContext.h"
namespace Ogre {
class _OgrePrivate EGLWindow : public RenderWindow
{
private:
protected:
bool mClosed;
bool mVisible;
bool mIsTopLevel;
bool mIsExternal;
bool mIsExternalGLControl;
EGLSupport* mGLSupport;
EGLContext* mContext;
//NativeWindowType mWindow;
//NativeDisplayType mNativeDisplay;
//::EGLDisplay mEglDisplay;
//::EGLConfig mEglConfig;
//::EGLSurface mEglSurface;
//::EGLSurface createSurfaceFromWindow(::EGLDisplay display, NativeWindowType win);
virtual void switchFullScreen(bool fullscreen) {} // = 0;
virtual EGLContext * createEGLContext() const { return 0; } //= 0;
virtual void getLeftAndTopFromNativeWindow(int & left, int & top, uint width, uint height) {} //= 0;
virtual void initNativeCreatedWindow(const NameValuePairList *miscParams) {} //= 0;
virtual void createNativeWindow( int &left, int &top, uint &width, uint &height, String &title ) {} //= 0;
virtual void reposition(int left, int top) {} //= 0;
virtual void resize(unsigned int width, unsigned int height) {} //= 0;
virtual void windowMovedOrResized() {} //= 0;
public:
EGLWindow(EGLSupport* glsupport);
virtual ~EGLWindow();
// Moved create to native source because it has native calls in it.
void create(const String& name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams);
virtual void setFullscreen (bool fullscreen, uint width, uint height);
void destroy(void);
bool isClosed(void) const;
bool isVisible(void) const;
void setVisible(bool visible);
void swapBuffers(bool waitForVSync);
void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer);
/**
@remarks
* Get custom attribute; the following attributes are valid:
* WINDOW The X NativeWindowType target for rendering.
* GLCONTEXT The Ogre GLContext used for rendering.
* DISPLAY EGLDisplay connection behind that context.
* DISPLAYNAME The name for the connected display.
*/
virtual void getCustomAttribute(const String& name, void* pData);
bool requiresTextureFlipping() const;
};
}
#endif
|
/*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADASaxFrameworkLoader.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADASAXFWL_SAXFWLERROR_H__
#define __COLLADASAXFWL_SAXFWLERROR_H__
#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADASaxFWLIError.h"
namespace COLLADASaxFWL
{
/** Describes errors that can occur */
class SaxFWLError : public IError
{
public:
enum ErrorType
{
ERROR_UNRESOLVED_REFERENCE, // An element that is referenced, could not be resolved.
ERROR_UNRESOLVED_FORMULA, // A formula referenced in a formula, could not be resolved.
ERROR_UNRESOLVED_PARAMETER, // A parameter referenced in a formula, could not be resolved.
ERROR_UNEXPECTED_ELEMENT, // An element could be resolved but does not have the expected type
ERROR_PARAMETER_COUNT_DOESNOT_MATCH, // A parameter referenced in a formula, could not be resolved.
ERROR_SOURCE_NOT_FOUND, // A source referenced an an input element could not be resolved
ERROR_DATA_NOT_VALID, // Data not valid.
ERROR_DATA_NOT_SUPPORTED // Data not supported.
};
private:
/** The type of the error.*/
ErrorType mErrorType;
/** The severity of th error. */
IError::Severity mSeverity;
/** The error message describing the error.*/
String mErrorMessage;
/** The line number the error occurred in. Might be zero if the location could not be
determined.*/
size_t mLineNumber;
/** The column number the error occurred in. Might be zero if the location could not be
determined.*/
size_t mColumnNumber;
public:
/** Constructor. */
SaxFWLError(ErrorType errorType, String errorMessage, IError::Severity severity = IError::SEVERITY_ERROR_NONCRITICAL);
/** Destructor. */
virtual ~SaxFWLError();
/** Returns the type of the error.*/
IError::ErrorClass getErrorClass() const { return IError::ERROR_SAXFWL; }
/** Returns the severity of the error.*/
IError::Severity getSeverity() const { return mSeverity; }
/** Returns the type of the error.*/
ErrorType getErrorType() const { return mErrorType; }
/** The error message describing the error.*/
const String& getErrorMessage() const { return mErrorMessage; }
/** The full error message describing the error, including all information.*/
String getFullErrorMessage() const;
/** The line number the error occurred in. Might be zero if the location could not be
determined.*/
size_t getLineNumber() const { return mLineNumber; }
/** The line number the error occurred in. Might be zero if the location could not be
determined.*/
void setLineNumber(size_t lineNumber) { mLineNumber = lineNumber; }
/** The column number the error occurred in. Might be zero if the location could not be
determined.*/
size_t getColumnNumber() const { return mColumnNumber; }
/** The column number the error occurred in. Might be zero if the location could not be
determined.*/
void setColumnNumber(size_t columnNumber) { mColumnNumber = columnNumber; }
private:
/** Disable default copy ctor. */
SaxFWLError( const SaxFWLError& pre );
/** Disable default assignment operator. */
const SaxFWLError& operator= ( const SaxFWLError& pre );
};
} // namespace COLLADASAXFWL
#endif // __COLLADASAXFWL_SAXFWLERROR_H__
|
#include<stdio.h>
int main()
{
int avg = 0;
int sum =0;
int x=0;
/* Array- declaration – length 20*/
int num[20];
/* for loop for receiving inputs from user and storing it in array*/
for (x=0; x<=19;x++)
{
printf("enter the integer number %d\n", x);
scanf("%d", &num[x]);
}
for (x=0; x<=19;x++)
{
sum = sum+num[x];
}
avg = sum/20;
printf("%d", avg);
return 0;
}
struct StudentData{
char *stu_name;
int stu_id;
int stu_age;
}
const PI = true
|
// Created by Samvel Khalatyan on Dec 6, 2013
// Copyright (c) 2013 Samvel Khalatyan. All rights reserved
//
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
#ifndef CREDIT_DATE
#define CREDIT_DATE
#include <iosfwd>
namespace credit
{
namespace chrono
{
// type for year, day, delta ... it should be unsigned
using value_type = unsigned short;
using Day = value_type;
using Year = value_type;
enum class Month : char
{
jan=1, feb,
mar, apr, may,
jun, jul, aug,
sep, oct, nov,
dec
};
class Date
// represent YYYY/MM/DD
{
public:
Date() = default;
Date(const Year &, const Month &, const Day &);
// Allow default copy
Date(const Date &) = default;
Date &operator =(const Date &) = default;
// Allow default move
Date(Date &&) = default;
Date &operator =(Date &&) = default;
inline Year year() const noexcept { return _year; }
inline Month month() const noexcept { return _month; }
inline Day day() const noexcept { return _day; }
private:
Year _year {1970};
Month _month {Month::jan};
Day _day {1};
};
// helpers
class Range
// generate months in range
{
public:
class Iterator
{
public:
inline Month operator *() const noexcept
{
return _month;
}
// advance iterator by some shift
inline Iterator operator ++();
private:
friend class Range;
Iterator(const Month &m):
_month{m}
{}
Month _month;
};
Range(const Month & /* from */,
const Month & /* last */,
const bool & /* include last month */ =false);
inline Iterator begin() const noexcept { return _from; }
inline Iterator end() const noexcept { return _last; }
private:
Iterator _from;
Iterator _last;
};
// Iteartor comparison
bool operator ==(const Range::Iterator &, const Range::Iterator &);
bool operator !=(const Range::Iterator &, const Range::Iterator &);
// Date comparison
bool operator ==(const Date &, const Date &);
bool operator !=(const Date &, const Date &);
bool operator <(const Date &, const Date &);
bool operator >(const Date &, const Date &);
bool operator <=(const Date &, const Date &);
bool operator >=(const Date &, const Date &);
// helpers
bool is_leap(const Year &);
Day days(const Year &); // days in year
Day days(const Year &, const Month &); // days in month
Day days(const Date &); // number of days passed since Jan 1
// basic math
Date operator +(const Date &, const Day &); // advance date
Day operator -(const Date &, const Date &); // days b/w dates
// output
std::ostream &operator <<(std::ostream &, const Month &);
std::ostream &operator <<(std::ostream &, const Date &);
// input
std::istream &operator >>(std::istream &, Month &);
std::istream &operator >>(std::istream &, Date &);
}
using chrono::Month;
using chrono::Date;
using chrono::days;
}
#endif
|
#include "i2cmaster.h"
#include "board.h"
#include "display.h"
#include "ds1339.h"
#include <avr/interrupt.h>
#include <avr/io.h>
unsigned char rtc_read(unsigned char addr);
void rtc_write(unsigned char addr, unsigned char data);
unsigned char
rtc_read(unsigned char addr)
{
unsigned char ret;
i2c_start_wait(RTC_ADDR); // set device address and write mode
i2c_write(addr); // write address = 0
i2c_rep_start(RTC_ADDR+1);// set device address and read mode
ret = i2c_readNak(); // read one byte form address 0
i2c_stop(); // set stop condition = release bus
return ret;
}
void
rtc_write(unsigned char addr, unsigned char data)
{
i2c_start_wait(RTC_ADDR); // set device address and write mode
i2c_write(addr); // write address
i2c_write(data); // ret=0 -> Ok, ret=1 -> no ACK
i2c_stop(); // set stop conditon = release bus
}
void
rtc_init(void)
{
i2c_init(); // init I2C interface
rtc_write( 0x10, 0xa5 ); // TCS3,TCS1,DS0,ROUT0 (No diode, 250Ohm)
rtc_write( 0x0e, 0x18 );
#if 0
uint8_t hb[6];
rtc_dotime(1, hb);
rtc_write(0x7, (hb[5]+1)|0x80);
rtc_write(0x8, hb[4]|0x80);
rtc_write(0x9, hb[3]|0x80);
rtc_write(0xa, hb[2]|0x80);
rtc_write(0xb, (hb[4]+1)|0x80); // Alarm2 set to once every minute
rtc_write(0xc, hb[3]|0x80);
rtc_write(0xd, hb[2]|0x80);
rtc_write( 0x0e, 0x07 ); // INTCN & A2IE : Interrupt & Alarm2 Enable
RTC_DDR &= ~_BV(RTC_PIN);
RTC_OUT_PORT |= _BV(RTC_PIN);
RTC_INTREG &= ~ISC41;
RTC_INTREG |= ISC40;
EIMSK |= _BV(RTC_INT);
EIFR |= _BV(RTC_INT);
#endif
}
void
rtc_get(uint8_t data[6])
{
data[0] = rtc_read(6); // year
data[1] = rtc_read(5); // month
data[2] = rtc_read(4); // mday
data[3] = rtc_read(2); // hour
data[4] = rtc_read(1); // min
data[5] = rtc_read(0); // sec
}
void
rtc_set(uint8_t len, uint8_t data[6])
{
uint8_t p = 0;
if(len == 6) {
rtc_write(6, data[p++]);
rtc_write(5, data[p++]);
rtc_write(4, data[p++]);
}
rtc_write(2, data[p++]);
rtc_write(1, data[p++]);
rtc_write(0, data[p++]);
}
void
rtc_func(char *in)
{
uint8_t hb[6], t;
t = fromhex(in+1, hb, 6);
if(t < 3) {
t = hb[0];
rtc_get(hb);
if(t&1) {
DH2(hb[0]); DC('-');
DH2(hb[1]); DC('-');
DH2(hb[2]);
}
if((t&3) == 3)
DC(' ');
if(t&2) {
DH2(hb[3]); DC(':');
DH2(hb[4]); DC(':');
DH2(hb[5]);
}
DNL();
}
else { // 3: time only, 6: date & time
rtc_set(t, hb);
}
}
#if 0
ISR(RTC_INTVECT)
{
DC('X');
DNL();
}
#endif
|
// member functions for priority queue class
// headers
#include <stdlib.h>
#include <iostream.h>
#include <assert.h>
// local headers
#include "pqueue.h"
// constructors and destructor
PriorityQueue::PriorityQueue(int hsz):
heapSize(hsz), last(0), heap((DataItem **)0)
{
// check heap size
assert(0 < heapSize && 0 <= last && last <= heapSize);
// allocate heap, skip entry 0
heap = new DataItem *[heapSize+1];
assert(heap != (DataItem **)0);
// initialize array to null
for (int ih = 1; ih <= heapSize; ih++)
{
heap[ih] = (DataItem *)0;
}
}
PriorityQueue::PriorityQueue(const PriorityQueue &pq):
heapSize(pq.heapSize), last(pq.last), heap((DataItem **)0)
{
// check heap size and number of items
assert(0 < heapSize && 0 <= last && last <= heapSize);
// allocate heap
heap = new DataItem *[heapSize+1];
assert(heap != (DataItem **)0);
// initialize array
for (int ih = 1; ih <= last; ih++)
{
heap[ih] = pq.heap[ih];
}
for ( ; ih <= heapSize; ih++)
{
heap[ih] = (DataItem *)0;
}
}
PriorityQueue::~PriorityQueue()
{
if (heap != (DataItem **)0) delete [] heap;
heap = (DataItem **)0;
heapSize = 0;
last = 0;
}
// assignment
PriorityQueue &
PriorityQueue::operator=(const PriorityQueue &pq)
{
// check for self-assignment
if (this == &pq) return(*this);
// delete old array
if (heap != (DataItem **)0) delete [] heap;
heap = (DataItem **)0;
// store data
heapSize = pq.heapSize;
last = pq.last;
assert(0 < heapSize && 0 <= last && last <= heapSize);
// allocate a new heap
heap = new DataItem *[heapSize+1];
assert(heap != (DataItem **)0);
// initialize array
for (int ih = 1; ih <= last; ih++)
{
heap[ih] = pq.heap[ih];
}
for ( ; ih <= heapSize; ih++)
{
heap[ih] = (DataItem *)0;
}
// all done
return(*this);
}
// heap operations
int
makeNull(PriorityQueue &pq)
{
// no items in heap
pq.last = 0;
return(OK);
}
int
insert(PriorityQueue &pq, DataItem *d)
{
// check if heap is full
if (pq.last >= pq.heapSize)
{
ERRORI("heap is full.", pq.heapSize);
return(NOTOK);
}
// insert new data item into heap, and percolate.
pq.heap[++pq.last] = d;
int id = pq.last;
while ((id > 1) && (*pq.heap[id] < *pq.heap[id/2]))
{
DataItem *temp = pq.heap[id];
pq.heap[id] = pq.heap[id/2];
pq.heap[id/2] = temp;
id = id/2;
}
// all done
return(OK);
}
int
remove(PriorityQueue &pq, DataItem *&d)
{
// check if queue is empty
if (pq.last == 0)
{
ERRORI("heap is empty.", pq.last);
return(NOTOK);
}
// return data item at top of heap
d = pq.heap[1];
// restore heap structure
pq.heap[1] = pq.heap[pq.last--];
int jh;
int ih = 1;
while (ih <= pq.last/2)
{
if ((*pq.heap[2*ih] < *pq.heap[2*ih+1]) ||
(2*ih == pq.last))
jh = 2*ih;
else
jh = 2*ih + 1;
if (*pq.heap[ih] > *pq.heap[jh])
{
DataItem *temp = pq.heap[ih];
pq.heap[ih] = pq.heap[jh];
pq.heap[jh] = temp;
ih = jh;
}
else
{
// done percolating
break;
}
}
// all done
return(OK);
}
int
isEmpty(const PriorityQueue &pq)
{
return(pq.last == 0);
}
// print data
void
PriorityQueue::dump(ostream &os) const
{
os << "{ ";
for (int ih = 1; ih <= last; ih++)
{
os << *heap[ih] << ",";
}
os << " }" << endl;
return;
}
ostream &
operator<<(ostream &os, const PriorityQueue &pq)
{
pq.dump(os);
return(os);
}
|
/****************************************************************************
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, 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 ABOVE 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. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
#include "form.priv.h"
MODULE_ID("$Id: fld_newftyp.c,v 1.13 2004/12/25 22:24:10 tom Exp $")
static FIELDTYPE const default_fieldtype =
{
0, /* status */
0L, /* reference count */
(FIELDTYPE *)0, /* pointer to left operand */
(FIELDTYPE *)0, /* pointer to right operand */
NULL, /* makearg function */
NULL, /* copyarg function */
NULL, /* freearg function */
NULL, /* field validation function */
NULL, /* Character check function */
NULL, /* enumerate next function */
NULL /* enumerate previous function */
};
NCURSES_EXPORT_VAR(const FIELDTYPE *)
_nc_Default_FieldType = &default_fieldtype;
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : FIELDTYPE *new_fieldtype(
| bool (* const field_check)(FIELD *,const void *),
| bool (* const char_check) (int, const void *) )
|
| Description : Create a new fieldtype. The application programmer must
| write a field_check and a char_check function and give
| them as input to this call.
| If an error occurs, errno is set to
| E_BAD_ARGUMENT - invalid arguments
| E_SYSTEM_ERROR - system error (no memory)
|
| Return Values : Fieldtype pointer or NULL if error occurred
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(FIELDTYPE *)
new_fieldtype(bool (*const field_check) (FIELD *, const void *),
bool (*const char_check) (int, const void *))
{
FIELDTYPE *nftyp = (FIELDTYPE *)0;
T((T_CALLED("new_fieldtype(%p,%p)"), field_check, char_check));
if ((field_check) || (char_check))
{
nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE));
if (nftyp)
{
*nftyp = default_fieldtype;
nftyp->fcheck = field_check;
nftyp->ccheck = char_check;
}
else
{
SET_ERROR(E_SYSTEM_ERROR);
}
}
else
{
SET_ERROR(E_BAD_ARGUMENT);
}
returnFieldType(nftyp);
}
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int free_fieldtype(FIELDTYPE *typ)
|
| Description : Release the memory associated with this fieldtype.
|
| Return Values : E_OK - success
| E_CONNECTED - there are fields referencing the type
| E_BAD_ARGUMENT - invalid fieldtype pointer
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(int)
free_fieldtype(FIELDTYPE *typ)
{
T((T_CALLED("free_fieldtype(%p)"), typ));
if (!typ)
RETURN(E_BAD_ARGUMENT);
if (typ->ref != 0)
RETURN(E_CONNECTED);
if (typ->status & _RESIDENT)
RETURN(E_CONNECTED);
if (typ->status & _LINKED_TYPE)
{
if (typ->left)
typ->left->ref--;
if (typ->right)
typ->right->ref--;
}
free(typ);
RETURN(E_OK);
}
/* fld_newftyp.c ends here */
|
#pragma once
#include "UmWaitObject.h"
#include "UmThreadStack.h"
#pragma managed
namespace UnmanagedInspector
{
using namespace System;
using namespace System::Collections::Generic;
public ref class WaitDeadLockItem
{
internal:
initonly ThreadStack^ r_waitingThread;
initonly WaitObject^ r_object;
initonly ThreadStack^ r_owningThread;
initonly WaitBlock^ r_waitBlock;
internal:
WaitDeadLockItem(ThreadStack^ threadStackA, WaitObject^ waitingForX, ThreadStack^ ownedByB, WaitBlock^ waitBlock);
public:
property ThreadStack^ WaitingThread
{public: ThreadStack^ get(){return r_waitingThread;}}
property ThreadStack^ OwningThread
{public: ThreadStack^ get(){return r_owningThread;}}
property WaitObject^ CurrentObject
{public: WaitObject^ get(){return r_object;}}
property WaitBlock^ CurrentWaitBlock
{public: WaitBlock^ get(){return r_waitBlock;}}
};
}
#pragma unmanaged
|
// 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 <Nimbus/NimbusModels.h>
@class SpeakerPlainObject;
@interface SpeakerInfoTableViewCellObject : NSObject <NICellObject>
@property (nonatomic, strong, readonly) NSString *speakerDescription;
+ (instancetype)objectWithSpeaker:(SpeakerPlainObject *)speaker;
@end
|
/*******************************************************************************
* File Name: PWM2.c
* Version 2.5
*
* Description:
* This file contains API to enable firmware control of a Pins component.
*
* Note:
*
********************************************************************************
* Copyright 2008-2014, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cytypes.h"
#include "PWM2.h"
#define SetP4PinDriveMode(shift, mode) \
do { \
PWM2_PC = (PWM2_PC & \
(uint32)(~(uint32)(PWM2_DRIVE_MODE_IND_MASK << (PWM2_DRIVE_MODE_BITS * (shift))))) | \
(uint32)((uint32)(mode) << (PWM2_DRIVE_MODE_BITS * (shift))); \
} while (0)
/*******************************************************************************
* Function Name: PWM2_Write
********************************************************************************
*
* Summary:
* Assign a new value to the digital port's data output register.
*
* Parameters:
* prtValue: The value to be assigned to the Digital Port.
*
* Return:
* None
*
*******************************************************************************/
void PWM2_Write(uint8 value)
{
uint8 drVal = (uint8)(PWM2_DR & (uint8)(~PWM2_MASK));
drVal = (drVal | ((uint8)(value << PWM2_SHIFT) & PWM2_MASK));
PWM2_DR = (uint32)drVal;
}
/*******************************************************************************
* Function Name: PWM2_SetDriveMode
********************************************************************************
*
* Summary:
* Change the drive mode on the pins of the port.
*
* Parameters:
* mode: Change the pins to one of the following drive modes.
*
* PWM2_DM_STRONG Strong Drive
* PWM2_DM_OD_HI Open Drain, Drives High
* PWM2_DM_OD_LO Open Drain, Drives Low
* PWM2_DM_RES_UP Resistive Pull Up
* PWM2_DM_RES_DWN Resistive Pull Down
* PWM2_DM_RES_UPDWN Resistive Pull Up/Down
* PWM2_DM_DIG_HIZ High Impedance Digital
* PWM2_DM_ALG_HIZ High Impedance Analog
*
* Return:
* None
*
*******************************************************************************/
void PWM2_SetDriveMode(uint8 mode)
{
SetP4PinDriveMode(PWM2__0__SHIFT, mode);
}
/*******************************************************************************
* Function Name: PWM2_Read
********************************************************************************
*
* Summary:
* Read the current value on the pins of the Digital Port in right justified
* form.
*
* Parameters:
* None
*
* Return:
* Returns the current value of the Digital Port as a right justified number
*
* Note:
* Macro PWM2_ReadPS calls this function.
*
*******************************************************************************/
uint8 PWM2_Read(void)
{
return (uint8)((PWM2_PS & PWM2_MASK) >> PWM2_SHIFT);
}
/*******************************************************************************
* Function Name: PWM2_ReadDataReg
********************************************************************************
*
* Summary:
* Read the current value assigned to a Digital Port's data output register
*
* Parameters:
* None
*
* Return:
* Returns the current value assigned to the Digital Port's data output register
*
*******************************************************************************/
uint8 PWM2_ReadDataReg(void)
{
return (uint8)((PWM2_DR & PWM2_MASK) >> PWM2_SHIFT);
}
/* If Interrupts Are Enabled for this Pins component */
#if defined(PWM2_INTSTAT)
/*******************************************************************************
* Function Name: PWM2_ClearInterrupt
********************************************************************************
*
* Summary:
* Clears any active interrupts attached to port and returns the value of the
* interrupt status register.
*
* Parameters:
* None
*
* Return:
* Returns the value of the interrupt status register
*
*******************************************************************************/
uint8 PWM2_ClearInterrupt(void)
{
uint8 maskedStatus = (uint8)(PWM2_INTSTAT & PWM2_MASK);
PWM2_INTSTAT = maskedStatus;
return maskedStatus >> PWM2_SHIFT;
}
#endif /* If Interrupts Are Enabled for this Pins component */
/* [] END OF FILE */
|
//
// ZDModel.h
// ZDToolKitDemo
//
// Created by Zero.D.Saber on 2018/9/30.
// Copyright © 2018 Zero.D.Saber. All rights reserved.
//
#import "ZDBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZDModel : ZDBaseModel
@property (nonatomic, strong) id myValue;
@property (nonatomic, copy) NSString *myName;
@property (nonatomic, copy) NSString *mySex;
@property (nonatomic, assign) NSUInteger myAge;
@end
NS_ASSUME_NONNULL_END
|
// EnemyWaterMine.h: interface for the EnemyWaterMine class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ENEMYWATERMINE_H__3777AE18_4F24_484F_8AC0_FFD7BDDE213B__INCLUDED_)
#define AFX_ENEMYWATERMINE_H__3777AE18_4F24_484F_8AC0_FFD7BDDE213B__INCLUDED_
#include "Enemy.h"
class EnemyWaterMine : public Enemy
{
public:
EnemyWaterMine(Level *curLevel);
virtual ~EnemyWaterMine();
virtual void processAttack();
virtual void processDeath();
virtual void processDamage();
HPTRect &GetWeaponWorldLoc();
// virtual HPTRect &GetWorldLoc();
void processUpdate();
bool IsEnemy() const { return false; }
void StartMine();
private:
float bobtimer;
};
#endif // !defined(AFX_ENEMYWATERMINE_H__3777AE18_4F24_484F_8AC0_FFD7BDDE213B__INCLUDED_)
|
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// 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.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////
#ifndef __UNIX_METRICFORME_H
#define __UNIX_METRICFORME_H
#include "CIM_Dependency.h"
#include "UNIX_MetricForMEDeps.h"
class UNIX_MetricForME :
public CIM_Dependency
{
public:
UNIX_MetricForME();
~UNIX_MetricForME();
virtual Boolean initialize();
virtual Boolean load(int&);
virtual Boolean finalize();
virtual Boolean find(Array<CIMKeyBinding>&);
virtual Boolean validateKey(CIMKeyBinding&) const;
virtual void setScope(CIMName);
virtual Boolean getAntecedent(CIMProperty&) const;
virtual CIMInstance getAntecedent() const;
virtual Boolean getDependent(CIMProperty&) const;
virtual CIMInstance getDependent() const;
private:
CIMName currentScope;
# include "UNIX_MetricForMEPrivate.h"
};
#endif /* UNIX_METRICFORME */
|
#ifndef VIGENERE_H
#define VIGENERE_H
class Vigenere : public Module {
public:
Vigenere();
static void encrypt(string&, string&, vector<int>&, unsigned int&, bool);
void disp_desc();
int run();
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.