text stringlengths 4 6.14k |
|---|
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platfroms allow them to do with
// text.
//
// Copyright (C) 2006-2019 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
// @package Kaltura
// @subpackage Client
#import "../KalturaClient.h"
#import "KalturaContentDistributionClientPlugin.h"
///////////////////////// enums /////////////////////////
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProfileOrderBy : NSObject
+ (NSString*)CREATED_AT_ASC;
+ (NSString*)UPDATED_AT_ASC;
+ (NSString*)CREATED_AT_DESC;
+ (NSString*)UPDATED_AT_DESC;
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProviderOrderBy : NSObject
@end
///////////////////////// classes /////////////////////////
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProvider : KalturaDistributionProvider
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionJobProviderData : KalturaConfigurableDistributionJobProviderData
@property (nonatomic,copy) NSString* xml;
@property (nonatomic,retain) NSMutableArray* videoFilePaths; // of KalturaString elements
@property (nonatomic,retain) NSMutableArray* thumbnailFilePaths; // of KalturaString elements
- (KalturaFieldType)getTypeOfXml;
- (KalturaFieldType)getTypeOfVideoFilePaths;
- (NSString*)getObjectTypeOfVideoFilePaths;
- (KalturaFieldType)getTypeOfThumbnailFilePaths;
- (NSString*)getObjectTypeOfThumbnailFilePaths;
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProfile : KalturaConfigurableDistributionProfile
@property (nonatomic,copy) NSString* sftpHost;
@property (nonatomic,copy) NSString* sftpLogin;
@property (nonatomic,copy) NSString* sftpPass;
@property (nonatomic,copy) NSString* sftpBasePath;
@property (nonatomic,copy) NSString* channelTitle;
@property (nonatomic,copy) NSString* channelLink;
@property (nonatomic,copy) NSString* channelDescription;
@property (nonatomic,copy) NSString* channelManagingEditor;
@property (nonatomic,copy) NSString* channelLanguage;
@property (nonatomic,copy) NSString* channelImageTitle;
@property (nonatomic,copy) NSString* channelImageWidth;
@property (nonatomic,copy) NSString* channelImageHeight;
@property (nonatomic,copy) NSString* channelImageLink;
@property (nonatomic,copy) NSString* channelImageUrl;
@property (nonatomic,copy) NSString* channelCopyright;
@property (nonatomic,copy) NSString* channelGenerator;
@property (nonatomic,copy) NSString* channelRating;
- (KalturaFieldType)getTypeOfSftpHost;
- (KalturaFieldType)getTypeOfSftpLogin;
- (KalturaFieldType)getTypeOfSftpPass;
- (KalturaFieldType)getTypeOfSftpBasePath;
- (KalturaFieldType)getTypeOfChannelTitle;
- (KalturaFieldType)getTypeOfChannelLink;
- (KalturaFieldType)getTypeOfChannelDescription;
- (KalturaFieldType)getTypeOfChannelManagingEditor;
- (KalturaFieldType)getTypeOfChannelLanguage;
- (KalturaFieldType)getTypeOfChannelImageTitle;
- (KalturaFieldType)getTypeOfChannelImageWidth;
- (KalturaFieldType)getTypeOfChannelImageHeight;
- (KalturaFieldType)getTypeOfChannelImageLink;
- (KalturaFieldType)getTypeOfChannelImageUrl;
- (KalturaFieldType)getTypeOfChannelCopyright;
- (KalturaFieldType)getTypeOfChannelGenerator;
- (KalturaFieldType)getTypeOfChannelRating;
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProviderBaseFilter : KalturaDistributionProviderFilter
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProviderFilter : KalturaQuickPlayDistributionProviderBaseFilter
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProfileBaseFilter : KalturaConfigurableDistributionProfileFilter
@end
// @package Kaltura
// @subpackage Client
@interface KalturaQuickPlayDistributionProfileFilter : KalturaQuickPlayDistributionProfileBaseFilter
@end
///////////////////////// services /////////////////////////
|
#ifndef _MCU_ROM_
#define _MCU_ROM_
#include <cstdint>
#include "system_bus.h"
class ROM: public SystemBusPeripheral {
public:
ROM(uint32_t nPages);
virtual ~ROM();
uint32_t get_number_of_pages() const { return nPages; }
void set_contents(uint8_t *contents);
uint8_t read_byte(uint32_t pAddr);
uint16_t read_halfword(uint32_t pAddr);
uint32_t read_word(uint32_t pAddr);
void write_byte(uint32_t pAddr, uint8_t value) {}
void write_halfword(uint32_t pAddr, uint16_t value) {}
void write_word(uint32_t pAddr, uint32_t value) {}
void cycle() {}
void timestep() {}
protected:
uint32_t nPages;
uint8_t * memory;
};
#endif /* MCU_ROM_H_ */
|
#ifndef SETTINGS_H
#define SETTINGS_H
#include <vector>
#include "utils/floatpoint.h"
#ifndef VERSION
#define VERSION "DEV"
#endif
#define FIX_HORRIBLE_UNION_ALL_TYPE_A 0x01
#define FIX_HORRIBLE_UNION_ALL_TYPE_B 0x02
#define FIX_HORRIBLE_EXTENSIVE_STITCHING 0x04
#define FIX_HORRIBLE_UNION_ALL_TYPE_C 0x08
#define FIX_HORRIBLE_KEEP_NONE_CLOSED 0x10
/**
* Type of support material.
* Grid is a X/Y grid with an outline, which is very strong, provides good support. But in some cases is hard to remove.
* Lines give a row of lines which break off one at a time, making them easier to remove, but they do not support as good as the grid support.
*/
enum Support_Pattern
{
SUPPORT_TYPE_GRID = 0,
SUPPORT_TYPE_LINES = 1
};
#ifndef DEFAULT_CONFIG_PATH
#define DEFAULT_CONFIG_PATH "default.cfg"
#endif
#define CONFIG_MULTILINE_SEPARATOR "\"\"\""
enum GCode_Flavor
{
/**
* RepRap flavored GCode is Marlin/Sprinter/Repetier based GCode.
* This is the most commonly used GCode set.
* G0 for moves, G1 for extrusion.
* E values give mm of filament extrusion.
* Retraction is done on E values with G1. Start/end code is added.
* M106 Sxxx and M107 are used to turn the fan on/off.
**/
GCODE_FLAVOR_REPRAP = 0,
/**
* UltiGCode flavored is Marlin based GCode.
* UltiGCode uses less settings on the slicer and puts more settings in the firmware. This makes for more hardware/material independed GCode.
* G0 for moves, G1 for extrusion.
* E values give mm^3 of filament extrusion. Ignores the filament diameter setting.
* Retraction is done with G10 and G11. Retraction settings are ignored. G10 S1 is used for multi-extruder switch retraction.
* Start/end code is not added.
* M106 Sxxx and M107 are used to turn the fan on/off.
**/
GCODE_FLAVOR_ULTIGCODE = 1,
/**
* Makerbot flavored GCode.
* Looks a lot like RepRap GCode with a few changes. Requires MakerWare to convert to X3G files.
* Heating needs to be done with M104 Sxxx T0
* No G21 or G90
* Fan ON is M126 T0 (No fan strength control?)
* Fan OFF is M127 T0
* Homing is done with G162 X Y F2000
**/
GCODE_FLAVOR_MAKERBOT = 2,
/**
* Bits From Bytes GCode.
* BFB machines use RPM instead of E. Which is coupled to the F instead of independed. (M108 S[deciRPM])
* Need X,Y,Z,F on every line.
* Needs extruder ON/OFF (M101, M103), has auto-retrection (M227 S[2560*mm] P[2560*mm])
**/
GCODE_FLAVOR_BFB = 3,
/**
* MACH3 GCode
* MACH3 is CNC control software, which expects A/B/C/D for extruders, instead of E.
**/
GCODE_FLAVOR_MACH3 = 4,
/**
* RepRap volumatric flavored GCode is Marlin based GCode.
* Volumatric uses less settings on the slicer and puts more settings in the firmware. This makes for more hardware/material independed GCode.
* G0 for moves, G1 for extrusion.
* E values give mm^3 of filament extrusion. Ignores the filament diameter setting.
* Retraction is done with G10 and G11. Retraction settings are ignored. G10 S1 is used for multi-extruder switch retraction.
* M106 Sxxx and M107 are used to turn the fan on/off.
**/
GCODE_FLAVOR_REPRAP_VOLUMATRIC = 5,
};
#define MAX_EXTRUDERS 16
/**
* Type of infill pattern.
*/
enum Infill_Pattern
{
INFILL_AUTOMATIC = 0,
INFILL_GRID = 1,
INFILL_LINES = 2,
INFILL_CONCENTRIC = 3,
};
class _ConfigSettingIndex
{
public:
const char* key;
int* ptr;
_ConfigSettingIndex(const char* key, int* ptr) : key(key), ptr(ptr) {}
};
class ConfigSettings
{
private:
std::vector<_ConfigSettingIndex> _index;
public:
static ConfigSettings *config; // allow access to config settings from everywhere
int layerThickness;
int initialLayerThickness;
int filamentDiameter;
int filamentFlow;
int layer0extrusionWidth;
int extrusionWidth;
int insetCount;
int downSkinCount;
int upSkinCount;
int skirtDistance;
int skirtLineCount;
int skirtMinLength;
//Retraction settings
int retractionAmount;
int retractionAmountPrime;
int retractionAmountExtruderSwitch;
int returnAmountExtruderSwitch;
int retractionSpeed;
int retractionMinimalDistance;
int minimalExtrusionBeforeRetraction;
int retractionZHop;
int enableCombing;
int enableOozeShield;
int wipeTowerSize;
int multiVolumeOverlap;
int initialSpeedupLayers;
int initialLayerSpeed;
int printSpeed;
int inset0Speed;
int insetXSpeed;
int moveSpeed;
int fanFullOnLayerNr;
//Infill settings
int sparseInfillLineDistance;
int infillOverlap;
int infillSpeed;
int infillPattern;
//Support material
int supportType;
int supportAngle;
int supportEverywhere;
int supportLineDistance;
int supportXYDistance;
int supportZDistance;
int supportExtruder;
//Cool settings
int minimalLayerTime;
int minimalFeedrate;
int coolHeadLift;
int fanSpeedMin;
int fanSpeedMax;
//Raft settings
int raftMargin;
int raftLineSpacing;
int raftBaseThickness;
int raftBaseLinewidth;
int raftBaseSpeed;
int raftInterfaceThickness;
int raftInterfaceLinewidth;
int raftInterfaceLineSpacing;
int raftFanSpeed;
int raftSurfaceThickness;
int raftSurfaceLinewidth;
int raftSurfaceLineSpacing;
int raftSurfaceLayers;
int raftSurfaceSpeed;
int raftAirGap;
int raftAirGapLayer0;
FMatrix3x3 matrix;
IntPoint objectPosition;
int objectSink;
int autoCenter;
int fixHorrible;
int spiralizeMode;
int simpleMode;
int gcodeFlavor;
IntPoint extruderOffset[MAX_EXTRUDERS];
std::string startCode;
std::string endCode;
std::string preSwitchExtruderCode;
std::string postSwitchExtruderCode;
ConfigSettings();
bool setSetting(const char* key, const char* value);
bool readSettings(void);
bool readSettings(const char* path);
};
#endif//SETTINGS_H
|
/// The declaration of the base type of the system object implementations.
/// \file
/// \author Antti Kivi
/// \date 18 April 2018
/// \copyright Copyright (c) 2018–2020 Antti Kivi.
/// Licensed under the Effective Elegy Licence.
#ifndef ODE_SYSTEMS_OBJECT_H
#define ODE_SYSTEMS_OBJECT_H
namespace ode
{
///
/// The base type of the objects which implement the functionalities of the
/// different system objects.
///
class object
{
public:
///
/// Constructs an object of the type \c object.
///
object() = default;
///
/// Constructs an object of the type \c object by copying the given object
/// of the type \c object.
///
/// \param a a \c object from which the new one is constructed.
///
object(const object& a) = default;
///
/// Constructs an object of the type \c object by moving the given object
/// of the type \c object.
///
/// \param a a \c object from which the new one is constructed.
///
object(object&& a) = default;
///
/// Destructs an object of the type \c object.
///
virtual ~object() = default;
///
/// Assigns the given object of the type \c object to this one by copying.
///
/// \param a a \c object from which this one is assigned.
///
/// \return A reference to \c *this.
///
object& operator=(const object& a) = default;
///
/// Assigns the given object of the type \c object to this one by moving.
///
/// \param a a \c object from which this one is assigned.
///
/// \return A reference to \c *this.
///
object& operator=(object&& a) = default;
};
} // namespace ode
#endif // !ODE_SYSTEMS_OBJECT_H
|
#ifndef __T42_H__
#define __T42_H__
/******************************************************************
* This file has been created to test
* the XSLT Bindings Generator (XBiG)
*
* It is based on a problem occured
* during the generation of ogre4j
*
* Problems:
* - type modifier __inline
* - ignorance of template functions
******************************************************************/
#ifdef WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#define FORCEINLINE __inline
namespace Ogre {
typedef unsigned int uint32;
class Bitwise {
public:
static FORCEINLINE unsigned int mostSignificantBitSet(unsigned int value)
{
unsigned int result = 0;
while (value != 0) {
++result;
value >>= 1;
}
return result-1;
}
static FORCEINLINE uint32 firstPO2From(uint32 n)
{
--n;
n |= n >> 16;
n |= n >> 8;
n |= n >> 4;
n |= n >> 2;
n |= n >> 1;
++n;
return n;
}
template<typename T>
static FORCEINLINE bool isPO2(T n)
{
return (n & (n-1)) == 0;
}
template<typename T>
static FORCEINLINE unsigned int getBitShift(T mask)
{
if (mask == 0)
return 0;
unsigned int result = 0;
while ((mask & 1) == 0) {
++result;
mask >>= 1;
}
return result;
}
};
}
#endif
|
/*
* Get one image using libdc1394 using the DMA interface (viedo1394).
* Nothing is done with the image.
*
* Written by Damien Douxchamps <ddouxchamps@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Description: This is a minimalist program that doesn't do everything
* you should do, like cleaning up in case of failure. The
* program uses the current setup of your camera and should
* (but may not) work right after a camera boot.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <dc1394/dc1394.h>
int main(int argc, char *argv[])
{
dc1394camera_t * camera;
dc1394error_t err;
dc1394video_frame_t * frame;
dc1394_t * d;
dc1394camera_list_t * list;
d = dc1394_new (); /* Initialize libdc1394 */
if (!d)
return 1;
err=dc1394_camera_enumerate (d, &list); /* Find cameras */
DC1394_ERR_RTN(err,"Failed to enumerate cameras");
if (list->num == 0) { /* Verify that we have at least one camera */
dc1394_log_error("No cameras found");
return 1;
}
camera = dc1394_camera_new (d, list->ids[0].guid); /* Work with first camera */
if (!camera) {
dc1394_log_error("Failed to initialize camera with guid %llx", list->ids[0].guid);
return 1;
}
dc1394_camera_free_list (list);
err=dc1394_capture_setup(camera, 4, DC1394_CAPTURE_FLAGS_DEFAULT); /* Setup capture */
err=dc1394_video_set_transmission(camera, DC1394_ON); /* Start transmission */
err=dc1394_capture_dequeue(camera, DC1394_CAPTURE_POLICY_WAIT, &frame);/* Capture */
DC1394_ERR_RTN(err,"Problem getting an image");
err=dc1394_capture_enqueue(camera, frame); /* Release the buffer */
err=dc1394_video_set_transmission(camera, DC1394_OFF); /* Stop transmission */
err=dc1394_capture_stop(camera); /* Stop capture */
printf("Hello World\n"); /* Hey, this is a HELLO WORLD program!! */
dc1394_camera_free (camera); /* cleanup and exit */
dc1394_free (d);
return 0;
}
|
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* Razor - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
*
* Copyright: 2010-2011 Razor team
* Authors:
* Petr Vanek <petr@scribus.info>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#ifndef WORKSPACEMANAGER_H
#define WORKSPACEMANAGER_H
#include <QtCore/QObject>
#include "desktopplugin.h"
#include "lxqtworkspace.h"
struct WorkspaceConfig;
class DesktopScene;
class DesktopConfig
{
public:
static DesktopConfig* instance()
{
if (!m_instance)
m_instance = new DesktopConfig;
return m_instance;
}
LxQt::Settings *config;
QString configId;
private:
DesktopConfig() : config(0) {};
DesktopConfig(DesktopConfig const&) : config(0) {};
//DesktopConfig& operator=(DesktopConfig const&){ };
static DesktopConfig* m_instance;
};
/**
* @brief this class does all the managing, like looking in the settings for a wallpaper
*/
class RazorWorkSpaceManager : public QObject, public DesktopPlugin
{
Q_OBJECT
public:
enum BackgroundType {
BackgroundPixmap = 0,
BackgroundColor = 1
};
RazorWorkSpaceManager(const QString & configId, LxQt::Settings * config);
~RazorWorkSpaceManager();
QString info();
protected:
virtual void x11EventFilter(XEvent* event);
private:
QList< QList<RazorWorkSpace*> > m_workspaces;
DesktopScene *m_scene;
int m_desktopCount;
RazorWorkSpaceManager::BackgroundType strToBackgroundType(const QString& str, BackgroundType defaultValue) const;
private slots:
void setup();
};
struct WorkspaceConfig
{
WorkspaceConfig() {};
WorkspaceConfig(RazorWorkSpaceManager::BackgroundType _wallpaperType,
bool _keepAspectRatio,
const QString & _wallpaper)
{
wallpaperType = _wallpaperType;
keepAspectRatio = _keepAspectRatio;
wallpaper = _wallpaper;
}
RazorWorkSpaceManager::BackgroundType wallpaperType;
bool keepAspectRatio;
QString wallpaper;
};
EXPORT_RAZOR_DESKTOP_PLUGIN_H
#endif
|
/****************************************************************************
* Copyright (C) 2009-2021 Savoir-faire Linux Inc. *
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#pragma once
#ifdef ENABLE_TEST
#include "../../test/mocks/callmanager_mock.h"
#else
#ifdef ENABLE_LIBWRAP
#include "../qtwrapper/callmanager_wrap.h"
#else
#include "callmanager_dbus_interface.h"
#include <QDBusPendingReply>
#endif
#endif
#include <typedefs.h>
namespace CallManager {
/// Singleton to access dbus "CallManager" interface
LIB_EXPORT CallManagerInterface& instance();
} // namespace CallManager
|
/*
Copyright (c) 2004-2010 Jason McMullan <jason.mcmullan@gmail.com>
USB/HID I/O routines
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <errno.h>
#include <usb.h>
#include "config.h"
#define USBHID_struct usb_dev_handle
#include "usb_hid.h"
static int timeout = 1000;
/*
Open the indexth USBHID device which match the delection criteria. The
selection criteria may be any combination of vendor id, product id and
version number as specified by the flags parameter.
Returns an open handle on success, or INVALID_USBHIDHANDLE if an error
occurred.
*/
USBHID OpenUSBHID( int index, int vendorId, int productId, int versionNumber, int flags )
{
struct usb_bus *bus;
struct usb_device *dev;
struct usb_dev_handle *usb = NULL;
int err,i=0;
usb_init();
usb_find_busses();
usb_find_devices();
for (bus = usb_get_busses(); bus != NULL; bus = bus->next) {
for (dev = bus->devices; dev != NULL; dev = dev->next) {
if (dev->descriptor.idVendor != vendorId ||
dev->descriptor.idProduct != productId)
continue;
if (i < index)
continue;
usb = usb_open(dev);
if (usb == NULL)
continue;
err=usb_claim_interface(usb,1);
if (err < 0) {
fprintf(stderr,"Can't claim P5 glove interface: %s\n",strerror(errno));
usb_close(usb);
return NULL;
}
break;
}
if (usb != NULL)
break;
}
return usb;
}
/*
Close a USB HID handle previously opened with OpenUSBHID()
*/
void CloseUSBHID( USBHID usb )
{
usb_release_interface(usb,1);
usb_close(usb);
}
/*
Read count bytes from the USB HID into dest. Returns the number of bytes
read. This routine reads from the Kernel HID ring buffer, if it is no called
frequently enough the data returned may lag behind the latest HID reports
from the device.
HidD_GetInputReport will read the most recent report, but is only
implemented on Windows XP.
*/
#ifndef HAVE_USB_INTERRUPT_READ
# define usb_read(usb,ep,data,len,tm) usb_bulk_read(usb,ep,data,len,tm)
# define usb_clear_halt(usb,ep) usb_resetep(usb,ep)
#else
//# define usb_read(usb,ep,data,len,tm) usb_get_input(usb,1,data,len)
# define usb_read(usb,ep,data,len,tm) usb_interrupt_read(usb,ep,data,len,tm)
#endif
int ReadUSBHID( USBHID usb, void *dest, int count )
{
return usb_read(usb, 0x81, dest, count, timeout);
}
int usb_get_input(USBHID udev, unsigned char *report, int ReportSize)
{
int err;
retry:
err=usb_control_msg(udev,
USB_ENDPOINT_IN + USB_TYPE_CLASS + USB_RECIP_INTERFACE,
0x01, /* HID_REPORT_GET */
(report[0]&0xf) | (0x01<<8), /* HID_REPORT_TYPE_INPUT */
1, report, ReportSize, timeout);
if (err == -EPIPE)
goto retry;
return err;
}
int usb_set_output(USBHID udev, unsigned char *report, int ReportSize )
{
return usb_control_msg(udev,
USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE,
0x09, /* HID_REPORT_SET = 0x09*/
(report[0]&0xf) | (0x02<<8), /* HID_REPORT_TYPE_OUPUT */
1, report, ReportSize, timeout);
}
int GetUSBHIDFeature( USBHID udev, char *report, int count )
{
int err;
retry:
err=usb_control_msg(udev,
USB_ENDPOINT_IN + USB_TYPE_CLASS + USB_RECIP_INTERFACE,
0x01, /* HID_REPORT_GET */
(report[0]&0xf) | (0x03<<8), /* HID_REPORT_TYPE_FEATURE */
1, report, count, timeout);
if (err == -EPIPE)
goto retry;
return err;
}
int SetUSBHIDFeature( USBHID udev, char *report, int count )
{
return usb_control_msg(udev,
USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE,
0x09, /* HID_REPORT_SET = 0x09*/
(report[0]&0xf) | (0x03<<8), /* HID_REPORT_TYPE_FEATURE */
1, report, count, timeout);
}
|
#pragma once
#include <QObject>
#include <QTimer>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include "musicdatabase.h"
#include "widgets/playlistwidget.h"
#include "widgets/musictoolbar.h"
#include "util/music_global.h"
#include "backend/musicdatabase.h"
class PlayListWidget;
class MusicToolBar;
class Player : public QObject
{
Q_OBJECT
public:
Player(QString &localPath, QStringList &pathList, qint32 volume, QObject *parent = 0);
static Player *getInstance(QString &localPath, QStringList &pathList, qint32 volume);
~Player();
void setPlaylist(QString localPath, QStringList list);
void updatePlaylist(QStringList list);
void playMedia(int index);
void initPlaymode();
enum playmode { ITEMONCE = 0, ITEMLOOP, SEQUENTIAL, LOOP, RANDOM };
signals:
void positionChanged(qint64);
void durationChanged(qint64);
// False for pause,and True for play
void updatedState(bool);
void updatedMode(qint32);
void gettedMetadata(QStringList);
public slots:
void playOrPause();
void lastMedia();
void nextMedia();
void updatePlaymode();
void sendMetaSignal(QMediaPlayer::MediaStatus status);
void updateMediaPosition(int pos);
void updateVolume(int value);
// void updatePlaylist(QStringList songlist);
private:
QMediaPlayer *qPlayer = NULL;
QMediaPlaylist *playlist = NULL;
PlayListWidget *playlistwidget = NULL;
MusicToolBar *toolbar = NULL;
MusicDatabase *database = NULL;
QTimer *timer;
QString localPlaylist;
private:
};
|
/* IteratorDictStringVector.h
* Copyright (C) 2014, Francisco Claude & Rodrigo Canovas & Miguel A. Martinez-Prieto
* all rights reserved.
*
* Iterator class for scanning a vector of strings.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Contacting the authors:
* Francisco Claude: fclaude@recoded.cl
* Rodrigo Canovas: rcanovas@student.unimelb.edu.au
* Miguel A. Martinez-Prieto: migumar2@infor.uva.es
*/
#ifndef _ITERATORDICTSTRINGVECTOR_H
#define _ITERATORDICTSTRINGVECTOR_H
#include <string.h>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class IteratorDictStringVector : public IteratorDictString
{
public:
/** Constructor for the Vector Iterator:
@arr: the array of strings.
@scanneable: stream size (in bytes).
*/
IteratorDictStringVector(vector<uchar*> *arr, size_t scanneable)
{
this->arr = *arr;
this->scanneable = scanneable;
this->processed = 0;
}
/** Extracts the next string in the stream.
@param strLen pointer to the string length.
@returns the next string.
*/
unsigned char* next(uint *str_length)
{
processed++;
*str_length = strlen((char*)(arr[processed-1]));
return arr[processed-1];
}
/** Checks for non-processed strings in the stream.
@returns if remains non-processed strings.
*/
bool hasNext()
{
return processed<scanneable;
}
/** Generic destructor. */
~IteratorDictStringVector()
{
}
protected:
vector<uchar*> arr; // The array of strings
bool static sorting(uchar *i, uchar *j)
{
if (strcmp((char*)i, (char*)j) < 0) return true;
else return false;
}
void sortstr()
{
std::sort(arr.begin(), arr.end(), sorting);
}
};
#endif
|
// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Utils.h
// Author : Open CASCADE S.A.S.
//
#ifndef SMESHGUI_UTILS_H
#define SMESHGUI_UTILS_H
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
// CORBA includes
#include <omniORB4/CORBA.h>
// SALOME KERNEL includes
#include <SALOMEDSClient_definitions.hxx>
#include <SALOME_GenericObj_wrap.hxx>
// SALOME GUI includes
#include <SALOME_InteractiveObject.hxx>
#include <LightApp_DataOwner.h>
//OCC includes
#include <gp_XYZ.hxx>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
class SUIT_ViewWindow;
class SUIT_Desktop;
class SUIT_Study;
class SUIT_ResourceMgr;
class CAM_Module;
class SALOMEDSClient_Study;
class SALOMEDSClient_SObject;
class SalomeApp_Study;
class SalomeApp_Module;
class LightApp_SelectionMgr;
class SMDS_MeshFace;
namespace SMESH
{
SMESHGUI_EXPORT
SUIT_Desktop*
GetDesktop( const CAM_Module* );
SMESHGUI_EXPORT
LightApp_SelectionMgr*
GetSelectionMgr( const SalomeApp_Module* );
SMESHGUI_EXPORT
SalomeApp_Study*
GetAppStudy( const CAM_Module* );
SMESHGUI_EXPORT
SUIT_ResourceMgr*
GetResourceMgr( const SalomeApp_Module* );
SMESHGUI_EXPORT
_PTR(Study)
GetCStudy( const SalomeApp_Study* );
SMESHGUI_EXPORT
CORBA::Object_var DataOwnerToObject( const LightApp_DataOwnerPtr& );
template<class TInterface> typename TInterface::_var_type
DataOwnerToInterface( const LightApp_DataOwnerPtr& theDataOwner )
{
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
SMESHGUI_EXPORT
SUIT_Study* GetActiveStudy();
SMESHGUI_EXPORT
SUIT_ViewWindow* GetActiveWindow();
SMESHGUI_EXPORT
_PTR(Study) GetActiveStudyDocument();
SMESHGUI_EXPORT
_PTR(SObject) FindSObject( CORBA::Object_ptr );
SMESHGUI_EXPORT
void SetName( _PTR(SObject), const QString& );
SMESHGUI_EXPORT
void SetValue( _PTR(SObject), const QString& );
void setFileType( _PTR(SObject), const QString& );
void setFileName( _PTR(SObject), const QString& );
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject),
_PTR(Study) );
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject) );
template<class TInterface> typename TInterface::_var_type
SObjectToInterface( _PTR(SObject) theSObject )
{
CORBA::Object_var anObj = SObjectToObject(theSObject);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
SMESHGUI_EXPORT
_PTR(SObject) ObjectToSObject( CORBA::Object_ptr );
SMESHGUI_EXPORT
CORBA::Object_var IObjectToObject( const Handle(SALOME_InteractiveObject)& );
template<class TInterface> typename TInterface::_var_type
IObjectToInterface( const Handle(SALOME_InteractiveObject)& theIO )
{
CORBA::Object_var anObj = IObjectToObject(theIO);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
SMESHGUI_EXPORT
CORBA::Object_var IORToObject( const QString& );
template<class TInterface> typename TInterface::_var_type
IORToInterface( const QString& theIOR )
{
CORBA::Object_var anObj = IORToObject( theIOR );
if ( !CORBA::is_nil( anObj ) )
return TInterface::_narrow( anObj );
return TInterface::_nil();
}
SMESHGUI_EXPORT
int GetNameOfSelectedIObjects( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
_PTR(SObject) GetMeshOrSubmesh( _PTR(SObject) );
SMESHGUI_EXPORT
void ModifiedMesh( _PTR(SObject), bool, bool = false );
SMESHGUI_EXPORT
void ShowHelpFile( const QString& );
/*!
* \brief Return the normal to a face
* \param theFace - input face
* \retval gp_XYZ - normal to a face
*/
SMESHGUI_EXPORT
gp_XYZ getNormale( const SMDS_MeshFace* theFace );
// type to use instead of SMESH_IDSource_var for automatic UnRegister()
typedef SALOME::GenericObj_wrap<SMESH_IDSource> SMESH_IDSource_wrap;
/*!
* \brief Class usefull to convert a string returned from a CORBA call
* to other string types w/o memory leak.
*
* Usage (of instantiations): QString s = toQStr( objVar->GetName() );
* std::string ss = toStdStr( objVar->GetName() );
*/
template < class _STRING >
class toStrT : public _STRING {
CORBA::String_var myStr;
public:
toStrT( char* s ): myStr(s), _STRING( s )
{}
operator const char*() const
{ return myStr.in(); }
};
// Instantiations:
struct toQStr : public toStrT< QString > {
toQStr( char* s ): toStrT< QString >(s) {}
};
struct toStdStr : public toStrT< std::string > {
toStdStr( char* s ): toStrT< std::string >(s) {}
};
}
#endif // SMESHGUI_UTILS_H
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtMultimedia module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia 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.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QABSTRACTVIDEOBUFFER_H
#define QABSTRACTVIDEOBUFFER_H
#include <QtCore/qmetatype.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Multimedia)
class QVariant;
class QAbstractVideoBufferPrivate;
class Q_MULTIMEDIA_EXPORT QAbstractVideoBuffer
{
public:
enum HandleType
{
NoHandle,
GLTextureHandle,
XvShmImageHandle,
CoreImageHandle,
QPixmapHandle,
UserHandle = 1000
};
enum MapMode
{
NotMapped = 0x00,
ReadOnly = 0x01,
WriteOnly = 0x02,
ReadWrite = ReadOnly | WriteOnly
};
QAbstractVideoBuffer(HandleType type);
virtual ~QAbstractVideoBuffer();
HandleType handleType() const;
virtual MapMode mapMode() const = 0;
virtual uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) = 0;
virtual void unmap() = 0;
virtual QVariant handle() const;
protected:
QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type);
QAbstractVideoBufferPrivate *d_ptr;
private:
Q_DECLARE_PRIVATE(QAbstractVideoBuffer)
Q_DISABLE_COPY(QAbstractVideoBuffer)
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QAbstractVideoBuffer::HandleType)
Q_DECLARE_METATYPE(QAbstractVideoBuffer::MapMode)
QT_END_HEADER
#endif
|
/**
* \file LOG4CXXLogger.hpp
* \brief Definitions required by logger.
* Stores device information
*
* Copyright (c) 2013, Ford Motor Company
* 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 Ford Motor Company 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 LOG4CXXLOGGER_HPP_
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>
namespace log4cxx
{
#define LOG4CXX_INFO_EXT(logger, logEvent) LOG4CXX_INFO(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_INFO_STR_EXT(logger, logEvent) LOG4CXX_INFO_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_TRACE_EXT(logger, logEvent) LOG4CXX_TRACE(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_TRACE_STR_EXT(logger, logEvent) LOG4CXX_TRACE_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_DEBUG_EXT(logger, logEvent) LOG4CXX_DEBUG(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_DEBUG_STR_EXT(logger, logEvent) LOG4CXX_DEBUG_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_WARN_EXT(logger, logEvent) LOG4CXX_WARN(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_WARN_STR_EXT(logger, logEvent) LOG4CXX_WARN_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_ERROR_EXT(logger, logEvent) LOG4CXX_ERROR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_ERROR_STR_EXT(logger, logEvent) LOG4CXX_ERROR_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_FATAL_EXT(logger, logEvent) LOG4CXX_FATAL(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_FATAL_STR_EXT(logger, logEvent) LOG4CXX_FATAL_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
#define LOG4CXX_TRACE_ENTER(logger) LOG4CXX_TRACE(logger, "ENTER: " << __PRETTY_FUNCTION__ )
#define LOG4CXX_TRACE_EXIT(logger) LOG4CXX_TRACE(logger, "EXIT: " << __PRETTY_FUNCTION__ )
#define LOG4CXX_ERROR_WITH_ERRNO(logger, message) LOG4CXX_ERROR(logger, message << ", error code " << errno << " (" << strerror(errno) << ")")
class Tracer
{
LoggerPtr mLogger;
std::string mEvent;
public:
Tracer(LoggerPtr logger, std::string const& event);
~Tracer();
};
#define LOG4CXX_TRACE_METHOD(logger, logEvent) log4cxx::Tracer tracer(logger, logEvent)
};
#define LOG4CXXLOGGER_HPP_
#endif /* LOG4CXXLOGGER_HPP_ */
|
/* Categories of Unicode characters.
Copyright (C) 2002, 2006-2007, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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/>. */
#include <config.h>
/* Specification. */
#include "unictype.h"
/* Define u_categ_No table. */
#include "categ_No.h"
const uc_general_category_t UC_CATEGORY_No =
{ UC_CATEGORY_MASK_No, 0, { &u_categ_No } };
|
/*
* Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup boards_arduino-mega2560 Arduino Mega 2560
* @ingroup boards
* @brief Board specific files for the Arduino Mega 2560 board.
* @{
*
* @file
* @brief Board specific definitions for the Arduino Mega 2560 board.
*
* @author Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
*/
#ifndef BOARD_H_
#define BOARD_H_
#include "cpu.h"
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief As the CPU is too slow to handle 115200 baud, we set the default
* baudrate to 9600 for this board
*/
#define UART_STDIO_BAUDRATE (9600U)
/**
* @name LED pin definitions
* @{
*/
#define LED_PORT PORTB
#define LED_PIN (1 << 7)
/** @} */
/**
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED_ENABLE_PORT DDRB |= (1 << DDB7)
#define LED_ON LED_PORT |= LED_PIN
#define LED_OFF LED_PORT &= ~LED_PIN
#define LED_TOGGLE LED_PORT ^= LED_PIN;
/* for compatability to other boards */
#define LED_GREEN_ON LED_ON
#define LED_GREEN_OFF LED_OFF
#define LED_GREEN_TOGGLE LED_TOGGLE
#define LED_RED_ON /* not available */
#define LED_RED_OFF /* not available */
#define LED_RED_TOGGLE /* not available */
/** @} */
/**
* @brief xtimer configuration values
* @{
*/
#define XTIMER_SHIFT (2)
#define XTIMER_SHIFT_ON_COMPARE (8)
#define XTIMER_BACKOFF (40)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H_ */
/** @} */
|
/*
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_DROID_CAM_SRC_QUIRKS_H__
#define __GST_DROID_CAM_SRC_QUIRKS_H__
#include <glib.h>
G_BEGIN_DECLS
typedef struct _GstDroidCamSrcQuirks GstDroidCamSrcQuirks;
typedef struct _GstDroidCamSrcQuirk GstDroidCamSrcQuirk;
struct _GstDroidCamSrcQuirk
{
gchar *prop;
gchar *on;
gchar *off;
int direction;
};
struct _GstDroidCamSrcQuirks
{
GstDroidCamSrcQuirk *face_detection;
GstDroidCamSrcQuirk *image_noise_reduction;
};
GstDroidCamSrcQuirks * gst_droidcamsrc_quirks_new ();
void gst_droidcamsrc_quirks_destroy (GstDroidCamSrcQuirks * quirks);
G_END_DECLS
#endif /* __GST_DROID_CAM_SRC_QUIRKS_H__ */
|
/*
* Copyright (C) 2020 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup pkg_nimble_autoadv
*
* @{
*
* @file
*
* @author Hendrik van Essen <hendrik.ve@fu-berlin.de>
*
* @}
*/
#include <errno.h>
#include <stdlib.h>
#include "nimble_riot.h"
#include "host/ble_hs.h"
#include "host/ble_gap.h"
#include "net/bluetil/ad.h"
#include "nimble_autoadv.h"
/* settings for advertising procedure */
static struct ble_gap_adv_params _advp;
/* duration of the advertisement procedure */
static int32_t _adv_duration;
/* buffer for _ad */
static uint8_t buf[BLE_HS_ADV_MAX_SZ];
/* advertising data struct */
static bluetil_ad_t _ad;
/* GAP callback function */
static ble_gap_event_fn *_gap_cb;
/* arguments for GAP callback function */
static void *_gap_cb_arg;
void nimble_autoadv_start(void);
static int _gap_event_cb(struct ble_gap_event *event, void *arg)
{
(void) arg;
switch (event->type) {
case BLE_GAP_EVENT_CONNECT:
if (event->connect.status != 0) {
// failed, ensure advertising is restarted
nimble_autoadv_start();
}
break;
case BLE_GAP_EVENT_DISCONNECT:
nimble_autoadv_start();
break;
}
return 0;
}
void nimble_autoadv_init(void)
{
nimble_autoadv_reset();
if (!NIMBLE_AUTOADV_START_MANUALLY) {
nimble_autoadv_start();
}
}
int nimble_autoadv_add_field(uint8_t type, const void *data, size_t data_len)
{
int rc = bluetil_ad_add(&_ad, type, data, data_len);
if (rc != BLUETIL_AD_OK) {
return rc;
}
if (ble_gap_adv_active()) {
nimble_autoadv_start();
}
return rc;
}
void nimble_autoadv_set_ble_gap_adv_params(struct ble_gap_adv_params *params)
{
memcpy(&_advp, params, sizeof(struct ble_gap_adv_params));
if (ble_gap_adv_active()) {
nimble_autoadv_start();
}
}
void nimble_auto_adv_set_adv_duration(int32_t duration_ms)
{
_adv_duration = duration_ms;
if (ble_gap_adv_active()) {
nimble_autoadv_start();
}
}
void nimble_auto_adv_set_gap_cb(ble_gap_event_fn *cb, void *cb_arg)
{
_gap_cb = cb;
_gap_cb_arg = cb_arg;
if (ble_gap_adv_active()) {
nimble_autoadv_start();
}
}
void nimble_autoadv_start(void)
{
int rc;
(void) rc;
rc = ble_gap_adv_stop();
assert(rc == BLE_HS_EALREADY || rc == 0);
rc = ble_gap_adv_set_data(_ad.buf, _ad.pos);
assert(rc == 0);
rc = ble_gap_adv_start(nimble_riot_own_addr_type, NULL, _adv_duration, &_advp, _gap_cb, _gap_cb_arg);
assert(rc == 0);
}
void nimble_autoadv_stop(void)
{
int rc;
(void) rc;
rc = ble_gap_adv_stop();
assert(rc == BLE_HS_EALREADY || rc == 0);
}
void nimble_autoadv_reset(void)
{
_gap_cb = &_gap_event_cb;
_gap_cb_arg = NULL;
_adv_duration = BLE_HS_FOREVER;
memset(&_advp, 0, sizeof _advp);
_advp.conn_mode = BLE_GAP_CONN_MODE_UND;
_advp.disc_mode = BLE_GAP_DISC_MODE_GEN;
int rc = 0;
(void) rc;
rc = bluetil_ad_init_with_flags(&_ad, buf, sizeof(buf), BLUETIL_AD_FLAGS_DEFAULT);
assert(rc == BLUETIL_AD_OK);
if (NIMBLE_AUTOADV_DEVICE_NAME != NULL) {
rc = bluetil_ad_add_name(&_ad, NIMBLE_AUTOADV_DEVICE_NAME);
assert(rc == BLUETIL_AD_OK);
}
if (ble_gap_adv_active()) {
nimble_autoadv_start();
}
}
|
/*=========================================================================
This file is part of the XIOT library.
Copyright (C) 2008-2009 EDF R&D
Author: Kristian Sons (xiot@actor3d.com)
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
The XIOT library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser Public License for more details.
You should have received a copy of the GNU Lesser Public License
along with XIOT; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
=========================================================================*/
#ifndef X3D_X3DPARSERVOCABULARY_H
#define X3D_X3DPARSERVOCABULARY_H
#include <fstream>
#include <map>
#include <string>
#include <xiot/FIParserVocabulary.h>
#include <xiot/X3DFIEncodingAlgorithms.h>
#include <xiot/XIOTConfig.h>
namespace XIOT {
/**
* <b>X3DParserVocabulary</b> implements the External Parser Vocabulary as defined
* in the X3DB spec.
*
* This includes the tables for element and attribute names, for
* attribute values and two X3D specific encoding algorithms
*
* @link(http://www.web3d.org/x3d/specifications/ISO-IEC-FCD-19776-3.2-X3DEncodings-CompressedBinary/Part03/tables.html)
*
* @ingroup x3dloader
*/
class XIOT_EXPORT X3DParserVocabulary : public FI::DefaultParserVocabulary {
public:
static const int ATTRIBUT_VALUE_FALSE_INDEX = 1;
static const int ATTRIBUT_VALUE_TRUE_INDEX = 2;
X3DParserVocabulary();
virtual ~X3DParserVocabulary(){};
QuantizedzlibFloatArrayAlgorithm _quantizedzlibFloatArrayAlgorithm;
DeltazlibIntArrayAlgorithm _deltazlibIntArrayAlgorithm;
private:
};
} // namespace XIOT
#endif
|
#define FAIM_INTERNAL
#include <aim.h>
/*
* Oncoming Buddy notifications contain a subset of the
* user information structure. Its close enough to run
* through aim_extractuserinfo() however.
*
* Although the offgoing notification contains no information,
* it is still in a format parsable by extractuserinfo.
*
*/
static int buddychange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
{
aim_userinfo_t userinfo;
aim_rxcallback_t userfunc;
aim_extractuserinfo(sess, bs, &userinfo);
if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
return userfunc(sess, rx, &userinfo);
return 0;
}
static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
{
aim_rxcallback_t userfunc;
aim_tlvlist_t *tlvlist;
fu16_t maxbuddies = 0, maxwatchers = 0;
int ret = 0;
/*
* TLVs follow
*/
tlvlist = aim_readtlvchain(bs);
/*
* TLV type 0x0001: Maximum number of buddies.
*/
if (aim_gettlv(tlvlist, 0x0001, 1))
maxbuddies = aim_gettlv16(tlvlist, 0x0001, 1);
/*
* TLV type 0x0002: Maximum number of watchers.
*
* Watchers are other users who have you on their buddy
* list. (This is called the "reverse list" by a certain
* other IM protocol.)
*
*/
if (aim_gettlv(tlvlist, 0x0002, 1))
maxwatchers = aim_gettlv16(tlvlist, 0x0002, 1);
if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
ret = userfunc(sess, rx, maxbuddies, maxwatchers);
aim_freetlvchain(&tlvlist);
return ret;
}
static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
{
if (snac->subtype == 0x0003)
return rights(sess, mod, rx, snac, bs);
else if ((snac->subtype == 0x000b) || (snac->subtype == 0x000c))
return buddychange(sess, mod, rx, snac, bs);
return 0;
}
faim_internal int buddylist_modfirst(aim_session_t *sess, aim_module_t *mod)
{
mod->family = 0x0003;
mod->version = 0x0001;
mod->toolid = 0x0110;
mod->toolversion = 0x047b;
mod->flags = 0;
strncpy(mod->name, "buddylist", sizeof(mod->name));
mod->snachandler = snachandler;
return 0;
}
/*
* aim_add_buddy()
*
* Adds a single buddy to your buddy list after login.
*
* XXX this should just be an extension of setbuddylist()
*
*/
faim_export int aim_add_buddy(aim_session_t *sess, aim_conn_t *conn, const char *sn)
{
aim_frame_t *fr;
aim_snacid_t snacid;
if (!sn || !strlen(sn))
return -EINVAL;
if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn))))
return -ENOMEM;
snacid = aim_cachesnac(sess, 0x0003, 0x0004, 0x0000, sn, strlen(sn)+1);
aim_putsnac(&fr->data, 0x0003, 0x0004, 0x0000, snacid);
aimbs_put8(&fr->data, strlen(sn));
aimbs_putraw(&fr->data, sn, strlen(sn));
aim_tx_enqueue(sess, fr);
return 0;
}
/*
* XXX generalise to support removing multiple buddies (basically, its
* the same as setbuddylist() but with a different snac subtype).
*
*/
faim_export int aim_remove_buddy(aim_session_t *sess, aim_conn_t *conn, const char *sn)
{
aim_frame_t *fr;
aim_snacid_t snacid;
if (!sn || !strlen(sn))
return -EINVAL;
if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn))))
return -ENOMEM;
snacid = aim_cachesnac(sess, 0x0003, 0x0005, 0x0000, sn, strlen(sn)+1);
aim_putsnac(&fr->data, 0x0003, 0x0005, 0x0000, snacid);
aimbs_put8(&fr->data, strlen(sn));
aimbs_putraw(&fr->data, sn, strlen(sn));
aim_tx_enqueue(sess, fr);
return 0;
}
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2000 Ximian, Inc.
*
* Authors: Dan Winship <danw@ximian.com>
* Jeffrey Stedfast <fejj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU Lesser General Public
* License 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
* 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, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "camel-mime-filter-crlf.h"
static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
char **out, size_t *outlen, size_t *outprespace);
static void complete (CamelMimeFilter *f, char *in, size_t len,
size_t prespace, char **out, size_t *outlen,
size_t *outprespace);
static void reset (CamelMimeFilter *f);
static void
camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *klass)
{
CamelMimeFilterClass *mime_filter_class =
(CamelMimeFilterClass *) klass;
mime_filter_class->filter = filter;
mime_filter_class->complete = complete;
mime_filter_class->reset = reset;
}
CamelType
camel_mime_filter_crlf_get_type (void)
{
static CamelType type = CAMEL_INVALID_TYPE;
if (type == CAMEL_INVALID_TYPE) {
type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterCRLF",
sizeof (CamelMimeFilterCRLF),
sizeof (CamelMimeFilterCRLFClass),
(CamelObjectClassInitFunc) camel_mime_filter_crlf_class_init,
NULL,
NULL,
NULL);
}
return type;
}
static void
filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
char **out, size_t *outlen, size_t *outprespace)
{
CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
register const char *inptr;
const char *inend;
gboolean do_dots;
char *outptr;
do_dots = crlf->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
inptr = in;
inend = in + len;
if (crlf->direction == CAMEL_MIME_FILTER_CRLF_ENCODE) {
camel_mime_filter_set_size (f, 3 * len, FALSE);
outptr = f->outbuf;
while (inptr < inend) {
if (*inptr == '\r') {
crlf->saw_cr = TRUE;
} else if (*inptr == '\n') {
crlf->saw_lf = TRUE;
if (!crlf->saw_cr)
*outptr++ = '\r';
crlf->saw_cr = FALSE;
} else {
if (do_dots && *inptr == '.' && crlf->saw_lf)
*outptr++ = '.';
crlf->saw_cr = FALSE;
crlf->saw_lf = FALSE;
}
*outptr++ = *inptr++;
}
} else {
/* Output can "grow" by one byte if crlf->saw_cr was set as
* a carry-over from the previous invocation. This will happen
* in practice, as the input is processed in arbitrarily-sized
* blocks. */
camel_mime_filter_set_size (f, len + 1, FALSE);
outptr = f->outbuf;
while (inptr < inend) {
if (*inptr == '\r') {
crlf->saw_cr = TRUE;
} else {
if (crlf->saw_cr) {
crlf->saw_cr = FALSE;
if (*inptr == '\n') {
crlf->saw_lf = TRUE;
*outptr++ = *inptr++;
continue;
} else
*outptr++ = '\r';
}
*outptr++ = *inptr;
}
if (do_dots && *inptr == '.') {
if (crlf->saw_lf) {
crlf->saw_dot = TRUE;
crlf->saw_lf = FALSE;
inptr++;
} else if (crlf->saw_dot) {
crlf->saw_dot = FALSE;
}
}
crlf->saw_lf = FALSE;
inptr++;
}
}
*out = f->outbuf;
*outlen = outptr - f->outbuf;
*outprespace = f->outpre;
}
static void
complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
char **out, size_t *outlen, size_t *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
}
static void
reset (CamelMimeFilter *f)
{
CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
crlf->saw_cr = FALSE;
crlf->saw_lf = TRUE;
crlf->saw_dot = FALSE;
}
/**
* camel_mime_filter_crlf_new:
* @direction: encode vs decode
* @mode: whether or not to perform SMTP dot-escaping
*
* Create a new #CamelMimeFiletrCRLF object.
*
* Returns a new #CamelMimeFilterCRLF object
**/
CamelMimeFilter *
camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction, CamelMimeFilterCRLFMode mode)
{
CamelMimeFilterCRLF *crlf = CAMEL_MIME_FILTER_CRLF(camel_object_new (CAMEL_MIME_FILTER_CRLF_TYPE));
crlf->direction = direction;
crlf->mode = mode;
crlf->saw_cr = FALSE;
crlf->saw_lf = TRUE;
crlf->saw_dot = FALSE;
return (CamelMimeFilter *)crlf;
}
|
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This 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/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_OGLGRID_H
#define SOFA_OGLGRID_H
#include "config.h"
#include <sofa/core/visual/VisualModel.h>
#include <sofa/defaulttype/RGBAColor.h>
namespace sofa
{
namespace component
{
namespace visualmodel
{
class OglGrid : public core::visual::VisualModel
{
public:
SOFA_CLASS(OglGrid, VisualModel);
typedef sofa::defaulttype::Vector3 Vector3;
enum PLANE {PLANE_X, PLANE_Y, PLANE_Z};
Data<std::string> plane;
PLANE internalPlane;
Data<float> size;
Data<int> nbSubdiv;
Data<defaulttype::RGBAColor> color;
Data<float> thickness;
Data<bool> draw;
OglGrid():
plane(initData(&plane, std::string("z"), "plane", "Plane of the grid")),
size(initData(&size, 10.0f, "size", "Size of the squared grid")),
nbSubdiv(initData(&nbSubdiv, 16, "nbSubdiv", "Number of subdivisions")),
color(initData(&color, defaulttype::RGBAColor(0.34117647058f,0.34117647058f,0.34117647058f,1.0f), "color", "Color of the lines in the grid. default=(0.34,0.34,0.34,1.0)")),
thickness(initData(&thickness, 1.0f, "thickness", "Thickness of the lines in the grid")),
draw(initData(&draw, true, "draw", "Display the grid or not"))
{}
virtual void init() override;
virtual void reinit() override;
virtual void drawVisual(const core::visual::VisualParams*) override;
virtual void updateVisual() override;
protected:
};
} // namespace visualmodel
} // namespace component
} // namespace sofa
#endif //SOFA_OGLGRID_H
|
/* This file is part of Zanshin
Copyright 2014 Kevin Ottens <ervin@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
#ifndef DOMAIN_NOTEREPOSITORY_H
#define DOMAIN_NOTEREPOSITORY_H
#include "datasource.h"
#include "note.h"
class KJob;
namespace Domain {
class NoteRepository
{
public:
typedef QSharedPointer<NoteRepository> Ptr;
NoteRepository();
virtual ~NoteRepository();
virtual bool isDefaultSource(DataSource::Ptr source) const = 0;
virtual void setDefaultSource(DataSource::Ptr source) = 0;
virtual KJob *save(Note::Ptr note) = 0;
virtual KJob *remove(Note::Ptr note) = 0;
};
}
#endif // DOMAIN_NOTEREPOSITORY_H
|
/* Text Widget/Automatic scrolling
*
* This example demonstrates how to use the gravity of
* GtkTextMarks to keep a text view scrolled to the bottom
* while appending text.
*/
#include <gtk/gtk.h>
#include "demo-common.h"
/* Scroll to the end of the buffer.
*/
static gboolean
scroll_to_end (GtkTextView *textview)
{
GtkTextBuffer *buffer;
GtkTextIter iter;
GtkTextMark *mark;
char *spaces;
static int count;
buffer = gtk_text_view_get_buffer (textview);
/* Get "end" mark. It's located at the end of buffer because
* of right gravity
*/
mark = gtk_text_buffer_get_mark (buffer, "end");
gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark);
/* and insert some text at its position, the iter will be
* revalidated after insertion to point to the end of inserted text
*/
spaces = g_strnfill (count++, ' ');
gtk_text_buffer_insert (buffer, &iter, "\n", -1);
gtk_text_buffer_insert (buffer, &iter, spaces, -1);
gtk_text_buffer_insert (buffer, &iter,
"Scroll to end scroll to end scroll "
"to end scroll to end ",
-1);
g_free (spaces);
/* Now scroll the end mark onscreen.
*/
gtk_text_view_scroll_mark_onscreen (textview, mark);
/* Emulate typewriter behavior, shift to the left if we
* are far enough to the right.
*/
if (count > 150)
count = 0;
return TRUE;
}
/* Scroll to the bottom of the buffer.
*/
static gboolean
scroll_to_bottom (GtkTextView *textview)
{
GtkTextBuffer *buffer;
GtkTextIter iter;
GtkTextMark *mark;
char *spaces;
static int count;
buffer = gtk_text_view_get_buffer (textview);
/* Get end iterator */
gtk_text_buffer_get_end_iter (buffer, &iter);
/* and insert some text at it, the iter will be revalidated
* after insertion to point to the end of inserted text
*/
spaces = g_strnfill (count++, ' ');
gtk_text_buffer_insert (buffer, &iter, "\n", -1);
gtk_text_buffer_insert (buffer, &iter, spaces, -1);
gtk_text_buffer_insert (buffer, &iter,
"Scroll to bottom scroll to bottom scroll "
"to bottom scroll to bottom",
-1);
g_free (spaces);
/* Move the iterator to the beginning of line, so we don't scroll
* in horizontal direction
*/
gtk_text_iter_set_line_offset (&iter, 0);
/* and place the mark at iter. the mark will stay there after we
* insert some text at the end because it has right gravity.
*/
mark = gtk_text_buffer_get_mark (buffer, "scroll");
gtk_text_buffer_move_mark (buffer, mark, &iter);
/* Scroll the mark onscreen.
*/
gtk_text_view_scroll_mark_onscreen (textview, mark);
/* Shift text back if we got enough to the right.
*/
if (count > 40)
count = 0;
return TRUE;
}
static guint
setup_scroll (GtkTextView *textview,
gboolean to_end)
{
GtkTextBuffer *buffer;
GtkTextIter iter;
buffer = gtk_text_view_get_buffer (textview);
gtk_text_buffer_get_end_iter (buffer, &iter);
if (to_end)
{
/* If we want to scroll to the end, including horizontal scrolling,
* then we just create a mark with right gravity at the end of the
* buffer. It will stay at the end unless explicitely moved with
* gtk_text_buffer_move_mark.
*/
gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE);
/* Add scrolling timeout. */
return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview);
}
else
{
/* If we want to scroll to the bottom, but not scroll horizontally,
* then an end mark won't do the job. Just create a mark so we can
* use it with gtk_text_view_scroll_mark_onscreen, we'll position it
* explicitely when needed. Use left gravity so the mark stays where
* we put it after inserting new text.
*/
gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE);
/* Add scrolling timeout. */
return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview);
}
}
static void
remove_timeout (GtkWidget *window,
gpointer timeout)
{
g_source_remove (GPOINTER_TO_UINT (timeout));
}
static void
create_text_view (GtkWidget *hbox,
gboolean to_end)
{
GtkWidget *swindow;
GtkWidget *textview;
guint timeout;
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);
timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end);
/* Remove the timeout in destroy handler, so we don't try to
* scroll destroyed widget.
*/
g_signal_connect (textview, "destroy",
G_CALLBACK (remove_timeout),
GUINT_TO_POINTER (timeout));
}
GtkWidget *
do_textscroll (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *hbox;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_container_add (GTK_CONTAINER (window), hbox);
create_text_view (hbox, TRUE);
create_text_view (hbox, FALSE);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
return window;
}
|
// The libMesh Finite Element Library.
// Copyright (C) 2002-2021 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef LIBMESH_METIS_CSR_GRAPH_H
#define LIBMESH_METIS_CSR_GRAPH_H
// Local Includes
#include "libmesh/libmesh_common.h"
// C++ Includes
#include <vector>
#include <numeric>
namespace libMesh
{
/**
* This utility class provides a convenient implementation for
* building the compressed-row-storage graph required for the
* METIS/ParMETIS graph partitioning schemes.
*
* \author Benjamin S. Kirk
* \date 2013
* \brief Compressed graph data structure used by MetisPartitioner.
*/
template <class IndexType>
class METIS_CSR_Graph
{
public:
std::vector<IndexType> offsets, vals;
/**
* Sets the number of non-zero values in the given row. The
* internal indexing is 1-based.
*/
void prep_n_nonzeros(const libMesh::dof_id_type row,
const libMesh::dof_id_type n_nonzeros_in)
{
libmesh_assert_less (row+1, offsets.size());
offsets[row+1] = n_nonzeros_in;
}
/**
* \returns The number of nonzeros in the requested row by
* subtracting the offsets vector entries.
*/
libMesh::dof_id_type n_nonzeros (const libMesh::dof_id_type row) const
{
libmesh_assert_less (row+1, offsets.size());
return (offsets[row+1] - offsets[row]);
}
/**
* Replaces the entries in the offsets vector with their partial
* sums and resizes the val vector accordingly.
*/
void prepare_for_use()
{
std::partial_sum (offsets.begin(), offsets.end(), offsets.begin());
libmesh_assert (!offsets.empty());
vals.resize(offsets.back());
if (vals.empty())
vals.push_back(0);
}
/**
* \returns A writable reference to the nonzero'th entry of row.
*/
IndexType & operator()(const libMesh::dof_id_type row,
const libMesh::dof_id_type nonzero)
{
libmesh_assert_greater (vals.size(), offsets[row]+nonzero);
return vals[offsets[row]+nonzero];
}
/**
* \returns A const reference to the nonzero'th entry of row.
*/
const IndexType & operator()(const libMesh::dof_id_type row,
const libMesh::dof_id_type nonzero) const
{
libmesh_assert_greater (vals.size(), offsets[row]+nonzero);
return vals[offsets[row]+nonzero];
}
};
} // namespace libMesh
#endif // LIBMESH_METIS_CSR_GRAPH_H
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2013-2015 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __HIF_UTILS_H
#define __HIF_UTILS_H
#include <glib.h>
gchar *hif_realpath (const gchar *path);
gboolean hif_remove_recursive (const gchar *directory,
GError **error);
#endif /* __HIF_UTILS_H */
|
"Read next frame from the pfs stream. See also help for pfsopen function.\n"
"\n"
"usage: new_pfs_struct = pfsget( pfs_struct );\n"
" pfs_struct - the structure returned by pfsopen or pfsget\n"
" new_pfs_struct - new structure with new fields containing channels and tags\n"
;
|
/*---------------------------------------------------------------------------*\
* OpenSG *
* *
* *
* Copyright (C) 2000-2002 by the OpenSG Forum *
* *
* www.opensg.org *
* *
* contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* License *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Library General Public License as published *
* by the Free Software Foundation, version 2. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* Changes *
* *
* *
* *
* *
* *
* *
\*---------------------------------------------------------------------------*/
/*****************************************************************************\
*****************************************************************************
** **
** This file is automatically generated. **
** **
** Any changes made to this file WILL be lost when it is **
** regenerated, which can become necessary at any time. **
** **
*****************************************************************************
\*****************************************************************************/
#ifndef _OSGLIGHTENVFIELDS_H_
#define _OSGLIGHTENVFIELDS_H_
#ifdef __sgi
#pragma once
#endif
#include <OSGConfig.h>
#include <OSGFieldContainerPtr.h>
#include <OSGNodeCoreFieldDataType.h>
#include <OSGSystemDef.h>
#include <OSGNodeCoreFields.h>
OSG_BEGIN_NAMESPACE
class LightEnv;
#if !defined(OSG_DO_DOC) // created as a dummy class, remove to prevent doubles
//! LightEnvPtr
typedef FCPtr<NodeCorePtr, LightEnv> LightEnvPtr;
#endif
#if !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
/*! \ingroup GrpSystemFieldTraits
*/
#if !defined(OSG_DOC_DEV_TRAITS)
/*! \hideinhierarchy */
#endif
template <>
struct FieldDataTraits<LightEnvPtr> :
public FieldTraitsRecurseMapper<LightEnvPtr, true>
{
static DataType _type;
enum { StringConvertable = 0x00 };
enum { bHasParent = 0x01 };
};
#if !defined(OSG_DOC_DEV_TRAITS)
/*! \class FieldTraitsRecurseMapper<LightEnvPtr, true>
\hideinhierarchy
*/
#endif
#endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
OSG_END_NAMESPACE
#define OSGLIGHTENVFIELDS_HEADER_CVSID "@(#)$Id: OSGLightEnvFields.h,v 1.8 2008/06/09 12:28:19 vossg Exp $"
#endif /* _OSGLIGHTENVFIELDS_H_ */
|
/* GLib testing framework examples and tests
*
* Copyright 2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*/
#include <gio/gio.h>
GMutex mutex_712570;
GCond cond_712570;
volatile gboolean finalized;
GType test_threaded_socket_service_get_type (void);
typedef GThreadedSocketService TestThreadedSocketService;
typedef GThreadedSocketServiceClass TestThreadedSocketServiceClass;
G_DEFINE_TYPE (TestThreadedSocketService, test_threaded_socket_service, G_TYPE_THREADED_SOCKET_SERVICE);
static void
test_threaded_socket_service_init (TestThreadedSocketService *service)
{
}
static void
test_threaded_socket_service_finalize (GObject *object)
{
G_OBJECT_CLASS (test_threaded_socket_service_parent_class)->finalize (object);
/* Signal the main thread that finalization completed successfully
* rather than hanging.
*/
finalized = TRUE;
g_cond_signal (&cond_712570);
g_mutex_unlock (&mutex_712570);
}
static void
test_threaded_socket_service_class_init (TestThreadedSocketServiceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = test_threaded_socket_service_finalize;
}
static gboolean
connection_cb (GThreadedSocketService *service,
GSocketConnection *connection,
GObject *source_object,
gpointer user_data)
{
/* Block until the main thread has dropped its ref to @service, so that we
* will drop the final ref from this thread.
*/
g_mutex_lock (&mutex_712570);
/* The service should now have 1 ref owned by the current "run"
* signal emission, and another added by GThreadedSocketService for
* this thread. Both will be dropped after we return.
*/
g_assert_cmpint (G_OBJECT (service)->ref_count, ==, 2);
return FALSE;
}
static void
client_connected_cb (GObject *client,
GAsyncResult *result,
gpointer user_data)
{
GMainLoop *loop = user_data;
GSocketConnection *conn;
GError *error = NULL;
conn = g_socket_client_connect_finish (G_SOCKET_CLIENT (client), result, &error);
g_assert_no_error (error);
g_object_unref (conn);
g_main_loop_quit (loop);
}
static void
test_threaded_712570 (void)
{
GSocketService *service;
GSocketAddress *addr, *listening_addr;
GMainLoop *loop;
GSocketClient *client;
GError *error = NULL;
g_test_bug ("712570");
g_mutex_lock (&mutex_712570);
service = g_object_new (test_threaded_socket_service_get_type (), NULL);
addr = g_inet_socket_address_new_from_string ("127.0.0.1", 0);
g_socket_listener_add_address (G_SOCKET_LISTENER (service),
addr,
G_SOCKET_TYPE_STREAM,
G_SOCKET_PROTOCOL_TCP,
NULL,
&listening_addr,
&error);
g_assert_no_error (error);
g_object_unref (addr);
g_signal_connect (service, "run", G_CALLBACK (connection_cb), NULL);
loop = g_main_loop_new (NULL, FALSE);
client = g_socket_client_new ();
g_socket_client_connect_async (client,
G_SOCKET_CONNECTABLE (listening_addr),
NULL,
client_connected_cb, loop);
g_object_unref (client);
g_object_unref (listening_addr);
g_main_loop_run (loop);
g_main_loop_unref (loop);
/* Stop the service and then wait for it to asynchronously cancel
* its outstanding accept() call (and drop the associated ref).
* At least one main context iteration is required in some circumstances
* to ensure that the cancellation actually happens.
*/
g_socket_service_stop (G_SOCKET_SERVICE (service));
do
g_main_context_iteration (NULL, TRUE);
while (G_OBJECT (service)->ref_count > 3);
/* Drop our ref, then unlock the mutex and wait for the service to be
* finalized. (Without the fix for 712570 it would hang forever here.)
*/
g_object_unref (service);
while (!finalized)
g_cond_wait (&cond_712570, &mutex_712570);
g_mutex_unlock (&mutex_712570);
}
int
main (int argc,
char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
g_test_add_func ("/socket-listener/threaded/712570", test_threaded_712570);
return g_test_run();
}
|
/*
* Copyright © 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Authored by: Tomas Frydrych <tf@linux.intel.com>
*/
#include "config.h"
#include "yts-message.h"
#include "yts-metadata-internal.h"
static void yts_message_dispose (GObject *object);
static void yts_message_finalize (GObject *object);
static void yts_message_constructed (GObject *object);
static void yts_message_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void yts_message_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (YtsMessage, yts_message, YTS_TYPE_METADATA);
#define YTS_MESSAGE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), YTS_TYPE_MESSAGE, YtsMessagePrivate))
struct _YtsMessagePrivate
{
guint disposed : 1;
};
enum
{
N_SIGNALS,
};
enum
{
PROP_0,
};
/*static guint signals[N_SIGNALS] = {0};*/
static void
yts_message_class_init (YtsMessageClass *klass)
{
GObjectClass *object_class = (GObjectClass *)klass;
g_type_class_add_private (klass, sizeof (YtsMessagePrivate));
object_class->dispose = yts_message_dispose;
object_class->finalize = yts_message_finalize;
object_class->constructed = yts_message_constructed;
object_class->get_property = yts_message_get_property;
object_class->set_property = yts_message_set_property;
}
static void
yts_message_constructed (GObject *object)
{
if (G_OBJECT_CLASS (yts_message_parent_class)->constructed)
G_OBJECT_CLASS (yts_message_parent_class)->constructed (object);
}
static void
yts_message_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
yts_message_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
yts_message_init (YtsMessage *self)
{
self->priv = YTS_MESSAGE_GET_PRIVATE (self);
}
static void
yts_message_dispose (GObject *object)
{
YtsMessage *self = (YtsMessage*) object;
YtsMessagePrivate *priv = self->priv;
if (priv->disposed)
return;
priv->disposed = TRUE;
G_OBJECT_CLASS (yts_message_parent_class)->dispose (object);
}
static void
yts_message_finalize (GObject *object)
{
G_OBJECT_CLASS (yts_message_parent_class)->finalize (object);
}
/**
* yts_message_new:
* @attributes: NULL terminated array of name/value pairs; can be %NULL
*
* Constructs a new #YtsMessage object, setting the top level attributes.
*
* Returns: (transfer full): newly allocated #YtsMessage object.
*/
YtsMessage *
yts_message_new (const char ** attributes)
{
RestXmlNode *top = rest_xml_node_add_child (NULL, "message");
YtsMetadata *mdata;
g_return_val_if_fail (top, NULL);
mdata = yts_metadata_new_from_node (top, attributes);
g_return_val_if_fail (YTS_IS_MESSAGE (mdata), NULL);
return (YtsMessage*) mdata;
}
|
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef ESHELBYTENSOR_H
#define ESHELBYTENSOR_H
#include "Material.h"
#include "DerivativeMaterialInterface.h"
class RankTwoTensor;
/**
* EshelbyTensor defines a strain increment and rotation increment, for finite strains.
*/
class EshelbyTensor : public DerivativeMaterialInterface<Material>
{
public:
EshelbyTensor(const InputParameters & parameters);
virtual void initQpStatefulProperties() override;
virtual void computeQpProperties() override;
protected:
std::string _base_name;
MaterialProperty<Real> & _sed;
const MaterialProperty<Real> & _sed_old;
MaterialProperty<RankTwoTensor> & _eshelby_tensor;
const MaterialProperty<RankTwoTensor> & _stress;
const MaterialProperty<RankTwoTensor> & _stress_old;
const MaterialProperty<RankTwoTensor> & _strain_increment;
std::vector<const VariableGradient *> _grad_disp;
MaterialProperty<RealVectorValue> & _J_thermal_term_vec;
const bool _has_temp;
const VariableGradient & _grad_temp;
const MaterialProperty<RankTwoTensor> * _total_deigenstrain_dT;
};
#endif // ESHELBYTENSOR_H
|
#ifndef __HDF_ARRAY_H__
#define __HDF_ARRAY_H__
#include "hdf5.h"
class HdfArray
{
public:
HdfArray();
~HdfArray();
public:
void set_shape(hid_t type_id, int rank, int *shape);
public:
int create(hid_t loc_id, const char *name, const char *title);
int open(hid_t loc_id, const char *name);
public:
int read(hid_t loc_id, const char *name);
int write(hid_t loc_id, const char *name);
public:
int slice_read(int start, int end);
int slice_write(int start, int end);
public:
int rank;
hsize_t *shape;
hid_t type_id;
void *data;
public:
hid_t dataset_id;
hsize_t *offset;
hsize_t *stride;
hsize_t *count;
hsize_t *block;
private:
HdfArray(const HdfArray &);
};
#endif
|
/**
* @file writer_file.h
* @brief SCEW writer functions for files
* @author Aleix Conchillo Flaque <aconchillo@gmail.com>
* @date Thu Nov 13, 2008 11:01
* @ingroup SCEWWriterFile
*
* @if copyright
*
* Copyright (C) 2008-2009 Aleix Conchillo Flaque
*
* SCEW is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SCEW is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* @endif
*/
/**
* @defgroup SCEWWriterFile Files
* Write data to files.
* @ingroup SCEWWriter
*/
#ifndef WRITER_FILE_H_0811131101
#define WRITER_FILE_H_0811131101
#include "export.h"
#include "writer.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* Creates a new SCEW writer for the given file name. This routine
* will create a new file if the file does not exist or it will
* overwrite the existing one. The file will be created in text
* mode. Once the writer is created, the @ref SCEWWriter routines must
* be called in order to store data to the file or to know the file
* status.
*
* For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order
* Mask) is automatically handled by the Windows API.
*
* @pre file_name != NULL
*
* @param file_name the file name to create for the new SCEW writer.
*
* @return a new SCEW writer for the given file name or NULL if the
* writer could not be created (e.g. memory allocation, file
* permissions, etc.).
*
* @ingroup SCEWWriterFile
*/
extern SCEW_API scew_writer* scew_writer_file_create (char const *file_name);
/**
* Creates a new SCEW writer for the given @a file stream. The file
* stream is created in text mode. Once the writer is created, any of
* the @ref SCEWWriter routines must be called in order to store data
* to the file or to know the file status.
*
* For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order
* Mask) is automatically handled by the Windows API.
*
* @pre file != NULL
*
* @param file the file where the new SCEW writer will write to.
*
* @return a new SCEW writer for the given file stream or NULL if the
* writer could not be created (e.g. memory allocation, file
* permissions, etc.).
*
* @ingroup SCEWWriterFile
*/
extern SCEW_API scew_writer* scew_writer_fp_create (FILE *file);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* WRITER_FILE_H_0811131101 */
|
#ifndef INCLUDED_KVU_RTCAPS_H
#define INCLUDED_KVU_RTCAPS_H
bool kvu_check_for_sched_fifo(void);
bool kvu_check_for_sched_rr(void);
bool kvu_check_for_mlockall(void);
int kvu_set_thread_scheduling(int policy, int priority);
#endif /* INCLUDED_KVU_RTCAPS_H */
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QREMOTESERVICEREGISTERENTRY_P_H
#define QREMOTESERVICEREGISTERENTRY_P_H
#include <QExplicitlySharedDataPointer>
#include <QString>
#include "qremoteserviceregister.h"
QTM_BEGIN_NAMESPACE
class QRemoteServiceRegisterEntryPrivate : public QSharedData
{
public:
QRemoteServiceRegisterEntryPrivate()
: meta(0), cptr(0), instanceType(QRemoteServiceRegister::PrivateInstance)
{
}
QRemoteServiceRegisterEntryPrivate(QRemoteServiceRegisterEntryPrivate &other)
: QSharedData(other), iface(other.iface),
service(other.service), ifaceVersion(other.ifaceVersion),
meta(other.meta), cptr(other.cptr), instanceType(other.instanceType)
{
}
QString iface;
QString service;
QString ifaceVersion;
const QMetaObject* meta;
QRemoteServiceRegister::CreateServiceFunc cptr;
QRemoteServiceRegister::InstanceType instanceType;
};
QTM_END_NAMESPACE
#endif
|
#ifndef COMPILE_CONTEXT_H_
#define COMPILE_CONTEXT_H_
#include <unordered_map>
#include "core/string/string.h"
#include "yasc/common/literaltable.h"
#include "compileinterfacetable.h"
#include "compilelog.h"
class ASTClass;
class ASTFunction;
class Compiler;
class CompileContext
{
typedef std::unordered_map<String, ASTClass*> ClassMap;
public:
explicit CompileContext(Compiler& compiler);
~CompileContext();
// get/set
CompileLog& getLog();
const LiteralTable& getLiteralTable() const;
LiteralTable& getLiteralTable();
Compiler& getCompiler();
// query
bool hasClass(const String& classname) const;
// operations
void addClass(ASTClass* pclass);
void addInterface(ASTClass& interfce);
bool loadClass(const String& classname);
// search
const ASTClass* findClass(const String& classname) const;
ASTClass* findClass(const String& name);
const ASTClass& resolveClass(const String& classname) const;
ASTClass& resolveClass(const String& classname);
const ASTFunction& resolveFunction(const String& call) const;
private:
// operations
void insertInternalTypes();
void loadBaseAndInterfaces(ASTClass* pclass);
// data
Compiler& mCompiler;
ClassMap mClasses;
CompileInterfaceTable mInterfaces;
LiteralTable mLiteralTable;
CompileLog mLog;
};
#endif // COMPILE_CONTEXT_H_
|
/*
Copyright 2010 Dally Richard
This file is part of QNetSoul.
QNetSoul is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QNetSoul is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QNetSoul. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QNETSOUL_H_
#define QNETSOUL_H_
#include <QAbstractSocket>
#include <QSystemTrayIcon>
#include "AddContact.h"
#include "ui_QNetsoul.h"
class Chat;
class QTimer;
class QAction;
class Network;
class Pastebin;
class TrayIcon;
class VieDeMerde;
class SlidingPopup;
class InternUpdater;
class OptionsWidget;
class ChuckNorrisFacts;
class PortraitResolver;
class PluginsManager;
class QNetsoul : public QMainWindow, public Ui_QNetsoul
{
Q_OBJECT
public:
QNetsoul(void);
~QNetsoul(void);
static void openOptionsDialog(OptionsWidget* options,
const int currentTab = -1,
QWidget* focus = NULL);
protected:
void closeEvent(QCloseEvent*);
private slots:
void connectToServer(void);
void ping(void);
void reconnect(void);
void disconnect(void);
void updateWidgets(const QAbstractSocket::SocketState&);
void openOptionsDialog(void);
void disableChats(const QString& login);
void saveStateBeforeQuiting(void);
void handleClicksOnTrayIcon(QSystemTrayIcon::ActivationReason);
void changeStatus(const QStringList& properties);
void updateContact(const QStringList& properties);
void showConversation(const QStringList&, const QString& msg = "");
void processHandShaking(int, QStringList);
void notifyTypingStatus(const int id, const bool typing);
void setPortrait(const QString&);
void aboutQNetSoul(void);
private:
Chat* getChat(const int id);
void disableChat(Chat* chat);
void resetAllContacts(void);
void readSettings(void);
void writeSettings(void);
void setupTrayIcon(void);
void connectQNetsoulModules(void);
void connectActionsSignals(void);
void connectNetworkSignals(void);
Chat* createWindowChat(const int, const QString&, const QString&);
void deleteAllWindowChats(void);
Network* _network;
OptionsWidget* _options;
TrayIcon* _trayIcon;
QHash<int, Chat*> _windowsChat;
QString _timeStamp;
QPoint _oldPos;
PortraitResolver* _portraitResolver;
Pastebin* _pastebin;
SlidingPopup* _popup;
VieDeMerde* _vdm;
ChuckNorrisFacts* _cnf;
QTimer* _ping;
InternUpdater* _internUpdater;
PluginsManager* _pluginsManager;
};
#endif // QNETSOUL_H_
|
// Created file "Lib\src\dxguid\X64\d3dxguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_ACTIVE_POWERSCHEME, 0x31f9f286, 0x5084, 0x42fe, 0xb7, 0x20, 0x2b, 0x02, 0x64, 0x99, 0x37, 0x63);
|
// Created file "Lib\src\Uuid\functiondiscovery"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_ALLOW_AWAYMODE, 0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87);
|
/* GStreamer
* Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu>
* Copyright (C) 2005 Edgard Lima <edgard.lima@indt.org.br>
* Copyright (C) 2005 Nokia Corporation <kai.vehmanen@nokia.com>
* Copyright (C) 2007,2008 Axis Communications <dev-gstreamer@axis.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <gst/rtp/gstrtpbuffer.h>
#include "gstrtpg726pay.h"
static const GstElementDetails gst_rtp_g726_pay_details =
GST_ELEMENT_DETAILS ("RTP packet payloader",
"Codec/Payloader/Network",
"Payload-encodes G.726 audio into a RTP packet",
"Axis Communications <dev-gstreamer@axis.com>");
static GstStaticPadTemplate gst_rtp_g726_pay_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-adpcm, "
"channels = (int) 1, "
"rate = (int) 8000, "
"bitrate = (int) { 16000, 24000, 32000, 40000 }, "
"layout = (string) \"g726\"")
);
static GstStaticPadTemplate gst_rtp_g726_pay_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"audio\", "
"payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", "
"clock-rate = (int) 8000, "
"encoding-name = (string) { \"G726-16\", \"G726-24\", \"G726-32\", \"G726-40\" } ")
);
static gboolean gst_rtp_g726_pay_setcaps (GstBaseRTPPayload * payload,
GstCaps * caps);
GST_BOILERPLATE (GstRtpG726Pay, gst_rtp_g726_pay, GstBaseRTPAudioPayload,
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD);
static void
gst_rtp_g726_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_g726_pay_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_g726_pay_src_template));
gst_element_class_set_details (element_class, &gst_rtp_g726_pay_details);
}
static void
gst_rtp_g726_pay_class_init (GstRtpG726PayClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gstbasertppayload_class->set_caps = gst_rtp_g726_pay_setcaps;
}
static void
gst_rtp_g726_pay_init (GstRtpG726Pay * rtpg726pay, GstRtpG726PayClass * klass)
{
GstBaseRTPAudioPayload *basertpaudiopayload;
basertpaudiopayload = GST_BASE_RTP_AUDIO_PAYLOAD (rtpg726pay);
GST_BASE_RTP_PAYLOAD (rtpg726pay)->clock_rate = 8000;
/* sample based codec */
gst_base_rtp_audio_payload_set_sample_based (basertpaudiopayload);
}
static gboolean
gst_rtp_g726_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
{
gchar *encoding_name;
GstStructure *structure = gst_caps_get_structure (caps, 0);
GstBaseRTPAudioPayload *basertpaudiopayload;
gint bitrate;
basertpaudiopayload = GST_BASE_RTP_AUDIO_PAYLOAD (payload);
if (!gst_structure_get_int (structure, "bitrate", &bitrate))
bitrate = 32000;
switch (bitrate) {
case 16000:
encoding_name = g_strdup ("G726-16");
gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload,
2);
break;
case 24000:
encoding_name = g_strdup ("G726-24");
gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload,
3);
break;
case 32000:
encoding_name = g_strdup ("G726-32");
gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload,
4);
break;
case 40000:
encoding_name = g_strdup ("G726-40");
gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload,
5);
break;
default:
goto invalid_bitrate;
}
gst_basertppayload_set_options (payload, "audio", TRUE, encoding_name, 8000);
gst_basertppayload_set_outcaps (payload, NULL);
g_free (encoding_name);
return TRUE;
/* ERRORS */
invalid_bitrate:
{
GST_ERROR_OBJECT (payload, "invalid bitrate %d specified", bitrate);
return FALSE;
}
}
gboolean
gst_rtp_g726_pay_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "rtpg726pay",
GST_RANK_NONE, GST_TYPE_RTP_G726_PAY);
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETINSIGHTSUMMARIESREQUEST_H
#define QTAWS_GETINSIGHTSUMMARIESREQUEST_H
#include "xrayrequest.h"
namespace QtAws {
namespace XRay {
class GetInsightSummariesRequestPrivate;
class QTAWSXRAY_EXPORT GetInsightSummariesRequest : public XRayRequest {
public:
GetInsightSummariesRequest(const GetInsightSummariesRequest &other);
GetInsightSummariesRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(GetInsightSummariesRequest)
};
} // namespace XRay
} // namespace QtAws
#endif
|
// Created file "Lib\src\Uuid\X64\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_STORAGE_MAX_OBJECT_SIZE, 0x01a3057a, 0x74d6, 0x4e80, 0xbe, 0xa7, 0xdc, 0x4c, 0x21, 0x2c, 0xe5, 0x0a);
|
/*
* The libcerror header wrapper
*
* Copyright (C) 2010-2021, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _FSCLFS_TEST_LIBCERROR_H )
#define _FSCLFS_TEST_LIBCERROR_H
#include <common.h>
/* Define HAVE_LOCAL_LIBCERROR for local use of libcerror
*/
#if defined( HAVE_LOCAL_LIBCERROR )
#include <libcerror_definitions.h>
#include <libcerror_error.h>
#include <libcerror_system.h>
#include <libcerror_types.h>
#else
/* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT
* before including libcerror.h
*/
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define LIBCERROR_DLL_IMPORT
#endif
#include <libcerror.h>
#endif /* defined( HAVE_LOCAL_LIBCERROR ) */
#endif /* !defined( _FSCLFS_TEST_LIBCERROR_H ) */
|
#ifndef __MFCUTILS_H__DECD7213_DA4C_477c_92EE_C4F07393C7C9
#define __MFCUTILS_H__DECD7213_DA4C_477c_92EE_C4F07393C7C9
#define RETRIEVE_CSTRING(function, cstring) \
{ \
_TCHAR *tszDummy = NULL; \
DWORD dwDummy = 0; \
##function(NULL, &dwDummy); \
dwDummy++; \
tszDummy = new _TCHAR[dwDummy]; \
##function(tszDummy, &dwDummy); \
##cstring = tszDummy; \
}
namespace MfcUtils {
void Localize(CWnd *pWnd, DWORD *adwIds);
}
#endif // __MFCUTILS_H__DECD7213_DA4C_477c_92EE_C4F07393C7C9
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_ROBOMAKERREQUEST_H
#define QTAWS_ROBOMAKERREQUEST_H
#include "core/awsabstractrequest.h"
#include "qtawsrobomakerglobal.h"
#include <QFlags>
#include <QObject>
class QNetworkRequest;
namespace QtAws {
namespace RoboMaker {
class RoboMakerRequestPrivate;
class QTAWSROBOMAKER_EXPORT RoboMakerRequest : public QtAws::Core::AwsAbstractRequest {
public:
/// Actions supported by RoboMaker.
enum Action {
BatchDeleteWorldsAction,
BatchDescribeSimulationJobAction,
CancelDeploymentJobAction,
CancelSimulationJobAction,
CancelSimulationJobBatchAction,
CancelWorldExportJobAction,
CancelWorldGenerationJobAction,
CreateDeploymentJobAction,
CreateFleetAction,
CreateRobotAction,
CreateRobotApplicationAction,
CreateRobotApplicationVersionAction,
CreateSimulationApplicationAction,
CreateSimulationApplicationVersionAction,
CreateSimulationJobAction,
CreateWorldExportJobAction,
CreateWorldGenerationJobAction,
CreateWorldTemplateAction,
DeleteFleetAction,
DeleteRobotAction,
DeleteRobotApplicationAction,
DeleteSimulationApplicationAction,
DeleteWorldTemplateAction,
DeregisterRobotAction,
DescribeDeploymentJobAction,
DescribeFleetAction,
DescribeRobotAction,
DescribeRobotApplicationAction,
DescribeSimulationApplicationAction,
DescribeSimulationJobAction,
DescribeSimulationJobBatchAction,
DescribeWorldAction,
DescribeWorldExportJobAction,
DescribeWorldGenerationJobAction,
DescribeWorldTemplateAction,
GetWorldTemplateBodyAction,
ListDeploymentJobsAction,
ListFleetsAction,
ListRobotApplicationsAction,
ListRobotsAction,
ListSimulationApplicationsAction,
ListSimulationJobBatchesAction,
ListSimulationJobsAction,
ListTagsForResourceAction,
ListWorldExportJobsAction,
ListWorldGenerationJobsAction,
ListWorldTemplatesAction,
ListWorldsAction,
RegisterRobotAction,
RestartSimulationJobAction,
StartSimulationJobBatchAction,
SyncDeploymentJobAction,
TagResourceAction,
UntagResourceAction,
UpdateRobotApplicationAction,
UpdateSimulationApplicationAction,
UpdateWorldTemplateAction,
};
Q_DECLARE_FLAGS(Actions, Action)
RoboMakerRequest(const Action action);
RoboMakerRequest(const RoboMakerRequest &other);
RoboMakerRequest &operator=(const RoboMakerRequest &other);
Action action() const;
QString actionString() const;
QString apiVersion() const;
void setAction(const Action action);
void setApiVersion(const QString &version);
virtual bool operator==(const RoboMakerRequest &other) const;
protected:
/// @cond internal
explicit RoboMakerRequest(RoboMakerRequestPrivate * const d);
/// @endcond
int clearParameter(const QString &name);
void clearParameters();
QVariant parameter(const QString &name, const QVariant &defaultValue = QVariant()) const;
const QVariantMap ¶meters() const;
void setParameter(const QString &name, const QVariant &value);
void setParameters(const QVariantMap ¶meters);
virtual QNetworkRequest unsignedRequest(const QUrl &endpoint) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(RoboMakerRequest)
};
} // namespace RoboMaker
} // namespace QtAws
#endif
|
#ifndef _GS_TYPES_H_
#define _GS_TYPES_H_
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef gchar* gsid;
typedef gchar* gskey;
typedef double gsreal;
typedef gboolean gsboolean;
#define GS_TRUE TRUE
#define GS_FALSE FALSE
/*
* Objects
*/
typedef struct _element GSElement;
typedef struct _node GSNode;
typedef struct _edge GSEdge;
typedef struct _graph GSGraph;
typedef struct _source GSSource;
typedef struct _sink GSSink;
typedef struct _iterator GSIterator;
/*
* Callbacks
*/
typedef void (*GSGraphCB)(GSGraph *node, void **data);
typedef void (*GSNodeCB)(gsid id, GSNode *node, void *data);
typedef void (*GSEdgeCB)(gsid id, GSEdge *edge, void *data);
typedef void (*GSKeyCB)(GSElement *element, gskey *key, void **data);
#define NODE_CALLBACK(function) ((GSNodeCB)function)
#define EDGE_CALLBACK(function) ((GSEdgeCB)function)
#define KEY_CALLBACK(function) ((GSKeyCB)function)
#include "gs_iterator.h"
#ifdef __cplusplus
}
#endif
#endif /* _GS_TYPES_H_ */
|
#include <ColorRecognition.h>
#include <ColorRecognitionTCS230PI.h>
void setup() {
Serial.begin(9600);
ColorRecognitionTCS230PI tcs230(2, 3, 4);
Serial.println("Adjust white color, show something white to the sensor and press y.");
while(!Serial.available() && Serial.read() != 'y');
Serial.read();
Serial.println("Adjusting...");
tcs230.adjustWhiteBalance();
Serial.println("Adjust black color, show something black to the sensor and press y.");
while(!Serial.available() && Serial.read() != 'y');
Serial.read();
Serial.println("Adjusting...");
tcs230.adjustBlackBalance();
while (1) {
Serial.print("Read: ");
Serial.println(tcs230.getRed());
Serial.print("Green: ");
Serial.println(tcs230.getGreen());
Serial.print("Blue ");
Serial.println(tcs230.getBlue());
delay(3000);
}
}
void loop() {
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_ACCEPTADMINISTRATORINVITATIONRESPONSE_H
#define QTAWS_ACCEPTADMINISTRATORINVITATIONRESPONSE_H
#include "securityhubresponse.h"
#include "acceptadministratorinvitationrequest.h"
namespace QtAws {
namespace SecurityHub {
class AcceptAdministratorInvitationResponsePrivate;
class QTAWSSECURITYHUB_EXPORT AcceptAdministratorInvitationResponse : public SecurityHubResponse {
Q_OBJECT
public:
AcceptAdministratorInvitationResponse(const AcceptAdministratorInvitationRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const AcceptAdministratorInvitationRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(AcceptAdministratorInvitationResponse)
Q_DISABLE_COPY(AcceptAdministratorInvitationResponse)
};
} // namespace SecurityHub
} // namespace QtAws
#endif
|
// Created file "Lib\src\mfuuid\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(MF_PD_NET_BROADCAST, 0xb13f98ea, 0xa3e1, 0x4714, 0x83, 0xc7, 0x0e, 0x3e, 0xfa, 0x39, 0xa1, 0x8a);
|
#pragma once
#include "SFML//Graphics.hpp"
#include "SFML//System.hpp"
#include "SFML//Window.hpp"
#include "SFML//Config.hpp"
#include <vector>
#include "Math.h"
namespace SATGame
{
class Polygon
{
private:
sf::Shape m_PolygonShape;
std::vector<sf::Vector2<float>> m_Points;
//First element Middle Point of segment, Second element displacement from middle(ie normal)
std::vector<std::pair<sf::Vector2<float>, sf::Vector2<float>>> m_NormalsVector;
sf::Vector2<float> m_Center;
sf::Vector3<float> m_z;
sf::Color m_Color;
static bool SAT_Polygon(const Polygon& A, const Polygon& B);
void _DrawArrow(sf::RenderWindow& RW, sf::Vector2<float>& Vec1, sf::Vector2<float>& Vec2, sf::Color color, float scale);
sf::String m_Text;
public:
Polygon();
Polygon(sf::Color color);
void CheckCollision(std::vector<Polygon*> possibleColliding);
void ResolveCollision(const sf::Vector2<float>& Normal);
bool IsInside(const sf::Vector2<float>& Point);
void Draw(sf::RenderWindow& Wnd);
void AddPoint(sf::Vector2<float>& Point, sf::Color Color );
void SetPosition(sf::Vector2<float>& Position);
void SetCenter(sf::Vector2<float>& Center);
};
} |
/* radare - LGPL - Copyright 2009-2017 - pancake */
#include "r_config.h"
#include "r_core.h"
#include "r_print.h"
static const char *help_msg_P[] = {
"Usage:", "P[?osi] [file]", "Project management",
"P", "", "list all projects",
"Pc", " [file]", "show project script to console",
"Pd", " [file]", "delete project",
"Pi", " [file]", "show project information",
"Pn", "[j]", "show project notes (Pnj for json)",
"Pn", " [base64]", "set notes text",
"Pn", " -", "edit notes with cfg.editor",
"Po", " [file]", "open project",
"Ps", " [file]", "save project",
"PS", " [file]", "save script file",
"P-", " [file]", "delete project (alias for Pd)",
"NOTE:", "", "See 'e??prj.'",
"NOTE:", "", "project are stored in ~/.config/radare2/projects",
NULL
};
static const char *help_msg_Pn[] = {
"Usage:", "Pn[j-?] [...]", "Project Notes",
"Pn", "", "show project notes",
"Pn", " -", "edit notes with cfg.editor",
"Pn-", "", "delete notes",
"Pn-", "str", "delete lines matching /str/ in notes",
"Pn+", "str", "append one line to the notes",
"Pnj", "", "show notes in base64",
"Pnj", " [base64]", "set notes in base64",
"Pnx", "", "run project note commands",
NULL
};
static void cmd_project_init(RCore *core) {
DEFINE_CMD_DESCRIPTOR (core, P);
DEFINE_CMD_DESCRIPTOR (core, Pn);
}
static int cmd_project(void *data, const char *input) {
RCore *core = (RCore *) data;
const char *file, *arg = (input && *input)? input + 1: NULL;
const char *fileproject = r_config_get (core->config, "prj.name");
char *str = NULL;
if (!input) {
return false;
}
str = strdup (fileproject);
arg = strchr (input, ' ');
if (arg) {
arg++;
} else {
if (*input) {
arg = input + 1;
if (*arg == '&') {
arg++;
}
}
}
file = arg;
switch (input[0]) {
case 'c':
if (input[1] == ' ') {
r_core_project_cat (core, input + 2);
} else {
eprintf ("Usage: Pc [prjname]\n");
}
break;
case 'o':
// if (r_file_is_regular (file))
if (input[1] == '&') {
r_core_project_open (core, file, true);
} else if (input[1]) {
r_core_project_open (core, file, false);
} else {
if (file && *file) {
r_cons_println (file);
}
}
break;
case 'd':
case '-':
r_core_project_delete (core, file);
break;
case 's':
if (!file || !file[0]) { /* if no argument specified use current project */
file = str;
}
if (r_core_project_save (core, file)) {
r_cons_println (file);
}
break;
case 'S':
if (input[1] == ' ') {
r_core_project_save_rdb (core, input + 2, R_CORE_PRJ_ALL);
} else {
eprintf ("Usage: PS [file]\n");
}
break;
case 'n': // "Pn"
if (input[1] == '?') {
r_core_cmd_help (core, help_msg_Pn);
} else if (!fileproject || !*fileproject) {
eprintf ("No project\n");
} else {
switch (input[1]) {
case '-': // "Pn-"
/* remove lines containing specific words */
{
FILE *fd = r_sandbox_fopen (str, "w");
if (!fd) {
eprintf ("Cannot open %s\n", str);
} else {
char *str = r_core_project_notes_file (core, fileproject);
char *data = r_file_slurp (str, NULL);
int del = 0;
if (data) {
char *ptr, *nl;
for (ptr = data; ptr; ptr = nl) {
nl = strchr (ptr, '\n');
if (nl) {
*nl++ = 0;
if (strstr (ptr, input + 2)) {
del++;
} else {
fprintf (fd, "%s\n", ptr);
}
}
}
free (data);
}
if (del > 0) {
eprintf ("Deleted %d lines\n", del);
}
free (str);
fclose (fd);
}
}
break;
case ' ': // "Pn "
if (input[2] == '-') {
char *str = r_core_project_notes_file (core, fileproject);
// edit with cfg.editor
const char *editor = r_config_get (core->config, "cfg.editor");
if (str && *str && editor && *editor) {
r_sys_cmdf ("%s %s", editor, str);
} else {
eprintf ("No cfg.editor configured\n");
}
free (str);
} else {
// char *str = r_core_project_notes_file (core, fileproject);
// append line to project notes
char *str = r_core_project_notes_file (core, fileproject);
char *data = r_file_slurp (str, NULL);
FILE *fd = r_sandbox_fopen (str, "a");
if (fd) {
fprintf (fd, "%s\n", input + 2);
fclose (fd);
}
free (str);
free (data);
}
break;
case '+': // "Pn+"
{
char *str = r_core_project_notes_file (core, fileproject);
char *data = r_file_slurp (str, NULL);
data = r_str_append (data, input + 2);
data = r_str_append (data, "\n");
r_file_dump (str, (const ut8*)data, strlen (data), false);
free (data);
free (str);
}
break;
case 'j': // "Pnj"
if (!input[2]) {
int len = 0;
/* get base64 string */
char *str = r_core_project_notes_file (core, fileproject);
if (str) {
char *data = r_file_slurp (str, &len);
char *res = r_base64_encode_dyn (data, len);
if (res) {
r_cons_println (res);
free (res);
}
free (data);
free (str);
}
} else if (input[2] == ' ') {
/* set base64 string */
ut8 *data = r_base64_decode_dyn (input + 3, -1);
if (data) {
char *str = r_core_project_notes_file (core, fileproject);
if (str) {
r_file_dump (str, data, strlen ((const char *) data), 0);
free (str);
}
free (data);
}
} else {
eprintf ("Usage: `Pnj` or `Pnj ...`\n");
}
break;
case 'x': // "Pnx"
r_core_project_execute_cmds (core, fileproject);
break;
case 0: // "Pn"
{
char *str = r_core_project_notes_file (core, fileproject);
char *data = r_file_slurp (str, NULL);
if (data) {
r_cons_println (data);
free (data);
}
free (str);
}
break;
}
}
break;
case 'i':
if (file && *file) {
char *prjName = r_core_project_info (core, file);
r_cons_println (prjName);
free (prjName);
}
break;
case 0:
case 'j':
r_core_project_list (core, input[0]);
break;
default:
r_core_cmd_help (core, help_msg_P);
break;
}
free (str);
return true;
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_STARTDEPLOYMENTREQUEST_P_H
#define QTAWS_STARTDEPLOYMENTREQUEST_P_H
#include "appconfigrequest_p.h"
#include "startdeploymentrequest.h"
namespace QtAws {
namespace AppConfig {
class StartDeploymentRequest;
class StartDeploymentRequestPrivate : public AppConfigRequestPrivate {
public:
StartDeploymentRequestPrivate(const AppConfigRequest::Action action,
StartDeploymentRequest * const q);
StartDeploymentRequestPrivate(const StartDeploymentRequestPrivate &other,
StartDeploymentRequest * const q);
private:
Q_DECLARE_PUBLIC(StartDeploymentRequest)
};
} // namespace AppConfig
} // namespace QtAws
#endif
|
//
// ExpModel.h
// BC2014Oscv0.0
//
// Created by Nicolas Winckler on 3/9/14.
// Copyright (c) 2014 Nicolas Winckler. All rights reserved.
//
#ifndef __BC2014Oscv0_0__ExpModel__
#define __BC2014Oscv0_0__ExpModel__
#include <iostream>
#include <BAT/BCDataPoint.h>
#include <BAT/BCParameter.h>
#include <BAT/BCMath.h>
#include <BAT/BCModel.h>
#include "TMath.h"
#include <cmath>
#include "SIDSProgOptions.h"
typedef SIDSProgOptions SIDSConfig;
class ExpModel : public BCModel
{
public:
ExpModel();
ExpModel(SIDSConfig* config);
~ExpModel ( );
bool use_maxLogL;
// Methods to overload
void DefineParameters();
double LogLikelihood(const std::vector<double> ¶meters);
// void MCMCIterationInterface();
void SetMyDataSet(BCDataSet* dataset, double unit=1);
double GetMaximumLogLikelihood(){return fMaxLogL;}
private :
double fxmin;
double fxmax;
double fSampleMean;
double fMaxLogL;
};
#endif /* defined(__BC2014Oscv0_0__ExpModel__) */
|
//
// Created by Jesse Squires
// http://www.jessesquires.com
//
//
// Documentation
// http://cocoadocs.org/docsets/JSQMessagesViewController
//
//
// GitHub
// https://github.com/jessesquires/JSQMessagesViewController
//
//
// License
// Copyright (c) 2014 Jesse Squires
// Released under an MIT license: http://opensource.org/licenses/MIT
//
#import "CCJSQMediaItem.h"
#import "CCJSQAudioMediaViewAttributes.h"
#import <AVFoundation/AVFoundation.h>
@class CCJSQAudioMediaItem;
NS_ASSUME_NONNULL_BEGIN
@protocol CCJSQAudioMediaItemDelegate <NSObject>
/**
* Tells the delegate if the specified `CCJSQAudioMediaItem` changes the sound category or categoryOptions, or if an error occurs.
*/
- (void)audioMediaItem:(CCJSQAudioMediaItem *)audioMediaItem
didChangeAudioCategory:(NSString *)category
options:(AVAudioSessionCategoryOptions)options
error:(nullable NSError *)error;
@end
/**
* The `CCJSQAudioMediaItem` class is a concrete `CCJSQMediaItem` subclass that implements the `CCJSQMessageMediaData` protocol
* and represents an audio media message. An initialized `CCJSQAudioMediaItem` object can be passed
* to a `CCJSQMediaMessage` object during its initialization to construct a valid media message object.
* You may wish to subclass `CCJSQAudioMediaItem` to provide additional functionality or behavior.
*/
@interface CCJSQAudioMediaItem : CCJSQMediaItem <CCJSQMessageMediaData, AVAudioPlayerDelegate, NSCoding, NSCopying>
/**
* The delegate object for audio event notifications.
*/
@property (nonatomic, weak, nullable) id<CCJSQAudioMediaItemDelegate> delegate;
/**
* The view attributes to configure the appearance of the audio media view.
*/
@property (nonatomic, strong, readonly) CCJSQAudioMediaViewAttributes *audioViewAttributes;
/**
* A data object that contains an audio resource.
*/
@property (nonatomic, strong, nullable) NSData *audioData;
/**
* Initializes and returns a audio media item having the given audioData.
*
* @param audioData The data object that contains the audio resource.
* @param audioViewConfiguration The view attributes to configure the appearance of the audio media view.
*
* @return An initialized `CCJSQAudioMediaItem`.
*
* @discussion If the audio must be downloaded from the network,
* you may initialize a `CCJSQVideoMediaItem` with a `nil` audioData.
* Once the audio is available you can set the `audioData` property.
*/
- (instancetype)initWithData:(nullable NSData *)audioData
audioViewAttributes:(CCJSQAudioMediaViewAttributes *)audioViewAttributes NS_DESIGNATED_INITIALIZER;
/**
* Initializes and returns a default audio media item.
*
* @return An initialized `CCJSQAudioMediaItem`.
*
* @discussion You must set `audioData` to enable the play button.
*/
- (instancetype)init;
/**
Initializes and returns a default audio media using the specified view attributes.
@param audioViewAttributes The view attributes to configure the appearance of the audio media view.
@return An initialized `CCJSQAudioMediaItem`.
*/
- (instancetype)initWithAudioViewAttributes:(CCJSQAudioMediaViewAttributes *)audioViewAttributes;
/**
* Initializes and returns an audio media item having the given audioData.
*
* @param audioData The data object that contains the audio resource.
*
* @return An initialized `CCJSQAudioMediaItem`.
*
* @discussion If the audio must be downloaded from the network,
* you may initialize a `CCJSQAudioMediaItem` with a `nil` audioData.
* Once the audio is available you can set the `audioData` property.
*/
- (instancetype)initWithData:(nullable NSData *)audioData;
/**
* Sets or updates the data object in an audio media item with the data specified at audioURL.
*
* @param audioURL A File URL containing the location of the audio data.
*/
- (void)setAudioDataWithUrl:(nonnull NSURL *)audioURL;
@end
NS_ASSUME_NONNULL_END
|
// Created file "Lib\src\Uuid\X64\i_activscp"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IActiveScriptSIPInfo, 0x764651d0, 0x38de, 0x11d4, 0xa2, 0xa3, 0x00, 0x10, 0x4b, 0xd3, 0x50, 0x90);
|
// Created file "Lib\src\Uuid\X64\imapi2uuid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_FsiFileItem, 0x2c941fc7, 0x975b, 0x59be, 0xa9, 0x60, 0x9a, 0x2a, 0x26, 0x28, 0x53, 0xa5);
|
// Created file "Lib\src\Uuid\X64\iid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_GetSecurityCallContextAppObject, 0xecabb0a8, 0x7f19, 0x11d2, 0x97, 0x8e, 0x00, 0x00, 0xf8, 0x75, 0x7e, 0x2a);
|
// Copyright (c) 2014 - 2020 Maksym V. Bilinets.
//
// This file is part of Dataflow++.
//
// Dataflow++ is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Dataflow++ 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 Dataflow++. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "dataflow++_export.h"
#include "node_t.h"
#include "nodes_factory.h"
#include "ref.h"
#include <dataflow/utility/std_future.h>
namespace dataflow
{
namespace internal
{
DATAFLOW___EXPORT update_status
update_node_selector_activator(node_id id, node_id x, bool initialized);
template <typename Policy, typename X, typename... Xs>
class node_selector_activator final : public node_t<X>, Policy
{
friend class nodes_factory;
public:
static ref create(Policy policy, const ref& x, ref_t<Xs>... xs)
{
DATAFLOW___CHECK_PRECONDITION(check_all_of(
x.template is_of_type<X>(), xs.template is_of_type<Xs>()...));
const std::array<node_id, 1 + sizeof...(Xs)> args = {{x.id(), xs.id()...}};
return nodes_factory::create<node_selector_activator<Policy, X, Xs...>>(
&args[0], args.size(), node_flags::none, std::move(policy));
}
private:
explicit node_selector_activator(Policy policy)
: Policy(std::move(policy))
{
}
template <typename... Args, std::size_t... Is>
ref calculate_(const node** p_args, const std14::index_sequence<Is...>&)
{
return Policy::calculate(extract_node_value<Args>(p_args[Is])...);
}
virtual update_status update_(node_id id,
bool initialized,
const node** p_args,
std::size_t args_count) override
{
DATAFLOW___CHECK_PRECONDITION(p_args != nullptr);
DATAFLOW___CHECK_PRECONDITION(args_count == 1 + sizeof...(Xs));
const auto& v = extract_node_value<X>(p_args[0]);
const auto status = this->set_value_(v);
const auto x = calculate_<X, Xs...>(
p_args, std14::make_index_sequence<1 + sizeof...(Xs)>());
return status | update_node_selector_activator(id, x.id(), initialized);
}
virtual std::string label_() const override
{
return "selector-activator";
}
virtual std::pair<std::size_t, std::size_t> mem_info_() const override final
{
return std::make_pair(sizeof(*this), alignof(decltype(*this)));
}
};
} // internal
} // dataflow
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTEVENTSRESPONSE_H
#define QTAWS_LISTEVENTSRESPONSE_H
#include "devopsgururesponse.h"
#include "listeventsrequest.h"
namespace QtAws {
namespace DevOpsGuru {
class ListEventsResponsePrivate;
class QTAWSDEVOPSGURU_EXPORT ListEventsResponse : public DevOpsGuruResponse {
Q_OBJECT
public:
ListEventsResponse(const ListEventsRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const ListEventsRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(ListEventsResponse)
Q_DISABLE_COPY(ListEventsResponse)
};
} // namespace DevOpsGuru
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_CREATEFIELDLEVELENCRYPTIONPROFILERESPONSE_H
#define QTAWS_CREATEFIELDLEVELENCRYPTIONPROFILERESPONSE_H
#include "cloudfrontresponse.h"
#include "createfieldlevelencryptionprofilerequest.h"
namespace QtAws {
namespace CloudFront {
class CreateFieldLevelEncryptionProfileResponsePrivate;
class QTAWSCLOUDFRONT_EXPORT CreateFieldLevelEncryptionProfileResponse : public CloudFrontResponse {
Q_OBJECT
public:
CreateFieldLevelEncryptionProfileResponse(const CreateFieldLevelEncryptionProfileRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const CreateFieldLevelEncryptionProfileRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(CreateFieldLevelEncryptionProfileResponse)
Q_DISABLE_COPY(CreateFieldLevelEncryptionProfileResponse)
};
} // namespace CloudFront
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_CREATEVPCPEERINGCONNECTIONRESPONSE_H
#define QTAWS_CREATEVPCPEERINGCONNECTIONRESPONSE_H
#include "ec2response.h"
#include "createvpcpeeringconnectionrequest.h"
namespace QtAws {
namespace EC2 {
class CreateVpcPeeringConnectionResponsePrivate;
class QTAWSEC2_EXPORT CreateVpcPeeringConnectionResponse : public Ec2Response {
Q_OBJECT
public:
CreateVpcPeeringConnectionResponse(const CreateVpcPeeringConnectionRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const CreateVpcPeeringConnectionRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(CreateVpcPeeringConnectionResponse)
Q_DISABLE_COPY(CreateVpcPeeringConnectionResponse)
};
} // namespace EC2
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETSERVICELINKEDROLEDELETIONSTATUSREQUEST_P_H
#define QTAWS_GETSERVICELINKEDROLEDELETIONSTATUSREQUEST_P_H
#include "iamrequest_p.h"
#include "getservicelinkedroledeletionstatusrequest.h"
namespace QtAws {
namespace IAM {
class GetServiceLinkedRoleDeletionStatusRequest;
class GetServiceLinkedRoleDeletionStatusRequestPrivate : public IamRequestPrivate {
public:
GetServiceLinkedRoleDeletionStatusRequestPrivate(const IamRequest::Action action,
GetServiceLinkedRoleDeletionStatusRequest * const q);
GetServiceLinkedRoleDeletionStatusRequestPrivate(const GetServiceLinkedRoleDeletionStatusRequestPrivate &other,
GetServiceLinkedRoleDeletionStatusRequest * const q);
private:
Q_DECLARE_PUBLIC(GetServiceLinkedRoleDeletionStatusRequest)
};
} // namespace IAM
} // namespace QtAws
#endif
|
/*
* Copyright (c) 2014-2016 Alex Spataru <alex_spataru@outlook.com>
*
* This file is part of the QSimpleUpdater library, which is released under
* the DBAD license, you can read a copy of it below:
*
* DON'T BE A DICK PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING,
* DISTRIBUTION AND MODIFICATION:
*
* Do whatever you like with the original work, just don't be a dick.
* Being a dick includes - but is not limited to - the following instances:
*
* 1a. Outright copyright infringement - Don't just copy this and change the
* name.
* 1b. Selling the unmodified original with no work done what-so-ever, that's
* REALLY being a dick.
* 1c. Modifying the original work to contain hidden harmful content.
* That would make you a PROPER dick.
*
* If you become rich through modifications, related works/services, or
* supporting the original work, share the love.
* Only a dick would make loads off this work and not buy the original works
* creator(s) a pint.
*
* Code is provided with no warranty. Using somebody else's code and bitching
* when it goes wrong makes you a DONKEY dick.
* Fix the problem yourself. A non-dick would submit the fix back.
*/
#ifndef _QSIMPLEUPDATER_UPDATER_H
#define _QSIMPLEUPDATER_UPDATER_H
#include <QUrl>
#include <QObject>
#include <QNetworkReply>
#include <QNetworkAccessManager>
class Downloader;
/**
* \brief Downloads and interprests the update definition file
*/
class UpdaterHttp : public QObject {
Q_OBJECT
signals:
void checkingFinished (const QString& url);
void downloadFinished (const QString& url, const QString& filepath);
void appcastDownloaded (const QString& url, const QByteArray& data);
public:
explicit UpdaterHttp(QObject *parent = 0);
~UpdaterHttp();
QString url() const;
QString openUrl() const;
QString changelog() const;
QString moduleName() const;
QString downloadUrl() const;
QString platformKey() const;
QString moduleVersion() const;
QString latestVersion() const;
bool customAppcast() const;
bool notifyOnUpdate() const;
bool notifyOnFinish() const;
bool updateAvailable() const;
bool downloaderEnabled() const;
bool useCustomInstallProcedures() const;
public slots:
void checkForUpdates();
void setUrl (const QString& url);
void setDownloadUrl (const QString& url);
void setModuleName (const QString& name);
void setNotifyOnUpdate (const bool notify);
void setNotifyOnFinish (const bool notify);
void setLatestVersion (const QString& version);
void setModuleVersion (const QString& version);
void setDownloaderEnabled (const bool enabled);
void setPlatformKey (const QString& platformKey);
void setUseCustomAppcast (const bool customAppcast);
void setUseCustomInstallProcedures (const bool custom);
void onReply (QNetworkReply* reply);
void setUpdateAvailable (const bool available);
private:
bool compare (const QString& x, const QString& y);
private:
QString m_url;
bool m_customAppcast;
bool m_notifyOnUpdate;
bool m_notifyOnFinish;
bool m_updateAvailable;
bool m_downloaderEnabled;
QString m_openUrl;
QString m_platform;
QString m_changelog;
QString m_moduleName;
QString m_downloadUrl;
QString m_moduleVersion;
QString m_latestVersion;
Downloader* m_downloader;
QNetworkAccessManager* m_manager;
};
#endif
|
// Created file "Lib\src\Uuid\propkeys"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PKEY_PropGroup_Content, 0xd0dab0ba, 0x368a, 0x4050, 0xa8, 0x82, 0x6c, 0x01, 0x0f, 0xd1, 0x9a, 0x4f);
|
/*
thot package for statistical machine translation
Copyright (C) 2017 Adam Harasimowicz
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU 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/>.
*/
/**
* @file TranslationMetadataTest.h
*
* @brief Declares the TranslationMetadataTest class implementing
* unit tests for the TranslationMetadata class.
*/
#ifndef _TranslationMetadataTest_h
#define _TranslationMetadataTest_h
//--------------- Include files --------------------------------------
#if HAVE_CONFIG_H
# include <thot_config.h>
#endif /* HAVE_CONFIG_H */
#include "TranslationMetadata.h"
#include "PhrScoreInfo.h"
#include "StrProcUtils.h"
#include <cppunit/extensions/HelperMacros.h>
//--------------- Constants ------------------------------------------
//--------------- typedefs -------------------------------------------
//--------------- Classes --------------------------------------------
//--------------- TranslationMetadata class
/**
* @brief Class implementing tests for TranslationMetadata.
*/
class TranslationMetadataTest: public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TranslationMetadataTest );
CPPUNIT_TEST( testSafeRecallingObtainTransConstraints );
CPPUNIT_TEST( testGetSrcSentVec );
CPPUNIT_TEST( testGetTransForSrcPhr );
CPPUNIT_TEST( testGetConstrainedSrcPhrases );
CPPUNIT_TEST( testSrcPhrAffectedByConstraint );
CPPUNIT_TEST( testTranslationSatisfiesSrcPhrConstraints );
CPPUNIT_TEST_SUITE_END();
public:
void setUp(void);
void tearDown(void);
void testSafeRecallingObtainTransConstraints(void);
void testGetSrcSentVec(void);
void testGetTransForSrcPhr(void);
void testGetConstrainedSrcPhrases(void);
void testSrcPhrAffectedByConstraint(void);
void testTranslationSatisfiesSrcPhrConstraints(void);
private:
TranslationMetadata<PhrScoreInfo>* metadata;
// Input data generators
std::string getXmlString(void);
// Auxiliary functions to test source phrase constraints
void testTranslationSatisfyingSrcPhrConstraints(void);
void testTranslationViolatingSrcSegmentationConstraints(void);
void testTranslationViolatingTrgSegmentationConstraints(void);
void testTranslationViolatingWordSelectionConstraints(void);
};
#endif
|
// Created file "Lib\src\amstrmid\strmiids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(TIME_FORMAT_NONE, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
/*
* Common output functions for the wtcdbtools
*
* Copyright (C) 2010-2021, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _WTCDBTOOLS_OUTPUT_H )
#define _WTCDBTOOLS_OUTPUT_H
#include <common.h>
#include <file_stream.h>
#include <types.h>
#include "wtcdbtools_libcerror.h"
#if defined( __cplusplus )
extern "C" {
#endif
int wtcdbtools_output_initialize(
int stdio_mode,
libcerror_error_t **error );
void wtcdbtools_output_copyright_fprint(
FILE *stream );
void wtcdbtools_output_version_fprint(
FILE *stream,
const char *program );
void wtcdbtools_output_version_detailed_fprint(
FILE *stream,
const char *program );
#if defined( __cplusplus )
}
#endif
#endif /* !defined( _WTCDBTOOLS_OUTPUT_H ) */
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UPDATEPORTFOLIOREQUEST_H
#define QTAWS_UPDATEPORTFOLIOREQUEST_H
#include "servicecatalogrequest.h"
namespace QtAws {
namespace ServiceCatalog {
class UpdatePortfolioRequestPrivate;
class QTAWSSERVICECATALOG_EXPORT UpdatePortfolioRequest : public ServiceCatalogRequest {
public:
UpdatePortfolioRequest(const UpdatePortfolioRequest &other);
UpdatePortfolioRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(UpdatePortfolioRequest)
};
} // namespace ServiceCatalog
} // namespace QtAws
#endif
|
/*#
* This file is protected by Copyright. Please refer to the COPYRIGHT file
* distributed with this source distribution.
*
* This file is part of REDHAWK core.
*
* REDHAWK core is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* REDHAWK core 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/.
#*/
//% set classname = portgen.className()
//% set vartype = portgen.interfaceClass() + '_var'
class ${classname} : public Port_Uses_base_impl, public POA_ExtendedCF::QueryablePort
{
ENABLE_LOGGING
public:
${classname}(std::string port_name, ${component.baseclass.name} *_parent);
~${classname}();
/*{% for op in portgen.operations() %}*/
${op.returns} ${op.name}(${op.arglist});
/*{% endfor %}*/
ExtendedCF::UsesConnectionSequence * connections()
{
boost::mutex::scoped_lock lock(updatingPortsLock); // don't want to process while command information is coming in
if (recConnectionsRefresh) {
recConnections.length(outConnections.size());
for (unsigned int i = 0; i < outConnections.size(); i++) {
recConnections[i].connectionId = CORBA::string_dup(outConnections[i].second.c_str());
recConnections[i].port = CORBA::Object::_duplicate(outConnections[i].first);
}
recConnectionsRefresh = false;
}
// NOTE: You must delete the object that this function returns!
return new ExtendedCF::UsesConnectionSequence(recConnections);
}
/*{% if portgen.interfaceClass() != "CF::Port" %}*/
void connectPort(CORBA::Object_ptr connection, const char* connectionId)
{
boost::mutex::scoped_lock lock(updatingPortsLock); // don't want to process while command information is coming in
${vartype} port = ${portgen.interfaceClass()}::_narrow(connection);
outConnections.push_back(std::make_pair(port, connectionId));
active = true;
recConnectionsRefresh = true;
}
void disconnectPort(const char* connectionId)
{
boost::mutex::scoped_lock lock(updatingPortsLock); // don't want to process while command information is coming in
for (unsigned int i = 0; i < outConnections.size(); i++) {
if (outConnections[i].second == connectionId) {
outConnections.erase(outConnections.begin() + i);
break;
}
}
if (outConnections.size() == 0) {
active = false;
}
recConnectionsRefresh = true;
}
/*{% endif %}*/
std::string getRepid () const;
std::vector< std::pair<${vartype}, std::string> > _getConnections()
{
return outConnections;
}
protected:
${component.userclass.name} *parent;
std::vector < std::pair<${vartype}, std::string> > outConnections;
ExtendedCF::UsesConnectionSequence recConnections;
bool recConnectionsRefresh;
};
|
// Created file "Lib\src\Uuid\X64\i_activscp"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IActiveScriptError, 0xeae1ba61, 0xa4ed, 0x11cf, 0x8f, 0x20, 0x00, 0x80, 0x5f, 0x2c, 0xd0, 0x64);
|
m4_include(`../CommonHtmlDocumentation/header.h')m4_dnl
<!-- Event snippet for Page view conversion page -->
<script>
gtag('event', 'conversion', {'send_to': 'AW-10810288706/U3KJCKekmIUDEMLU36Io'});
</script>
m4_include(`../CommonHtmlDocumentation/postHeader.h')m4_dnl
WBigTitle(`Downloading and running')
Currently, you can download and run 42 as a
Java program.
<ul>
<li>
For windows download here <a href=
"https://l42.is/L42PortableWin.zip"
>L42PortableWin.zip</a>
WComm "https://github.com/Language42/Language42.github.io/releases/download/d025/L42PortableWin.zip"
WComm For windows download here <a href="http://130.195.5.18/L42PortableWin.zip">L42PortableWin.zip</a>
WComm or <a href="L42Win.jar">L42Win.jar</a>
</li>
<li>
For Linux download here <a href=
"https://l42.is/L42PortableLinux.zip"
>L42PortableLinux.zip</a>
WComm For Linux download here <a href="http://130.195.5.18/L42PortableLinux.zip">L42PortableLinux.zip</a>
WComm <a href="L42Linux.jar">L42Linux.jar</a>
</li>
<li>
For Mac download here <a href=
"https://l42.is/L42PortableMac.zip"
>L42PortableMac.zip</a>
WComm For Mac download here <a href="http://130.195.5.18/L42PortableMac.zip">L42PortableMac.zip</a>
</li>
WComm <li> The portable version contains also an appropriate JVM.</li>
<li> Run Wcode(L42)
WComm Wcode(java --enable-preview -jar L42.jar)
to start the IDE.
</li>
<li>
Run Wcode(L42 ProjectName)
WComm with Wcode(Java --enable-preview -jar L42.jar ProjectName)
to run the 42 program inside of the folder Wcode(ProjectName) from the command line.
</li>
</ul>
WBigTitle(`The tutorial!')
You are now ready to follow the tutorial.
You can look at it in text form on the links below, or in video form
at <a href="https://www.youtube.com/playlist?list=PLWsQqjANQic8c5wG3LfSe-mMiBKfOtBFJ"> Video tutorial </a>.
WBR
WBR
OFloatClass(index)
<div class="rotate90"> Index of Content</div>
ContinueFloat
<ol>
WMenuItem(`tutorial_01Basics.xhtml',`Basic concepts')
WMenuItem(`tutorial_02ModifiersIntro.xhtml',`Introduction to modifiers')
WMenuItem(`tutorial_03BasicClasses.xhtml',`Basic Classes')
WMenuItem(`tutorial_04ErrorsAndExceptions.xhtml',`Errors and Exceptions')
WMenuItem(`tutorial_05Caching.xhtml',`Caching')
WMenuItem(`tutorial_06CachingMut.xhtml',`Caching on Mutable objects')
WMenuItem(`tutorial_07InterfacesAndMatching.xhtml',`Interfaces and Matching')
WMenuItem(`tutorial_08Sequences.xhtml',`Collections and Sequences')
WMenuItem(`tutorial_09InputOutput.xhtml',`Input Output')
WMenuItem(`tutorial_10Exercises.xhtml',`Exercises')
WMenuItem(`tutorial_11MetaprogrammingIntro.xhtml',`Metaprogramming Introduction')
WMenuItem(`tutorial_12Refactoring.xhtml',`Programmatic Refactoring')
WMenuItem(`tutorial_13MoreDecorators.xhtml',`More Decorators')
WMenuItem(`tutorial_14ExampleOfProgram.xhtml',`Example of a 42 Program')
WMenuItem(`tutorial_15DeployCode.xhtml',`Deploy code')
</ol>
CFloat
m4_include(`../CommonHtmlDocumentation/footer.h')
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UNTAGATTENDEEREQUEST_P_H
#define QTAWS_UNTAGATTENDEEREQUEST_P_H
#include "chimerequest_p.h"
#include "untagattendeerequest.h"
namespace QtAws {
namespace Chime {
class UntagAttendeeRequest;
class UntagAttendeeRequestPrivate : public ChimeRequestPrivate {
public:
UntagAttendeeRequestPrivate(const ChimeRequest::Action action,
UntagAttendeeRequest * const q);
UntagAttendeeRequestPrivate(const UntagAttendeeRequestPrivate &other,
UntagAttendeeRequest * const q);
private:
Q_DECLARE_PUBLIC(UntagAttendeeRequest)
};
} // namespace Chime
} // namespace QtAws
#endif
|
#pragma once
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <iterator>
using namespace std;
/*************************************************************************************
HILSIM setup loading from HILSIMSetup.txt in the XPLane executable directory
Matthew Coleman - 10-05-05
Using the following format
Comm,COMx
Overide,***Overide path description****
Control,Servo Channel,Xplane control surface path, Servo zero, Servo Hi Travel, Servo Lo Travel, Surafe Max travel, Serface Min Travel
Engine,Servo Channel,Engine Mask,Servo Zero,Servo Hi Travel,Servo Low Travel, Engine Max, Engine Min
To comment out any line in the setup, change the first word before the comma.
The surface and overide paths are defined in the xsquarkbox data references file
http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html
If you need simple control choose the joystick overide.
If you need to translate servos to flying surfaces choose full surface overide.
Surface travel is normally in degrees for advanced mode. Read the XPlane documentation
Surface travel is normally +-1 for simple joystick overide mode
Servo Hi and Low travel is defined by the relative count travelled from zero,
not the absolute value.
The engine mask is a bitfield Bit0 = engine 1, Bit 7 = engine 8.
If you need to control all engines together on one channel, choose mask 256
Use your transmitter and/or autopilot to do the mixing.
THIS SETUP WILL NOT DO INTER-CHANNEL MIXING. This feature is to be added if needed.
This might be a problem for some heli setups.
LOGFILE
The plugin will create a logfile in the XPlane executable directory.
It will give you details of what has been loaded from the setup file.
**************************************************************************************/
#define FIXED_SERVO_CHANNELS 8
#define MAX_VARIABLE_CHANNELS 32
#define EngineString "Engine"
#define ControlString "Control"
#define CommString "Comm"
#define OverideString "Overide"
typedef enum
{
DATAPOS_CONTROL_DATATYPE = 0,
DATAPOS_CONTROL_SERVO_CHAN,
DATAPOS_CONTROL_IDENTITY,
DATAPOS_CONTROL_SERVO_ZERO,
DATAPOS_CONTROL_SERVO_HI_TRAVEL,
DATAPOS_CONTROL_SERVO_LO_TRAVEL,
DATAPOS_CONTROL_SURFACE_MAX,
DATAPOS_CONTROL_SURFACE_MIN,
DATAPOS_CONTROL_LAST_INDEX,
} ControlDataPos;
typedef enum
{
DATAPOS_ENGINE_DATATYPE = 0,
DATAPOS_ENGINE_SERVO_CHAN,
DATAPOS_ENGINE_MASK, // An 8 bit mask of which engines this servo drives
DATAPOS_ENGINE_SERVO_ZERO,
DATAPOS_ENGINE_SERVO_HI_TRAVEL,
DATAPOS_ENGINE_SERVO_LO_TRAVEL,
DATAPOS_ENGINE_MAX, // Keep MAX-MIN for engine reversing
DATAPOS_ENGINE_MIN,
DATAPOS_ENGINE_LAST_INDEX,
} EngineDataPos;
typedef enum
{
DATAPOS_OVERIDE_DATATYPE = 0,
DATAPOS_OVERIDE_IDENTITY,
DATAPOS_OVERIDE_LAST_INDEX,
} OverideDataPos;
typedef enum
{
DATAPOS_COMM_DATATYPE = 0,
DATAPOS_COMM_IDENTITY,
DATAPOS_COMM_LAST_INDEX
} CommDataPos;
typedef enum
{
CONTROL_TYPE_NULL = 0,
CONTROL_TYPE_SURFACE,
CONTROL_TYPE_ENGINE
} ControlType;
class ChannelSetup
{
public:
ChannelSetup(); // Default constructor
ChannelSetup(const ChannelSetup* pCopyChannel); // Copy constructor
float GetControlDeflection(int ServoPosition); // Translate from servo position to control deflection
int mServoChannel; // Servo channel variables
int mChannelOffset;
int mChannelHiTravel;
int mChannelLoTravel;
XPLMDataRef mControlSurfaceRef;
float mMaxDeflection; // Deflection at channel max. THIS IS NOT A LIMITER
float mMinDeflection; // Deflection at channel min. THIS IS NOT A LIMITER
ControlType mControlType;
unsigned int mEngineMask;
};
class Channels : public vector<ChannelSetup>
{
};
class SetupFile
{
public:
void LoadSetupFile(Channels& ChannelInfo, string& CommStr, long& CommSpeed, string& OverideStr);
void ParseLine(string& ParseString, Channels &ChannelInfo, string& CommStr, long& CommSpeed, string& OverideStr);
void ParseControlLine(string& ParseString, Channels &ChannelInfo);
void ParseControlString(string& ValueString, int Index, ChannelSetup* pSetup);
void ParseEngineLine(string& ParseString, Channels &ChannelInfo);
void ParseEngineString(string& ValueString, int Index, ChannelSetup* pSetup);
void ParseCommLine(string& ParseString, string& CommStr, long& CommSpeed);
void ParseOverideLine(string& ParseString, string& OverideStr);
};
class LogFile
{
public:
LogFile();
~LogFile();
void AppendString(string& AddString);
ofstream mLogFile;
};
static LogFile LoggingFile;
|
/*
Copyright 2010, 2011 Tarik Sekmen.
All Rights Reserved.
Written by Tarik Sekmen <tarik@ilixi.org>.
This file is part of ilixi.
ilixi is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ilixi 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 ilixi. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ILIXI_ANIMATION_H_
#define ILIXI_ANIMATION_H_
#include "core/Thread.h"
namespace ilixi
{
class Widget;
class Animation;
class AnimationThread : public Thread
{
public:
AnimationThread(Animation* animation);
~AnimationThread();
int
run();
private:
Animation* _animation;
};
//! Base class for animations.
/*!
* This class implements basic animation functionality.
*/
class Animation
{
public:
friend class AnimationThread;
enum AnimationState
{
Running, Paused, Stopped
};
/*!
* Constructor.
*
* Initialises a new animation.
*
* @param target widget to repaint at each step.
*/
Animation(Widget* target = 0);
/*!
* Destructor.
*/
virtual
~Animation();
/*!
* Returns current state of animation.
*/
AnimationState
state() const;
/*!
* Returns duration of animation in milliseconds.
*/
int
duration() const;
/*!
* Returns current animation time in milliseconds.
*/
int
currentTime() const;
/*!
* Returns number of loops.
*/
int
loops() const;
/*!
* Returns current loop number.
*/
int
currentLoop() const;
/*!
* Starts animation.
*/
void
start();
/*!
* Stops animation.
*/
void
stop();
/*!
* Resumes animation.
*/
void
resume();
/*!
* Pauses animation.
*/
void
pause();
/*!
* Sets duration of animation.
*
* @param ms duration in milliseconds.
*/
void
setDuration(int ms);
/*!
* Sets number of loops.
*
* @param loopCount
*/
void
setLoops(int loopCount);
/*!
* This signal is emitted when animation is finished playing.
*/
sigc::signal<void> sigFinished;
/*!
* This signal is emitted when animation finishes a loop.
*/
sigc::signal<int> sigLoopChanged;
protected:
//! Sets current time of animation.
void
setCurrentTime(int ms = 0);
//! Sets animation state.
virtual void
setState(AnimationState state);
//! Iterates animation.
bool
animate();
//! Reimplement this method...
virtual void
step(long ms)=0;
private:
//! Target widget to repaint at each step of animation.
Widget* _targetWidget;
//! Current state of animation.
AnimationState _state;
//! Duration of animation in milliseconds.
int _duration;
//! Current animation time in milliseconds.
int _currentTime;
//! Last measured time in milliseconds.
long _lastTime;
//! Loop count of animation.
int _loops;
//! Current loop in animation.
int _currentLoop;
AnimationThread* _thread;
//AnimationGroup* _group;
};
}
#endif /* ILIXI_ANIMATION_H_ */
|
#ifndef SQFVM_RUNTIME_VERSION_H_
#define SQFVM_RUNTIME_VERSION_H_
#ifndef CONCAT_
#define CONCAT_(L, R) L ## R
#endif // !CONCAT_
#ifndef CONCAT
#define CONCAT(L, R) CONCAT_(L, R)
#endif // !CONCAT
#ifndef STR_
#define STR_(IN) # IN
#endif // !STR_
#ifndef STR
#define STR(IN) STR_(IN)
#endif // !STR
#define SQFVM_RUNTIME_VERSION_MAJOR 2
#define SQFVM_RUNTIME_VERSION_MINOR 1
#define SQFVM_RUNTIME_VERSION_REVISION 0
#define SQFVM_RUNTIME_VERSION STR(SQFVM_RUNTIME_VERSION_MAJOR) "." STR(SQFVM_RUNTIME_VERSION_MINOR) "." STR(SQFVM_RUNTIME_VERSION_REVISION)
#define SQFVM_RUNTIME_VERSION_FULL SQFVM_RUNTIME_VERSION " - " __DATE__ " " __TIME__
#endif // !SQFVM_RUNTIME_VERSION_H_
|
#ifndef _WSP_IO_MEMORY_H_
#define _WSP_IO_MEMORY_H_
#include "wsp.h"
#include "wsp_memfs.h"
extern wsp_io wsp_io_memory;
typedef struct {
wsp_memfs_t *file;
} wsp_io_memory_inst_t;
extern wsp_memfs_context_t memfs_ctx;
#endif /* _WSP_IO_MEMORY_H_ */
|
/***************************************************************************
* Copyright (c) 2010 Art Tevs *
* *
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 3 of *
* the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesse General Public License for more details. *
* *
* The full license is in LICENSE file included with this distribution. *
***************************************************************************/
#ifndef _C_OSGPPU_CAMERA__H_
#define _C_OSGPPU_CAMERA__H_
//-------------------------------------------------------------------------
// Includes
//-------------------------------------------------------------------------
#include <osgPPU/Export.h>
#include <osgPPU/Unit.h>
#include <osg/Camera>
#include <osg/FrameBufferObject>
namespace osgPPU
{
//! Camera class which can be used with osgPPU
/**
* A camera class which acts as a wrapper for standard osg::Camera
* and includes useful methods for proper use of osgPPU.
*
* NOTE: You do not have to use this class, this is just a wrapper for simple usage.
**/
class OSGPPU_EXPORT Camera : public osg::Camera
{
public:
/**
* Resize camera's viewport. This will also resize camera's attachments if such exists.
* Call this method when you have resized your window and wish to update the camera to
* the new size.
**/
static void resizeViewport(int x, int y, int width, int height, osg::Camera* camera);
};
//! Derived class from osg's FBO implementation in order to allow marking FBO as dirty
/**
* This is a workaround implementation of osg::FrameBufferObject giving a possibility
* to mark the FBO as dirty. This is required when you made changes to FBOs attachments
* and you want to propagate them to the FBO.
*/
class OSGPPU_EXPORT FrameBufferObject : public osg::FrameBufferObject
{
public:
void dirty() { dirtyAll(); }
};
};
#endif
|
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* FairMQSocketNN.h
*
* @since 2013-12-05
* @author A. Rybalchenko
*/
#ifndef FAIRMQSOCKETNN_H_
#define FAIRMQSOCKETNN_H_
#include <vector>
#include <atomic>
#include "FairMQSocket.h"
class FairMQSocketNN : public FairMQSocket
{
public:
FairMQSocketNN(const std::string& type, const std::string& name, const int numIoThreads, const std::string& id = ""); // numIoThreads is not used in nanomsg.
FairMQSocketNN(const FairMQSocketNN&) = delete;
FairMQSocketNN operator=(const FairMQSocketNN&) = delete;
virtual std::string GetId();
virtual bool Bind(const std::string& address);
virtual void Connect(const std::string& address);
virtual int Send(FairMQMessage* msg, const std::string& flag = "");
virtual int Send(FairMQMessage* msg, const int flags = 0);
virtual int64_t Send(const std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0);
virtual int Receive(FairMQMessage* msg, const std::string& flag = "");
virtual int Receive(FairMQMessage* msg, const int flags = 0);
virtual int64_t Receive(std::vector<std::unique_ptr<FairMQMessage>>& msgVec, const int flags = 0);
virtual void* GetSocket() const;
virtual int GetSocket(int nothing) const;
virtual void Close();
virtual void Terminate();
virtual void SetOption(const std::string& option, const void* value, size_t valueSize);
virtual void GetOption(const std::string& option, void* value, size_t* valueSize);
unsigned long GetBytesTx() const;
unsigned long GetBytesRx() const;
unsigned long GetMessagesTx() const;
unsigned long GetMessagesRx() const;
virtual bool SetSendTimeout(const int timeout, const std::string& address, const std::string& method);
virtual int GetSendTimeout() const;
virtual bool SetReceiveTimeout(const int timeout, const std::string& address, const std::string& method);
virtual int GetReceiveTimeout() const;
static int GetConstant(const std::string& constant);
virtual ~FairMQSocketNN();
private:
int fSocket;
std::string fId;
std::atomic<unsigned long> fBytesTx;
std::atomic<unsigned long> fBytesRx;
std::atomic<unsigned long> fMessagesTx;
std::atomic<unsigned long> fMessagesRx;
};
#endif /* FAIRMQSOCKETNN_H_ */
|
#include "platform_wtk.h"
#ifdef HAVE_POINTER
#include "platform_input_pointer.c"
#endif
#ifdef HAVE_KEYBOARD
#include "platform_input_keyboard.c"
#endif
static void
_seat_handle_capabilities(void *data, struct wl_seat *seat,
enum wl_seat_capability caps)
{
struct pilot_display *display = data;
struct platform_display *platform = display->platform;
struct pilot_input *input = NULL;
#ifdef HAVE_POINTER
if ((caps & WL_SEAT_CAPABILITY_POINTER)) {
input = pilot_inputpointer_create(display);
}
#endif
#ifdef HAVE_KEYBOARD
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD))
{
input = pilot_inputkeyboard_create(display);
}
#endif
if (input)
pilot_list_append(display->inputs, input);
pilot_emit(display, inputChanged, input);
}
static const struct wl_seat_listener _st_seat_listener = {
_seat_handle_capabilities,
};
void
_platform_display_inputmanager(struct pilot_display *display, struct wl_registry *registry, uint32_t id)
{
struct platform_display *platform = display->platform;
platform->seat = wl_registry_bind(registry,
id, &wl_seat_interface, 1);
wl_seat_add_listener(platform->seat, &_st_seat_listener, display);
}
static void
_platform_input_destroy(struct pilot_input *thiz)
{
struct platform_input *platform = thiz->platform;
if (platform->pointer) {
wl_pointer_destroy(platform->pointer);
platform->pointer = NULL;
}
if (platform->keyboard) {
wl_keyboard_destroy(platform->keyboard);
platform->keyboard = NULL;
}
if (platform->touch) {
wl_touch_destroy(platform->touch);
platform->touch = NULL;
}
free(platform);
}
|
/*
* QuarkPlayer, a Phonon media player
* Copyright (C) 2008-2009 Tanguy Krotoff <tkrotoff@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WPLPARSER_H
#define WPLPARSER_H
#include "PlaylistParser.h"
#include <QtCore/QString>
/**
* Parses a WPL playlist (Windows Media Player Playlist).
*
* Developed by Microsoft.
*
* WPL is UTF-8 encoded and should only contains local files.
* Is it real XML?
*
* @see http://en.wikipedia.org/wiki/WPL
* @author Tanguy Krotoff
*/
class WPLParser : public IPlaylistParser {
public:
WPLParser(const QString & filename, QObject * parent);
~WPLParser();
QStringList fileExtensions() const;
void load();
void save(const QList<MediaInfo> & files);
void stop();
private:
QString _filename;
volatile bool _stop;
};
#endif //WPLPARSER_H
|
//
// BufferFiller.h
// Tonic
//
// Created by Nick Donaldson on 2/9/13.
//
// See LICENSE.txt for license and usage information.
//
#ifndef TONIC_BUFFERFILLER_H
#define TONIC_BUFFERFILLER_H
#include "Generator.h"
namespace Tonic{
namespace Tonic_ {
//! Base class for any generator expected to produce output for a buffer fill.
/*!
BufferFillers provide a high-level interface for combinations of generators, and can be used to fill
arbitraryly large buffers.
Subclasses to include mixer, channel, synth, etc.
*/
class BufferFiller_ : public Generator_ {
private:
unsigned long bufferReadPosition_;
TONIC_MUTEX_T mutex_;
protected:
Tonic_::SynthesisContext_ synthContext_;
public:
BufferFiller_();
~BufferFiller_();
// mutex for swapping inputs, etc
void lockMutex();
void unlockMutex();
//! Process a single synthesis vector, output to frames
/*!
tick method without context argument passes down this instance's SynthesisContext_
*/
void tick( TonicFrames& frames );
void fillBufferOfFloats(float *outData, unsigned int numFrames, unsigned int numChannels);
double getContextTime(){return synthContext_.elapsedTime;}
};
inline void BufferFiller_::lockMutex(){
TONIC_MUTEX_LOCK(mutex_);
}
inline void BufferFiller_::unlockMutex(){
TONIC_MUTEX_UNLOCK(mutex_);
}
inline void BufferFiller_::tick( TonicFrames& frames ){
lockMutex();
Generator_::tick(frames, synthContext_);
synthContext_.tick();
unlockMutex();
}
inline void BufferFiller_::fillBufferOfFloats(float *outData, unsigned int numFrames, unsigned int numChannels)
{
// flush denormals on this thread
TONIC_ENABLE_DENORMAL_ROUNDING();
#ifdef TONIC_DEBUG
if(numChannels > outputFrames_.channels()) error("Mismatch in channels sent to Synth::fillBufferOfFloats", true);
#endif
const unsigned long sampleCount = outputFrames_.size();
const unsigned int channelsPerSample = (outputFrames_.channels() - numChannels) + 1;
TonicFloat sample = 0.0f;
TonicFloat *outputSamples = &outputFrames_[bufferReadPosition_];
for(unsigned int i = 0; i<numFrames * numChannels; i++){
sample = 0;
for (unsigned int c = 0; c<channelsPerSample; c++){
if(bufferReadPosition_ == 0){
tick(outputFrames_);
}
sample += *outputSamples++;
if(++bufferReadPosition_ == sampleCount){
bufferReadPosition_ = 0;
outputSamples = &outputFrames_[0];
}
}
*outData++ = sample / (float)channelsPerSample;
}
}
}
class BufferFiller : public Generator {
public:
BufferFiller(Tonic_::BufferFiller_ * newBf) : Generator(newBf) {}
//! Fill an arbitrarily-sized, interleaved buffer of audio samples as floats
/*!
This BufferFiller's outputGen is used to fill an interleaved buffer starting at outData.
*/
inline void fillBufferOfFloats(float *outData, unsigned int numFrames, unsigned int numChannels){
static_cast<Tonic_::BufferFiller_*>(obj)->fillBufferOfFloats(outData, numFrames, numChannels);
}
};
template<class GenType>
class TemplatedBufferFiller : public BufferFiller {
protected:
GenType* gen(){
return static_cast<GenType*>(obj);
}
public:
TemplatedBufferFiller() : BufferFiller(new GenType) {}
};
}
#endif /* defined(__TonicDemo__BufferFiller__) */
|
/*
* koji scripting language
*
* Copyright (C) 2017 Canio Massimo Tristano
*
* This source file is part of the koji scripting language, distributed under
* the MIT license. See koji.h for further licensing information.
*/
#pragma once
#include "kplatform.h"
struct source_membuf {
char *curr;
char *end;
};
/*
* Opens a file input stream at specified [filename] and returns if file open
* was successful.
*/
kintern bool
source_file_open(struct koji_source *src, const char *filename);
/*
* Closes a previously opened file input stream.
*/
kintern void
source_file_close(struct koji_source *src);
/*
* Opens a string input stream.
*/
kintern void
source_string_open(struct koji_source *src, const char *name,
const char **string);
/*
* Opens a memory input stream with specified [name] and memory buffer [mb].
*/
kintern void
source_mem_open(struct koji_source *src, const char *name,
struct source_membuf *mb);
|
#include<stdio.h>
//#include<iostream.h>
#define ROW1 3
#define COL1 3
#define ROW2 COL1
#define COL2 3
int main()
{
int i,j,k,l;
int temp=0;
int N1 = ROW1*COL1;
int N2 = ROW2*COL2;
int N3 = ROW1*COL2;
char mat1[9] = { 0x00, 0x01, 0x02,
0x03, 0x04, 0x05,
0x06, 0x07, 0x08 };
char mat2[9] = { 0x10, 0x11, 0x12,
0x13, 0x14, 0x15,
0x16, 0x17, 0x17 };
unsigned long mat3[9];
for(j=0; j<ROW1; j++){
for(k=0; k<COL2; k++){
for(l=0; l<COL1; l++){
temp = temp + (mat1[l+j*COL1])*(mat2[k+l*COL2]);
}
mat3[k+j*COL2] = temp;
temp = 0;
}
}
for(i=0; i<N3; i++){
printf("0x%x\t",mat3[i]);
printf("\n");
}
}
|
//
// NFICollectionPresenter.h
// NFIFramework
//
// Created by Pedro Lopez on 9/1/16.
// Copyright © 2016 Pedro Lopez. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NFIPresenter.h"
#import "NFICollectionItem.h"
@protocol NFICollectionPresenter <NFIPresenter>
- (void)itemWasTapped:(NSObject<NFICollectionItem> *)item;
@end
|
/*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbWorldView2ImageMetadataInterface_h
#define otbWorldView2ImageMetadataInterface_h
#include "otbOpticalImageMetadataInterface.h"
namespace otb
{
/** \class WorldView2ImageMetadataInterface
*
* \brief Creation of an "otb" WorldView2ImageMetadataInterface that gets metadata.
*
*
* \ingroup OTBMetadata
*/
class OTBMetadata_EXPORT WorldView2ImageMetadataInterface : public OpticalImageMetadataInterface
{
public:
typedef WorldView2ImageMetadataInterface Self;
typedef ImageMetadataInterfaceBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(WorldView2ImageMetadataInterface, ImageMetadataInterfaceBase);
typedef Superclass::ImageType ImageType;
typedef Superclass::MetaDataDictionaryType MetaDataDictionaryType;
typedef Superclass::VectorType VectorType;
typedef Superclass::VariableLengthVectorType VariableLengthVectorType;
void Parse(ImageMetadata &) override;
protected:
WorldView2ImageMetadataInterface() = default;
~WorldView2ImageMetadataInterface() = default;
private:
WorldView2ImageMetadataInterface(const Self&) = delete;
void operator=(const Self&) = delete;
void FetchPhysicalBias(ImageMetadata&);
void FetchSolarIrradianceWorldView2(ImageMetadata &);
void FetchSpectralSensitivityWorldView2(ImageMetadata &);
void FetchSolarIrradianceQuickBird(ImageMetadata &);
void FetchSpectralSensitivityQuickBird(ImageMetadata &);
void FetchPhysicalGainQuickBird(int bitsPerPixel,
const std::unordered_map<std::string, double> & absCalFactor,
const std::unordered_map<std::string, int> & TDILevels,
ImageMetadata &);
};
} // end namespace otb
#endif
|
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <jni.h>
#include <gltfio/MaterialProvider.h>
#define JAVA_MATERIAL_KEY "com/google/android/filament/gltfio/MaterialProvider$MaterialKey"
class MaterialKeyHelper {
public:
static MaterialKeyHelper& get();
void copy(JNIEnv* env, gltfio::MaterialKey& dst, jobject src);
void copy(JNIEnv* env, jobject dst, const gltfio::MaterialKey& src);
void init(JNIEnv* env); // called only from the Java static class constructor
private:
jfieldID doubleSided;
jfieldID unlit;
jfieldID hasVertexColors;
jfieldID hasBaseColorTexture;
jfieldID hasNormalTexture;
jfieldID hasOcclusionTexture;
jfieldID hasEmissiveTexture;
jfieldID useSpecularGlossiness;
jfieldID alphaMode;
jfieldID enableDiagnostics;
jfieldID hasMetallicRoughnessTexture;
jfieldID metallicRoughnessUV;
jfieldID baseColorUV;
jfieldID hasClearCoatTexture;
jfieldID clearCoatUV;
jfieldID hasClearCoatRoughnessTexture;
jfieldID clearCoatRoughnessUV;
jfieldID hasClearCoatNormalTexture;
jfieldID clearCoatNormalUV;
jfieldID hasClearCoat;
jfieldID hasTransmission;
jfieldID hasTextureTransforms;
jfieldID emissiveUV;
jfieldID aoUV;
jfieldID normalUV;
jfieldID hasTransmissionTexture;
jfieldID transmissionUV;
jfieldID hasSheenColorTexture;
jfieldID sheenColorUV;
jfieldID hasSheenRoughnessTexture;
jfieldID sheenRoughnessUV;
jfieldID hasVolumeThicknessTexture;
jfieldID volumeThicknessUV;
jfieldID hasSheen;
jfieldID hasIOR;
};
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkOpenCLUtil_h
#define __itkOpenCLUtil_h
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <itkVector.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/opencl.h>
#endif
#include <itkMacro.h>
namespace itk
{
/** Get the local block size based on the desired Image Dimension
* currently set as follows:
* OpenCL workgroup (block) size for 1/2/3D - needs to be tuned based on the GPU architecture
* 1D : 256
* 2D : 16x16 = 256
* 3D : 4x4x4 = 64
*/
int OpenCLGetLocalBlockSize(unsigned int ImageDim);
/** Get the devices that are available */
cl_device_id* OpenCLGetAvailableDevices(cl_platform_id platform, cl_device_type devType, cl_uint* numAvailableDevices);
/** Get the device that has the maximum FLOPS in the current context */
cl_device_id OpenCLGetMaxFlopsDev(cl_context cxGPUContext);
/** Print device name and info */
void OpenCLPrintDeviceInfo(cl_device_id device, bool verbose=false);
/** Find the OpenCL platform that matches the "name" */
cl_platform_id OpenCLSelectPlatform(const char* name);
/** Check OpenCL error */
void OpenCLCheckError(cl_int error, const char* filename="", int lineno=0, const char* location="");
/** Check if OpenCL-enabled GPU is present. */
bool IsGPUAvailable();
/** Get Typename */
std::string GetTypename(const std::type_info& intype);
/** Get Typename in String if a valid type */
bool GetValidTypename(const std::type_info& intype, const std::vector<std::string>& validtypes, std::string& retTypeName);
/** Get 64-bit pragma */
std::string Get64BitPragma();
/** Get Typename in String */
void GetTypenameInString( const std::type_info& intype, std::ostringstream& ret );
/** Get pixel dimension (number of channels).
* For high-dimensional pixel format, only itk::Vector< type, 2/3 > is acceptable. */
int GetPixelDimension( const std::type_info& intype );
}
#endif
|
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2011 Nokia Corporation
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include "lib/uuid.h"
#include "btio/btio.h"
#include "att.h"
#include "gattrib.h"
#include "gatt.h"
#include "utils.h"
GIOChannel *gatt_connect(const char *src, const char *dst,
const char *dst_type, const char *sec_level,
int psm, int mtu, BtIOConnect connect_cb,
GError **gerr, gpointer user_data)
{
GIOChannel *chan;
bdaddr_t sba, dba;
uint8_t dest_type;
GError *tmp_err = NULL;
BtIOSecLevel sec;
str2ba(dst, &dba);
/* Local adapter */
if (src != NULL) {
if (!strncmp(src, "hci", 3))
hci_devba(atoi(src + 3), &sba);
else
str2ba(src, &sba);
} else
bacpy(&sba, BDADDR_ANY);
/* Not used for BR/EDR */
if (strcmp(dst_type, "random") == 0)
dest_type = BDADDR_LE_RANDOM;
else
dest_type = BDADDR_LE_PUBLIC;
if (strcmp(sec_level, "medium") == 0)
sec = BT_IO_SEC_MEDIUM;
else if (strcmp(sec_level, "high") == 0)
sec = BT_IO_SEC_HIGH;
else
sec = BT_IO_SEC_LOW;
if (psm == 0)
chan = bt_io_connect(connect_cb, user_data, NULL, &tmp_err,
BT_IO_OPT_SOURCE_BDADDR, &sba,
BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC,
BT_IO_OPT_DEST_BDADDR, &dba,
BT_IO_OPT_DEST_TYPE, dest_type,
BT_IO_OPT_CID, ATT_CID,
BT_IO_OPT_SEC_LEVEL, sec,
BT_IO_OPT_INVALID);
else
chan = bt_io_connect(connect_cb, user_data, NULL, &tmp_err,
BT_IO_OPT_SOURCE_BDADDR, &sba,
BT_IO_OPT_DEST_BDADDR, &dba,
BT_IO_OPT_PSM, psm,
BT_IO_OPT_IMTU, mtu,
BT_IO_OPT_SEC_LEVEL, sec,
BT_IO_OPT_INVALID);
if (tmp_err) {
g_propagate_error(gerr, tmp_err);
return NULL;
}
return chan;
}
size_t gatt_attr_data_from_string(const char *str, uint8_t **data)
{
char tmp[3];
size_t size, i;
size = strlen(str) / 2;
*data = g_try_malloc0(size);
if (*data == NULL)
return 0;
tmp[2] = '\0';
for (i = 0; i < size; i++) {
memcpy(tmp, str + (i * 2), 2);
(*data)[i] = (uint8_t) strtol(tmp, NULL, 16);
}
return size;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <unistd.h>
#include <time.h>
#include <locale.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include "utils.h"
char * trim (char *string)
{
register char *s, *t;
if (string == NULL)
{
return NULL;
}
for (s = string; isspace (*s); s++)
;
if (*s == 0)
return s;
t = s + strlen (s) - 1;
while (t > s && isspace (*t))
t--;
*++t = '\0';
return s;
}
int strsplit (const char *str, const char *delim, char ***tokens, int *token_count)
{
char *_running = NULL;
char *running = NULL;
char *token = NULL;
char **token_list = NULL;
int count = 0;
int i = 0;
int j = 0;
if (str == NULL || delim == NULL || tokens == NULL || token_count == NULL)
{
return -1;
}
if ((_running = strdup (str)) == NULL)
{
return -1;
}
running = _running;
while ((token = strsep (&running, delim)) != NULL)
{
if (token[0] != '\0')
count++;
}
free (_running);
if ((_running = strdup (str)) == NULL)
{
return -1;
}
running = _running;
if ((token_list = (char **)calloc(count, sizeof(char))) == NULL)
{
free (_running);
return -1;
}
while ((token = strsep (&running, delim)) != NULL)
{
if (token[0] == '\0')
continue;
if ((token_list[i++] = strdup (token)) == NULL)
goto free_exit;
}
free (_running);
*tokens = token_list;
*token_count = count;
return 0;
free_exit:
free (_running);
for (j = 0; j < i; j++)
{
free (token_list[j]);
}
free (token_list);
return -1;
}
|
//
// UIBarButtonItem+Extension.h
//
//
// Created by apple on 14-10-7.
// Copyright (c) 2014年 jiaguanglei. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (Extension)
+ (UIBarButtonItem *)itemWithTarget:(id)target action:(SEL)action image:(NSString *)image highImage:(NSString *)highImage;
+ (UIBarButtonItem *)itemWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action;
@end
|
/* $NetBSD: lfsr.c,v 1.3 2012/06/05 00:42:28 christos Exp $ */
/*
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* Id: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp */
/*! \file */
#include <config.h>
#include <stddef.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/lfsr.h>
#include <isc/util.h>
#define VALID_LFSR(x) (x != NULL)
void
isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits,
isc_uint32_t tap, unsigned int count,
isc_lfsrreseed_t reseed, void *arg)
{
REQUIRE(VALID_LFSR(lfsr));
REQUIRE(8 <= bits && bits <= 32);
REQUIRE(tap != 0);
lfsr->state = state;
lfsr->bits = bits;
lfsr->tap = tap;
lfsr->count = count;
lfsr->reseed = reseed;
lfsr->arg = arg;
if (count == 0 && reseed != NULL)
reseed(lfsr, arg);
if (lfsr->state == 0)
lfsr->state = 0xffffffffU >> (32 - lfsr->bits);
}
/*!
* Return the next state of the lfsr.
*/
static inline isc_uint32_t
lfsr_generate(isc_lfsr_t *lfsr)
{
/*
* If the previous state is zero, we must fill it with something
* here, or we will begin to generate an extremely predictable output.
*
* First, give the reseed function a crack at it. If the state is
* still 0, set it to all ones.
*/
if (lfsr->state == 0) {
if (lfsr->reseed != NULL)
lfsr->reseed(lfsr, lfsr->arg);
if (lfsr->state == 0)
lfsr->state = 0xffffffffU >> (32 - lfsr->bits);
}
if (lfsr->state & 0x01) {
lfsr->state = (lfsr->state >> 1) ^ lfsr->tap;
return (1);
} else {
lfsr->state >>= 1;
return (0);
}
}
void
isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count)
{
unsigned char *p;
unsigned int bit;
unsigned int byte;
REQUIRE(VALID_LFSR(lfsr));
REQUIRE(data != NULL);
REQUIRE(count > 0);
p = data;
byte = count;
while (byte--) {
*p = 0;
for (bit = 0; bit < 7; bit++) {
*p |= lfsr_generate(lfsr);
*p <<= 1;
}
*p |= lfsr_generate(lfsr);
p++;
}
if (lfsr->count != 0 && lfsr->reseed != NULL) {
if (lfsr->count <= count * 8)
lfsr->reseed(lfsr, lfsr->arg);
else
lfsr->count -= (count * 8);
}
}
static inline isc_uint32_t
lfsr_skipgenerate(isc_lfsr_t *lfsr, unsigned int skip)
{
while (skip--)
(void)lfsr_generate(lfsr);
(void)lfsr_generate(lfsr);
return (lfsr->state);
}
/*
* Skip "skip" states in "lfsr".
*/
void
isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip)
{
REQUIRE(VALID_LFSR(lfsr));
while (skip--)
(void)lfsr_generate(lfsr);
}
/*
* Skip states in lfsr1 and lfsr2 using the other's current state.
* Return the final state of lfsr1 ^ lfsr2.
*/
isc_uint32_t
isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2)
{
isc_uint32_t state1, state2;
isc_uint32_t skip1, skip2;
REQUIRE(VALID_LFSR(lfsr1));
REQUIRE(VALID_LFSR(lfsr2));
skip1 = lfsr1->state & 0x01;
skip2 = lfsr2->state & 0x01;
/* cross-skip. */
state1 = lfsr_skipgenerate(lfsr1, skip2);
state2 = lfsr_skipgenerate(lfsr2, skip1);
return (state1 ^ state2);
}
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#pragma once
#include <array>
#include <string>
#include <utility>
#include "iapplication.h"
#include "HandleWrapper.h"
typedef
HRESULT
(WINAPI * PFN_ASPNETCORE_CREATE_APPLICATION)(
_In_ IHttpServer *pServer,
_In_ const IHttpApplication * pHttpApplication,
_In_ APPLICATION_PARAMETER *pParameters,
_In_ DWORD nParameters,
_Out_ IAPPLICATION **pApplication
);
class ApplicationFactory
{
public:
ApplicationFactory(HMODULE hRequestHandlerDll, std::wstring location, PFN_ASPNETCORE_CREATE_APPLICATION pfnAspNetCoreCreateApplication) noexcept:
m_pfnAspNetCoreCreateApplication(pfnAspNetCoreCreateApplication),
m_location(std::move(location)),
m_hRequestHandlerDll(hRequestHandlerDll)
{
}
HRESULT Execute(
_In_ IHttpServer *pServer,
_In_ IHttpContext *pHttpContext,
_In_ std::wstring& shadowCopyDirectory,
_Outptr_ IAPPLICATION **pApplication) const
{
// m_location.data() is const ptr copy to local to get mutable pointer
auto location = m_location;
std::array<APPLICATION_PARAMETER, 4> parameters {
{
{"InProcessExeLocation", location.data()},
{"TraceContext", pHttpContext->GetTraceContext()},
{"Site", pHttpContext->GetSite()},
{"ShadowCopyDirectory", shadowCopyDirectory.data()}
}
};
return m_pfnAspNetCoreCreateApplication(pServer, pHttpContext->GetApplication(), parameters.data(), static_cast<DWORD>(parameters.size()), pApplication);
}
private:
PFN_ASPNETCORE_CREATE_APPLICATION m_pfnAspNetCoreCreateApplication;
std::wstring m_location;
HandleWrapper<ModuleHandleTraits> m_hRequestHandlerDll;
};
|
#include "sftest.h"
MAIN()
{
Sfio_t* f1;
Sfio_t* f2;
char* s;
if(!(f1 = sfopen(NIL(Sfio_t*), tstfile(0),"w+")) )
terror("Can't open file\n");
if(sfwrite(f1,"0123456789\n",11) != 11)
terror("Can't write to file\n");
sfclose(sfstdin);
if(sfswap(f1,sfstdin) != sfstdin)
terror("Can't swap with sfstdin\n");
sfseek(sfstdin,(Sfoff_t)0,0);
if(!(s = sfgetr(sfstdin,'\n',1)) )
terror("sfgetr failed\n");
if(strcmp(s,"0123456789") != 0)
terror("Get wrong data\n");
if(!(f1 = sfswap(sfstdin,NIL(Sfio_t*))) )
terror("Failed swapping to NULL\n");
if(!sfstack(sfstdout,f1) )
terror("Failed stacking f1\n");
if(!(f2 = sfopen(NIL(Sfio_t*), tstfile(0), "r")) )
terror("Can't open for read\n");
if(sfswap(f1,f2) != NIL(Sfio_t*) )
terror("sfswap should have failed\n");
TSTEXIT(0);
}
|
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include "ourhdr.h"
char buf[100000];
int
main(void)
{
int ntowrite, nwrite;
char *ptr;
ntowrite = read(STDIN_FILENO, buf, sizeof(buf));
fprintf(stderr, "read %d bytes\n", ntowrite);
set_fl(STDOUT_FILENO, O_NONBLOCK); /* set nonblocking */
for (ptr = buf; ntowrite > 0; ) {
errno = 0;
nwrite = write(STDOUT_FILENO, ptr, ntowrite);
fprintf(stderr, "nwrite = %d, errno = %d\n", nwrite, errno);
if (nwrite > 0) {
ptr += nwrite;
ntowrite -= nwrite;
}
}
clr_fl(STDOUT_FILENO, O_NONBLOCK); /* clear nonblocking */
exit(0);
}
|
#pragma once
#include "envoy/common/pure.h"
#include "envoy/http/message.h"
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace Common {
namespace Aws {
// TODO(lavignes): Move this interface to include/envoy if this is needed elsewhere
class Signer {
public:
virtual ~Signer() = default;
/**
* Sign an AWS request.
* @param message an AWS API request message.
* @param sign_body include the message body in the signature. The body must be fully buffered.
* @throws EnvoyException if the request cannot be signed.
*/
virtual void sign(Http::Message& message, bool sign_body) PURE;
};
using SignerPtr = std::unique_ptr<Signer>;
} // namespace Aws
} // namespace Common
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
|
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef PCA10001_H
#define PCA10001_H
#define LED_START 18
#define LED_0 18
#define LED_1 19
#define LED_STOP 19
#define BSP_LED_0 LED_0
#define BSP_LED_1 LED_1
#define BUTTON_START 16
#define BUTTON_0 16
#define BUTTON_1 17
#define BUTTON_STOP 17
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
#define BSP_BUTTON_0 BUTTON_0
#define BSP_BUTTON_1 BUTTON_1
#define BUTTONS_NUMBER 2
#define LEDS_NUMBER 2
#define BUTTONS_MASK 0x00030000
#define LEDS_MASK 0x000C0000
#define LEDS_INV_MASK 0
#define BSP_BUTTON_0_MASK (1<<BSP_BUTTON_0)
#define BSP_BUTTON_1_MASK (1<<BSP_BUTTON_1)
#define BUTTONS_LIST { BUTTON_0, BUTTON_1 }
#define LEDS_LIST { LED_0, LED_1 }
#define BSP_LED_0_MASK (1<<LED_0)
#define BSP_LED_1_MASK (1<<LED_1)
#define RX_PIN_NUMBER 11
#define TX_PIN_NUMBER 9
#define CTS_PIN_NUMBER 10
#define RTS_PIN_NUMBER 8
#define HWFC true
#define SPIS_MISO_PIN 20 // SPI MISO signal.
#define SPIS_CSN_PIN 21 // SPI CSN signal.
#define SPIS_MOSI_PIN 22 // SPI MOSI signal.
#define SPIS_SCK_PIN 23 // SPI SCK signal.
#define SPIM0_SCK_PIN 23u /**< SPI clock GPIO pin number. */
#define SPIM0_MOSI_PIN 20u /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM0_MISO_PIN 22u /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM0_SS_PIN 21u /**< SPI Slave Select GPIO pin number. */
#define SPIM1_SCK_PIN 29u /**< SPI clock GPIO pin number. */
#define SPIM1_MOSI_PIN 24u /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM1_MISO_PIN 28u /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM1_SS_PIN 25u /**< SPI Slave Select GPIO pin number. */
// serialization APPLICATION board
// UART
// this configuration works with the SPI wires setup
#define SER_APP_RX_PIN 20 // UART RX pin number.
#define SER_APP_TX_PIN 22 // UART TX pin number.
#define SER_APP_CTS_PIN 23 // UART Clear To Send pin number.
#define SER_APP_RTS_PIN 21 // UART Request To Send pin number.
// SPI
#if 0
#define SER_APP_SPIM0_SCK_PIN 20 // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN 17 // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN 16 // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN 21 // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN 19 // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN 18 // SPI REQUEST GPIO pin number
#else
#define SER_APP_SPIM0_SCK_PIN 23 // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN 20 // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN 22 // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN 21 // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN 25 // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN 24 // SPI REQUEST GPIO pin number
#endif
// serialization CONNECTIVITY board
// UART
#if 0
#define SER_CON_RX_PIN 22 // UART RX pin number.
#define SER_CON_TX_PIN 20 // UART TX pin number.
#define SER_CON_CTS_PIN 21 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN 23 // UART Request To Send pin number. Not used if HWFC is set to false.
#else
// this configuration works with the SPI wires setup
#define SER_CON_RX_PIN 20 // UART RX pin number.
#define SER_CON_TX_PIN 22 // UART TX pin number.
#define SER_CON_CTS_PIN 21 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN 23 // UART Request To Send pin number. Not used if HWFC is set to false.
#endif
//SPI
#if 0
#define SER_CON_SPIS_SCK_PIN 20 // SPI SCK signal.
#define SER_CON_SPIS_MISO_PIN 16 // SPI MISO signal.
#define SER_CON_SPIS_MOSI_PIN 17 // SPI MOSI signal.
#define SER_CON_SPIS_CSN_PIN 21 // SPI CSN signal.
#define SER_CON_SPIS_RDY_PIN 19 // SPI READY GPIO pin number.
#define SER_CON_SPIS_REQ_PIN 18 // SPI REQUEST GPIO pin number.
#else
#define SER_CON_SPIS_SCK_PIN 23 // SPI SCK signal.
#define SER_CON_SPIS_MOSI_PIN 22 // SPI MOSI signal.
#define SER_CON_SPIS_MISO_PIN 20 // SPI MISO signal.
#define SER_CON_SPIS_CSN_PIN 21 // SPI CSN signal.
#define SER_CON_SPIS_RDY_PIN 25 // SPI READY GPIO pin number.
#define SER_CON_SPIS_REQ_PIN 24 // SPI REQUEST GPIO pin number.
#endif
#define SER_CONN_ASSERT_LED_PIN LED_0
// Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC NRF_CLOCK_LFCLKSRC_XTAL_20_PPM
#endif
|
//
// MOBABaseResponse.h
// MOBApiCloud
//
// Created by fenghj on 15/10/9.
// Copyright © 2015年 mob. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* 基础回复类型
*
* @author vimfung
*/
@interface MOBAResponse : NSObject
/**
* 错误信息
*/
@property (nonatomic, strong) NSError *error;
/**
* 响应数据
*/
@property (nonatomic, strong) id responder;
@end
|
//
// Created by yuxuan on 17-3-11.
//
#ifndef DSA_BUBBLESORT_H
#define DSA_BUBBLESORT_H
#include <zconf.h>
/** 交换元素 */
void Swap(int Array[], int i, int j) {
if(!Array)
return;
int tmp = Array[i];
Array[i] = Array[j];
Array[j] = tmp;
}
/** 冒泡排序算法 */
void BubbleSort(int Array[], int len) {
if(!Array)
return;
bool sorted = true;
while(sorted) {
sorted = false;
for(int i = 1; i < len; ++i) {
if(Array[i - 1] > Array[i]) {
Swap(Array, i - 1, i);
sorted = true;
}
}
--len;
}
}
/** 对任意非负整数,统计其二进制展开中数位1的数目。*/
int countOnes(unsigned int n) { //时间复杂度O(logn)
int ones = 0;
while(n > 0) {
ones += (n & 1); //通过与运算,检查最低位,若为1,则计数
n >>= 1; //让n右移一位
}
return ones;
}
/** 计算给定N个数的总和。*/
int sumI(int Array[], int n) { //时间复杂度O(n)
int sum = 0;
for(int i = 0; i < n; ++i) {
sum = Array[i];
}
return sum;
}
//线性递归版
int sumR(int Array[], int n) {
if (n < 1) {
return 0;
} else {
return Array[n - 1] + sumR(Array, n - 1);
}
}
/** 在禁止超过1位的移位运算的前提下,对任意非负整数n, 计算幂2n。*/
__int64_t power2BF_I(int n) {
__int64_t pow = 1;
while( 0 < n --) {
pow <<= n;
}
return pow;
}
//幂函数的多向递归版本
inline __int64_t sqr(__int64_t a) {return a * a;}
__int64_t power2(int n) {
if(n == 0) {
return 1;
}
return (n & 1) ? sqr(power2(n >> 1)) << 1 : sqr(power2(n >> 1));
}
//
/** 将输出数组的元素倒置 */
void reverse(int Array[], int lo, int hi) {
if(lo < hi) {
Swap(Array, lo, hi);
reverse(Array, lo + 1, hi - 1);
}
}
//非递归版本
void reverse(int Array[], int lo, int hi) {
while(lo < hi) {
Swap(Array, lo--, hi--);
}
}
void reverse(int Array[], int n) {
reverse(Array, 0, n - 1);
}
#endif //DSA_BUBBLESORT_H
|
/* Include prototype headers. */
#include "6SV1.0B/AATSR.h"
#include "6SV1.0B/ABSTRA.h"
#include "6SV1.0B/AEROPROF.h"
#include "6SV1.0B/AEROSO.h"
#include "6SV1.0B/AKTOOL.h"
#include "6SV1.0B/ATMREF.h"
#include "6SV1.0B/AVHRR.h"
#include "6SV1.0B/BBM.h"
#include "6SV1.0B/BDM.h"
#include "6SV1.0B/BRDFGRID.h"
#include "6SV1.0B/CHAND.h"
#include "6SV1.0B/CLEARW.h"
#include "6SV1.0B/CSALBR.h"
#include "6SV1.0B/DICA1.h"
#include "6SV1.0B/DICA2.h"
#include "6SV1.0B/DICA3.h"
#include "6SV1.0B/DISCOM.h"
#include "6SV1.0B/DISCRE.h"
#include "6SV1.0B/DUST.h"
#include "6SV1.0B/ENVIRO.h"
#include "6SV1.0B/EQUIVWL.h"
#include "6SV1.0B/GAUSS.h"
#include "6SV1.0B/GLI.h"
#include "6SV1.0B/GOES.h"
#include "6SV1.0B/HAPKALBE.h"
#include "6SV1.0B/HAPKBRDF.h"
#include "6SV1.0B/HRV.h"
#include "6SV1.0B/IAPIALBE.h"
#include "6SV1.0B/IAPIBRDF.h"
#include "6SV1.0B/IAPITOOLS.h"
#include "6SV1.0B/INTERP.h"
#include "6SV1.0B/ISO.h"
#include "6SV1.0B/KERNEL.h"
#include "6SV1.0B/KERNELPOL.h"
#include "6SV1.0B/LAKEW.h"
#include "6SV1.0B/MAS.h"
#include "6SV1.0B/MERIS.h"
#include "6SV1.0B/METEO.h"
#include "6SV1.0B/METH1.h"
#include "6SV1.0B/METH2.h"
#include "6SV1.0B/METH3.h"
#include "6SV1.0B/METH4.h"
#include "6SV1.0B/METH5.h"
#include "6SV1.0B/METH6.h"
#include "6SV1.0B/MIDSUM.h"
#include "6SV1.0B/MIDWIN.h"
#include "6SV1.0B/MIE.h"
#include "6SV1.0B/MINNALBE.h"
#include "6SV1.0B/MINNBRDF.h"
#include "6SV1.0B/MOCA1.h"
#include "6SV1.0B/MOCA2.h"
#include "6SV1.0B/MOCA3.h"
#include "6SV1.0B/MOCA4.h"
#include "6SV1.0B/MOCA5.h"
#include "6SV1.0B/MOCA6.h"
#include "6SV1.0B/MODISALBE.h"
#include "6SV1.0B/MODISBRDF.h"
#include "6SV1.0B/MODIS.h"
#include "6SV1.0B/MSS.h"
#include "6SV1.0B/NIOX1.h"
#include "6SV1.0B/NIOX2.h"
#include "6SV1.0B/NIOX3.h"
#include "6SV1.0B/NIOX4.h"
#include "6SV1.0B/NIOX5.h"
#include "6SV1.0B/NIOX6.h"
#include "6SV1.0B/OCEAALBE.h"
#include "6SV1.0B/OCEABRDFFAST.h"
#include "6SV1.0B/OCEABRDF.h"
#include "6SV1.0B/OCEA.h"
#include "6SV1.0B/OCEATOOLS.h"
#include "6SV1.0B/ODA550.h"
#include "6SV1.0B/ODRAYL.h"
#include "6SV1.0B/OS.h"
#include "6SV1.0B/OSPOL.h"
#include "6SV1.0B/OXYG3.h"
#include "6SV1.0B/OXYG4.h"
#include "6SV1.0B/OXYG5.h"
#include "6SV1.0B/OXYG6.h"
#include "6SV1.0B/OZON1.h"
#include "6SV1.0B/PLANPOL.h"
#include "6SV1.0B/POLDER.h"
#include "6SV1.0B/POLGLIT.h"
#include "6SV1.0B/POLNAD.h"
#include "6SV1.0B/POSGE.h"
#include "6SV1.0B/POSGW.h"
#include "6SV1.0B/POSLAN.h"
#include "6SV1.0B/POSMTO.h"
#include "6SV1.0B/POSNOA.h"
#include "6SV1.0B/POSSOL.h"
#include "6SV1.0B/POSSPO.h"
#include "6SV1.0B/PRESPLANE.h"
#include "6SV1.0B/PRESSURE.h"
#include "6SV1.0B/PRINT_ERROR.h"
#include "6SV1.0B/RAHMALBE.h"
#include "6SV1.0B/RAHMBRDF.h"
#include "6SV1.0B/ROUJALBE.h"
#include "6SV1.0B/ROUJBRDF.h"
#include "6SV1.0B/SAND.h"
#include "6SV1.0B/SCATRA.h"
#include "6SV1.0B/SEAWIFS.h"
#include "6SV1.0B/SOLIRR.h"
#include "6SV1.0B/SOOT.h"
#include "6SV1.0B/SPECINTERP.h"
#include "6SV1.0B/SPLIE2.h"
#include "6SV1.0B/SPLIN2.h"
#include "6SV1.0B/SPLINE.h"
#include "6SV1.0B/SPLINT.h"
#include "6SV1.0B/STM.h"
#include "6SV1.0B/SUBSUM.h"
#include "6SV1.0B/SUBWIN.h"
#include "6SV1.0B/TM.h"
#include "6SV1.0B/TROPIC.h"
#include "6SV1.0B/TRUNCA.h"
#include "6SV1.0B/US62.h"
#include "6SV1.0B/VARSOL.h"
#include "6SV1.0B/VEGETA.h"
#include "6SV1.0B/VERSALBE.h"
#include "6SV1.0B/VERSBRDF.h"
#include "6SV1.0B/VERSTOOLS.h"
#include "6SV1.0B/WALTALBE.h"
#include "6SV1.0B/WALTBRDF.h"
#include "6SV1.0B/WATE.h"
#include "6SV1.0B/WAVA1.h"
#include "6SV1.0B/WAVA2.h"
#include "6SV1.0B/WAVA3.h"
#include "6SV1.0B/WAVA4.h"
#include "6SV1.0B/WAVA5.h"
#include "6SV1.0B/WAVA6.h"
/* otb 6S Main function */
#include "otb_main6S_function.h"
|
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AOM_DSP_BLEND_H_
#define AOM_DSP_BLEND_H_
#include "aom_ports/mem.h"
// Various blending functions and macros.
// See also the aom_blend_* functions in aom_dsp_rtcd.h
// Alpha blending with alpha values from the range [0, 64], where 64
// means use the first input and 0 means use the second input.
#define AOM_BLEND_A64_ROUND_BITS 6
#define AOM_BLEND_A64_MAX_ALPHA (1 << AOM_BLEND_A64_ROUND_BITS) // 64
#define AOM_BLEND_A64(a, v0, v1) \
ROUND_POWER_OF_TWO((a) * (v0) + (AOM_BLEND_A64_MAX_ALPHA - (a)) * (v1), \
AOM_BLEND_A64_ROUND_BITS)
// Alpha blending with alpha values from the range [0, 256], where 256
// means use the first input and 0 means use the second input.
#define AOM_BLEND_A256_ROUND_BITS 8
#define AOM_BLEND_A256_MAX_ALPHA (1 << AOM_BLEND_A256_ROUND_BITS) // 256
#define AOM_BLEND_A256(a, v0, v1) \
ROUND_POWER_OF_TWO((a) * (v0) + (AOM_BLEND_A256_MAX_ALPHA - (a)) * (v1), \
AOM_BLEND_A256_ROUND_BITS)
// Blending by averaging.
#define AOM_BLEND_AVG(v0, v1) ROUND_POWER_OF_TWO((v0) + (v1), 1)
#define DIFF_FACTOR_LOG2 4
#define DIFF_FACTOR (1 << DIFF_FACTOR_LOG2)
#endif // AOM_DSP_BLEND_H_
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.