text stringlengths 4 6.14k |
|---|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_POLLFORTHIRDPARTYJOBSREQUEST_H
#define QTAWS_POLLFORTHIRDPARTYJOBSREQUEST_H
#include "codepipelinerequest.h"
namespace QtAws {
namespace CodePipeline {
class PollForThirdPartyJobsRequestPrivate;
class QTAWSCODEPIPELINE_EXPORT PollForThirdPartyJobsRequest : public CodePipelineRequest {
public:
PollForThirdPartyJobsRequest(const PollForThirdPartyJobsRequest &other);
PollForThirdPartyJobsRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(PollForThirdPartyJobsRequest)
};
} // namespace CodePipeline
} // namespace QtAws
#endif
|
#ifndef COUNTING_ITERATORAT_HEADER_INCLUDED_PE98TUW0EOIBNOIJPT
#define COUNTING_ITERATORAT_HEADER_INCLUDED_PE98TUW0EOIBNOIJPT
#include "finance_config.h"
#include <iterator>
#include <cmath>
namespace finance {
/**
* Utility code for internal rate of return calculations.
*/
namespace detail {
/**
* Binary Function object for calculating the derivitive (w.r.t to the interest rate) of
* the present value of a payment.
*/
struct Derivator {
Derivator(SK_FIN_ACC_TYPE i=0.0) : i(i) {}
/**
* Calculate the derivitive of the present value of a payment.
*
* \param payment The amount of the payment.
* \param period The time of the payment.
*/
SK_FIN_ACC_TYPE operator()(SK_FIN_ACC_TYPE payment, SK_FIN_ACC_TYPE period) {
return -payment * period / pow(1.0 + i, period-1.0);
}
/**
* The interest rate to be used in the present value calculation.
*/
SK_FIN_ACC_TYPE i;
};
/**
* Binary Function object for calculating the present value of a payment.
*/
struct Evaluator {
Evaluator(SK_FIN_ACC_TYPE i=0.0) : i(i) {}
/**
* Calculate the present value of a payment.
*
* \param payment The amount of the payment.
* \param period The time of the payment.
*/
SK_FIN_ACC_TYPE operator()(SK_FIN_ACC_TYPE payment, SK_FIN_ACC_TYPE period) {
return payment / pow(1.0 + i, period);
}
/**
* The interest rate to be used in the present value calculation.
*/
SK_FIN_ACC_TYPE i;
};
/**
* A simple counting iterator (which I think is standards compliant).
*
* @note it would be better to use boost::counting_iterator, but I'd like this library to be standalone.
*
* @note I've not bothered to document all members, as they are described elsewhere in the documentation
* of the C++ standard library.
*/
struct Counter {
//
typedef std::input_iterator_tag iterator_category;
typedef SK_FIN_ACC_TYPE value_type;
typedef ptrdiff_t difference_type;
typedef ptrdiff_t distance_type; // not sure if this is needed.
typedef SK_FIN_ACC_TYPE const* pointer;
typedef SK_FIN_ACC_TYPE const& reference;
Counter(SK_FIN_ACC_TYPE start)
: count_(start) {
}
inline Counter const& operator++(void) {
++count_;
return *this;
}
inline reference operator*(void) const {
return count_;
}
// not really needed here
inline Counter const operator++(int) {
Counter tmp = *this;
++count_;
return tmp;
}
private:
SK_FIN_ACC_TYPE count_;
};
} // end namespace detail
} // end namespace finance
#endif //COUNTING_ITERATORAT_HEADER_INCLUDED_PE98TUW0EOIBNOIJPT |
// Created file "Lib\src\Uuid\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_CONTENT_TYPE_TELEVISION, 0x60a169cf, 0xf2ae, 0x4e21, 0x93, 0x75, 0x96, 0x77, 0xf1, 0x1c, 0x1c, 0x6e);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETENCRYPTIONCONFIGREQUEST_P_H
#define QTAWS_GETENCRYPTIONCONFIGREQUEST_P_H
#include "xrayrequest_p.h"
#include "getencryptionconfigrequest.h"
namespace QtAws {
namespace XRay {
class GetEncryptionConfigRequest;
class GetEncryptionConfigRequestPrivate : public XRayRequestPrivate {
public:
GetEncryptionConfigRequestPrivate(const XRayRequest::Action action,
GetEncryptionConfigRequest * const q);
GetEncryptionConfigRequestPrivate(const GetEncryptionConfigRequestPrivate &other,
GetEncryptionConfigRequest * const q);
private:
Q_DECLARE_PUBLIC(GetEncryptionConfigRequest)
};
} // namespace XRay
} // namespace QtAws
#endif
|
/* This file is an image processing operation for GEGL
*
* GEGL 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.
*
* GEGL 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 GEGL; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#include "config.h"
#include <glib/gi18n-lib.h>
#ifdef GEGL_PROPERTIES
/* no properties */
#else
#define GEGL_OP_POINT_FILTER
#define GEGL_OP_NAME invert_linear
#define GEGL_OP_C_SOURCE invert-linear.c
#include "gegl-op.h"
static gboolean
process (GeglOperation *op,
void *in_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
gfloat *in = in_buf;
gfloat *out = out_buf;
while (samples--)
{
out[0] = 1.0 - in[0];
out[1] = 1.0 - in[1];
out[2] = 1.0 - in[2];
out[3] = in[3];
in += 4;
out+= 4;
}
return TRUE;
}
#include "opencl/invert-linear.cl.h"
static void
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
point_filter_class->process = process;
gegl_operation_class_set_keys (operation_class,
"name", "gegl:invert-linear",
"title", _("Invert"),
"compat-name", "gegl:invert",
"categories" , "color",
"description",
_("Inverts the components (except alpha), the result is the "
"corresponding \"negative\" image."),
"cl-source" , invert_linear_cl_source,
NULL);
}
#endif
|
// Created file "Lib\src\Uuid\i_activscp"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IActiveScriptSiteInterruptPoll, 0x539698a0, 0xcdca, 0x11cf, 0xa5, 0xeb, 0x00, 0xaa, 0x00, 0x47, 0xa0, 0x63);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_CHECKDNSAVAILABILITYRESPONSE_P_H
#define QTAWS_CHECKDNSAVAILABILITYRESPONSE_P_H
#include "elasticbeanstalkresponse_p.h"
namespace QtAws {
namespace ElasticBeanstalk {
class CheckDNSAvailabilityResponse;
class CheckDNSAvailabilityResponsePrivate : public ElasticBeanstalkResponsePrivate {
public:
explicit CheckDNSAvailabilityResponsePrivate(CheckDNSAvailabilityResponse * const q);
void parseCheckDNSAvailabilityResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(CheckDNSAvailabilityResponse)
Q_DISABLE_COPY(CheckDNSAvailabilityResponsePrivate)
};
} // namespace ElasticBeanstalk
} // namespace QtAws
#endif
|
/*
* Copyright 2010-present Facebook.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FBDialog.h"
#include "FBLoginDialog.h"
#include "FBRequest.h"
#include "Facebook.h"
|
/* nthword.c */
/* Print the nth "word" in a string. */
/* This may possibly be useful as a substitute for strtok(). */
/* This code is released to the public domain. */
/* "Share and enjoy...." ;) */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void nthword(char *str, int num)
{
char ret[80] ;
int i=0;
/* Counter for the string number. */
int strnum=0;
/* Pointer to character before *str. */
/* Used to find first character of string. */
char *prev;
prev = NULL;
while ( *str != '\0' )
{
if ( *str != ' ' )
{
if ( ( prev == NULL ) || ( *prev == ' ' ) ) strnum++;
if ( strnum == num ) {ret[i] = *str; i++;}
str++;
prev = str - 1;
}
else if ( *str == ' ' )
{
str++;
prev = str - 1;
}
}
ret[i] = '\0' ;
printf("%s \n", ret);
}
int main()
{
char *test = "select * from mytable where city = \"Auckland\" ;" ;
nthword(test, 1) ;
nthword(test, 2) ;
nthword(test, 3) ;
return 0;
}
|
#ifndef API_STATE_H_
#define API_STATE_H_
#include <memory>
namespace api {
class Bot;
enum class StateType {
ChaseState,
PatrolState,
AggressiveState,
AttachState,
BaseduelState,
FollowState,
PluginState
};
class State {
protected:
Bot* m_Bot;
public:
State(Bot* bot) : m_Bot(bot) { }
virtual ~State() { }
virtual void Update(DWORD dt) = 0;
virtual StateType GetType() const { return StateType::PluginState; }
};
typedef std::shared_ptr<State> StatePtr;
class StateMachine {
public:
virtual void Update(DWORD dt) = 0;
virtual void Push(StatePtr state) = 0;
virtual StatePtr Pop() = 0;
virtual StatePtr GetState() const = 0;
virtual bool IsEmpty() const = 0;
virtual void Clear() = 0;
};
typedef std::shared_ptr<StateMachine> StateMachinePtr;
} // ns
#endif
|
#ifndef _PNGUTILS_H
#define _PNGUTILS_H
#include <stdint.h>
#include <png.h>
#include <vector>
typedef struct {
std::vector<int8_t> data;
int width;
int height;
int channels;
png_byte color_type;
png_byte bit_depth;
} PNGImage;
typedef struct {
unsigned char* buf;
size_t size;
size_t offset;
} buf_stream_info;
void ConvertRGBToRGBA(PNGImage* image);
void VertFlip(PNGImage* image);
PNGImage read_png_from_memory(const png_bytep buf, png_size_t size);
PNGImage read_png_from_file(const char* filename);
PNGImage read_png_file(const char* filename);
void write_png_file(const char* filename, char* data, int w, int h,
int channels, int depth);
#endif // _PNGUTILS_H
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtSql>
#include <QLabel>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_actionImport_triggered();
private:
Ui::MainWindow *ui;
QSqlTableModel *model;
QLabel * labelInfo;
QStringList list;
void readSQL();
void updateSQL(QStringList &newWords);
};
#endif // MAINWINDOW_H
|
/* mystrlen.c */
/* Find the length of a string without using strlen(). */
/* This code is released to the public domain. */
/* "Share and enjoy...." ;) */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int mystrlen(char *str)
{
int len=0;
/* Pointer to character before *str. */
/* Used to find first character of string. */
char *next;
next = str + 1;
while ( *str != '\0' )
{
if ( *str != ' ' )
{
str++;
len++;
if ( ( *next == ' ' ) || ( *next == '\0' ) ) {break;}
}
else if ( *str == ' ' )
{
str++;
next++;
}
}
return len;
}
int main()
{
char *test = " select " ;
char *test2 = " * " ;
printf("%d \n", mystrlen(test) ) ;
printf("%d \n", mystrlen(test2) ) ;
return 0;
}
|
#pragma once
#include "gmock/gmock.h" // Brings in Google Mock.
#include "turtle.h"
class MockTurtle : public Turtle {
public:
MOCK_METHOD0(PenUp, void());
MOCK_METHOD0(PenDown, void());
MOCK_METHOD1(Forward, void(int distance));
MOCK_METHOD1(Turn, void(int degrees));
MOCK_METHOD2(GoTo, void(int x, int y));
MOCK_CONST_METHOD0(GetX, int());
MOCK_CONST_METHOD0(GetY, int());
};
|
#ifndef LWR_HW__LWR_HW_REAL_H
#define LWR_HW__LWR_HW_REAL_H
// lwr hw definition
#include "lwr_hw/lwr_hw.h"
// fri remote
#include <iostream>
#include <cstdlib>
#include <math.h>
#include <limits.h>
#include "fri/friudp.h"
#include "fri/friremote.h"
namespace lwr_hw
{
class LWRHWreal : public lwr_hw::LWRHW
{
public:
LWRHWreal(ros::NodeHandle nh);
bool start();
bool read(ros::Time time, ros::Duration period);
void write(ros::Time time, ros::Duration period);
void stop();
void set_mode();
// low-level interface
boost::shared_ptr<friRemote> device_;
// FRI values
FRI_QUALITY lastQuality_;
FRI_CTRL lastCtrlScheme_;
private:
// Node handle
ros::NodeHandle nh_;
// Parameters
int port_;
std::string hintToRemoteHost_;
};
}
#endif |
#pragma once
#include <gtkmm/application.h>
#include <gtkmm/window.h>
#include <string>
#include <vector>
#include <memory>
#include <i_gui_manager.h>
namespace erebus {
class IWindow;
class GTK_Window;
class IViewWindow;
class ViewPreferencesManager;
}
namespace erebus {
/**
* This class is the gui manager for the gtkmm library.
*/
class GTK_GUIManager:public IGUIManager {
Glib::RefPtr<Gtk::Application> application_;
std::unique_ptr<Gtk::Window> dummyWindow_;
std::vector<std::unique_ptr<IWindow>> windows_;
std::unique_ptr<ViewPreferencesManager> viewPreferences_;
bool isInitialized_;
void showMessageDialogPr(Gtk::Window& window,std::string primaryText,std::string secondaryText,
ErrorLevel errorLevel);
GTK_Window* getWindow(std::size_t id);
public:
/**
* The package name of this application.
*
* This is needed to make this application a single instance or not.
*/
static const std::string STD_APP_ID;
/**
* Constructor.
*
* @param viewPreferences the manager that hold the view preferences
*/
GTK_GUIManager();
/**
* Copy constructor.
*
* Copying the whole gui makes no sense.
*/
GTK_GUIManager(const GTK_GUIManager &obj)=delete;
/**
* Move Constructor.
*
* Moving the whole gui makes no sense.
*/
GTK_GUIManager( GTK_GUIManager&& )=delete;
/**
* Copy assignment operator.
*
* Copying the whole gui makes no sense.
*/
GTK_GUIManager& operator=(const GTK_GUIManager&)=delete;
/**
* Move assignment operator.
*
* Moving the whole gui makes no sense.
*/
GTK_GUIManager& operator=(GTK_GUIManager&&)=delete;
/**
* Destructor.
*/
~GTK_GUIManager();
/**
* See IGUIManager::loadCustomViewPreferences.
*/
void loadCustomViewPreferences()override;
/**
* See IGUIManager::loadDefaultViewPreferences.
*/
void loadDefaultViewPreferences()override;
/**
* Initializes the gui.
*
* This method has to be called before every other method.
*
* @param argc command line arg argc
* @param argv command line arg argv
*/
void initialize(int argc,char** argv);
/**
* See IGUIManager::closeEmptyViewWindows;
*/
void closeEmptyViewWindows()override;
/**
* See IGUIManager::getViewPreferences.
*/
ViewPreferencesManager& getViewPreferences()override;
/**
* See IGUIManager::getParentOf.
*/
IGUIObject* getParentOf(std::size_t id)override;
/**
* See IGUIManager::showMessageDialog.
*
* The purpose of this method is originally that no window is locked when
* a message box is shown. but gtkmm does not allow such behavior. So all windows will be
* blocked.
*/
void showMessageDialog(std::string primaryText,std::string secondaryText,
ErrorLevel errorLevel)override;
/**
* See IGUIManager::showMessageDialog.
*/
void showMessageDialog(std::size_t id,std::string primaryText,std::string secondaryText,
ErrorLevel errorLevel)override;
/**
* See IGUIManager::moveViewToNewWindow.
*/
void moveViewToNewWindow(IView& view)override;
/**
* See IGUIManager::runGUI.
*/
void runGUI()override;
/**
* See IGUIManager::joinContainer.
*/
void joinContainer(std::size_t id)override;
/**
* See IGUIManager::resetViewPreferences.
*/
void resetViewPreferences()override;
/**
* See IGUIManager::createNewViewWindow.
*/
IViewWindow& createNewViewWindow()override;
/**
* See IGUIManager::addWindow.
*/
IWindow& addWindow(std::unique_ptr<IWindow> window,bool makePersistent)override;
/**
* See IGUIManager::destroyWindow.
*/
void destroyWindow(IWindow& window)override;
};
}//namespace erebus
|
#pragma once
#include <limits>
template<class T>
class NumericLimits {
public:
static T max();
};
bool NumericLimits<bool>::max() {
return true;
}
double NumericLimits<double>::max() {
return DBL_MAX;
}
float NumericLimits<float>::max() {
return FLT_MAX;
}
int NumericLimits<int>::max() {
return INT_MAX;
}
long NumericLimits<long>::max() {
return LONG_MAX;
}
unsigned short NumericLimits<unsigned short>::max() {
return 0xFFFF;
} |
/*
* Copyright (c) 2016 Wind River Systems, Inc.
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
*
* System workqueue.
*/
#include <kernel.h>
#include <init.h>
// KID 20170715
// KID 20170717
// CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE: 1024
//
// K_THREAD_STACK_DEFINE(sys_work_q_stack, 1024):
// char __attribute__((section("." "noinit" "." "_FILE_PATH_HASH" "." "__COUNTER__"))) __aligned(4) sys_work_q_stack[1024]
K_THREAD_STACK_DEFINE(sys_work_q_stack, CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE);
// KID 20170715
// KID 20170717
// KID 20170719
struct k_work_q k_sys_work_q;
// KID 20170715
// KID 20170726
// __device_sys_init_k_sys_work_q_init0
static int k_sys_work_q_init(struct device *dev)
{
// dev: __device_sys_init_k_sys_work_q_init0
ARG_UNUSED(dev);
// K_THREAD_STACK_SIZEOF(sys_work_q_stack): 1024, CONFIG_SYSTEM_WORKQUEUE_PRIORITY: -1
k_work_q_start(&k_sys_work_q,
sys_work_q_stack,
K_THREAD_STACK_SIZEOF(sys_work_q_stack),
CONFIG_SYSTEM_WORKQUEUE_PRIORITY);
// k_work_q_start 에서 한일:
// 워크큐 생성 및 초기화 수행
// (&(&(&k_sys_work_q)->fifo)->data_q)->head: NULL
// (&(&(&k_sys_work_q)->fifo)->data_q)->tail: NULL
// (&(&(&k_sys_work_q)->fifo)->wait_q)->head: &(&(&k_sys_work_q)->fifo)->wait_q
// (&(&(&k_sys_work_q)->fifo)->wait_q)->tail: &(&(&k_sys_work_q)->fifo)->wait_q
//
// 신규 쓰레드를 생성함
// (&(&(&k_sys_work_q)->thread)->base)->user_options: 0
// (&(&(&k_sys_work_q)->thread)->base)->thread_state: 0x4
// (&(&(&k_sys_work_q)->thread)->base)->prio: -1
// (&(&(&k_sys_work_q)->thread)->base)->sched_locked: 0
// (&(&(&(&k_sys_work_q)->thread)->base)->timeout)->delta_ticks_from_prev: -1
// (&(&(&(&k_sys_work_q)->thread)->base)->timeout)->wait_q: NULL
// (&(&(&(&k_sys_work_q)->thread)->base)->timeout)->thread: NULL
// (&(&(&(&k_sys_work_q)->thread)->base)->timeout)->func: NULL
//
// (&(&k_sys_work_q)->thread)->init_data: NULL
// (&(&k_sys_work_q)->thread)->fn_abort: NULL
//
// *(unsigned long *)(sys_work_q_stack + 1024): &k_sys_work_q
// *(unsigned long *)(sys_work_q_stack + 1020): NULL
// *(unsigned long *)(sys_work_q_stack + 1016): NULL
// *(unsigned long *)(sys_work_q_stack + 1016), pEntry: work_q_main
// *(unsigned long *)(sys_work_q_stack + 1012): eflag 레지스터 값 | 0x00000200
// *(unsigned long *)(sys_work_q_stack + 1008): _thread_entry_wrapper
//
// (&(&k_sys_work_q)->thread)->callee_saved.esp: sys_work_q_stack + 980
//
// 생성된 쓰레드 &(&k_sys_work_q)->thread 을 시작 시키기 위해 레디큐에 등록함
//
// (&(&k_sys_work_q)->thread)->base.thread_state: 0
//
// _kernel.ready_q.prio_bmap[0]: 0x80018000
//
// (&(&(&k_sys_work_q)->thread)->base.k_q_node)->next: &_kernel.ready_q.q[15]
// (&(&(&k_sys_work_q)->thread)->base.k_q_node)->prev: (&_kernel.ready_q.q[15])->tail
// (&_kernel.ready_q.q[15])->tail->next: &(&(&k_sys_work_q)->thread)->base.k_q_node
// (&_kernel.ready_q.q[15])->tail: &(&(&k_sys_work_q)->thread)->base.k_q_node
//
// _kernel.ready_q.cache: &(&k_sys_work_q)->thread
//
// 현재 실행 중인 &_main_thread_s 보다 우선 순위가 높은 &(&k_sys_work_q)->thread 가 실행하여
// &_main_thread_s 는 선점됨, work_q_main이 실행 되다가 &(&k_sys_work_q)->fifo에 있는 큐에
// 연결되어 있는 잡이 비어 있는 상태를 확인 후 &(&(&k_sys_work_q)->fifo)->wait_q 인 웨이트 큐에
// &(&(&k_sys_work_q)->thread)->base.k_q_node 를 등록하고 현재 쓰레드 &(&k_sys_work_q)->thread 는
// _THREAD_PENDING 상태롤 변경, 변경된 이후 다시 &_main_thread_s 로 쓰레드 복귀 하여 수행 됨
//
// &_kernel.ready_q.q[15] 에 연결된 list node 인 &(&(&k_sys_work_q)->thread)->base.k_q_node 을 제거함
//
// (&_kernel.ready_q.q[15])->next: &_kernel.ready_q.q[15]
// (&_kernel.ready_q.q[15])->prev: &_kernel.ready_q.q[15]
//
// _kernel.ready_q.prio_bmap[0]: 0x80010000
// _kernel.ready_q.cache: &_main_thread_s
//
// &(&(&k_sys_work_q)->fifo)->wait_q 에 list node 인 &(&(&k_sys_work_q)->thread)->base.k_q_node 을 tail로 추가함
//
// (&(&(&k_sys_work_q)->thread)->base.k_q_node)->next, &(&(&k_sys_work_q)->fifo)->wait_q
// (&(&(&k_sys_work_q)->thread)->base.k_q_node)->prev: (&(&(&k_sys_work_q)->fifo)->wait_q)->tail: &(&(&k_sys_work_q)->fifo)->wait_q
// (&(&(&k_sys_work_q)->fifo)->wait_q)->tail->next: (&(&(&k_sys_work_q)->fifo)->wait_q)->next: &(&(&k_sys_work_q)->thread)->base.k_q_node
// (&(&(&k_sys_work_q)->fifo)->wait_q)->tail: &(&(&k_sys_work_q)->thread)->base.k_q_node
//
// (&(&k_sys_work_q)->thread)->base.thread_state: 0x2
return 0;
// return 0
}
// KID 20170714
// CONFIG_KERNEL_INIT_PRIORITY_DEFAULT: 40
//
// SYS_INIT(k_sys_work_q_init, POST_KERNEL, 40):
// static struct device_config __config_sys_init_k_sys_work_q_init0 __used
// __attribute__((__section__(".devconfig.init"))) = {
// .name = "",
// .init = (k_sys_work_q_init),
// .config_info = (NULL)
// };
// static struct device __device_sys_init_k_sys_work_q_init0 __used
// __attribute__((__section__(".init_" "POST_KERNEL" "40"))) = {
// .config = &__config_sys_init_k_sys_work_q_init0,
// .driver_api = NULL,
// .driver_data = NULL
// }
SYS_INIT(k_sys_work_q_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_ggf_gridway_drmaa_DrmaaJNI */
#ifndef _Included_DrmaaJNI
#define _Included_DrmaaJNI
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: init
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_ggf_drmaa_DrmaaJNI_init
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: exit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_ggf_drmaa_DrmaaJNI_exit
(JNIEnv *, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: createJobTemplate
* Signature: ()Lorg/ggf/gridway/drmaa/JobTemplate;
*/
JNIEXPORT jobject JNICALL Java_org_ggf_drmaa_DrmaaJNI_createJobTemplate
(JNIEnv *, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: deleteJobTemplate
* Signature: (Lorg/ggf/gridway/drmaa/JobTemplate;)V
*/
JNIEXPORT void JNICALL Java_org_ggf_drmaa_DrmaaJNI_deleteJobTemplate
(JNIEnv *, jobject, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: runJob
* Signature: (Lorg/ggf/gridway/drmaa/JobTemplateImpl)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ggf_drmaa_DrmaaJNI_runJob
(JNIEnv *, jobject, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: runBulkJobs
* Signature: (Lorg/ggf/gridway/drmaa/JobTemplateImpl;III)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_org_ggf_drmaa_DrmaaJNI_runBulkJobs
(JNIEnv *, jobject, jobject, jint, jint, jint);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: control
* Signature: (Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_org_ggf_drmaa_DrmaaJNI_control
(JNIEnv *, jobject, jstring, jint);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: synchronize
* Signature: (Ljava/util/List;JZ)V
*/
JNIEXPORT void JNICALL Java_org_ggf_drmaa_DrmaaJNI_synchronize
(JNIEnv *, jobject, jobject, jlong, jboolean);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: wait
* Signature: (Ljava/lang/String;J)Lorg/ggf/gridway/drmaa/JobInfo;
*/
JNIEXPORT jobject JNICALL Java_org_ggf_drmaa_DrmaaJNI_wait
(JNIEnv *, jobject, jstring, jlong);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: getJobProgramStatus
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_org_ggf_drmaa_DrmaaJNI_getJobProgramStatus
(JNIEnv *, jobject, jstring);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: getContact
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ggf_drmaa_DrmaaJNI_getContact
(JNIEnv *, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: getVersion
* Signature: ()Lorg/ggf/gridway/drmaa/Version;
*/
JNIEXPORT jobject JNICALL Java_org_ggf_drmaa_DrmaaJNI_getVersion
(JNIEnv *, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: getDRMSInfo
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ggf_drmaa_DrmaaJNI_getDRMSInfo
(JNIEnv *, jobject);
/*
* Class: org_ggf_drmaa_DrmaaJNI
* Method: getDRMAAImplementation
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ggf_drmaa_DrmaaJNI_getDRMAAImplementation
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
|
/*
** parsing_globing.c for 42sh in /media/data/all/projects/42sh-v1
**
** Made by kevin labbe
** Login <labbe_k@epitech.net>
**
** Started on Wed May 8 17:16:03 2013 kevin labbe
** Last update Fri May 17 14:52:19 2013 kevin labbe
*/
#include "proto.h"
static void arraycat(char **dest, int *i, glob_t *g)
{
size_t j;
j = 0;
while (j < g->gl_pathc)
dest[(*i)++] = g->gl_pathv[j++];
dest[*i] = NULL;
}
static char **processing_globing(t_cmd *cmd, int i, char **args, int *j)
{
int len;
glob_t g;
if (glob(cmd->args[i], MY_GLOB_FLAGS, NULL, &g) != GLOB_NOMATCH)
{
len = count(args) + g.gl_pathc;
if (!(args = my_realloc(args, len, sizeof(char *))))
return (NULL);
arraycat(args, j, &g);
free(g.gl_pathv);
}
else
{
len = count(args);
if (!(args = my_realloc(args, len + 1, sizeof(char *))))
return (NULL);
if (!(args[(*j)++] = xstrdup(cmd->args[i])))
return (NULL);
}
return (args);
}
int parsing_globing(t_cmd *cmd)
{
int i;
int j;
char **args;
if (!cmd->args[0] || !(args = my_alloc(1, sizeof(char *))))
return (0);
if (!(args[0] = xstrdup(cmd->args[0])))
return (0);
args[1] = NULL;
i = 1;
j = 1;
while (cmd->args[i])
{
if (!(args = processing_globing(cmd, i++, args, &j)))
return (0);
args[j] = NULL;
}
free(cmd->args);
cmd->args = args;
return (0);
}
|
//
// YR_PersonalPageListModel.h
// __PRODUCTNAME__
//
// Created by Dendi on 16/09/09
// Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//
#import "YR_BaseModel.h"
@class YR_PersonalPageCateModel,YR_PersonalPagePicsModel;
@interface YR_PersonalPageListModel : YR_BaseModel
@property (nonatomic, copy) NSString *uid;
@property (nonatomic, copy) NSString *is_framed;
@property (nonatomic, copy) NSString *level;
@property (nonatomic, copy) NSString *quality;
@property (nonatomic, strong) NSArray<YR_PersonalPagePicsModel *> *pics;
@property (nonatomic, copy) NSString *is_del;
@property (nonatomic, copy) NSString *h;
@property (nonatomic, copy) NSString *unit;
@property (nonatomic, copy) NSString *sort;
@property (nonatomic, copy) NSString *number;
@property (nonatomic, strong) YR_PersonalPageCateModel *cate;
@property (nonatomic, copy) NSString *is_sale;
@property (nonatomic, copy) NSString *times;
@property (nonatomic, copy) NSString *row_type;
@property (nonatomic, copy) NSString *mark;
@property (nonatomic, copy) NSString *work_type;
@property (nonatomic, copy) NSString *num_view;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *is_show_home;
@property (nonatomic, copy) NSString *is_secret;
@property (nonatomic, copy) NSString *height;
@property (nonatomic, copy) NSString *status;
@property (nonatomic, copy) NSString *price;
@property (nonatomic, copy) NSString *goods_num;
@property (nonatomic, copy) NSString *tags;
@property (nonatomic, copy) NSString *is_show_feed;
@property (nonatomic, copy) NSString *is_available;
@property (nonatomic, copy) NSString *size;
@property (nonatomic, copy) NSString *is_certificates;
@property (nonatomic, copy) NSString *desc;
@property (nonatomic, copy) NSString *row_id;
@property (nonatomic, copy) NSString *is_water_mark;
@property (nonatomic, copy) NSString *bj;
@property (nonatomic, copy) NSString *owner_id;
@property (nonatomic, copy) NSString *mail_fee;
@property (nonatomic, copy) NSString *mtime;
@property (nonatomic, copy) NSString *w;
@property (nonatomic, copy) NSString *is_block;
@property (nonatomic, copy) NSString *collection_id;
@property (nonatomic, copy) NSString *pid;
@property (nonatomic, copy) NSString *width;
@end |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// UnityEngine.Texture
struct Texture_t2526458961;
#include "AssemblyU2DCSharp_UnityStandardAssets_ImageEffects3325865135.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityStandardAssets.ImageEffects.ColorCorrectionRamp
struct ColorCorrectionRamp_t2343682757 : public ImageEffectBase_t3325865135
{
public:
// UnityEngine.Texture UnityStandardAssets.ImageEffects.ColorCorrectionRamp::textureRamp
Texture_t2526458961 * ___textureRamp_4;
public:
inline static int32_t get_offset_of_textureRamp_4() { return static_cast<int32_t>(offsetof(ColorCorrectionRamp_t2343682757, ___textureRamp_4)); }
inline Texture_t2526458961 * get_textureRamp_4() const { return ___textureRamp_4; }
inline Texture_t2526458961 ** get_address_of_textureRamp_4() { return &___textureRamp_4; }
inline void set_textureRamp_4(Texture_t2526458961 * value)
{
___textureRamp_4 = value;
Il2CppCodeGenWriteBarrier(&___textureRamp_4, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cassandra.h"
void print_error(CassFuture* future) {
const char* message;
size_t message_length;
cass_future_error_message(future, &message, &message_length);
fprintf(stderr, "Error: %.*s\n", (int)message_length, message);
}
CassCluster* create_cluster(const char* hosts) {
CassCluster* cluster = cass_cluster_new();
cass_cluster_set_contact_points(cluster, hosts);
return cluster;
}
CassError connect_session(CassSession* session, const CassCluster* cluster) {
CassError rc = CASS_OK;
CassFuture* future = cass_session_connect(session, cluster);
cass_future_wait(future);
rc = cass_future_error_code(future);
if (rc != CASS_OK) {
print_error(future);
}
cass_future_free(future);
return rc;
}
void on_log(const CassLogMessage* message, void* data) {
FILE* log_file = (FILE*)data;
fprintf(log_file, "%u.%03u [%s] (%s:%d:%s): %s\n", (unsigned int)(message->time_ms / 1000),
(unsigned int)(message->time_ms % 1000), cass_log_level_string(message->severity),
message->file, message->line, message->function, message->message);
}
int main(int argc, char* argv[]) {
CassCluster* cluster = NULL;
CassSession* session = NULL;
char* hosts = "127.0.0.1";
FILE* log_file = fopen("driver.log", "w+");
if (log_file == NULL) {
fprintf(stderr, "Unable to open log file\n");
}
/* Log configuration *MUST* be done before any other driver call */
cass_log_set_level(CASS_LOG_INFO);
cass_log_set_callback(on_log, (void*)log_file);
if (argc > 1) {
hosts = argv[1];
}
cluster = create_cluster(hosts);
session = cass_session_new();
if (connect_session(session, cluster) != CASS_OK) {
cass_cluster_free(cluster);
cass_session_free(session);
return -1;
}
cass_cluster_free(cluster);
cass_session_free(session);
/* Stop all sessions before cleaning up log resources */
fclose(log_file);
return 0;
}
|
//
// ViewController.h
// IndoorNavi
//
// Created by Patrick Jayet on 20/08/13.
// Copyright (c) 2013 Patrick Jayet. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RootController : UITableViewController
@end
|
//
// AppDelegate.h
// 趣味信息分享
//
// Created by Huanying on 16/4/19.
// Copyright © 2016年 huanying. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/util/idestructorcallback.h>
namespace proton::feedtoken { class IState; }
namespace proton {
/**
* Context class for document operations that acks operation when
* instance is destroyed. Typically a shared pointer to an instance is
* passed around to multiple worker threads that performs portions of
* a larger task before dropping the shared pointer, triggering the
* ack when all worker threads have completed.
*/
class OperationDoneContext : public vespalib::IDestructorCallback
{
public:
OperationDoneContext(std::shared_ptr<feedtoken::IState> token, std::shared_ptr<IDestructorCallback> done_callback);
~OperationDoneContext() override;
bool is_replay() const;
private:
std::shared_ptr<feedtoken::IState> _token;
std::shared_ptr<vespalib::IDestructorCallback> _done_callback;
};
} // namespace proton
|
/*!A cross-platform build utility based on Lua
*
* 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.
*
* Copyright (C) 2015-2020, TBOOX Open Source Group.
*
* @author ruki
* @file poller.c
*
*/
/* //////////////////////////////////////////////////////////////////////////////////////
* trace
*/
#define TB_TRACE_MODULE_NAME "poller"
#define TB_TRACE_MODULE_DEBUG (0)
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "poller.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* macros
*/
// the singleton type of poller
#define XM_IO_POLLER (TB_SINGLETON_TYPE_USER + 4)
/* //////////////////////////////////////////////////////////////////////////////////////
* private implementation
*/
static tb_handle_t xm_io_poller_instance_init(tb_cpointer_t* ppriv)
{
// init poller
tb_poller_ref_t poller = tb_poller_init(tb_null);
tb_assert_and_check_return_val(poller, tb_null);
// attach poller to the current thread
tb_poller_attach(poller);
return (tb_handle_t)poller;
}
static tb_void_t xm_io_poller_instance_exit(tb_handle_t poller, tb_cpointer_t priv)
{
if (poller) tb_poller_exit((tb_poller_ref_t)poller);
}
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
tb_poller_ref_t xm_io_poller()
{
return (tb_poller_ref_t)tb_singleton_instance(XM_IO_POLLER, xm_io_poller_instance_init, xm_io_poller_instance_exit, tb_null, tb_null);
}
|
//
// Copyright 2013 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OSD_PTEX_MIPMAP_TEXTURE_LOADER_H
#define OSD_PTEX_MIPMAP_TEXTURE_LOADER_H
#include "../version.h"
#include <stdlib.h>
#include <stdint.h>
#include <vector>
class PtexTexture;
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
class OsdPtexMipmapTextureLoader {
public:
OsdPtexMipmapTextureLoader(PtexTexture *ptex,
int maxNumPages,
int maxLevels = -1,
size_t targetMemory = 0,
bool seamlessMipmap = true);
~OsdPtexMipmapTextureLoader();
const unsigned char * GetLayoutBuffer() const {
return _layoutBuffer;
}
const unsigned char * GetTexelBuffer() const {
return _texelBuffer;
}
int GetNumFaces() const {
return (int)_blocks.size();
}
int GetNumPages() const {
return (int)_pages.size();
}
int GetPageWidth() const {
return _pageWidth;
}
int GetPageHeight() const {
return _pageHeight;
}
size_t GetMemoryUsage() const {
return _memoryUsage;
}
/*
block : atomic texture unit
XXX: face of 128x128 or more (64kb~) texels should be considered separately
using ARB_sparse_texture...?
. : per-face texels for each mipmap level
x : guttering pixel
xxxxxxxxxxxxxx
x........xx..x 2x2
x........xx..x
x........xxxxx
x..8x8...xxxxxxx
x........xx....x
x........xx....x 4x4
x........xx....x
x........xx....x
xxxxxxxxxxxxxxxx
For each face (w*h), texels with guttering and mipmap is stored into
(w+2+w/2+2)*(h+2) area as above.
*/
/*
Ptex loader
Texels buffer : the packed texels
*/
private:
struct Block {
int index; // ptex index
int nMipmaps;
uint16_t u, v; // top-left texel offset
uint16_t width, height; // texel dimension (includes mipmap)
uint16_t adjSizeDiffs; // maximum tile size difference around each vertices
int8_t ulog2, vlog2; // texel dimension log2 (original tile)
void Generate(OsdPtexMipmapTextureLoader *loader, PtexTexture *ptex,
unsigned char *destination,
int bpp, int width, int maxLevels);
void SetSize(unsigned char ulog2_, unsigned char vlog2_, bool mipmap);
int GetNumTexels() const {
return width*height;
}
void guttering(OsdPtexMipmapTextureLoader *loader, PtexTexture *ptex,
int level, int width, int height,
unsigned char *pptr, int bpp, int stride);
static bool sort(const Block *a, const Block *b) {
return (a->height > b->height) or
((a->height == b->height) and (a->width > b->width));
}
};
struct Page;
class CornerIterator;
void generateBuffers();
void optimizePacking(int maxNumPages, size_t targetMemory);
int getLevelDiff(int face, int edge);
bool getCornerPixel(float *resultPixel, int numchannels,
int face, int edge, int8_t res);
void sampleNeighbor(unsigned char *border,
int face, int edge, int length, int bpp);
int resampleBorder(int face, int edgeId, unsigned char *result,
int dstLength, int bpp,
float srcStart = 0.0f, float srcEnd = 1.0f);
std::vector<Block> _blocks;
std::vector<Page *> _pages;
PtexTexture *_ptex;
int _maxLevels;
int _bpp;
int _pageWidth, _pageHeight;
unsigned char *_texelBuffer;
unsigned char *_layoutBuffer;
size_t _memoryUsage;
};
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif // OSD_PTEX_MIPMAP_TEXTURE_LOADER_H
|
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TNT_FILAMENT_DETAILS_BUFFEROBJECT_H
#define TNT_FILAMENT_DETAILS_BUFFEROBJECT_H
#include "upcast.h"
#include <backend/Handle.h>
#include <filament/BufferObject.h>
#include <utils/compiler.h>
namespace filament {
class FEngine;
class FBufferObject : public BufferObject {
public:
FBufferObject(FEngine& engine, const Builder& builder);
// frees driver resources, object becomes invalid
void terminate(FEngine& engine);
backend::Handle<backend::HwBufferObject> getHwHandle() const noexcept { return mHandle; }
size_t getByteCount() const noexcept { return mByteCount; }
BindingType getBindingType() const noexcept { return mBindingType; }
private:
friend class BufferObject;
void setBuffer(FEngine& engine, BufferDescriptor&& buffer, uint32_t byteOffset = 0);
backend::Handle<backend::HwBufferObject> mHandle;
uint32_t mByteCount;
BindingType mBindingType;
};
FILAMENT_UPCAST(BufferObject)
} // namespace filament
#endif // TNT_FILAMENT_DETAILS_BUFFEROBJECT_H
|
/**
* FreeRDP: A Remote Desktop Protocol Client
* FreeRDP Windows Server
*
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2012 Corey Clayton <can.of.tuna@gmail.com>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <winpr/windows.h>
#include <freerdp/freerdp.h>
#include <freerdp/listener.h>
#include "wf_peer.h"
#include "wf_info.h"
#include "wf_mirage.h"
#include "wf_update.h"
DWORD WINAPI wf_update_thread(LPVOID lpParam)
{
int index;
int peerindex;
DWORD fps;
wfInfo* wfi;
DWORD beg, end;
DWORD diff, rate;
wfi = (wfInfo*) lpParam;
fps = wfi->framesPerSecond;
rate = 1000 / fps;
while (1)
{
beg = GetTickCount();
if (wf_info_lock(wfi) > 0)
{
if (wfi->activePeerCount > 0)
{
wf_info_update_changes(wfi);
if (wf_info_have_updates(wfi))
{
wf_update_encode(wfi);
//printf("Start of parallel sending\n");
index = 0;
for (peerindex = 0; peerindex < wfi->peerCount; peerindex++)
{
for (; index < WF_INFO_MAXPEERS; index++)
{
if (wfi->peers[index] && wfi->peers[index]->activated)
{
//printf("Setting event for %d of %d\n", index + 1, wfi->activePeerCount);
SetEvent(((wfPeerContext*) wfi->peers[index]->context)->updateEvent);
}
}
}
for (index = 0; index < wfi->activePeerCount; index++)
{
//printf("Waiting for %d of %d\n", index + 1, wfi->activePeerCount);
//WaitForSingleObject(wfi->updateSemaphore, INFINITE);
WaitForSingleObject(wfi->updateSemaphore, 1000);
}
//printf("End of parallel sending\n");
wf_info_clear_invalid_region(wfi);
}
}
wf_info_unlock(wfi);
}
end = GetTickCount();
diff = end - beg;
if (diff < rate)
{
Sleep(rate - diff);
}
}
//printf("Exiting Update Thread\n");
return 0;
}
void wf_update_encode(wfInfo* wfi)
{
RFX_RECT rect;
long height, width;
BYTE* pDataBits = NULL;
int stride;
SURFACE_BITS_COMMAND* cmd;
wf_info_find_invalid_region(wfi);
cmd = &wfi->cmd;
stream_set_pos(wfi->s, 0);
wf_info_getScreenData(wfi, &width, &height, &pDataBits, &stride);
rect.x = 0;
rect.y = 0;
rect.width = (UINT16) width;
rect.height = (UINT16) height;
//printf("x:%d y:%d w:%d h:%d\n", wfi->invalid.left, wfi->invalid.top, width, height);
stream_clear(wfi->s);
rfx_compose_message(wfi->rfx_context, wfi->s, &rect, 1,
pDataBits, width, height, stride);
wfi->frame_idx = wfi->rfx_context->frame_idx;
cmd->destLeft = wfi->invalid.left;
cmd->destTop = wfi->invalid.top;
cmd->destRight = wfi->invalid.left + width;
cmd->destBottom = wfi->invalid.top + height;
cmd->bpp = 32;
cmd->codecID = 3;
cmd->width = width;
cmd->height = height;
cmd->bitmapDataLength = stream_get_length(wfi->s);
cmd->bitmapData = stream_get_head(wfi->s);
}
void wf_update_peer_send(wfInfo* wfi, wfPeerContext* context)
{
freerdp_peer* client = ((rdpContext*) context)->peer;
/* This happens when the RemoteFX encoder state is reset */
if (wfi->frame_idx == 1)
context->frame_idx = 0;
/*
* When a new client connects, it is possible that old frames from
* from a previous encoding state remain. Those frames should be discarded
* as they will cause an error condition in mstsc.
*/
if ((context->frame_idx + 1) != wfi->frame_idx)
{
/* This frame is meant to be discarded */
if (context->frame_idx == 0)
return;
/* This is an unexpected error condition */
printf("Unexpected Frame Index: Actual: %d Expected: %d\n",
wfi->frame_idx, context->frame_idx + 1);
}
wfi->cmd.codecID = client->settings->RemoteFxCodecId;
client->update->SurfaceBits(client->update->context, &wfi->cmd);
context->frame_idx++;
}
void wf_update_encoder_reset(wfInfo* wfi)
{
if (wf_info_lock(wfi) > 0)
{
printf("Resetting encoder\n");
if (wfi->rfx_context)
{
rfx_context_reset(wfi->rfx_context);
}
else
{
wfi->rfx_context = rfx_context_new();
wfi->rfx_context->mode = RLGR3;
wfi->rfx_context->width = wfi->servscreen_width;
wfi->rfx_context->height = wfi->servscreen_height;
rfx_context_set_pixel_format(wfi->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8);
wfi->s = stream_new(0xFFFF);
}
wf_info_invalidate_full_screen(wfi);
wf_info_unlock(wfi);
}
}
void wf_update_peer_activate(wfInfo* wfi, wfPeerContext* context)
{
if (wf_info_lock(wfi) > 0)
{
if (wfi->activePeerCount < 1)
{
#ifndef WITH_WIN8
wf_mirror_driver_activate(wfi);
#endif
ResumeThread(wfi->updateThread);
}
wf_update_encoder_reset(wfi);
wfi->activePeerCount++;
printf("Activating Peer Updates: %d\n", wfi->activePeerCount);
wf_info_unlock(wfi);
}
}
void wf_update_peer_deactivate(wfInfo* wfi, wfPeerContext* context)
{
if (wf_info_lock(wfi) > 0)
{
freerdp_peer* client = ((rdpContext*) context)->peer;
if (client->activated)
{
if (wfi->activePeerCount <= 1)
{
wf_mirror_driver_deactivate(wfi);
}
client->activated = FALSE;
wfi->activePeerCount--;
printf("Deactivating Peer Updates: %d\n", wfi->activePeerCount);
}
wf_info_unlock(wfi);
}
}
|
#ifndef _SERVER_LINK_H_
#define _SERVER_LINK_H_
#include "client_session.h"
#include "server_msg.h"
struct server_message
{
char* message;
std::size_t message_length;
FDXSLib::protocol_message* bin_data;
server_message():message(0),message_length(0),bin_data(0)
{
}
~server_message()
{
if(message != 0)
{
delete message;
message_length = 0;
}
if( bin_data != 0)
{
bin_data->release();
}
}
};
struct server_info
{
char svrip[64];
std::size_t svrport;
std::size_t service_code;
std::size_t internal_id;
};
class server_link
{
public:
server_link(server_info& server);
~server_link();
bool connect_to(int timeout);
bool is_connected();
bool test_connect();
bool send_funcno(netsvr::client_func_info* function_list, size_t list_size);
bool get_message( server_message& msg );
bool answer_data( const server_message& msg );
bool push_data( const server_message& msg );
bool call( const server_message& req, server_message& resp );
private:
void prepare_message(netsvr::server_message_head &head,int msgtype = 0);
FDXSLib::client client_;
server_info& server_;
bool is_connected_;
std::size_t link_id_;
char client_name[64];
};
#endif // _SERVER_LINK_H_
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "glut_wrap.h"
static int Win;
static int WinWidth = 400, WinHeight = 400;
static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
static GLboolean Anim = GL_FALSE;
static int CurVert = 0, MoveAll = 0;
static GLfloat Verts[3][2];
static void
Idle(void)
{
Xrot += 3.0;
Yrot += 4.0;
Zrot += 2.0;
glutPostRedisplay();
}
static void
Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2fv(Verts[0]);
glVertex2fv(Verts[1]);
glVertex2fv(Verts[2]);
glEnd();
glutSwapBuffers();
}
static void
Reshape(int width, int height)
{
WinWidth = width;
WinHeight = height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void
RotVerts(void)
{
float tx = Verts[0][0], ty = Verts[0][1];
Verts[0][0] = Verts[1][0]; Verts[0][1] = Verts[1][1];
Verts[1][0] = Verts[2][0]; Verts[1][1] = Verts[2][1];
Verts[2][0] = tx; Verts[2][1] = ty;
}
static void
Save(void)
{
int i;
FILE *f = fopen("verts.txt", "w");
for (i = 0; i < 3; i++)
fprintf(f, "%f %f\n", Verts[i][0], Verts[i][1]);
fclose(f);
printf("Saved data\n");
}
static void
Restore(void)
{
int i;
FILE *f = fopen("verts.txt", "r");
if (f) {
printf("Restoring data\n");
for (i = 0; i < 3; i++) {
int n =fscanf(f, "%f %f\n", &Verts[i][0], &Verts[i][1]);
(void) n;
}
fclose(f);
}
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case 'r':
RotVerts();
break;
case 'a':
MoveAll = 1;
break;
case '0':
MoveAll = 0;
CurVert = 0;
break;
case '1':
MoveAll = 0;
CurVert = 1;
break;
case '2':
MoveAll = 0;
CurVert = 2;
break;
case 's':
Save();
break;
case 27:
glutDestroyWindow(Win);
exit(0);
break;
}
glutPostRedisplay();
}
static void
move(float dx, float dy)
{
int i;
dx *= 0.05;
dy *= 0.05;
if (MoveAll) {
for (i = 0; i < 3; i++) {
Verts[i][0] += dx;
Verts[i][1] += dy;
}
}
else {
Verts[CurVert][0] += dx;
Verts[CurVert][1] += dy;
}
printf("\n");
for (i = 0; i < 3; i++) {
printf("%f %f\n", Verts[i][0], Verts[i][1]);
}
}
static void
SpecialKey(int key, int x, int y)
{
switch (key) {
case GLUT_KEY_UP:
move(0, +1);
break;
case GLUT_KEY_DOWN:
move(0, -1);
break;
case GLUT_KEY_LEFT:
move(-1, 0);
break;
case GLUT_KEY_RIGHT:
move(1, 0);
break;
}
glutPostRedisplay();
}
static void
Init(void)
{
Verts[0][0] = 0.0; Verts[0][1] = 0.0;
Verts[1][0] = 1.2; Verts[1][1] = -0.5;
Verts[2][0] = 0.6; Verts[2][1] = -1.5;
Restore();
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
if (Anim)
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}
|
// Warning: this is generated file. Do not modify!
#define TI_VERSION 2.1.1.GA
#define USE_TI_ANALYTICS
#define USE_TI_NETWORK
#define USE_TI_PLATFORM
#define USE_TI_UI
#define USE_TI_API
#define USE_TI_UISETBACKGROUNDCOLOR
#define USE_TI_INCLUDE
#define USE_TI_UIWINDOW
#define USE_TI_UILABEL
#define USE_TI_UIBUTTON
#define USE_TI_UIIMAGEVIEW
#define USE_TI_UIVIEW
#define USE_TI_UIINPUT_BORDERSTYLE_ROUNDED
#define USE_TI_UITEXTFIELD
#define USE_TI_UIFILL
#define USE_TI_UISCROLLVIEW
#define USE_TI_DATABASE
#define USE_TI_DATABASEOPEN
#define USE_TI_APILOG
#define USE_TI_DATABASEINSTALL
#define USE_TI_FILESYSTEM
#define USE_TI_FILESYSTEMEXTERNALSTORAGEDIRECTORY
#define USE_TI_FILESYSTEMISEXTERNALSTORAGEPRESENT
#define USE_TI_FILESYSTEMSEPARATOR
#define USE_TI_PLATFORMNAME
|
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ch_usi_overseerJNI_WrapperJNI */
#ifndef _Included_ch_usi_overseer_OverAgent
#define _Included_ch_usi_overseer_OverAgent
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jfloat JNICALL Java_ch_usi_overseer_OverAgent_getThreadCpuUsage
(JNIEnv *, jobject, jint);
JNIEXPORT jfloat JNICALL Java_ch_usi_overseer_OverAgent_getThreadCpuUsageRelative
(JNIEnv *, jobject, jint);
JNIEXPORT void JNICALL Java_ch_usi_overseer_OverAgent_updateStats
(JNIEnv *, jobject);
JNIEXPORT jboolean JNICALL Java_ch_usi_overseer_OverAgent_isRunning
(JNIEnv *, jobject);
JNIEXPORT jint JNICALL Java_ch_usi_overseer_OverAgent_getVersion
(JNIEnv *, jobject);
JNIEXPORT jint JNICALL Java_ch_usi_overseer_OverAgent_getNumberOfThreads
(JNIEnv *, jobject);
JNIEXPORT void JNICALL Java_ch_usi_overseer_OverAgent_init
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkScalarVector_h
#define itkScalarVector_h
#if !defined( ITK_LEGACY_REMOVE )
#include "itkMacro.h"
#include "vnl/vnl_vector_fixed.h"
#include <memory>
namespace itk
{
/** \class ScalarVector
* \brief A templated class holding bot scalar and vector values and
* responding to the GetScalar() and GetVector() methods.
*
* ScalarVector is a templated class that holds a scalar value plus an
* array of values (a vector). ScalarVector can be used as the data type
* held at each pixel in an Image or at each vertex of an Mesh. There
* are three template parameters: the type of scalar, the type of vector, and
* the number of components of the vector. The types can be any data type
* that behaves like a primitive (or atomic) data type (int, short, float,
* complex). itk filters that rely on scalar data assume the data type held
* at each pixel or each vertex responds to GetScalar()/SetScalar()
* methods. itk filters that rely on vector data assume the data type held at
* each pixel or each vertex responds to GetVector()/SetVector() methods. If
* not, a compile time error will occur.
*
* ScalarVector is not a dynamically extendible array like std::vector. It
* is intended to be used like a mathematical vector.
*
* If you wish a simpler pixel types, you can use Scalar, which represents
* a single data value at a pixel. YOu can also use Vector, which supports
* (for a given pixel) an array of vector values.
*
* \sa Image
* \sa Mesh
* \sa Scalar
* \sa Vector
* \deprecated
* \ingroup ITKDeprecated
* \ingroup DataRepresentation
*/
template< typename TScalar, typename TVector, unsigned int TVectorDimension = 3 >
class ScalarVector
{
public:
/** Standard class typedefs. */
typedef ScalarVector Self;
/** ValueType can be used to declare a variable that is the same type
* as the data held in the scalar portion of the ScalarVector. */
typedef TScalar ValueType;
/** ValueType can be used to declare a variable that is the same type
* as the data held in the scalar portion of the ScalarVector. */
typedef TScalar ScalarValueType;
/** ValueType can be used to declare a variable that is the same type
* as the data held in the scalar portion of the ScalarVector. */
typedef TVector VectorValueType;
/** VectorType can be used to declare a variable that is the same type
* as the internal vector. */
typedef vnl_vector_fixed< TVector, TVectorDimension > VectorType;
/** Get the scalar value. \sa SetScalar() */
TScalar GetScalar() const
{ return m_Scalar; }
/** Set the scalar value. \sa GetScalar() */
void SetScalar(const TScalar & val)
{ m_Scalar = val; }
/** Get the dimension (size) of the vector. */
static unsigned int GetVectorDimension()
{ return TVectorDimension; }
/** Get the vector. This provides a read only reference to the vector.
* \sa SetVector(). */
const VectorType & GetVector() const
{ return m_Vector; }
/** Get the vector. This provides a read/write reference to the vector.
* \sa SetVector */
VectorType & GetVector()
{ return m_Vector; }
/** Set the vector. \sa GetVector */
void SetVector(const VectorType & vec)
{ m_Vector = vec; }
private:
TScalar m_Scalar;
VectorType m_Vector;
};
} // end namespace itk
#endif //#if !defined( ITK_LEGACY_REMOVE )
#endif
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/dlm/DLM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace DLM
{
namespace Model
{
/**
* <p>Specifies a tag for a resource.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/Tag">AWS API
* Reference</a></p>
*/
class AWS_DLM_API Tag
{
public:
Tag();
Tag(Aws::Utils::Json::JsonView jsonValue);
Tag& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The tag key.</p>
*/
inline const Aws::String& GetKey() const{ return m_key; }
/**
* <p>The tag key.</p>
*/
inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }
/**
* <p>The tag key.</p>
*/
inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; }
/**
* <p>The tag key.</p>
*/
inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); }
/**
* <p>The tag key.</p>
*/
inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); }
/**
* <p>The tag key.</p>
*/
inline Tag& WithKey(const Aws::String& value) { SetKey(value); return *this;}
/**
* <p>The tag key.</p>
*/
inline Tag& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;}
/**
* <p>The tag key.</p>
*/
inline Tag& WithKey(const char* value) { SetKey(value); return *this;}
/**
* <p>The tag value.</p>
*/
inline const Aws::String& GetValue() const{ return m_value; }
/**
* <p>The tag value.</p>
*/
inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
/**
* <p>The tag value.</p>
*/
inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; }
/**
* <p>The tag value.</p>
*/
inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); }
/**
* <p>The tag value.</p>
*/
inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); }
/**
* <p>The tag value.</p>
*/
inline Tag& WithValue(const Aws::String& value) { SetValue(value); return *this;}
/**
* <p>The tag value.</p>
*/
inline Tag& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;}
/**
* <p>The tag value.</p>
*/
inline Tag& WithValue(const char* value) { SetValue(value); return *this;}
private:
Aws::String m_key;
bool m_keyHasBeenSet;
Aws::String m_value;
bool m_valueHasBeenSet;
};
} // namespace Model
} // namespace DLM
} // namespace Aws
|
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TemplateContentDocumentFragment_h
#define TemplateContentDocumentFragment_h
#include "core/dom/DocumentFragment.h"
namespace WebCore {
class TemplateContentDocumentFragment FINAL : public DocumentFragment {
public:
static PassRefPtr<TemplateContentDocumentFragment> create(Document* document, const Element* host)
{
return adoptRef(new TemplateContentDocumentFragment(document, host));
}
const Element* host() const { return m_host; }
void clearHost() { m_host = 0; }
private:
TemplateContentDocumentFragment(Document* document, const Element* host)
: DocumentFragment(document, CreateDocumentFragment)
, m_host(host)
{
}
virtual bool isTemplateContent() const OVERRIDE { return true; }
const Element* m_host;
};
} // namespace WebCore
#endif // TemplateContentDocumentFragment_h
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace SageMaker
{
namespace Model
{
enum class AppStatus
{
NOT_SET,
Deleted,
Deleting,
Failed,
InService,
Pending
};
namespace AppStatusMapper
{
AWS_SAGEMAKER_API AppStatus GetAppStatusForName(const Aws::String& name);
AWS_SAGEMAKER_API Aws::String GetNameForAppStatus(AppStatus value);
} // namespace AppStatusMapper
} // namespace Model
} // namespace SageMaker
} // namespace Aws
|
@interface MWMSettings : NSObject
+ (BOOL)adServerForbidden;
+ (void)setAdServerForbidden:(BOOL)adServerForbidden;
+ (BOOL)adForbidden;
+ (void)setAdForbidden:(BOOL)adForbidden;
+ (BOOL)autoDownloadEnabled;
+ (void)setAutoDownloadEnabled:(BOOL)autoDownloadEnabled;
+ (MWMUnits)measurementUnits;
+ (void)setMeasurementUnits:(MWMUnits)measurementUnits;
+ (BOOL)zoomButtonsEnabled;
+ (void)setZoomButtonsEnabled:(BOOL)zoomButtonsEnabled;
+ (BOOL)compassCalibrationEnabled;
+ (void)setCompassCalibrationEnabled:(BOOL)compassCalibrationEnabled;
+ (BOOL)statisticsEnabled;
+ (void)setStatisticsEnabled:(BOOL)statisticsEnabled;
+ (MWMTheme)theme;
+ (void)setTheme:(MWMTheme)theme;
+ (BOOL)routingDisclaimerApproved;
+ (void)setRoutingDisclaimerApproved;
+ (NSString *)spotlightLocaleLanguageId;
+ (void)setSpotlightLocaleLanguageId:(NSString *)spotlightLocaleLanguageId;
+ (BOOL)largeFontSize;
+ (void)setLargeFontSize:(BOOL)largeFontSize;
+ (BOOL)transliteration;
+ (void)setTransliteration:(BOOL)transliteration;
+ (BOOL)isTrackWarningAlertShown;
+ (void)setTrackWarningAlertShown:(BOOL)shown;
+ (BOOL)crashReportingDisabled;
+ (void)setCrashReportingDisabled:(BOOL)disabled;
@end
|
#pragma once
#include <functional>
#include <string>
#include "envoy/buffer/buffer.h"
#include "envoy/common/pure.h"
#include "envoy/http/codes.h"
#include "envoy/http/filter.h"
#include "envoy/http/header_map.h"
#include "envoy/network/listen_socket.h"
#include "envoy/server/config_tracker.h"
#include "absl/strings/string_view.h"
namespace Envoy {
namespace Server {
class AdminStream {
public:
virtual ~AdminStream() {}
/**
* @param end_stream set to false for streaming response. Default is true, which will
* end the response when the initial handler completes.
*/
virtual void setEndStreamOnComplete(bool end_stream) PURE;
/**
* @param cb callback to be added to the list of callbacks invoked by onDestroy() when stream
* is closed.
*/
virtual void addOnDestroyCallback(std::function<void()> cb) PURE;
/**
* @return Http::StreamDecoderFilterCallbacks& to be used by the handler to get HTTP request data
* for streaming.
*/
virtual const Http::StreamDecoderFilterCallbacks& getDecoderFilterCallbacks() const PURE;
/**
* @return Http::HeaderMap& to be used by handler to parse header information sent with the
* request.
*/
virtual const Http::HeaderMap& getRequestHeaders() const PURE;
};
/**
* This macro is used to add handlers to the Admin HTTP Endpoint. It builds
* a callback that executes X when the specified admin handler is hit. This macro can be
* used to add static handlers as in source/server/http/admin.cc and also dynamic handlers as
* done in the RouteConfigProviderManagerImpl constructor in source/common/router/rds_impl.cc.
*/
#define MAKE_ADMIN_HANDLER(X) \
[this](absl::string_view path_and_query, Http::HeaderMap& response_headers, \
Buffer::Instance& data, AdminStream& admin_stream) -> Http::Code { \
return X(path_and_query, response_headers, data, admin_stream); \
}
/**
* Global admin HTTP endpoint for the server.
*/
class Admin {
public:
virtual ~Admin() {}
/**
* Callback for admin URL handlers.
* @param path_and_query supplies the the path and query of the request URL.
* @param response_headers enables setting of http headers (eg content-type, cache-control) in the
* handler.
* @param response supplies the buffer to fill in with the response body.
* @param admin_stream supplies the filter which invoked the handler, enables the handler to use
* its data.
* @return Http::Code the response code.
*/
typedef std::function<Http::Code(absl::string_view path_and_query,
Http::HeaderMap& response_headers, Buffer::Instance& response,
AdminStream& admin_stream)>
HandlerCb;
/**
* Add an admin handler.
* @param prefix supplies the URL prefix to handle.
* @param help_text supplies the help text for the handler.
* @param callback supplies the callback to invoke when the prefix matches.
* @param removable if true allows the handler to be removed via removeHandler.
* @param mutates_server_state indicates whether callback will mutate server state.
* @return bool true if the handler was added, false if it was not added.
*/
virtual bool addHandler(const std::string& prefix, const std::string& help_text,
HandlerCb callback, bool removable, bool mutates_server_state) PURE;
/**
* Remove an admin handler if it is removable.
* @param prefix supplies the URL prefix of the handler to delete.
* @return bool true if the handler was removed, false if it was not removed.
*/
virtual bool removeHandler(const std::string& prefix) PURE;
/**
* Obtain socket the admin endpoint is bound to.
* @return Network::Socket& socket reference.
*/
virtual const Network::Socket& socket() PURE;
/**
* @return ConfigTracker& tracker for /config_dump endpoint.
*/
virtual ConfigTracker& getConfigTracker() PURE;
};
} // namespace Server
} // namespace Envoy
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_ValueType3507792607.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.SortingLayer
struct SortingLayer_t221838959
{
public:
// System.Int32 UnityEngine.SortingLayer::m_Id
int32_t ___m_Id_0;
public:
inline static int32_t get_offset_of_m_Id_0() { return static_cast<int32_t>(offsetof(SortingLayer_t221838959, ___m_Id_0)); }
inline int32_t get_m_Id_0() const { return ___m_Id_0; }
inline int32_t* get_address_of_m_Id_0() { return &___m_Id_0; }
inline void set_m_Id_0(int32_t value)
{
___m_Id_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/*
* Copyright 2014-2017 Real Logic Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef AERON_DATAFRAMEHEADER_H
#define AERON_DATAFRAMEHEADER_H
#include <stddef.h>
#include <util/Index.h>
namespace aeron { namespace concurrent { namespace logbuffer {
namespace DataFrameHeader {
#pragma pack(push)
#pragma pack(4)
struct DataFrameHeaderDefn
{
std::int32_t frameLength;
std::uint8_t version;
std::uint8_t flags;
std::uint16_t type;
std::int32_t termOffset;
std::int32_t sessionId;
std::int32_t streamId;
std::int32_t termId;
std::int64_t reservedValue;
};
#pragma pack(pop)
static const util::index_t FRAME_LENGTH_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, frameLength);
static const util::index_t VERSION_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, version);
static const util::index_t FLAGS_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, flags);
static const util::index_t TYPE_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, type);
static const util::index_t TERM_OFFSET_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, termOffset);
static const util::index_t SESSION_ID_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, sessionId);
static const util::index_t STREAM_ID_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, streamId);
static const util::index_t TERM_ID_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, termId);
static const util::index_t RESERVED_VALUE_FIELD_OFFSET = offsetof(DataFrameHeaderDefn, reservedValue);
static const util::index_t DATA_OFFSET = sizeof(DataFrameHeaderDefn);
static const util::index_t LENGTH = DATA_OFFSET;
static const std::uint16_t HDR_TYPE_PAD = 0x00;
static const std::uint16_t HDR_TYPE_DATA = 0x01;
static const std::uint16_t HDR_TYPE_NAK = 0x02;
static const std::uint16_t HDR_TYPE_SM = 0x03;
static const std::uint16_t HDR_TYPE_ERR = 0x04;
static const std::uint16_t HDR_TYPE_SETUP = 0x05;
static const std::uint16_t HDR_TYPE_EXT = 0xFFFF;
static const std::int8_t CURRENT_VERSION = 0x0;
}
}}}
#endif //AERON_DATAFRAMEHEADER_H
|
//
// LinkMapParse.h
// LinkSize
//
// Created by aiijim on 16/8/27.
// Copyright © 2016年 aiijim. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LinkMapParse : NSObject
@property (strong,nonatomic) NSString* fileName;
- (instancetype) init __attribute__((unavailable("Invoke the designated initializer")));
- (instancetype) initWithFileName:(NSString*)fileName NS_DESIGNATED_INITIALIZER;
//解析linkmap文件
- (void) parse;
//获取linkmap文件分析日志,html格式
- (NSString*) getFileAnalyzeLog;
@end
|
#pragma once
#include <string>
#include <iostream>
#include "week.h"
class availability;
class shifts;
class employee {
public:
availability *days[7];
std::string name;
employee(std::string);
int max = 4000;
int current = 0;
bool in[7];
shifts *s[7];
bool checkmax(int);
};
class availability {
public:
int start[10];
int end[10];
int top;
public:
bool check(int _s, int _e);
availability();
void set(int _s, int _e);
void print();
}; |
//
// STPFormEncodable.h
// Stripe
//
// Created by Jack Flintermann on 10/14/15.
// Copyright © 2015 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Objects conforming to STPFormEncodable can be automatically converted to a form-encoded string, which can then be used when making requests to the Stripe API.
*/
@protocol STPFormEncodable <NSObject>
/**
* The root object name to be used when converting this object to a form-encoded string. For example, if this returns @"card", then the form-encoded output will resemble @"card[foo]=bar" (where 'foo' and 'bar' are specified by `propertyNamesToFormFieldNamesMapping` below.
*/
+ (nullable NSString *)rootObjectName;
/**
* This maps properties on an object that is being form-encoded into parameter names in the Stripe API. For example, STPCardParams has a field called `expMonth`, but the Stripe API expects a field called `exp_month`. This dictionary represents a mapping from the former to the latter (in other words, [STPCardParams propertyNamesToFormFieldNamesMapping][@"expMonth"] == @"exp_month".)
*/
+ (NSDictionary *)propertyNamesToFormFieldNamesMapping;
/**
* You can use this property to add additional fields to an API request that are not explicitly defined by the object's interface. This can be useful when using beta features that haven't been added to the Stripe SDK yet. For example, if the /v1/tokens API began to accept a beta field called "test_field", you might do the following:
STPCardParams *cardParams = [STPCardParams new];
// add card values
cardParams.additionalAPIParameters = @{@"test_field": @"example_value"};
[[STPAPIClient sharedClient] createTokenWithCard:cardParams completion:...];
*/
@property(nonatomic, readwrite, copy)NSDictionary *additionalAPIParameters;
@end
NS_ASSUME_NONNULL_END
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 Greenplum, Inc.
//
// @filename:
// CDXLPhysicalMergeJoin.h
//
// @doc:
// Class for representing DXL merge join operators.
//---------------------------------------------------------------------------
#ifndef GPDXL_CDXLPhysicalMergeJoin_H
#define GPDXL_CDXLPhysicalMergeJoin_H
#include "gpos/base.h"
#include "naucrates/dxl/operators/CDXLPhysicalJoin.h"
namespace gpdxl
{
// indices of merge join elements in the children array
enum Edxlmj
{
EdxlmjIndexProjList = 0,
EdxlmjIndexFilter,
EdxlmjIndexJoinFilter,
EdxlmjIndexMergeCondList,
EdxlmjIndexLeftChild,
EdxlmjIndexRightChild,
EdxlmjIndexSentinel
};
//---------------------------------------------------------------------------
// @class:
// CDXLPhysicalMergeJoin
//
// @doc:
// Class for representing DXL merge operators
//
//---------------------------------------------------------------------------
class CDXLPhysicalMergeJoin : public CDXLPhysicalJoin
{
private:
// true if outer relation has unique values for the merge key
BOOL m_fUniqueOuter;
// private copy ctor
CDXLPhysicalMergeJoin(const CDXLPhysicalMergeJoin&);
public:
// ctor
CDXLPhysicalMergeJoin(IMemoryPool *pmp, EdxlJoinType edxljt, BOOL fUniqueOuter);
// accessors
Edxlopid Edxlop() const;
const CWStringConst *PstrOpName() const;
// serialize operator in DXL format
virtual
void SerializeToDXL(CXMLSerializer *pxmlser, const CDXLNode *pdxln) const;
// conversion function
static
CDXLPhysicalMergeJoin *PdxlopConvert
(
CDXLOperator *pdxlop
)
{
GPOS_ASSERT(NULL != pdxlop);
GPOS_ASSERT(EdxlopPhysicalMergeJoin == pdxlop->Edxlop());
return dynamic_cast<CDXLPhysicalMergeJoin*>(pdxlop);
}
#ifdef GPOS_DEBUG
// checks whether the operator has valid structure, i.e. number and
// types of child nodes
void AssertValid(const CDXLNode *, BOOL fValidateChildren) const;
#endif // GPOS_DEBUG
};
}
#endif // !GPDXL_CDXLPhysicalMergeJoin_H
// EOF
|
//
// orderStatusTableViewCell.h
// LiyiTong
//
// Created by 耿远风 on 16/8/17.
// Copyright © 2016年 WanYu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface orderStatusTableViewCell : UITableViewCell
@property (nonatomic,strong)UIImageView *header;
@property (nonatomic,strong)UILabel *name;
@property (nonatomic,strong)UILabel *time;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/ec2/model/AttributeBooleanValue.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ec2/model/ResponseMetadata.h>
#include <aws/ec2/model/ProductCode.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Xml
{
class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{
/**
* <p>Contains the output of DescribeVolumeAttribute.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttributeResult">AWS
* API Reference</a></p>
*/
class AWS_EC2_API DescribeVolumeAttributeResponse
{
public:
DescribeVolumeAttributeResponse();
DescribeVolumeAttributeResponse(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
DescribeVolumeAttributeResponse& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
/**
* <p>The state of <code>autoEnableIO</code> attribute.</p>
*/
inline const AttributeBooleanValue& GetAutoEnableIO() const{ return m_autoEnableIO; }
/**
* <p>The state of <code>autoEnableIO</code> attribute.</p>
*/
inline void SetAutoEnableIO(const AttributeBooleanValue& value) { m_autoEnableIO = value; }
/**
* <p>The state of <code>autoEnableIO</code> attribute.</p>
*/
inline void SetAutoEnableIO(AttributeBooleanValue&& value) { m_autoEnableIO = std::move(value); }
/**
* <p>The state of <code>autoEnableIO</code> attribute.</p>
*/
inline DescribeVolumeAttributeResponse& WithAutoEnableIO(const AttributeBooleanValue& value) { SetAutoEnableIO(value); return *this;}
/**
* <p>The state of <code>autoEnableIO</code> attribute.</p>
*/
inline DescribeVolumeAttributeResponse& WithAutoEnableIO(AttributeBooleanValue&& value) { SetAutoEnableIO(std::move(value)); return *this;}
/**
* <p>A list of product codes.</p>
*/
inline const Aws::Vector<ProductCode>& GetProductCodes() const{ return m_productCodes; }
/**
* <p>A list of product codes.</p>
*/
inline void SetProductCodes(const Aws::Vector<ProductCode>& value) { m_productCodes = value; }
/**
* <p>A list of product codes.</p>
*/
inline void SetProductCodes(Aws::Vector<ProductCode>&& value) { m_productCodes = std::move(value); }
/**
* <p>A list of product codes.</p>
*/
inline DescribeVolumeAttributeResponse& WithProductCodes(const Aws::Vector<ProductCode>& value) { SetProductCodes(value); return *this;}
/**
* <p>A list of product codes.</p>
*/
inline DescribeVolumeAttributeResponse& WithProductCodes(Aws::Vector<ProductCode>&& value) { SetProductCodes(std::move(value)); return *this;}
/**
* <p>A list of product codes.</p>
*/
inline DescribeVolumeAttributeResponse& AddProductCodes(const ProductCode& value) { m_productCodes.push_back(value); return *this; }
/**
* <p>A list of product codes.</p>
*/
inline DescribeVolumeAttributeResponse& AddProductCodes(ProductCode&& value) { m_productCodes.push_back(std::move(value)); return *this; }
/**
* <p>The ID of the volume.</p>
*/
inline const Aws::String& GetVolumeId() const{ return m_volumeId; }
/**
* <p>The ID of the volume.</p>
*/
inline void SetVolumeId(const Aws::String& value) { m_volumeId = value; }
/**
* <p>The ID of the volume.</p>
*/
inline void SetVolumeId(Aws::String&& value) { m_volumeId = std::move(value); }
/**
* <p>The ID of the volume.</p>
*/
inline void SetVolumeId(const char* value) { m_volumeId.assign(value); }
/**
* <p>The ID of the volume.</p>
*/
inline DescribeVolumeAttributeResponse& WithVolumeId(const Aws::String& value) { SetVolumeId(value); return *this;}
/**
* <p>The ID of the volume.</p>
*/
inline DescribeVolumeAttributeResponse& WithVolumeId(Aws::String&& value) { SetVolumeId(std::move(value)); return *this;}
/**
* <p>The ID of the volume.</p>
*/
inline DescribeVolumeAttributeResponse& WithVolumeId(const char* value) { SetVolumeId(value); return *this;}
inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }
inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; }
inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); }
inline DescribeVolumeAttributeResponse& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}
inline DescribeVolumeAttributeResponse& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;}
private:
AttributeBooleanValue m_autoEnableIO;
Aws::Vector<ProductCode> m_productCodes;
Aws::String m_volumeId;
ResponseMetadata m_responseMetadata;
};
} // namespace Model
} // namespace EC2
} // namespace Aws |
/*
* queue.h
*
* Created on: Dec 1, 2013
* Author: Lucas
*/
#ifndef QUEUE_H_
#define QUEUE_H_
#include "linkedlist.h"
typedef struct Queue{
UnsortedLinkedList *contents;
}Queue;
/*
* Creates a new empty Queue and returns it
* Input: Nothing
* Output: The created empty Queue if successful, 0 otherwise
* Modified: Empty Queue created
*/
Queue *Queue_create();
/*
* Destroys input Queue if possible
* Input: Pointer to Queue to destroy
* Output: 0 if successful, -1 otherwise
* Modified: Queue and all its contents destroyed
*/
int Queue_destroy(Queue *queue);
/*
* Adds input data to back of input Queue
* Input: queue to add to, data to add to queue
* Output: 0 if successful, -1 otherwise
* Modified: data added to back of queue
*/
int Queue_add(Queue *queue, void *data);
/*
* Removes the front element from input Queue, if not empty. If empty, does nothing
* Input: Queue to remove from
* Output: Data removed if successful, 0 otherwise
* Modified: Data removed from front of Queue
*/
void *Queue_remove(Queue *queue);
#endif /* QUEUE_H_ */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef H_BLE_LL_SCHED_
#define H_BLE_LL_SCHED_
#ifdef __cplusplus
extern "C" {
#endif
/* Time per BLE scheduler slot */
#define BLE_LL_SCHED_USECS_PER_SLOT (1250)
#define BLE_LL_SCHED_32KHZ_TICKS_PER_SLOT (41) /* 1 tick = 30.517 usecs */
/*
* Worst case time needed for scheduled advertising item. This is the longest
* possible time to receive a scan request and send a scan response (with the
* appropriate IFS time between them). This number is calculated using the
* following formula: IFS + SCAN_REQ + IFS + SCAN_RSP = 150 + 176 + 150 + 376.
* Note: worst case time to tx adv, rx scan req and send scan rsp is 1228 usecs.
* This assumes maximum sized advertising PDU and scan response PDU.
*
* For connectable advertising events no scan request is allowed. In this case
* we just need to receive a connect request PDU: IFS + CONNECT_REQ = 150 + 352.
* Note: worst-case is 376 + 150 + 352 = 878 usecs
*
* NOTE: The advertising PDU transmit time is NOT included here since we know
* how long that will take (worst-case is 376 usecs).
*/
#define BLE_LL_SCHED_ADV_MAX_USECS (852)
#define BLE_LL_SCHED_DIRECT_ADV_MAX_USECS (502)
#define BLE_LL_SCHED_MAX_ADV_PDU_USECS (376)
/* BLE Jitter (+/- 16 useecs) */
#define BLE_LL_JITTER_USECS (16)
/*
* This is the offset from the start of the scheduled item until the actual
* tx/rx should occur, in ticks.
*/
#if MYNEWT_VAL(OS_CPUTIME_FREQ) == 32768
extern uint8_t g_ble_ll_sched_offset_ticks;
#endif
/*
* This is the number of slots needed to transmit and receive a maximum
* size PDU, including an IFS time before each. The actual time is
* 2120 usecs for tx/rx and 150 for IFS = 4540 usecs.
*/
#define BLE_LL_SCHED_MAX_TXRX_SLOT (4 * BLE_LL_SCHED_USECS_PER_SLOT)
/* BLE scheduler errors */
#define BLE_LL_SCHED_ERR_OVERLAP (1)
/* Types of scheduler events */
#define BLE_LL_SCHED_TYPE_ADV (1)
#define BLE_LL_SCHED_TYPE_SCAN (2)
#define BLE_LL_SCHED_TYPE_CONN (3)
/* Return values for schedule callback. */
#define BLE_LL_SCHED_STATE_RUNNING (0)
#define BLE_LL_SCHED_STATE_DONE (1)
/* Callback function */
struct ble_ll_sched_item;
typedef int (*sched_cb_func)(struct ble_ll_sched_item *sch);
/*
* Schedule item
* sched_type: This is the type of the schedule item.
* enqueued: Flag denoting if item is on the scheduler list. 0: no, 1:yes
* remainder: # of usecs from offset till tx/rx should occur
* txrx_offset: Number of ticks from start time until tx/rx should occur.
*
*/
struct ble_ll_sched_item
{
uint8_t sched_type;
uint8_t enqueued;
uint8_t remainder;
uint32_t start_time;
uint32_t end_time;
void *cb_arg;
sched_cb_func sched_cb;
TAILQ_ENTRY(ble_ll_sched_item) link;
};
/* Initialize the scheduler */
int ble_ll_sched_init(void);
/* Remove item(s) from schedule */
void ble_ll_sched_rmv_elem(struct ble_ll_sched_item *sch);
/* Get a schedule item */
struct ble_ll_sched_item *ble_ll_sched_get_item(void);
/* Free a schedule item */
void ble_ll_sched_free_item(struct ble_ll_sched_item *sch);
/* Schedule a new master connection */
struct ble_ll_conn_sm;
int ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len);
/* Schedule a new slave connection */
int ble_ll_sched_slave_new(struct ble_ll_conn_sm *connsm);
/* Schedule a new advertising event */
int ble_ll_sched_adv_new(struct ble_ll_sched_item *sch);
/* Reschedule an advertising event */
int ble_ll_sched_adv_reschedule(struct ble_ll_sched_item *sch, uint32_t *start,
uint32_t max_delay_ticks);
/* Reschedule and advertising pdu */
int ble_ll_sched_adv_resched_pdu(struct ble_ll_sched_item *sch);
/* Reschedule a connection that had previously been scheduled or that is over */
int ble_ll_sched_conn_reschedule(struct ble_ll_conn_sm * connsm);
/**
* Called to determine when the next scheduled event will occur.
*
* If there are not scheduled events this function returns 0; otherwise it
* returns 1 and *next_event_time is set to the start time of the next event.
*
* @param next_event_time cputime at which next scheduled event will occur
*
* @return int 0: No events are scheduled 1: there is an upcoming event
*/
int ble_ll_sched_next_time(uint32_t *next_event_time);
/* Stop the scheduler */
void ble_ll_sched_stop(void);
#ifdef BLE_XCVR_RFCLK
/* Check if RF clock needs to be restarted */
void ble_ll_sched_rfclk_chk_restart(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* H_LL_SCHED_ */
|
/* Compiler implementation of the D programming language
* Copyright (c) 1999-2014 by Digital Mars
* All Rights Reserved
* written by Walter Bright
* http://www.digitalmars.com
* Distributed under the Boost Software License, Version 1.0.
* http://www.boost.org/LICENSE_1_0.txt
* https://github.com/D-Programming-Language/dmd/blob/master/src/scope.h
*/
#ifndef DMD_SCOPE_H
#define DMD_SCOPE_H
#ifdef __DMC__
#pragma once
#endif
class Dsymbol;
class ScopeDsymbol;
class Identifier;
class Module;
class Statement;
class SwitchStatement;
class TryFinallyStatement;
class LabelStatement;
class ForeachStatement;
class ClassDeclaration;
class AggregateDeclaration;
class FuncDeclaration;
class UserAttributeDeclaration;
struct DocComment;
struct AA;
class TemplateInstance;
#include "dsymbol.h"
#if __GNUC__
// Requires a full definition for LINK
#include "mars.h"
#else
enum LINK;
enum PINLINE;
#endif
#define CSXthis_ctor 1 // called this()
#define CSXsuper_ctor 2 // called super()
#define CSXthis 4 // referenced this
#define CSXsuper 8 // referenced super
#define CSXlabel 0x10 // seen a label
#define CSXreturn 0x20 // seen a return statement
#define CSXany_ctor 0x40 // either this() or super() was called
#define CSXhalt 0x80 // assert(0)
// Flags that would not be inherited beyond scope nesting
#define SCOPEctor 0x0001 // constructor type
#define SCOPEnoaccesscheck 0x0002 // don't do access checks
#define SCOPEcondition 0x0004 // inside static if/assert condition
#define SCOPEdebug 0x0008 // inside debug conditional
// Flags that would be inherited beyond scope nesting
#define SCOPEconstraint 0x0010 // inside template constraint
#define SCOPEinvariant 0x0020 // inside invariant code
#define SCOPErequire 0x0040 // inside in contract code
#define SCOPEensure 0x0060 // inside out contract code
#define SCOPEcontract 0x0060 // [mask] we're inside contract code
#define SCOPEctfe 0x0080 // inside a ctfe-only expression
#define SCOPEcompile 0x0100 // inside __traits(compile)
#define SCOPEfree 0x8000 // is on free list
struct Scope
{
Scope *enclosing; // enclosing Scope
Module *module; // Root module
ScopeDsymbol *scopesym; // current symbol
ScopeDsymbol *sds; // if in static if, and declaring new symbols,
// sds gets the addMember()
FuncDeclaration *func; // function we are in
Dsymbol *parent; // parent to use
LabelStatement *slabel; // enclosing labelled statement
SwitchStatement *sw; // enclosing switch statement
TryFinallyStatement *tf; // enclosing try finally statement
OnScopeStatement *os; // enclosing scope(xxx) statement
Statement *sbreak; // enclosing statement that supports "break"
Statement *scontinue; // enclosing statement that supports "continue"
ForeachStatement *fes; // if nested function for ForeachStatement, this is it
Scope *callsc; // used for __FUNCTION__, __PRETTY_FUNCTION__ and __MODULE__
int inunion; // we're processing members of a union
int nofree; // set if shouldn't free it
int noctor; // set if constructor calls aren't allowed
int intypeof; // in typeof(exp)
VarDeclaration *lastVar; // Previous symbol used to prevent goto-skips-init
/* If minst && !tinst, it's in definitely non-speculative scope (eg. module member scope).
* If !minst && !tinst, it's in definitely speculative scope (eg. template constraint).
* If minst && tinst, it's in instantiated code scope without speculation.
* If !minst && tinst, it's in instantiated code scope with speculation.
*/
Module *minst; // root module where the instantiated templates should belong to
TemplateInstance *tinst; // enclosing template instance
unsigned callSuper; // primitive flow analysis for constructors
unsigned *fieldinit;
size_t fieldinit_dim;
structalign_t structalign; // alignment for struct members
LINK linkage; // linkage for external functions
PINLINE inlining; // inlining strategy for functions
Prot protection; // protection for class members
int explicitProtection; // set if in an explicit protection attribute
StorageClass stc; // storage class
char *depmsg; // customized deprecation message
unsigned flags;
UserAttributeDeclaration *userAttribDecl; // user defined attributes
DocComment *lastdc; // documentation comment for last symbol at this scope
AA *anchorCounts; // lookup duplicate anchor name count
Identifier *prevAnchor; // qualified symbol name of last doc anchor
static Scope *freelist;
static Scope *alloc();
static Scope *createGlobal(Module *module);
Scope();
Scope *copy();
Scope *push();
Scope *push(ScopeDsymbol *ss);
Scope *pop();
Scope *startCTFE();
Scope *endCTFE();
void mergeCallSuper(Loc loc, unsigned cs);
unsigned *saveFieldInit();
void mergeFieldInit(Loc loc, unsigned *cses);
Module *instantiatingModule();
Dsymbol *search(Loc loc, Identifier *ident, Dsymbol **pscopesym, int flags = IgnoreNone);
Dsymbol *search_correct(Identifier *ident);
Dsymbol *insert(Dsymbol *s);
ClassDeclaration *getClassScope();
AggregateDeclaration *getStructClassScope();
void setNoFree();
};
#endif /* DMD_SCOPE_H */
|
/**
Copyright 2017 Google Inc. All Rights Reserved.
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.
*/
/*
* Copyright © 2009 Red Hat, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Red Hat Author(s): Behdad Esfahbod
*/
#ifndef HB_OT_H
#define HB_OT_H
#define HB_OT_H_IN
#include "hb.h"
#include "hb-ot-font.h"
#include "hb-ot-layout.h"
#include "hb-ot-math.h"
#include "hb-ot-tag.h"
#include "hb-ot-shape.h"
#include "hb-ot-var.h"
HB_BEGIN_DECLS
HB_END_DECLS
#undef HB_OT_H_IN
#endif /* HB_OT_H */
|
/**
* Copyright 2017 Harold Bruintjes
*
* 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.
*/
#pragma once
#define IPV6
#define USE_OPENSSL
#define USE_MBEDTLS
#define USE_WOLFSSL
/* #undef PLATFORM_BIG_ENDIAN */
|
/**
* Copyright 2017 Google Inc.
*
* 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.
*
**************************************************************************
*/
#import <Foundation/Foundation.h>
@class TINKKeysetHandle;
@protocol TINKHybridDecrypt;
NS_ASSUME_NONNULL_BEGIN
/**
* TINKHybridDecryptFactory allows for obtaining a TINKHybridDecrypt primitive from a
* TINKKeysetHandle.
*
* TINKHybridDecryptFactory gets primitives from the Registry, which can be initialized via
* convenience methods from TINKHybridConfig. Here is an example how one can obtain and use a
* TINKHybridDecrypt primitive:
*
* NSError *error = nil;
* TINKHybridConfig *hybridConfig = [[TINKHybridConfig alloc] initWithError:&error];
* if (!hybridConfig || error) {
* // handle error.
* }
*
* if (![TINKConfig registerConfig:hybridConfig error:&error]) {
* // handle error.
* }
*
* TINKKeysetHandle keysetHandle = ...;
* id<TINKHybridDecrypt> hybridDecrypt =
* [TINKHybridDecryptFactory primitiveWithKeysetHandle:keysetHandle error:&error];
* if (!hybridDecrypt || error) {
* // handle error.
* }
*
* NSData *plaintext = ...;
* NSData *contextInfo = ...;
* NSData *plaintext = [hybridDecrypt decrypt:ciphertext withContextInfo:contextInfo
* error:&error];
*/
@interface TINKHybridDecryptFactory : NSObject
/**
* Returns an object that conforms to the TINKHybridDecrypt protocol. It uses key material from the
* keyset specified via @c keysetHandle.
*/
+ (nullable id<TINKHybridDecrypt>)primitiveWithKeysetHandle:(TINKKeysetHandle *)keysetHandle
error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
|
/*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDisparityTranslateFilter_h
#define otbDisparityTranslateFilter_h
#include "itkImageToImageFilter.h"
#include "otbVectorImage.h"
#include "otbImage.h"
namespace otb
{
/** \class DisparityTranslateFilter
* \brief Translate epipolar disparities into sensor disparities
*
* This filter resamples a disparity map computed in epipolar geometry
* into a disparity map relative to sensor geometry. The output disparity
* map is aligned on the left sensor image. The disparity values are computed
* relative to the physical coordinates of the left and right sensor images.
* The vertical disparity mask input and the mask are optional.
*
* \ingroup Streamed
* \ingroup Threaded
*
*
* \ingroup OTBDisparityMap
*/
template <class TDisparityImage, class TGridImage = otb::VectorImage<float, 2>, class TSensorImage = otb::Image<unsigned short, 2>,
class TMaskImage = otb::Image<unsigned char, 2>>
class ITK_EXPORT DisparityTranslateFilter : public itk::ImageToImageFilter<TDisparityImage, TDisparityImage>
{
public:
/** Standard class typedef */
typedef DisparityTranslateFilter Self;
typedef itk::ImageToImageFilter<TDisparityImage, TDisparityImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(DisparityTranslateFilter, ImageToImageFilter);
/** Useful typedefs */
typedef TDisparityImage DispMapType;
typedef TGridImage GridType;
typedef TMaskImage MaskType;
typedef TSensorImage SensorType;
typedef typename DispMapType::PixelType PixelType;
typedef typename DispMapType::RegionType RegionType;
typedef typename DispMapType::SizeType SizeType;
typedef typename DispMapType::IndexType IndexType;
typedef typename DispMapType::SpacingType SpacingType;
typedef typename DispMapType::PointType PointType;
typedef typename DispMapType::IndexValueType IndexValueType;
typedef typename GridType::RegionType GridRegionType;
/** Set/Get macro for NoDataValue */
itkSetMacro(NoDataValue, PixelType);
itkGetConstReferenceMacro(NoDataValue, PixelType);
/** Set the horizontal disparity map */
void SetHorizontalDisparityMapInput(const TDisparityImage* hmap);
/** Set the vertical disparity map */
void SetVerticalDisparityMapInput(const TDisparityImage* vmap);
/** Set the inverse left epipolar grid */
void SetInverseEpipolarLeftGrid(const TGridImage* lgrid);
/** Set the direct epipolar right grid */
void SetDirectEpipolarRightGrid(const TGridImage* rgrid);
/** Set the mask relative to the input disparity map */
void SetDisparityMaskInput(const TMaskImage* mask);
/** Set the left input sensor image
* (used as a support for the output disparity map)
*/
void SetLeftSensorImageInput(const TSensorImage* left);
/** Get the inputs */
const TDisparityImage* GetHorizontalDisparityMapInput() const;
const TDisparityImage* GetVerticalDisparityMapInput() const;
const TGridImage* GetInverseEpipolarLeftGrid() const;
const TGridImage* GetDirectEpipolarRightGrid() const;
const TMaskImage* GetDisparityMaskInput() const;
const TSensorImage* GetLeftSensorImageInput() const;
/** Get output disparity maps */
TDisparityImage* GetHorizontalDisparityMapOutput();
TDisparityImage* GetVerticalDisparityMapOutput();
protected:
/** Constructor */
DisparityTranslateFilter();
/** Destructor */
~DisparityTranslateFilter() override{};
/** Generate output information */
void GenerateOutputInformation() override;
/** Generate input requested region */
void GenerateInputRequestedRegion() override;
/** Threaded generate data */
void ThreadedGenerateData(const RegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
/** Override VerifyInputInformation() since this filter's inputs do
* not need to occupy the same physical space.
*
* \sa ProcessObject::VerifyInputInformation
*/
void VerifyInputInformation() override
{
}
private:
DisparityTranslateFilter(const Self&) = delete;
void operator=(const Self&) = delete;
PixelType m_NoDataValue;
};
} // end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbDisparityTranslateFilter.hxx"
#endif
#endif
|
/*
Copyright (c) 2008 by Jeff Weisberg
Author: Jeff Weisberg <jaw @ tcp4me.com>
Created: 2008-Dec-31 13:37 (EST)
Function:
*/
#ifndef __mrquincy_misc_h_
#define __mrquincy_misc_h_
#include <stdlib.h>
#include <atomic.h>
#define ELEMENTSIN(T) (sizeof(T)/sizeof(T[0]))
#define MAX(a,b) (((a)<(b)) ? (b) : (a))
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
#define ABS(x) (((x) < 0) ? -(x) : (x))
#define BOUND(x,min,max) MAX(MIN((x),(max)),(min))
inline int random_n(int n){ return n ? random() % n : 0; }
inline int probability(float p){ return random() < p * 0x7FFFFFFF; }
// use solaris atomic_ops if we have them
#if 0
# define ATOMIC_SET32(a,b) ((a) = (b))
# define ATOMIC_SET64(a,b) ((a) = (b))
# define ATOMIC_SETPTR(a,b) ((a) = (b))
# define ATOMIC_ADD32(a,b) ((a) += (b))
# define ATOMIC_ADD64(a,b) ((a) += (b))
#else
# define ATOMIC_SET32(a,b) atomic_swap_32( (uint32_t*)&a, b )
# define ATOMIC_SET64(a,b) atomic_swap_64( (uint64_t*)&a, b )
# define ATOMIC_SETPTR(a,b) atomic_swap_ptr( &a, b)
# define ATOMIC_ADD32(a,b) atomic_add_32( (uint32_t*)&a, b )
# define ATOMIC_ADD64(a,b) atomic_add_64( (uint64_t*)&a, b )
#endif
extern int current_load(void);
#endif // __mrquincy_misc_h_
|
/**
* eg0202.c
* Dynamically allocate space for pathname.
* Through this example you can get a cue that how to write portable codes.
* If the macro PATH_MAX has been defined, then we are set. If not, we use
* pathconf to retrieve. If the result indicates it is indeterminate, then we
* have to guess one for it.
*/
#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "../com/comhdr.h"
#ifdef PATH_MAX
static int pathmax = PATH_MAX;
#else
static int pathmax = 0;
#endif
/*
* if PATH_MAX is indeterminate, we have to guess one. We're not guaranteed this
* is adequate.
*/
#define PATH_MAX_GUESS 1024
#define SUSV3 200112L
static long posix_version = 0;
static char *path_alloc( int *size );
/* main program, testing driver */
int main( int argc, char **argv ) {
int size;
char *path = path_alloc( &size );
int i;
for ( i = 0; i < size; i += 256 ) {
strcat( path, "/home/alex" );
}
printf( "path is: \n%s\nsize is %d\n", path, size );
free( path );
return 0;
}
static char *path_alloc( int *size ) {
char *ptr;
int s;
if ( posix_version == 0 ) {
posix_version = sysconf( _SC_VERSION );
}
printf( "posix_version = %ld\n", posix_version );
if ( pathmax == 0 ) {
errno = 0;
if ( (pathmax = pathconf( "/", _PC_PATH_MAX )) < 0 ) {
if ( errno == 0 ) {
/* it is indeterminate we have to guess one */
pathmax = PATH_MAX_GUESS;
} else {
err_sys( "pathconf error for _PC_PATH_MAX" );
}
} else {
/* add one, since it is relative to root */
pathmax++;
}
}
/*
* Standards prior to SUSv3 is unclear as to whether or not path included a
* null byte at the end of path. We have to test it and add one more in case.
*/
if ( posix_version < SUSV3 ) {
s = pathmax + 1;
} else {
s = pathmax;
}
if ( (ptr = malloc( s )) == NULL ) {
err_sys( "out of memory" );
}
if ( ptr != NULL ) {
*size = s;
}
return ptr;
}
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* imdumb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mngomane <mngomane@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/06/02 18:58:15 by mngomane #+# #+# */
/* Updated: 2014/06/25 07:55:13 by mngomane ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "ftsh.h"
t_pars is_tok(char *str)
{
if (!ft_strncmp(str, "|", ft_strlen(str)))
return (PIPE);
if (!ft_strncmp(str, ">", ft_strlen(str)))
return (RIGHT);
if (!ft_strncmp(str, ">>", ft_strlen(str)))
return (DRIGHT);
if (!ft_strncmp(str, "<", ft_strlen(str)))
return (LEFT);
if (!ft_strncmp(str, "<<", ft_strlen(str)))
return (DLEFT);
if (!ft_strncmp(str, "&&", ft_strlen(str)))
return (AND);
if (!ft_strncmp(str, "||", ft_strlen(str)))
return (OR);
if (!ft_strncmp(str, "&", ft_strlen(str)))
return (ESPERL);
return (NONE);
}
static t_sent **tab_init(t_sent *sent, size_t *sent_len)
{
t_sent **tmp;
t_sent *save;
save = sent;
*sent_len = 0;
while (sent)
{
++(*sent_len);
sent = sent->next;
}
sent = save;
if ((tmp = (t_sent **)malloc(sizeof(t_sent) * (*sent_len + 2))) == NULL)
{
write(2, FAILED_ALLOC, sizeof(FAILED_ALLOC));
return (NULL);
}
tmp[0] = NULL;
return (tmp);
}
static int htab_fill(t_sent **sent, t_sent ***tab, size_t *j)
{
if (*sent)
{
++(*j);
if ((*tab)[0])
add_rev_sent(&(*tab)[0], (*sent)->word);
else
{
if (((*tab)[0] = (t_sent *)malloc(sizeof(t_sent))) == NULL)
{
write(2, FAILED_ALLOC, sizeof(FAILED_ALLOC));
return (1);
}
(*tab)[0]->word = (*sent)->word;
(*tab)[0]->index = 1;
(*tab)[0]->next = NULL;
}
*sent = (*sent)->next;
}
return (0);
}
static int tab_fill(t_sent **sent, t_sent ***tab, size_t *i, size_t *j)
{
while (*sent && is_tok((*sent)->word) != NONE)
{
if (htab_fill(sent, tab, j))
return (1);
}
if (!*sent)
{
(*tab)[*i] = NULL;
return (0);
}
(*tab)[*i]->word = (*sent)->word;
(*tab)[*i]->index = 1;
(*tab)[*i]->next = NULL;
if (*sent)
{
++(*j);
*sent = (*sent)->next;
}
while (*sent && is_tok((*sent)->word) == NONE)
{
add_rev_sent(&(*tab)[*i], (*sent)->word);
++(*j);
*sent = (*sent)->next;
}
return (0);
}
t_sent **sent_split(t_sent *sent)
{
t_sent **tab;
size_t sent_len;
size_t i;
size_t j;
i = 1;
j = 0;
tab = NULL;
if ((tab = tab_init(sent, &sent_len)) == NULL)
return (NULL);
while (j < sent_len)
{
if ((tab[i] = (t_sent *)malloc(sizeof(t_sent))) == NULL)
{
write(2, FAILED_ALLOC, sizeof(FAILED_ALLOC));
return (NULL);
}
if (tab_fill(&sent, &tab, &i, &j))
return (NULL);
if (htab_fill(&sent, &tab, &j))
return (NULL);
++i;
}
tab[i] = NULL;
return (tab);
}
|
#ifndef __NET_GENEVE_WRAPPER_H
#define __NET_GENEVE_WRAPPER_H 1
#ifdef CONFIG_INET
#include <net/udp_tunnel.h>
#endif
/* Geneve Header:
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |Ver| Opt Len |O|C| Rsvd. | Protocol Type |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Virtual Network Identifier (VNI) | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Variable Length Options |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* Option Header:
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Option Class | Type |R|R|R| Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Variable Option Data |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct geneve_opt {
__be16 opt_class;
u8 type;
#ifdef __LITTLE_ENDIAN_BITFIELD
u8 length:5;
u8 r3:1;
u8 r2:1;
u8 r1:1;
#else
u8 r1:1;
u8 r2:1;
u8 r3:1;
u8 length:5;
#endif
u8 opt_data[];
};
#define GENEVE_CRIT_OPT_TYPE (1 << 7)
struct genevehdr {
#ifdef __LITTLE_ENDIAN_BITFIELD
u8 opt_len:6;
u8 ver:2;
u8 rsvd1:6;
u8 critical:1;
u8 oam:1;
#else
u8 ver:2;
u8 opt_len:6;
u8 oam:1;
u8 critical:1;
u8 rsvd1:6;
#endif
__be16 proto_type;
u8 vni[3];
u8 rsvd2;
struct geneve_opt options[];
};
#ifdef CONFIG_INET
struct geneve_sock;
typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb);
struct geneve_sock {
geneve_rcv_t *rcv;
void *rcv_data;
struct socket *sock;
struct rcu_head rcu;
};
#define GENEVE_VER 0
#define GENEVE_BASE_HLEN (sizeof(struct udphdr) + sizeof(struct genevehdr))
struct geneve_sock *geneve_sock_add(struct net *net, __be16 port,
geneve_rcv_t *rcv, void *data,
bool no_share, bool ipv6);
void geneve_sock_release(struct geneve_sock *vs);
int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos,
__u8 ttl, __be16 df, __be16 src_port, __be16 dst_port,
__be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt,
bool csum, bool xnet);
#endif /*ifdef CONFIG_INET */
#endif /*ifdef__NET_GENEVE_WRAPPER_H */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/networkmanager/NetworkManager_EXPORTS.h>
#include <aws/networkmanager/NetworkManagerRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace NetworkManager
{
namespace Model
{
/**
*/
class AWS_NETWORKMANAGER_API AcceptAttachmentRequest : public NetworkManagerRequest
{
public:
AcceptAttachmentRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "AcceptAttachment"; }
Aws::String SerializePayload() const override;
/**
* <p>The ID of the attachment. </p>
*/
inline const Aws::String& GetAttachmentId() const{ return m_attachmentId; }
/**
* <p>The ID of the attachment. </p>
*/
inline bool AttachmentIdHasBeenSet() const { return m_attachmentIdHasBeenSet; }
/**
* <p>The ID of the attachment. </p>
*/
inline void SetAttachmentId(const Aws::String& value) { m_attachmentIdHasBeenSet = true; m_attachmentId = value; }
/**
* <p>The ID of the attachment. </p>
*/
inline void SetAttachmentId(Aws::String&& value) { m_attachmentIdHasBeenSet = true; m_attachmentId = std::move(value); }
/**
* <p>The ID of the attachment. </p>
*/
inline void SetAttachmentId(const char* value) { m_attachmentIdHasBeenSet = true; m_attachmentId.assign(value); }
/**
* <p>The ID of the attachment. </p>
*/
inline AcceptAttachmentRequest& WithAttachmentId(const Aws::String& value) { SetAttachmentId(value); return *this;}
/**
* <p>The ID of the attachment. </p>
*/
inline AcceptAttachmentRequest& WithAttachmentId(Aws::String&& value) { SetAttachmentId(std::move(value)); return *this;}
/**
* <p>The ID of the attachment. </p>
*/
inline AcceptAttachmentRequest& WithAttachmentId(const char* value) { SetAttachmentId(value); return *this;}
private:
Aws::String m_attachmentId;
bool m_attachmentIdHasBeenSet;
};
} // namespace Model
} // namespace NetworkManager
} // namespace Aws
|
#import <Foundation/Foundation.h>
/**
* Location Intelligence APIs
* Incorporate our extensive geodata into everyday applications, business processes and workflows.
*
* OpenAPI spec version: 8.5.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* 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.
*/
@interface PBQueryParamCollection : NSObject
@property(nonatomic, readonly) NSArray* values;
@property(nonatomic, readonly) NSString* format;
- (id) initWithValuesAndFormat: (NSArray*) values
format: (NSString*) format;
@end
|
/* Copyright 2014-2017 Rsyn
*
* 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.
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Reader.h
* Author: jucemar
*
* Created on 18 de Fevereiro de 2017, 08:20
*/
#ifndef RSYN_READER_H
#define RSYN_READER_H
#include "rsyn/3rdparty/json/json.hpp"
#include "rsyn/io/reader/PopulateRsyn.h"
namespace Rsyn {
class Session;
typedef nlohmann::json Json;
class Reader : public PopulateRsyn {
public:
virtual void load(const Json ¶ms) = 0;
}; // end class
} // end namespace
#endif /* RSYN_READER_H */
|
//
// UIColor+Extension.h
// Careerdream
//
// Created by 赵祥凯 on 15/6/30.
// Copyright (c) 2015年 zxk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (Extension)
+(UIColor *) hexStringToColor: (NSString *) stringToConvert;
@end
|
/*
* This file is part of the Sequoia MSO Solver.
*
* Copyright 2012 Alexander Langer, Theoretical Computer Science,
* RWTH Aachen University
*
* 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.
*/
/**
* @author Alexander Langer
*/
#ifndef SEQUOIA_PAIR_ITERATOR_STL
#define SEQUOIA_PAIR_ITERATOR_STL
#include <boost/iterator/iterator_facade.hpp>
namespace sequoia {
/**
* A Cartesian-product style iterator
* that, given two iterator-ranges i1,i1end and i2,i2end
* returns each pair<i1,i2> in the range exactly once.
*/
template <class It1, class It2>
class PairIteratorStl : public boost::iterator_facade<
PairIteratorStl<It1,It2>, // curious recursion
std::pair<typename It1::value_type, typename It2::value_type>,
boost::forward_traversal_tag,
std::pair<typename It1::value_type, typename It2::value_type> // reference type, make value
> {
public:
typedef typename PairIteratorStl<It1,It2>::reference reference;
explicit PairIteratorStl<It1,It2>(const It1 &it1, const It2 &it2)
: _it1(it1), _it1end(it1), _it2(it2), _it2end(it2), _orig_it2(it2) {
}
explicit PairIteratorStl<It1,It2>(const It1 &it1, const It1 &it1end,
const It2 &it2, const It2 &it2end)
: _it1(it1), _it1end(it1end), _it2(it2), _it2end(it2end), _orig_it2(it2) {
if (_it1 == _it1end || _it2 == _it2end) { // empty iteration
_it1 = _it1end;
_it2 = _it2end;
}
reinit_it1();
}
private:
friend class boost::iterator_core_access;
It1 _it1, _it1end;
It2 _it2, _it2end, _orig_it2;
void increment() {
_it2++;
if (_it2 == _it2end) {
_it1++;
reinit_it1();
}
}
bool equal(const PairIteratorStl<It1,It2> &other) const {
if (this->_it1 != other._it1) return false;
if (this->_it2 != other._it2) return false;
if (this->_it1end != other._it1end) return false;
if (this->_it2end != other._it2end) return false;
return true;
}
reference dereference() const {
return std::make_pair(*_it1, *_it2);
}
void reinit_it1() {
_it2 = _it2end;
if (_it1 != _it1end)
_it2 = _orig_it2;
}
};
}; // namespace;
#endif // SEQUOIA_PAIR_ITERATOR_STL |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstdint>
namespace storage::distributor {
/**
* Used by stripes to signal that the distributor node should immediately respond to
* any pending GetNodeState long-poll RPCs from the cluster controller. This is generally
* done when a stripe has completed initializing or if all merging has completed for
* a bucket space.
*
* Implementations of this interface may batch and/or throttle actual host info sends,
* but shall attempt to send new host info within a reasonable amount of time (on the
* order of seconds).
*/
class StripeHostInfoNotifier {
public:
virtual ~StripeHostInfoNotifier() = default;
virtual void notify_stripe_wants_to_send_host_info(uint16_t stripe_index) = 0;
};
}
|
#include <string.h>
//Compare first n characters pointed by s1 to s2.
int memcmp(const void* s1, const void* s2,size_t n)
{
const unsigned char *p1 = s1, *p2 = s2;
while(n--)
if( *p1 != *p2 )
return *p1 - *p2;
else
p1++,p2++;
return 0;
}
void *(memcpy)(void * restrict s1, const void * restrict s2, size_t n)
{
char *dst = s1;
const char *src = s2;
/* Loop and copy. */
while (n-- != 0)
*dst++ = *src++;
return s1;
}
char *strcpy(char *dest, const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0');
return tmp;
}
char *strncpy(char *dest, const char *src, size_t count)
{
char *tmp = dest;
while (count) {
if ((*tmp = *src) != 0)
src++;
tmp++;
count--;
}
return dest;
}
size_t strlen(const char * str)
{
const char *s;
for (s = str; *s; ++s);
return(s - str);
}
int strcmp(const char *cs, const char *ct)
{
unsigned char c1, c2;
while (1) {
c1 = *cs++;
c2 = *ct++;
if (c1 != c2)
return c1 < c2 ? -1 : 1;
if (!c1)
break;
}
return 0;
}
char *strstr(const char *s1, const char *s2)
{
size_t l1, l2;
l2 = strlen(s2);
if (!l2)
return (char *)s1;
l1 = strlen(s1);
while (l1 >= l2) {
l1--;
if (!memcmp(s1, s2, l2))
return (char *)s1;
s1++;
}
return NULL;
}
char *strcat(char *dest, const char *src)
{
char *tmp = dest;
while (*dest)
dest++;
while ((*dest++ = *src++) != '\0')
;
return tmp;
}
int isspace(char c)
{
return (c == ' ' || c == '\t' || c == '\n' || c == '\12');
}
char *strchr(const char *s, int c)
{
while (*s != (char)c)
if (!*s++)
return 0;
return (char *)s;
}
int isdigit(int ch)
{
return (ch >= '0') && (ch <= '9');
}
size_t strcspn(const char *s, const char *reject) {
size_t count = 0;
while (*s != '\0') {
if (strchr(reject, *s++) == NULL) {
++count;
} else {
return count;
}
}
return count;
}
void reset(char str[], int len)
{
for(int i = 0; i < len; i++)
str[i] = '\0';
}
int atoi(const char *str)
{
int k = 0;
for (int i = 0; str[i] != '\0'; ++i)
k = (k<<3)+(k<<1)+(str[i])-'0';
return k;
}
int64_t htol(char *str)
{
int64_t res = 0;
int i = 0;
while(str[i] != '\0')
{
switch(str[i]){
case 'a':
res = res*16 + 10;
break;
case 'b':
res = res*16 + 11;
break;
case 'c':
res = res*16 + 12;
break;
case 'd':
res = res*16 + 13;
break;
case 'e':
res = res*16 + 14;
break;
case 'f':
res = res*16 + 15;
break;
default:
res = res*16 + (str[i] - '0');
break;
}
i++;
}
return res;
}
|
/*
* @(#)event_generator.h generated by: makeheader Mon Dec 3 23:07:59 2007
*
* built from: generator.ifc
*/
#ifndef event_generator_h
#define event_generator_h
struct RTIClock;
struct RTINtpTime;
struct REDAWorker;
struct RTIEventGeneratorListener;
struct RTIEventGenerator;
#ifndef osapi_type_h
#include "osapi/osapi_type.h"
#endif
#ifndef reda_fastBuffer_h
#include "reda/reda_fastBuffer.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* RTPS 2.0: match larger MIG interpreter storage */
#define RTI_EVENT_GENERATOR_LISTENER_STORAGE_LENGTH (8)
struct RTIEventGeneratorListenerStorage {
void *field[RTI_EVENT_GENERATOR_LISTENER_STORAGE_LENGTH];
};
typedef RTIBool (*RTIEventGeneratorListenerOnEventCallback)(
const struct RTIEventGeneratorListener *me,
struct RTINtpTime *newTime, struct RTINtpTime *newSnooze,
const struct RTINtpTime *now, const struct RTINtpTime *time,
const struct RTINtpTime *snooze,
const struct RTIEventGeneratorListenerStorage *listenerStorage,
struct REDAWorker *worker);
struct RTIEventGeneratorListener {
/*e Generator will call this method for the fired event */
RTIEventGeneratorListenerOnEventCallback onEvent;
};
struct RTIEventGeneratorProperty {
/*e For performance, the generator creates events from a fast buffer pool
to avoid allocating memory dynamically. The fast buffer needs a hint
for the initial pool size. If there will be many events, the initial
pool should be appropriately large.
*/
struct REDAFastBufferPoolGrowthProperty growth;
};
#define RTI_EVENT_GENERATOR_PROPERTY_DEFAULT { \
{100, REDA_FAST_BUFFER_POOL_UNLIMITED, REDA_FAST_BUFFER_POOL_UNLIMITED} }
#define RTI_EVENT_GENERATOR_POST_NEW_EVENT (0)
typedef RTIBool (*RTIEventGeneratorEventPostFunction)(
struct RTIEventGenerator *me,
const struct RTINtpTime *time, const struct RTINtpTime *snooze,
const struct RTIEventGeneratorListener *listener,
const struct RTIEventGeneratorListenerStorage *listenerStorage,
int bytesToCompareIfReuse);
struct RTIEventGenerator {
/*e Schedule future event */
RTIEventGeneratorEventPostFunction postEvent;
};
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* event_generator_h */
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/dom/interfaces/load-save/nsIDOMLSSerializerFilter.idl
*/
#ifndef __gen_nsIDOMLSSerializerFilter_h__
#define __gen_nsIDOMLSSerializerFilter_h__
#ifndef __gen_nsIDOMNodeFilter_h__
#include "nsIDOMNodeFilter.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOMLSSerializerFilter */
#define NS_IDOMLSSERIALIZERFILTER_IID_STR "b9b6ec85-f69f-4a5a-a96a-8a7a8f07e2b4"
#define NS_IDOMLSSERIALIZERFILTER_IID \
{0xb9b6ec85, 0xf69f, 0x4a5a, \
{ 0xa9, 0x6a, 0x8a, 0x7a, 0x8f, 0x07, 0xe2, 0xb4 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMLSSerializerFilter : public nsIDOMNodeFilter {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMLSSERIALIZERFILTER_IID)
/* readonly attribute unsigned long whatToShow; */
NS_SCRIPTABLE NS_IMETHOD GetWhatToShow(PRUint32 *aWhatToShow) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMLSSerializerFilter, NS_IDOMLSSERIALIZERFILTER_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMLSSERIALIZERFILTER \
NS_SCRIPTABLE NS_IMETHOD GetWhatToShow(PRUint32 *aWhatToShow);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMLSSERIALIZERFILTER(_to) \
NS_SCRIPTABLE NS_IMETHOD GetWhatToShow(PRUint32 *aWhatToShow) { return _to GetWhatToShow(aWhatToShow); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMLSSERIALIZERFILTER(_to) \
NS_SCRIPTABLE NS_IMETHOD GetWhatToShow(PRUint32 *aWhatToShow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWhatToShow(aWhatToShow); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOMLSSerializerFilter : public nsIDOMLSSerializerFilter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMLSSERIALIZERFILTER
nsDOMLSSerializerFilter();
private:
~nsDOMLSSerializerFilter();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMLSSerializerFilter, nsIDOMLSSerializerFilter)
nsDOMLSSerializerFilter::nsDOMLSSerializerFilter()
{
/* member initializers and constructor code */
}
nsDOMLSSerializerFilter::~nsDOMLSSerializerFilter()
{
/* destructor code */
}
/* readonly attribute unsigned long whatToShow; */
NS_IMETHODIMP nsDOMLSSerializerFilter::GetWhatToShow(PRUint32 *aWhatToShow)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOMLSSerializerFilter_h__ */
|
/*******************************************************************************
Copyright The University of Auckland
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.
*******************************************************************************/
//==============================================================================
// PMR exposure
//==============================================================================
#pragma once
//==============================================================================
#include "pmrsupportglobal.h"
//==============================================================================
#include <QList>
#include <QString>
//==============================================================================
namespace OpenCOR {
namespace PMRSupport {
//==============================================================================
class PMRSUPPORT_EXPORT PmrExposure
{
public:
explicit PmrExposure(const QString &pUrl, const QString &pName);
static bool compare(const PmrExposure *pFirst, const PmrExposure *pSecond);
QString url() const;
QString name() const;
private:
QString mUrl;
QString mName;
};
//==============================================================================
class PmrExposures : public QList<PmrExposure *>
{
public:
PmrExposures();
virtual ~PmrExposures();
void add(const QString &pUrl, const QString &pName);
};
//==============================================================================
} // namespace PMRSupport
} // namespace OpenCOR
//==============================================================================
// End of file
//==============================================================================
|
#ifndef TRANSITION_SCROLL_H__
#define TRANSITION_SCROLL_H__
#include <Arduino.h>
// #include "Adafruit_ILI9341.h"
#include "MathUtil.h"
#include "BaseTransition.h"
#define setScroll scrollTo
#define writeRect drawBitmap
const float TRANSITION_SCROLL_SPEED = 0.0014f;
const float SCROLL_WRAPS = 5.0f;
const uint_fast8_t MAX_STAGGER_X = 20;
const uint_fast8_t MAX_STAGGER_HEIGHT = 4;
const float STAGGER_X_STRENGTH = 100.0f; // stagger is higher when the ease motion is faster
class TransitionScroll : public BaseTransition {
public:
TransitionScroll() : BaseTransition() {};
void init( Adafruit_ILI9341 tft );
void restart( Adafruit_ILI9341 tft, uint_fast16_t color );
void perFrame( Adafruit_ILI9341 tft, FrameParams frameParams );
boolean isComplete();
private:
float _phase = 0;
uint_fast16_t _color;
float _lastEase;
uint_fast16_t _lastScroll;
uint16_t * _pixels;
};
void TransitionScroll::init( Adafruit_ILI9341 tft ) {
_pixels = (uint16_t*)malloc( sizeof(uint_fast16_t) * tft.width() );
}
void TransitionScroll::restart( Adafruit_ILI9341 tft, uint_fast16_t inColor ) {
//uint_fast16_t w = tft.width();
//uint_fast16_t h = tft.height();
_phase = 0;
_color = inColor;
_lastEase = 0;
_lastScroll = tft.width();
}
float easeInOutCubic( float p ) {
if( p < 0.5f ) {
float p2 = p * 2.0f;
return (p2*p2*p2) * 0.5f;
}
float p2 = (1.0f - p) * 2.0f;
return 1.0f - (p2*p2*p2) * 0.5f;
}
float easeInOutQuart( float p ) {
if( p < 0.5f ) {
float p2 = p * 2.0f;
return (p2*p2*p2*p2) * 0.5f;
}
float p2 = (1.0f - p) * 2.0f;
return 1.0f - (p2*p2*p2*p2) * 0.5f;
}
void TransitionScroll::perFrame( Adafruit_ILI9341 tft, FrameParams frameParams ) {
uint_fast16_t w = (uint_fast16_t)tft.width();
uint_fast16_t h = (uint_fast16_t)tft.height();
_phase += frameParams.timeMult * TRANSITION_SCROLL_SPEED * SCROLL_WRAPS;
// Apply some easing. Linear speed feels dull
float ease = min( easeInOutCubic( _phase ), 1.0f );
float unwrapped = SCROLL_WRAPS * ease;
float wrap = unwrapped - floor(unwrapped);
// scroll values fall from 1 to 0, so the image appears to move left.
float scroll_f = w * (1.0f - wrap);
uint_fast16_t scroll = floor(scroll_f);
tft.setScroll( scroll );
// Final frame: Fill with destination color
if( unwrapped >= (SCROLL_WRAPS-1.0f) ) {
if( scroll < _lastScroll ) {
tft.fillRect( w - _lastScroll, 0, _lastScroll - scroll, h, _color );
_lastScroll = scroll;
}
// Fill part of a random line
uint_fast16_t x = random((uint_fast16_t)(w*0.9f),w);
uint_fast16_t y = random(h);
tft.drawFastHLine( x, y, w-x, _color );
} else {
// Let's noise this thing up
uint_fast16_t staggerX = 1 + constrain( (ease-_lastEase) * STAGGER_X_STRENGTH, 0.0f, 1.0f ) * MAX_STAGGER_X;
uint_fast8_t staggerHeight = random(1,MAX_STAGGER_HEIGHT+1);
uint_fast16_t startY = random(h-(staggerHeight-1));
for( uint_fast8_t line=0; line<staggerHeight; line++ ) {
uint_fast16_t y = startY + line;
// FIXME: this doesn't exist in the adafruit library.
//tft.readRect( 0, y, w, 1, _pixels );
tft.writeRect( staggerX, y, w-staggerX, 1, _pixels );
}
}
_lastEase = ease;
}
boolean TransitionScroll::isComplete() {
return _phase >= 1.0f;
}
#endif
|
//
// GoodsTableViewCell.h
// FrameTinyShop
//
// Created by Mac on 16/12/31.
// Copyright © 2016年 Mac. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GoodsModel.h"
@interface GoodsTableViewCell : UITableViewCell
@property (nonatomic,strong)GoodsModel *goodModel;
@property (nonatomic,strong)UIColor *leftColor;
@property (nonatomic,strong)UIColor *rightColor;
@property (nonatomic,strong)UIView *leftView;
@property (nonatomic,strong)UIView *rightView;
@property (nonatomic,strong)UILabel *goodNameLabel;
@property (nonatomic,strong)UILabel *goodUnitPriceLabel;
@property (nonatomic,strong)UILabel *goodNumLabel;
@property (nonatomic,strong)UILabel *goodTotalPriceLabel;
@property (nonatomic,assign) CGFloat goodCellHeight;
@end
|
/* Siconos is a program dedicated to modeling, simulation and control
* of non smooth dynamical systems.
*
* Copyright 2018 INRIA.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FRICTIONCONTACT3D_nonsmooth_Newton_FischerBurmeister_H
#define FRICTIONCONTACT3D_nonsmooth_Newton_FischerBurmeister_H
/*!\file fc3d_nonsmooth_Newton_FischerBurmeister.h
\brief Typedef and functions declarations related to Fischer-Burmeister
formulation for 3 dimension frictional contact problems in Local Coordinates.
Subroutines used when the friction-contact 3D problem is written
using Fischer-Burmeister formulation:
[...]
where M is an n by n matrix, q an n-dimensional vector, reaction an
n-dimensional vector and velocity an n-dimensional vector.
We consider a "global" (ie for several contacts) problem, used to
initialize the static global variables.
*/
#include "SiconosConfig.h"
#include "FrictionContactProblem.h"
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
extern "C"
{
#endif
/** The Fischer Burmeister function signature for a 3x3 block.
*/
typedef void (*FischerBurmeisterFun3x3Ptr)(double* reaction,
double* velocity,
double mu,
double* rho,
double* F,
double* A,
double* B);
/** Nonsmooth Newton solver based on the Fischer--Burmeister function for the
* local (reduced) frictional contact problem in the dense form
* \param problem the problem to solve in dense or sparse block form
* \param reaction solution and initial guess for reaction
* \param velocity solution and initial guess for velocity
* \param info returned info
* \param options the solver options
*/
void fc3d_nonsmooth_Newton_FischerBurmeister(
FrictionContactProblem* problem,
double *reaction,
double *velocity,
int *info,
SolverOptions *options);
/** The Fischer & Burmeister function for several contacts.
On each contact, the specified Fischer Burmeister function in iparam[9] is called.
\param problemSize the number of contacts.
\param computeACFun3x3 the block 3x3 Fischer & Burmeister function.
\param reaction3D the reactions at each contact (size: 3 x problemSize)
\param velocity3D the velocities at each contact (size: 3 x problemSize)
\param mu the mu parameter (size : problemSize)
\param rho3D the rho parameters (size : 3 x problemSize)
\param output_blocklist3 the computed Fischer & Burmeister function (size : 3 x problemSize)
\param output_blocklist3x3_1 the computed A part of gradient (size : 9 x problemSize)
\param output_blocklist3x3_2 the computed B param of gradient (size : 9 x problemSize)
*/
void fc3d_FischerBurmeisterFunction(
unsigned int problemSize,
FischerBurmeisterFun3x3Ptr computeACFun3x3,
double *reaction3D,
double *velocity3D,
double *mu,
double *rho3D,
double *output_blocklist3,
double *output_blocklist3x3_1,
double *output_blocklist3x3_2);
/* Set the default solver options for the NSN_FB Solver
* Some default values:
* options.iparam[0] = 200 is the maximum number of iterations.
* options.iparam[3] = 100000 is the nzmax parameter for sparse matrices.
* options.dparam[0] = 1e-3 precision.
* \param options the solver options
*/
int fc3d_nonsmooth_Newton_FischerBurmeister_setDefaultSolverOptions(
SolverOptions* options);
int fc3d_nonsmooth_Newton_FischerBurmeister_compute_error(
FrictionContactProblem* problem,
double *z , double *w, double tolerance,
SolverOptions * options, double * error);
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
}
#endif
#endif
|
//
// LoadingViewForOC.h
// LoadingAnimation
//
// Created by huangbaoyu on 16/10/23.
// Copyright © 2016年 chachong. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LoadingViewForOC : UIView
+ (LoadingViewForOC *)showLoadingWith:(UIView *)view;
+ (LoadingViewForOC *)showLoadingWithWindow;
- (void)hideLoadingView;
@end
|
#ifndef MOMENTS_H
#define MOMENTS_H
#include "../ImageChannel.h"
#include "../../geo/Point2.h"
#include "../../geo/Size2.h"
namespace K {
class Moments {
public:
template <int p, int q> static float get(const ImageChannel& img, const Point2i center, const Size2i window) {
const int x1 = - halfL(window.w);
const int x2 = + halfH(window.w);
const int y1 = - halfL(window.h);
const int y2 = + halfH(window.h);
float sum = 0;
for (int oy = y1; oy < y2; ++oy) {
#pragma omp parallel for
for (int ox = x1; ox < x2; ++ox) {
const int x = center.x + ox;
const int y = center.y + oy;
if (!img.contains(x,y)) {continue;}
const float mx = std::pow(ox+x1, p);
const float my = std::pow(oy+y1, q);
sum += mx * my * img.get(x, y);
}
}
return sum;
}
template <int p, int q> static float get(const ImageChannel& img, const Point2i center, const std::vector<Point2i>& offsets) {
float sum = 0;
#pragma omp parallel for
for (size_t i = 0; i < offsets.size(); ++i) {
const Point2i offset = offsets[i];
const int x = center.x + offset.x;
const int y = center.y + offset.y;
if (!img.contains(x,y)) {continue;}
const float mx = std::pow(offset.x, p);
const float my = std::pow(offset.y, q);
sum += mx * my * img.get(x, y);
}
return sum;
}
private:
static inline int halfL(const int inp) { return inp/2; }
static inline int halfH(const int inp) { return (inp+1)/2; }
};
}
#endif // MOMENTS_H
|
/* $NetBSD: trim_info.c,v 1.1.1.2.4.2 2015/04/23 18:53:02 snj Exp $ */
/*
* /src/NTP/ntp4-dev/libparse/trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
*
* trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
*
* $Created: Sun Aug 2 20:20:34 1998 $
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <config.h>
#include "ntp_types.h"
#include "trimble.h"
cmd_info_t *
trimble_convert(
unsigned int cmd,
cmd_info_t *tbl
)
{
int i;
for (i = 0; tbl[i].cmd != 0xFF; i++)
{
if (tbl[i].cmd == cmd)
return &tbl[i];
}
return 0;
}
/*
* trim_info.c,v
* Revision 4.5 2005/04/16 17:32:10 kardel
* update copyright
*
* Revision 4.4 2004/11/14 15:29:41 kardel
* support PPSAPI, upgrade Copyright to Berkeley style
*
* Revision 4.2 1998/12/20 23:45:31 kardel
* fix types and warnings
*
* Revision 4.1 1998/08/09 22:27:48 kardel
* Trimble TSIP support
*
*/
|
/* Copyright (C) 2017 haniu (niuhao.cn@gmail.com)
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
////////////////////////////////////////////////////////////
// import header files
////////////////////////////////////////////////////////////
#include <tt_platform.h>
////////////////////////////////////////////////////////////
// internal macro
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// internal type
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// extern declaration
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// global variant
////////////////////////////////////////////////////////////
// === routine declarations ================
TT_TEST_ROUTINE_DECLARE(case_sshmac_sha1)
// =========================================
// === test case list ======================
TT_TEST_CASE_LIST_DEFINE_BEGIN(sshmac_case)
TT_TEST_CASE("case_sshmac_sha1",
"ssh hmac: sha1",
case_sshmac_sha1,
NULL,
NULL,
NULL,
NULL,
NULL)
,
TT_TEST_CASE_LIST_DEFINE_END(sshmac_case)
// =========================================
TT_TEST_UNIT_DEFINE(SSH_MAC, 0, sshmac_case)
////////////////////////////////////////////////////////////
// interface declaration
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// interface implementation
////////////////////////////////////////////////////////////
/*
TT_TEST_ROUTINE_DEFINE(name)
{
//tt_u32_t param = TT_TEST_ROUTINE_PARAM(tt_u32_t);
TT_TEST_CASE_ENTER()
// test start
// test end
TT_TEST_CASE_LEAVE()
}
*/
TT_TEST_ROUTINE_DEFINE(case_sshmac_sha1)
{
// tt_u32_t param = TT_TEST_ROUTINE_PARAM(tt_u32_t);
tt_sshmac_t smac;
tt_result_t ret;
tt_u8_t hkey[] = {0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x30, 0x61, 0x62, 0x63, 0x64,
0x65, 0x66, 0x31, 0x32, 0x33, 0x34};
tt_u8_t dgst[20];
tt_char_t data[] = "hello,world";
tt_u8_t d1[] = {0x46, 0xc8, 0x39, 0x53, 0xe7, 0x40, 0x8e, 0x48, 0xfc, 0x86,
0x68, 0xd1, 0x29, 0x80, 0x9e, 0x4f, 0x09, 0x29, 0x49, 0x49};
tt_u8_t d2[] = {0xc0, 0x41, 0x79, 0x53, 0xf7, 0xce, 0x8b, 0x47, 0xee, 0x78,
0x13, 0x44, 0x2a, 0x30, 0xe1, 0xbf, 0xb2, 0x54, 0xe6, 0xc7};
TT_TEST_CASE_ENTER()
// test start
tt_sshmac_init(&smac);
// can not sign and verify yet
ret = tt_sshmac_sign(&smac,
0,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
dgst,
sizeof(dgst));
TT_UT_EQUAL(ret, TT_FAIL, "");
ret = tt_sshmac_verify(&smac,
0,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
dgst,
sizeof(dgst));
TT_UT_EQUAL(ret, TT_FAIL, "");
// set to sha1
ret = tt_sshmac_setalg(&smac, TT_SSH_MAC_ALG_HMAC_SHA1, hkey, sizeof(hkey));
TT_UT_EQUAL(ret, TT_SUCCESS, "");
// 1
ret = tt_sshmac_sign(&smac,
0,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
dgst,
sizeof(dgst));
TT_UT_EQUAL(ret, TT_SUCCESS, "");
TT_UT_EQUAL(tt_memcmp(dgst, d1, sizeof(d1)), 0, "");
ret = tt_sshmac_verify(&smac,
0,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
d1,
sizeof(d1));
TT_UT_EQUAL(ret, TT_SUCCESS, "");
// 2
ret = tt_sshmac_sign(&smac,
1,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
dgst,
sizeof(dgst));
TT_UT_EQUAL(ret, TT_SUCCESS, "");
TT_UT_EQUAL(tt_memcmp(dgst, d2, sizeof(d2)), 0, "");
ret = tt_sshmac_verify(&smac,
1,
(tt_u8_t *)data,
(tt_u32_t)strlen(data),
d2,
sizeof(d2));
TT_UT_EQUAL(ret, TT_SUCCESS, "");
tt_sshmac_destroy(&smac);
// test end
TT_TEST_CASE_LEAVE()
}
|
//
// SCPKoreaTableViewController.h
// SCPProject
//
// Created by 韩辉 on 15/9/2.
// Copyright © 2015年 liupuyan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SCPKoreaTableViewController : UITableViewController
@end
|
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_PORT_PLATFORM_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_PORT_PLATFORM_H
/**
* @file
*
* Platform portability details.
*
* This file discover details about the platform (compiler, OS, and hardware
* features) and defines objects and types (mostly macros) to adapt the code.
* The file should be fairly minimal because we rely on gRPC to deal with most
* of the platform problems.
*/
// Turn off clang-format because these nested #if/#endif blocks are more
// readable with indentation.
// clang-format off
// Abort compilation if the compiler does not support C++11.
#ifndef _MSC_VER
// Microsoft Visual Studio does not define __cplusplus correctly for C++11.
# if __cplusplus < 201103L
# error "Bigtable C++ Client requires C++11"
# endif // __cplusplus < 201103L
#elif _MSC_VER < 1900
# error "Bigtable C++ Client requires C++11, your version of MSVC is too old"
#endif // _MSC_VER
// Abort the build if the version of the compiler is too old. With CMake we
// never start the build, but with Bazel we may start the build only to find
// that the compiler is too old. This also simplifies some of the testing
// further down in this file. Because Clang defines both __GNUC__ and __clang__
// test for the Clang version first (sigh).
#if defined(__clang__)
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 8)
# error "Only Clang >= 3.8 is supported."
# endif // Clang < 3.8
#elif defined(__GNUC__)
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
# error "Only GCC >= 4.8 is supported."
# endif // GCC < 4.8
#endif // defined(__clang__)
// Discover if exceptions are enabled and define them as needed.
#ifdef GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS
# error "GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS should not be set directly."
#elif defined(__clang__)
# if defined(__EXCEPTIONS) && __has_feature(cxx_exceptions)
# define GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS 1
# endif // defined(__EXCEPTIONS) && __has_feature(cxx_exceptions)
#elif defined(_MSC_VER)
# if defined(_CPPUNWIND)
# define GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS 1
# endif // defined(_CPPUNWIND)
#elif defined(__GNUC__)
# if (__GNUC__ < 5) && defined(__EXCEPTIONS)
# define GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS 1
# elif (__GNUC__ >= 5) && defined(__cpp_exceptions)
# define GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS 1
# endif // (__GNUC__ >= 5) && defined(__cpp_exceptions)
#elif defined(__cpp_exceptions)
// This should work in increasingly more and more compilers.
// https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
# define GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS 1
#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS
// Define a macro to detect if the compiler supports `const&&`-qualified member
// functions.
#ifdef GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF
# error "GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF should not be set directly."
#elif defined(__clang__)
// Of course this is not true of all Clang versions, but older versions are
// rejected earlier in this file.
# define GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF 1
#elif defined(_MSC_VER)
// Of course this is not true of all MSVC versions, but older versions are
// rejected earlier in this file.
# define GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF 1
#elif defined(__GNUC__)
# if __GNUC__ == 4 && __GNUC_MINOR__ == 8
# define GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF 0
# else
# define GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF 1
# endif // __GNUC__ == 4 && __GNUC_MINOR__ = 8
#else
# define GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF 1
#endif // GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF
// clang-format on
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_PORT_PLATFORM_H
|
//
// PCVAppDelegate.h
// personalcosmosviewer
//
// Created by Yumura Tsubasa on 2013/08/04.
// Copyright (c) 2013年 Yumura Tsubasa. All rights reserved.
//
#import <UIKit/UIKit.h>
@class PCVViewController;
@interface PCVAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) PCVViewController *viewController;
@end
|
//
// SearchTrailTableViewCell.h
// AppWEAR
//
// Created by HKM on 12/03/17.
// Copyright © 2017 HKM. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SearchTrailTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UILabel *labelTrailName;
@property (weak, nonatomic) IBOutlet UILabel *labelName;
@property (weak, nonatomic) IBOutlet UILabel *labelAvgTime;
@property (weak, nonatomic) IBOutlet UILabel *labelTrailTime;
@property (weak, nonatomic) IBOutlet UILabel *labelDate;
@property (strong, nonatomic) NSDictionary *trail;
@end
|
/*
* lib.c
*
* Library implementation
*
* Copyright [yyyy] [name of copyright owner]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "lib.h"
int some_library_function()
{
// do nothing
return 1;
}
|
/* ================================================================
*
* PyCA Project
*
* Copyright (c) J. Samuel Preston, Linh K. Ha, Sarang C. Joshi. All
* rights reserved. See Copyright.txt or for details.
*
* This software is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the above copyright notice for more information.
*
* ================================================================ */
#ifndef __CREDUCE_H
#define __CREDUCE_H
#include <MOpers.h>
#include <estream.h>
namespace PyCA {
template<typename T>
class Vec2D;
class CReduce{
private:
template<typename T, MATH_OPS op>
void reduce(T* h_o, const T* h_i, size_t n, bool update, StreamT stream);
template <typename T, MATH_OPS op, MATH_OPS op1>
void compReduce(T* h_o, const T* h_i, size_t n, bool update, StreamT stream);
template <typename T, MATH_OPS op, MATH_OPS op1>
void bireduce(T* h_o, const T* h_i, size_t n, bool update, StreamT stream);
template <typename T, MATH_OPS op, MATH_OPS op1>
void product(T* h_o, const T* h_i0, const T* h_i1, size_t n, bool update, StreamT stream);
public:
CReduce();
template<typename T>
void Max(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void Min(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void Sum(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void LInf(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void L1(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void Sum2(T& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<class T>
void MaxMin(Vec2D<T>& h_o, const T* h_i, size_t n, bool update=false, StreamT stream=NULL);
template<typename T>
void Dot(T& h_o, const T* h_i, const T* h_i1, size_t n, bool update=false, StreamT stream=NULL);
bool selfTest(size_t n);
};
//static __thread CReduce* __global_cpu_reduce;
} // end namespace PyCA
#endif
|
/*******************************************************************************
* Copyright 2015 MobileMan GmbH
* www.mobileman.com
*
* 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.
******************************************************************************/
//
// NALUnit.h
//
// Basic parsing of H.264 NAL Units
//
// Geraint Davies, March 2004
//
// Copyright (c) GDCL 2004-2008 http://www.gdcl.co.uk/license.htm
#pragma once
typedef unsigned char BYTE;
typedef unsigned long ULONG;
#ifndef NULL
#define NULL 0
#endif
class NALUnit
{
public:
NALUnit();
NALUnit(const BYTE* pStart, int len)
{
m_pStart = m_pStartCodeStart = pStart;
m_cBytes = len;
ResetBitstream();
}
virtual ~NALUnit() {}
// assignment copies a pointer into a fixed buffer managed elsewhere. We do not copy the data
NALUnit(const NALUnit& r)
{
m_pStart = r.m_pStart;
m_cBytes = r.m_cBytes;
ResetBitstream();
}
const NALUnit& operator=(const NALUnit& r)
{
m_pStart = r.m_pStart;
m_cBytes = r.m_cBytes;
ResetBitstream();
return *this;
}
enum eNALType
{
NAL_Slice = 1,
NAL_PartitionA = 2,
NAL_PartitionB = 3,
NAL_PartitionC = 4,
NAL_IDR_Slice = 5,
NAL_SEI = 6,
NAL_Sequence_Params = 7,
NAL_Picture_Params = 8,
NAL_AUD = 9,
};
// identify a NAL unit within a buffer.
// If LengthSize is non-zero, it is the number of bytes
// of length field we expect. Otherwise, we expect start-code
// delimiters.
bool Parse(const BYTE* pBuffer, int cSpace, int LengthSize, bool bEnd);
eNALType Type()
{
if (m_pStart == NULL)
{
return eNALType(0);
}
return eNALType(m_pStart[0] & 0x1F);
}
int Length()
{
return m_cBytes;
}
const BYTE* Start()
{
return m_pStart;
}
// bitwise access to data
void ResetBitstream();
void Skip(int nBits);
unsigned long GetWord(int nBits);
unsigned long GetUE();
long GetSE();
BYTE GetBYTE();
unsigned long GetBit();
const BYTE* StartCodeStart() { return m_pStartCodeStart; }
private:
bool GetStartCode(const BYTE*& pBegin, const BYTE*& pStart, int& cRemain);
private:
const BYTE* m_pStartCodeStart;
const BYTE* m_pStart;
int m_cBytes;
// bitstream access
int m_idx;
int m_nBits;
BYTE m_byte;
int m_cZeros;
};
// simple parser for the Sequence parameter set things that we need
class SeqParamSet
{
public:
SeqParamSet();
bool Parse(NALUnit* pnalu);
int FrameBits()
{
return m_FrameBits;
}
long EncodedWidth()
{
return m_cx;
}
long EncodedHeight()
{
return m_cy;
}
#if 0
long CroppedWidth()
{
if (IsRectEmpty(&m_rcFrame))
{
return EncodedWidth();
}
return m_rcFrame.right - m_rcFrame.left;
}
long CroppedHeight()
{
if (IsRectEmpty(&m_rcFrame))
{
return EncodedHeight();
}
return m_rcFrame.bottom - m_rcFrame.top;
}
RECT* CropRect()
{
return &m_rcFrame;
}
#endif
bool Interlaced()
{
return !m_bFrameOnly;
}
unsigned int Profile() { return m_Profile; }
unsigned int Level() { return m_Level; }
BYTE Compat() { return m_Compatibility; }
NALUnit* NALU() {return &m_nalu; }
private:
NALUnit m_nalu;
int m_FrameBits;
long m_cx;
long m_cy;
// RECT m_rcFrame;
bool m_bFrameOnly;
int m_Profile;
int m_Level;
BYTE m_Compatibility;
};
// extract frame num from slice headers
class SliceHeader
{
public:
SliceHeader(int nBitsFrame)
: m_framenum(0),
m_nBitsFrame(nBitsFrame)
{
}
bool Parse(NALUnit* pnalu);
int FrameNum()
{
return m_framenum;
}
private:
int m_framenum;
int m_nBitsFrame;
};
// SEI message structure
class SEIMessage
{
public:
SEIMessage(NALUnit* pnalu);
int Type() { return m_type; }
int Length() { return m_length; }
const BYTE* Payload() { return m_pnalu->Start() + m_idxPayload; }
private:
NALUnit* m_pnalu;
int m_type;
int m_length;
int m_idxPayload;
};
// avcC structure from MP4
class avcCHeader
{
public:
avcCHeader(const BYTE* header, int cBytes);
NALUnit* sps() { return &m_sps; }
NALUnit* pps() { return &m_pps; }
private:
NALUnit m_sps;
NALUnit m_pps;
};
|
/*!
\file main.c
\brief comparator portoutput
*/
/*
Copyright (C) 2016 GigaDevice
2014-12-26, V1.0.0, firmware for GD32F1x0(x=3,5)
2016-01-15, V2.0.0, firmware for GD32F1x0(x=3,5,7,9)
2016-04-30, V3.0.0, firmware update for GD32F1x0(x=3,5,7,9)
*/
#include "gd32f1x0.h"
#include <stdio.h>
#include "gd32f1x0_eval.h"
void rcu_config(void);
void gpio_config(void);
/*!
\brief main function
\param[in] none
\param[out] none
\retval none
*/
int main(void)
{
int i;
/* configure RCU */
rcu_config();
/* configure GPIO */
gpio_config();
gd_eval_ledinit(LED2);
/* configure comparator channel0 */
cmp_mode_init(CMP_CHANNEL_CMP0, CMP_VERYLOWSPEED, CMP_1_4VREFINT, CMP_HYSTERESIS_NO);
cmp_output_init(CMP_CHANNEL_CMP0, CMP_OUTPUT_NONE, CMP_OUTPUT_POLARITY_NOINVERTED);
/* enable comparator channel0 */
cmp_channel_enable(CMP_CHANNEL_CMP0);
for( i=0; i<100; i++);
/* get the output level */
if(CMP_OUTPUTLEVEL_HIGH == cmp_output_level(CMP_CHANNEL_CMP0)){
gd_eval_ledon(LED2);
}else{
gd_eval_ledoff(LED2);
}
while (1);
}
/*!
\brief configure RCU
\param[in] none
\param[out] none
\retval none
*/
void rcu_config(void)
{
/* enable GPIOA clock */
rcu_periph_clock_enable(RCU_GPIOA);
/* enable comparator clock */
rcu_periph_clock_enable(RCU_CFGCMP);
}
/*!
\brief configure GPIO
\param[in] none
\param[out] none
\retval none
*/
void gpio_config(void)
{
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_1);
gpio_mode_set(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_PULLUP, GPIO_PIN_1);
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_6);
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_6);
gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_6);
}
|
#ifndef _ANALYZER_H
#define _ANALYZER_H
#include "csc32Common.h"
class Analyzer
{
public:
Analyzer();
~Analyzer();
u32 analyze(u8* src,u32 size);
u32 analyzeHeader(u8 *src,u32 size,u32 *typeArg1,u32 *typeArg2,u32 *typeArg3);
private:
u32 logTable[(MinBlockSize>>4)+1];
i32 GetChnIdx(u8 *src,u32 size);
};
#endif
|
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2004, 2007, 2009, 2010 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <mailutils/mailcap.h>
#include <mailutils/stream.h>
#include <mailutils/error.h>
int
main (int argc, char **argv)
{
mu_stream_t stream = NULL;
int status = 0;
char *file = argc == 1 ? "/etc/mailcap" : argv[1];
mu_mailcap_t mailcap = NULL;
status = mu_file_stream_create (&stream, file, MU_STREAM_READ);
if (status)
{
mu_error ("cannot create file stream %s: %s",
file, mu_strerror (status));
exit (1);
}
status = mu_stream_open (stream);
if (status)
{
mu_error ("cannot open file stream %s: %s",
file, mu_strerror (status));
exit (1);
}
status = mu_mailcap_create (&mailcap, stream);
if (status == 0)
{
int i;
size_t count = 0;
char buffer[256];
mu_mailcap_entries_count (mailcap, &count);
for (i = 1; i <= count; i++)
{
size_t j;
mu_mailcap_entry_t entry = NULL;
size_t fields_count = 0;
printf ("entry[%d]\n", i);
mu_mailcap_get_entry (mailcap, i, &entry);
/* typefield. */
mu_mailcap_entry_get_typefield (entry, buffer,
sizeof (buffer), NULL);
printf ("\ttypefield: %s\n", buffer);
/* view-command. */
mu_mailcap_entry_get_viewcommand (entry, buffer,
sizeof (buffer), NULL);
printf ("\tview-command: %s\n", buffer);
/* fields. */
mu_mailcap_entry_fields_count (entry, &fields_count);
for (j = 1; j <= fields_count; j++)
{
int status = mu_mailcap_entry_get_field (entry, j, buffer,
sizeof (buffer), NULL);
if (status)
{
mu_error ("cannot retrieve field %lu: %s",
(unsigned long) j,
mu_strerror (status));
break;
}
printf ("\tfields[%lu]: %s\n", (unsigned long) j, buffer);
}
printf ("\n");
}
mu_mailcap_destroy (&mailcap);
}
return 0;
}
|
/**
******************************************************************************
* @file FSMC/FSMC_SRAM/main.c
* @author MCD Application Team
* @version V1.2.0
* @date 19-September-2013
* @brief Main program body
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/** @addtogroup STM32F4xx_StdPeriph_Examples
* @{
*/
/** @addtogroup FSMC_SRAM
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define BUFFER_SIZE ((uint32_t)0x0100)
#define WRITE_READ_ADDR ((uint32_t)0x0800)
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Read/Write Buffers */
uint16_t aTxBuffer[BUFFER_SIZE];
uint16_t aRxBuffer[BUFFER_SIZE];
/* Status variables */
__IO uint32_t uwWriteReadStatus_SRAM = 0;
/* Counter index */
uint32_t uwIndex = 0;
/* Private function prototypes -----------------------------------------------*/
static void Fill_Buffer(uint16_t *pBuffer, uint32_t uwBufferLenght, uint16_t uhOffset);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
files (startup_stm32f40_41xxx.s/startup_stm32f427_437xx.s/
startup_stm32f429_439xx.s/startup_stm32f401xx.s) before to branch to
application main. To reconfigure the default setting of SystemInit()
function, refer to system_stm32f4xx.c file
*/
/* Initialize LEDs on EVAL board */
STM_EVAL_LEDInit(LED1);
STM_EVAL_LEDInit(LED2);
/* Initialize the SRAM memory */
SRAM_Init();
/* Fill the buffer to send */
Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0x250F);
/* Write data to the SRAM memory */
SRAM_WriteBuffer(aTxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);
/* Read back data from the SRAM memory */
SRAM_ReadBuffer(aRxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);
/* Check the SRAM memory content correctness */
for (uwIndex = 0; (uwIndex < BUFFER_SIZE) && (uwWriteReadStatus_SRAM == 0); uwIndex++)
{
if (aRxBuffer[uwIndex] != aTxBuffer[uwIndex])
{
uwWriteReadStatus_SRAM++;
}
}
if (uwWriteReadStatus_SRAM)
{
/* KO */
/* Turn on LD2 */
STM_EVAL_LEDOn(LED2);
}
else
{
/* OK */
/* Turn on LD1 */
STM_EVAL_LEDOn(LED1);
}
while (1)
{
}
}
/**
* @brief Fills buffer with user predefined 16 bit length data.
* @param pBuffer: pointer on the buffer to fill
* @param uwBufferLenght: size of the buffer to fill
* @param uhOffset: first value to fill on the buffer
* @retval None
*/
static void Fill_Buffer(uint16_t *pBuffer, uint32_t uwBufferLenght, uint16_t uhOffset)
{
uint32_t tmpIndex = 0;
/* Put in global buffer different values */
for (tmpIndex = 0; tmpIndex < uwBufferLenght; tmpIndex++ )
{
pBuffer[tmpIndex] = tmpIndex + uhOffset;
}
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// Copyright 2019 ZetaSQL Authors
//
// 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.
//
// See (broken link) for details on these functions.
#ifndef ZETASQL_PUBLIC_FUNCTIONS_JSON_H_
#define ZETASQL_PUBLIC_FUNCTIONS_JSON_H_
#include <memory>
#include <string>
#include <vector>
#include "zetasql/base/string_numbers.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "zetasql/base/statusor.h"
namespace zetasql {
namespace functions {
namespace json_internal {
class ValidJSONPathIterator;
} // namespace json_internal
// Utility class for Json extraction. Optimized for reuse of a constant
// json_path, whereas the above functions normalize json_path on every call.
class JsonPathEvaluator {
public:
~JsonPathEvaluator();
// Creates a new evaluator for a constant json_path. json_path does not need
// to persist beyond the call to Create().
//
// sql_standard_mode: The JSON Path is interpreted differently with this
// flag. For full details please see (broken link)
// 1) True: Only number subscripts are allowed. It allows the . child
// operator as a quoted field name. The previous example could be rewritten
// as $.a."b"
// 2) False: String subscripts are allowed. For example: $.a["b"] is a valid
// JSON path in this mode and equivalent to $.a.b
//
// New callers to this API should be using sql_standard_mode = true.
//
// Error cases:
// * OUT_OF_RANGE - json_path is malformed.
// * OUT_OF_RANGE - json_path uses a (currently) unsupported expression type.
static zetasql_base::StatusOr<std::unique_ptr<JsonPathEvaluator>> Create(
absl::string_view json_path, bool sql_standard_mode);
// Extracts a value from 'json' according to the JSONPath string 'json_path'
// provided in Create().
// For example:
// json: {"a": {"b": [ { "c" : "foo" } ] } }
// json_path: $
// value -> {"a":{"b":[{"c":"foo"}]}}
//
// json: {"a": {"b": [ { "c" : "foo" } ] } }
// json_path: $.a.b[0]
// value -> {"c":"foo"}
//
// json: {"a": {"b": ["c" : "foo"] } }
// json_path: $.a.b[0].c
// value -> "foo" (i.e. quoted string)
//
// Since JsonPathEvaluator is only created on valid JSON paths this
// will always return OK.
//
// Null cases:
// * json is malformed and fails to parse.
// * json_path does not match anything.
// * json_path uses an array index but the value is not an array, or the path
// uses a name but the value is not an object.
absl::Status Extract(absl::string_view json, std::string* value,
bool* is_null) const;
// Similar to the above, but the 'json_path' provided in Create() must refer
// to a scalar value in 'json'.
// For example:
// json: {"a": {"b": ["c" : "foo"] } }
// json_path: $.a.b[0].c
// value -> foo (i.e. unquoted string)
//
// json: {"a": 3.14159 }
// json_path: $.a
// value -> 3.14159 (i.e. unquoted string)
//
// Error cases are the same as in JsonExtract.
// Null cases are the same as in JsonExtract, except for the addition of:
// * json_path does not correspond to a scalar value in json.
absl::Status ExtractScalar(absl::string_view json, std::string* value,
bool* is_null) const;
// Extracts an array from 'json' according to the JSONPath string 'json_path'
// provided in Create(). The value in 'json' that 'json_path' refers to should
// be an JSON array. Then the output of the function will be in the form of an
// ARRAY.
// For example:
// json: ["foo","bar","baz"]
// json_path: $
// value -> ["\"foo\"", "\"bar\"", "\"baz\""] (ARRAY, quotes kept)
//
// json: [1,2,3]
// value -> [1, 2, 3] (ARRAY, JSONPath is $ by default if not provided)
//
// json: {"a":[{"b":"foo","c":1},{"b":"bar","c":2}],"d":"baz"}
// json_path: $.a
// value -> ["{\"b\":\"foo\",\"c\":1}","{\"b\":\"bar\",\"c\":2}"]
// (ARRAY, objects in the form of strings)
//
// Error cases are the same as in JsonExtract function.
// Null cases are the same as in JsonExtract, except for the addition of:
// * json_path does not correspond to an array in json.
absl::Status ExtractArray(absl::string_view json,
std::vector<std::string>* value,
bool* is_null) const;
// Enables the escaping of special characters for JSON_EXTRACT.
//
// Escaping special characters is part of the behavior detailed in the
// ISO/IEC TR 19075-6 report on SQL support for JavaScript Object Notation.
//
// This implementation follows the proto3 JSON spec ((broken link),
// (broken link)), where special characters include the
// following:
// * Quotation mark, "
// * Reverse solidus, \
// * Control characters (U+0000 through U+001F).
void enable_special_character_escaping() {
escape_special_characters_ = true;
}
private:
explicit JsonPathEvaluator(
std::unique_ptr<json_internal::ValidJSONPathIterator> itr);
const std::unique_ptr<json_internal::ValidJSONPathIterator> path_iterator_;
bool escape_special_characters_ = false;
};
} // namespace functions
} // namespace zetasql
#endif // ZETASQL_PUBLIC_FUNCTIONS_JSON_H_
|
//
// MainTabBarController.h
// 模仿简书自定义Tabbar(纯代码)
//
// Created by 莫大宝 on 16/6/24.
// Copyright © 2016年 dabao. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HomePageViewController.h"
#import "TestChatListViewController.h"
#import "PersonViewController.h"
@protocol MainTabBarControllerDelegate <NSObject>
- (void)setAddress:(NSString *)address;
//- (void)checkOrder;
@end
@interface MainTabBarController : UITabBarController
@property (nonatomic, assign) BOOL isPush;
@property(nonatomic, strong) HomePageViewController *homeVc;
@property (nonatomic, strong) TestChatListViewController *chatListVC;
@property(nonatomic, strong) PersonViewController *personVC;
@property (nonatomic, assign) id<MainTabBarControllerDelegate> tabdelegate;
//@property (nonatomic, assign) id<MainTabBarControllerDelegate> tabCheckDelegate;
@end
|
/*
* Copyright 2015 Alexey Baranov <me@kotiki.cc>. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SQUIM_IMAGE_OPIMIZATION_ROOT_STRATEGY_H_
#define SQUIM_IMAGE_OPIMIZATION_ROOT_STRATEGY_H_
#include <memory>
#include "squim/image/optimization/codec_aware_strategy.h"
namespace image {
class ImageCodecFactory;
class RootStrategy : public CodecAwareStrategy {
public:
using CodecFactoryBuilder =
std::function<std::unique_ptr<ImageCodecFactory>(CodecConfigurator*)>;
class Adjuster {
public:
virtual Result ShouldEvenBother() = 0;
virtual Result AdjustReader(ImageType image_type,
std::unique_ptr<ImageReader>* reader) = 0;
virtual Result AdjustReaderAfterInfoReady(
std::unique_ptr<ImageReader>* reader) = 0;
virtual Result AdjustWriter(ImageReader* reader,
std::unique_ptr<ImageWriter>* writer) = 0;
virtual bool ShouldWaitForMetadata() = 0;
virtual void AdjustGifDecoderParams(GifDecoder::Params* params) = 0;
virtual void AdjustJpegDecoderParams(JpegDecoder::Params* params) = 0;
virtual void AdjustPngDecoderParams(PngDecoder::Params* params) = 0;
virtual void AdjustWebPDecoderParams(WebPDecoder::Params* params) = 0;
virtual void AdjustWebPEncoderParams(WebPEncoder::Params* params) = 0;
virtual ~Adjuster() {}
};
RootStrategy(CodecFactoryBuilder codec_factory_builder,
std::unique_ptr<CodecAwareStrategy> base_strategy,
std::unique_ptr<Adjuster> adjuster);
~RootStrategy() override;
// CodecAwareStrategy implementation:
Result ShouldEvenBother() override;
Result CreateImageReader(ImageType image_type,
std::unique_ptr<io::BufReader> src,
std::unique_ptr<ImageReader>* reader) override;
Result CreateImageWriter(std::unique_ptr<io::VectorWriter> dest,
ImageReader* reader,
std::unique_ptr<ImageWriter>* writer) override;
Result AdjustImageReaderAfterInfoReady(
std::unique_ptr<ImageReader>* reader) override;
bool ShouldWaitForMetadata() override;
GifDecoder::Params GetGifDecoderParams() override;
JpegDecoder::Params GetJpegDecoderParams() override;
PngDecoder::Params GetPngDecoderParams() override;
WebPDecoder::Params GetWebPDecoderParams() override;
WebPEncoder::Params GetWebPEncoderParams() override;
void SetCodecFactory(ImageCodecFactory* factory) override;
private:
std::unique_ptr<ImageCodecFactory> codec_factory_;
std::unique_ptr<CodecAwareStrategy> base_strategy_;
std::unique_ptr<Adjuster> adjuster_;
};
} // namespace image
#endif // SQUIM_IMAGE_OPIMIZATION_ROOT_STRATEGY_H_
|
/*
* Battery.h
*
* Created on: Nov 12, 2016
* Author: ghagleitner
*/
#ifndef BATTERY_H_
#define BATTERY_H_
#define MIN_CELL_LIPO (3.5)
#define MAX_CELL_LIPO (4.2)
#define LOAD_CORRECTION_LIPO (0.2)
#define MIN_VOLTS_LIPO(CELL_COUNT) (MIN_CELL_LIPO * (CELL_COUNT)\
- LOAD_CORRECTION_LIPO * ((CELL_COUNT)))
#define MAX_VOLTS_LIPO(CELL_COUNT) (MAX_CELL_LIPO * (CELL_COUNT)\
- LOAD_CORRECTION_LIPO *((CELL_COUNT)))
#define WARN_VOLTS_LIPO(CELL_COUNT) ((MIN_CELL_LIPO + 0.2) * (CELL_COUNT)\
- LOAD_CORRECTION_LIPO * (CELL_COUNT))
#define MIN_CELL_NIMH (0.9)
#define MAX_CELL_NIMH (1.4)
#define LOAD_CORRECTION_NIMH (0.1)
#define MIN_VOLTS_NIMH(CELL_COUNT) (MIN_CELL_NIMH * (CELL_COUNT)\
- LOAD_CORRECTION_NIMH * ((CELL_COUNT)))
#define MAX_VOLTS_NIMH(CELL_COUNT) (MAX_CELL_NIMH * (CELL_COUNT)\
- LOAD_CORRECTION_NIMH *((CELL_COUNT)))
#define WARN_VOLTS_NIMH(CELL_COUNT) ((MIN_CELL_NIMH + 0.05) * (CELL_COUNT)\
- LOAD_CORRECTION_NIMH * (CELL_COUNT))
#define A1_TO_VOLTS(a1) ((a1) * 52 / 1000.0)
#define A2_TO_VOLTS(a2) ((a2) * 13.4 / 1000.0)
#define A1_TO_BYTE(a1) (a1)
#define A2_TO_BYTE(a2) ((uint8_t) ((a2) * (13.4 / 52.0)))
#define VOLTS_TO_BYTE(v) ((uint8_t) ((v) * 1000 / 52.0))
#define BYTE_TO_VOLTS(v) ((v) * 52 / 1000.0)
#define COMPUTE_VOLTS(v, r1, r2) ((uint8_t)((((v) * 5 * (r1+r2)) / r2) / 52))
#endif /* BATTERY_H_ */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by Jellow, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiProxy.h"
#import "Bridge.h"
#import "TiEvaluator.h"
#import "TiStylesheet.h"
@interface TiHost : NSObject
{
NSMutableDictionary *modules;
NSMutableDictionary *contexts;
NSURL *startURL;
NSURL *baseURL;
TiStylesheet *stylesheet;
BOOL debugMode;
}
@property (nonatomic,assign) BOOL debugMode;
-(NSString*)appID;
-(NSURL*)baseURL;
-(NSURL*)startURL;
+(NSString *)resourcePath;
-(TiStylesheet*)stylesheet;
+(NSURL*)resourceBasedURL:(NSString*)fn baseURL:(NSString**)base;
-(id)moduleNamed:(NSString*)name context:(id<TiEvaluator>)context;
-(void)fireEvent:(id)listener withObject:(id)obj remove:(BOOL)remove context:(id<TiEvaluator>)context thisObject:(TiProxy*)thisObject_;
-(void)removeListener:(id)listener context:(id<TiEvaluator>)context;
-(void)evaluateJS:(NSString*)js context:(id<TiEvaluator>)context;
-(void)registerContext:(id<TiEvaluator>)context forToken:(NSString*)token;
-(void)unregisterContext:(id<TiEvaluator>)context forToken:(NSString*)token;
-(id<TiEvaluator>)contextForToken:(NSString*)token;
@end
|
/*************************************************************************
> File Name: my_list.c
> Brief:
> Author: Chen Kai(http://www.chenkai.me)
> Mail: ischenkai@qq.com
> Created Time: 日 5/ 7 20:52:23 2017
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct Nameval Nameval;
struct Nameval {
char* name;
int value;
Nameval *next;
};
Nameval *newitem(char *name, int value)
{
Nameval *newp;
newp = (Nameval*)malloc(sizeof(Nameval));
newp->name = name;
newp->value = value;
newp->next = NULL;
return newp;
}
Nameval* addfront(Nameval* listp, Nameval* newp)
{
newp->next = listp;
return newp;
}
Nameval* addend(Nameval* listp, Nameval* newp)
{
if(listp == NULL)
{
return newp;
}
Nameval* p;
for(p = listp; p->next != NULL; p = p->next){}
return listp;
}
Nameval* lookup(Nameval* listp, char* name)
{
for(; listp != NULL; listp = listp->next)
{
if(strcmp(name, listp->name) == 0)
{
return listp;
}
}
return NULL;
}
void apply(Nameval* listp, void(*fn)(Nameval*,void*), void* arg)
{
for(; listp != NULL; listp = listp->next)
{
(*fn)(listp, arg);
}
}
int itemcmp(void* item1, void* item2)
{
Nameval* i1 = (Nameval*)item1;
Nameval* i2 = (Nameval*)item2;
if(i1->value == i2->value)
return 0;
else if(i1->value > i2->value)
return 1;
else
return -1;
}
void printv(Nameval* p, void* arg)
{
char* fmt;
fmt = (char*)arg;
printf(fmt, p->name, p->value);
}
void inccounter(Nameval* p, void* arg)
{
int* ip;
ip = (int*)arg;
(*ip)++;
}
void freeall(Nameval* listp)
{
Nameval* next;
for(; listp != NULL; listp = next)
{
next = listp->next;
free(listp);
}
}
Nameval* delitem(Nameval* listp, char* name)
{
//lookup
Nameval *pre;
Nameval *p;
for(p = listp; p != NULL; p = listp->next)
{
if(strcmp(name, p->name) == 0)
{
if(pre == NULL)
listp = p->next;
else
pre->next = p->next;
free(p);
return listp;
}
pre = p;
}
return NULL;
}
Nameval* copy(Nameval* lists, Nameval* listd)
{
for(; lists != NULL; lists = lists->next)
{
}
}
Nameval* merge(Nameval* listp1, Nameval* listp2)
{
if(listp1 == NULL)
{
return listp2;
}
if(listp2 == NULL)
{
return listp1;
}
Nameval * listp;
int listcmpr = itemcmp(listp1, listp2);
if(listcmpr > 0)
{
listp = listp2;
listp->next = merge(listp1, listp2->next);
}
else
{
listp = listp1;
listp->next = merge(listp1->next, listp2);
}
return listp;
}
Nameval* merge2(Nameval* listp1, Nameval* listp2)
{
if(listp1 == NULL)
{
return listp2;
}
if(listp2 == NULL)
{
return listp1;
}
Nameval * listp;
Nameval* p1 = listp1;
Nameval* p2 = listp2;
int listcmpr = itemcmp(listp1, listp2);
if(listcmpr > 0)
{
listp = listp2;
}
else
{
listp = listp1;
}
Nameval* listpe = listp;
while(p1 && p2)
{
if(p1->value < p2->value)
{
listpe->next = p1;
listpe = p1;
p1 = p1->next;
}
else
{
listpe->next = p2;
listpe = p2;
p2 = p2->next;
}
}
while(p1)
{
listpe->next = p1;
listpe = p1;
p1 = p1->next;
}
while(p2)
{
listpe->next = p2;
listpe = p2;
p2 = p2->next;
}
return listp;
}
Nameval* revers(Nameval* listp)
{
if(!listp || !listp->next)
return listp;
Nameval* listp1 = listp;
Nameval* listp2 = listp->next;
listp1->next = NULL;
while(listp2)
{
Nameval* next = listp2->next;
listp2->next = listp1;
listp1 = listp2;
listp2 = next;
}
return listp1;;
}
int main()
{
return 0;
}
|
/**
* _titaniumappApp _titaniumappApp Mobile
* Copyright (c) 2009-2014 by _titaniumappApp, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiModule.h"
#ifdef USE_TI_CALENDAR
#import <EventKit/EventKit.h>
#import "TiCalendarCalendar.h"
#import "TiCalendarAlert.h"
#import "TiCalendarEvent.h"
#import "TiCalendarReminder.h"
@interface CalendarModule : TiModule {
@private
EKEventStore * store;
}
-(EKEventStore*)store;
@property (nonatomic, readonly)NSNumber* STATUS_NONE;
@property (nonatomic, readonly)NSNumber* STATUS_CONFIRMED;
@property (nonatomic, readonly)NSNumber* STATUS_TENTATIVE;
@property (nonatomic, readonly)NSNumber* STATUS_CANCELED;
@property (nonatomic, readonly)NSNumber* AVAILABILITY_NOTSUPPORTED;
@property (nonatomic, readonly)NSNumber* AVAILABILITY_BUSY;
@property (nonatomic, readonly)NSNumber* AVAILABILITY_FREE;
@property (nonatomic, readonly)NSNumber* AVAILABILITY_TENTATIVE;
@property (nonatomic, readonly)NSNumber* AVAILABILITY_UNAVAILABLE;
@property (nonatomic, readonly)NSNumber* SPAN_THISEVENT;
@property (nonatomic, readonly)NSNumber* SPAN_FUTUREEVENTS;
@property (nonatomic, readonly)NSNumber* RECURRENCEFREQUENCY_DAILY;
@property (nonatomic, readonly)NSNumber* RECURRENCEFREQUENCY_WEEKLY;
@property (nonatomic, readonly)NSNumber* RECURRENCEFREQUENCY_MONTHLY;
@property (nonatomic, readonly)NSNumber* RECURRENCEFREQUENCY_YEARLY;
@property (nonatomic, readonly)NSNumber* AUTHORIZATION_UNKNOWN;
@property (nonatomic, readonly)NSNumber* AUTHORIZATION_RESTRICTED;
@property (nonatomic, readonly)NSNumber* AUTHORIZATION_DENIED;
@property (nonatomic, readonly)NSNumber* AUTHORIZATION_AUTHORIZED;
@end
#endif |
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef STDLIB_STRIDED_BASE_MSKUNARY_B_K_AS_K_K_H
#define STDLIB_STRIDED_BASE_MSKUNARY_B_K_AS_K_K_H
#include <stdint.h>
/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Applies a unary callback accepting and returning signed 16-bit integers to an unsigned 8-bit integer strided input array and assigns results to elements in a signed 16-bit integer strided output array.
*/
void stdlib_strided_mask_b_k_as_k_k( uint8_t *arrays[], int64_t *shape, int64_t *strides, void *fcn );
#ifdef __cplusplus
}
#endif
#endif // !STDLIB_STRIDED_BASE_MSKUNARY_B_K_AS_K_K_H
|
/* ----------------------------------------------------------------------
* Project: CMSIS DSP Library
* Title: arm_fir_init_q31.c
* Description: Q31 FIR filter initialization function.
*
* $Date: 18. March 2019
* $Revision: V1.6.0
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
/*
* Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "arm_math.h"
/**
@ingroup groupFilters
*/
/**
@addtogroup FIR
@{
*/
/**
@brief Initialization function for the Q31 FIR filter.
@param[in,out] S points to an instance of the Q31 FIR filter structure
@param[in] numTaps number of filter coefficients in the filter
@param[in] pCoeffs points to the filter coefficients buffer
@param[in] pState points to the state buffer
@param[in] blockSize number of samples processed
@return none
@par Details
<code>pCoeffs</code> points to the array of filter coefficients stored in time reversed order:
<pre>
{b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
</pre>
<code>pState</code> points to the array of state variables.
<code>pState</code> is of length <code>numTaps+blockSize-1</code> samples, where <code>blockSize</code> is the number of input samples processed by each call to <code>arm_fir_q31()</code>.
*/
void arm_fir_init_q31(
arm_fir_instance_q31 * S,
uint16_t numTaps,
const q31_t * pCoeffs,
q31_t * pState,
uint32_t blockSize)
{
/* Assign filter taps */
S->numTaps = numTaps;
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Clear state buffer. The size is always (blockSize + numTaps - 1) */
memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t));
/* Assign state pointer */
S->pState = pState;
}
/**
@} end of FIR group
*/
|
//
// Created by akinsella on 02/04/13.
//
#import <Foundation/Foundation.h>
#import "XBHttpRequestDataBuilder.h"
#import "XBDataPager.h"
@interface XBDataPagerHttpQueryDataBuilder : NSObject<XBHttpRequestDataBuilder>
@property (nonatomic, strong) id <XBDataPager> paginator;
@property (nonatomic, strong) NSString *pageParameterName;
- (instancetype)initWithPager:(id <XBDataPager>)pager pageParameterName:(NSString *)pageParameterName;
+ (instancetype)builderWithDataPager:(id <XBDataPager>)pager pageParameterName:(NSString *)pageParameterName;
@end |
#include <stdio.h>
#include <string.h>
#include <assert.h>
/*this file is for unix only, will need to add*/
#include <sys/select.h>
#include <sphinxbase/err.h>
#include <sphinxbase/ad.h>
#include <pocketsphinx.h>
static ps_decoder_t *ps;
static cmd_ln_t *config;
static void
sleep_msec(int32 ms)
{
/* ------------------- Unix ------------------ */
struct timeval tmo;
tmo.tv_sec = 0;
tmo.tv_usec = ms * 1000;
select(0, NULL, NULL, NULL, &tmo);
}
#define SAMPLE_RATE 16000
#define AUDIO_DEVICE_NAME "foo"
static void
recognize_from_microphone()
{
ad_rec_t *ad;
int16 adbuf[2048];
uint8 utt_started, in_speech;
int32 k;
char const *hyp;
if ((ad = ad_open_dev(AUDIO_DEVICE_NAME,
(int) SAMPLE_RATE )) == NULL) {
E_FATAL("Failed to open audio device\n");
}
if (ad_start_rec(ad) < 0) {
E_FATAL("Failed to start recording\n");
}
if (ps_start_utt(ps) < 0) {
E_FATAL("Failed to start utterance\n");
}
utt_started = FALSE;
printf("READY....\n");
for (;;) {
if ((k = ad_read(ad, adbuf, 2048)) < 0)
E_FATAL("Failed to read audio\n");
ps_process_raw(ps, adbuf, k, FALSE, FALSE);
in_speech = ps_get_in_speech(ps);
if (in_speech && !utt_started) {
utt_started = TRUE;
printf("Listening...\n");
}
if (!in_speech && utt_started) {
/* speech -> silence transition, time to start new utterance */
ps_end_utt(ps);
hyp = ps_get_hyp(ps, NULL );
if (hyp != NULL)
printf("%s\n", hyp);
if (ps_start_utt(ps) < 0)
E_FATAL("Failed to start utterance\n");
utt_started = FALSE;
printf("READY....\n");
}
sleep_msec(100);
}
ad_close(ad);
}
int main(int argc, char *argv[])
{
ps_decoder_t *ps;
cmd_ln_t *config;
FILE *fh;
char const *hyp, *uttid;
int16 buf[512];
int rv;
int32 score;
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-hmm", MODELDIR "/en-us/en-us",
"-lm", MODELDIR "/en-us/en-us.lm.bin",
"-dict", MODELDIR "/en-us/cmudict-en-us.dict",
NULL);
if (config == NULL) {
fprintf(stderr, "Failed to create config object, see log for details\n");
return -1;
}
ps = ps_init(config);
if (ps == NULL) {
fprintf(stderr, "Failed to create recognizer, see log for details\n");
return -1;
}
fh = fopen("res/gripper_open.raw", "rb");
if (fh == NULL) {
fprintf(stderr, "Unable to open input file goforward.raw\n");
return -1;
}
rv = ps_start_utt(ps);
while (!feof(fh)) {
size_t nsamp;
nsamp = fread(buf, 2, 512, fh);
rv = ps_process_raw(ps, buf, nsamp, FALSE, FALSE);
}
rv = ps_end_utt(ps);
hyp = ps_get_hyp(ps, &score);
printf("====================================\n" );
printf("Recognized: %s\n", hyp);
fclose(fh);
ps_free(ps);
cmd_ln_free_r(config);
return 0;
} |
//
// TYThemeViewModel.h
// baisiAPP
//
// Created by TimorYang on 16/6/25.
// Copyright © 2016年 TimorYang. All rights reserved.
//
#import <Foundation/Foundation.h>
@class TYThemeItem;
@interface TYThemeViewModel : NSObject
/** TYThemeItem */
@property (nonatomic, strong) TYThemeItem *item;
/** topViewFrame */
@property (nonatomic, assign) CGRect topViewFrame;
/** cell_h */
@property (nonatomic, assign) CGFloat cell_h;
/** middleFrame */
@property (nonatomic, assign) CGRect middleFrame;
@end
|
#import <Foundation/Foundation.h>
#import "MulticastDelegate.h"
@class XMPPStream;
/**
* XMPPModule is the base class that all extensions/modules inherit.
* They automatically get:
*
* - An xmppStream variable, with the corresponding property.
* - A multicastDelegate that automatically invokes added delegates.
*
* The module also automatically registers/unregisters itself with the xmpp stream.
**/
@interface XMPPModule : NSObject
{
XMPPStream *xmppStream;
id multicastDelegate;
}
- (id)initWithStream:(XMPPStream *)xmppStream;
@property (nonatomic, readonly) XMPPStream *xmppStream;
- (void)addDelegate:(id)delegate;
- (void)removeDelegate:(id)delegate;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.